Commit b4edad7d authored by devill.tamachan's avatar devill.tamachan

[修正] 2ファイルを引数に起動した場合、分割方向を最後に使った分割方向にする (Issue #56 Special Thanks! おろっ!)

parent 648e63af
Pipeline #84685178 passed with stage
......@@ -146,6 +146,7 @@ public:
bMiniToolbar = GetProfileInt(key, _T("MiniToolbar"), TRUE);
lastPalletName = GetProfileString(key, _T("lastPalletName"));
lastSplitView = GetProfileInt(key, _T("LastSplitView"), 0);
CheckOptions();
// key.Flush();
......@@ -201,6 +202,7 @@ public:
bAddressTooltip = TRUE;
bMiniToolbar = TRUE;
lastSplitView = 0;
}
void CheckOptions()
......@@ -238,7 +240,7 @@ public:
t.Replace(_T("\r"), _T("\\r"));
t.Replace(_T("\n"), _T("\\n"));
CStringA str;
//str.Format("%s = \"%s\"\n", name, CT2A(val, CP_UTF8)); //64ビット版だけ文字化けするので禁止。UTF8が化ける。32ビット版は問題無い
//str.Format("%s = \"%s\"\n", name, CT2A(val, CP_UTF8)); //64ビット版だけ文字化けするので禁止。UTF8が化ける。32ビット版は問題無い
str.Format("%s = \"", name);
HRESULT hr = file.Write(((LPVOID)(LPCSTR)(str)), str.GetLength());
if(FAILED(hr))return hr;
......@@ -306,7 +308,7 @@ public:
CAtlFile file;
if(FAILED(file.Create(path, GENERIC_WRITE, 0, CREATE_ALWAYS)))return E_FAIL;
CStringA t = CW2A(_T("/* このファイルがあるとポータブルモードになります。設定はこのファイルへ書きだされます。レジストリには書き込まれません。 */\r\n\r\n"), CP_UTF8);
CStringA t = CW2A(_T("/* このファイルがあるとポータブルモードになります。設定はこのファイルへ書きだされます。レジストリには書き込まれません。 */\r\n\r\n"), CP_UTF8);
file.Write( ((LPCVOID)(LPCSTR)t), t.GetLength());
WriteFileInt(file, "PortableVersion", 1);
......@@ -376,6 +378,7 @@ public:
WriteFileInt(file, "MiniToolbar", bMiniToolbar);
WriteFileString(file, "lastPalletName", lastPalletName);
WriteFileInt(file, "LastSplitView", lastSplitView);
file.Flush();
......@@ -453,6 +456,7 @@ public:
WriteProfileInt(key, _T("MiniToolbar"), bMiniToolbar);
WriteProfileString(key, _T("lastPalletName"), lastPalletName);
WriteProfileInt(key, _T("LastSplitView"), lastSplitView);
key.Flush();
}
......@@ -510,6 +514,8 @@ public:
CString lastPalletName;
int lastSplitView;
public:
CBZOptions() : m_bModified(FALSE), bPortableMode(FALSE) { }
......
......@@ -70,7 +70,7 @@ int Run(LPTSTR lpstrCmdLine = NULL, int nCmdShow = SW_SHOWDEFAULT)
CMainFrame *pMainFrame = pCoreData->GetMainFrame();
if(pMainFrame!=NULL)
{
pMainFrame->_OnViewSplit(ID_VIEW_SPLIT_H);
pMainFrame->_OnViewSplit(options.lastSplitView==0 ? ID_VIEW_SPLIT_H : ID_VIEW_SPLIT_V);
}
}
for(int i=0;i<argc;i++)
......
......@@ -438,6 +438,7 @@ void CMainFrame::_OnViewSplit(int nID)
SwitchActiveBZView();
ResetWindowWidth();
options.lastSplitView = m_nSplitView==ID_VIEW_SPLIT_H ? 0:1;
}
LRESULT CMainFrame::OnStatusBarClicked(LPNMHDR pnmh)
......
This diff is collapsed.
......@@ -30,7 +30,7 @@ typedef struct Scanner
PassData val;
} Scanner;
enum {TYPE_CharSet=0, TYPE_AutoDetect, TYPE_ByteOrder, TYPE_FontName, TYPE_FontStyle, TYPE_FontSize, TYPE_FrameLeft, TYPE_FrameTop, TYPE_CmdShow, TYPE_FrameHeight, TYPE_FrameHeight2, TYPE_FrameWidth2, TYPE_SplitHPos, TYPE_SplitVPos, TYPE_SplitStruct, TYPE_StructView, TYPE_ComboHeight, TYPE_Language, TYPE_DetectMax, TYPE_BarState, TYPE_ReadOnly, TYPE_BmpWidth, TYPE_BmpZoom, TYPE_BmpPallet, TYPE_MaxOnMemory, TYPE_MaxMapSize, TYPE_TagAll, TYPE_SubCursor, TYPE_Colors, TYPE_MemberColumns2, TYPE_PageMargin, TYPE_DumpHeader, TYPE_DumpPage, TYPE_QWordAddr, TYPE_ClearUndoRedoWhenSave, TYPE_SyncScroll, TYPE_Grid, TYPE_BmpColorWidth, TYPE_InspectView, TYPE_AnalyzerView, TYPE_BmpAddressTooltip, TYPE_MiniToolbar, TYPE_lastPalletName, TYPE_PortableVersion};
enum {TYPE_CharSet=0, TYPE_AutoDetect, TYPE_ByteOrder, TYPE_FontName, TYPE_FontStyle, TYPE_FontSize, TYPE_FrameLeft, TYPE_FrameTop, TYPE_CmdShow, TYPE_FrameHeight, TYPE_FrameHeight2, TYPE_FrameWidth2, TYPE_SplitHPos, TYPE_SplitVPos, TYPE_SplitStruct, TYPE_StructView, TYPE_ComboHeight, TYPE_Language, TYPE_DetectMax, TYPE_BarState, TYPE_ReadOnly, TYPE_BmpWidth, TYPE_BmpZoom, TYPE_BmpPallet, TYPE_MaxOnMemory, TYPE_MaxMapSize, TYPE_TagAll, TYPE_SubCursor, TYPE_Colors, TYPE_MemberColumns2, TYPE_PageMargin, TYPE_DumpHeader, TYPE_DumpPage, TYPE_QWordAddr, TYPE_ClearUndoRedoWhenSave, TYPE_SyncScroll, TYPE_Grid, TYPE_BmpColorWidth, TYPE_InspectView, TYPE_AnalyzerView, TYPE_BmpAddressTooltip, TYPE_MiniToolbar, TYPE_lastPalletName, TYPE_LastSplitView, TYPE_PortableVersion};
static int g_cfgVer = 0;
static int g_numReadColors = 0;
......@@ -76,6 +76,7 @@ case TYPE_InspectView: options.bInspectView = val; break;
case TYPE_AnalyzerView: options.bAnalyzerView = val; break;
case TYPE_BmpAddressTooltip: options.bAddressTooltip = val; break;
case TYPE_MiniToolbar: options.bMiniToolbar = val; break;
case TYPE_LastSplitView: options.lastSplitView = val; break;
case TYPE_PortableVersion: g_cfgVer = val; break;
}
}
......@@ -253,6 +254,7 @@ RGBA = [#] (H {8});
"BmpAddressTooltip" { RETT(INTTYPE, TYPE_BmpAddressTooltip); }
"MiniToolbar" { RETT(INTTYPE, TYPE_MiniToolbar); }
"lastPalletName" { RETT(STRTYPE, TYPE_lastPalletName); }
"LastSplitView" { RETT(INTTYPE, TYPE_LastSplitView); }
[+-]? [ \t]* (D+) { uchar *start = s->tok;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment