Make log options an AUI window instead of a dialog.
git-svn-id: https://dolphin-emu.googlecode.com/svn/trunk@7217 8ced0084-cf51-0410-be5f-012b33b47a6e
This commit is contained in:
parent
f9ccd6dfa1
commit
3b6f7644fd
|
@ -157,6 +157,7 @@ void SConfig::SaveSettings()
|
|||
ini.Set("Interface", "ShowToolbar", m_InterfaceToolbar);
|
||||
ini.Set("Interface", "ShowStatusbar", m_InterfaceStatusbar);
|
||||
ini.Set("Interface", "ShowLogWindow", m_InterfaceLogWindow);
|
||||
ini.Set("Interface", "ShowLogConfigWindow", m_InterfaceLogConfigWindow);
|
||||
ini.Set("Interface", "ShowConsole", m_InterfaceConsole);
|
||||
|
||||
// Hotkeys
|
||||
|
@ -278,6 +279,7 @@ void SConfig::LoadSettings()
|
|||
ini.Get("Interface", "ShowToolbar", &m_InterfaceToolbar, true);
|
||||
ini.Get("Interface", "ShowStatusbar", &m_InterfaceStatusbar, true);
|
||||
ini.Get("Interface", "ShowLogWindow", &m_InterfaceLogWindow, false);
|
||||
ini.Get("Interface", "ShowLogConfigWindow", &m_InterfaceLogConfigWindow, false);
|
||||
ini.Get("Interface", "ShowConsole", &m_InterfaceConsole, false);
|
||||
|
||||
// Hotkeys
|
||||
|
|
|
@ -59,6 +59,7 @@ struct SConfig : NonCopyable
|
|||
bool m_InterfaceToolbar;
|
||||
bool m_InterfaceStatusbar;
|
||||
bool m_InterfaceLogWindow;
|
||||
bool m_InterfaceLogConfigWindow;
|
||||
bool m_InterfaceConsole;
|
||||
|
||||
bool m_ListDrives;
|
||||
|
|
|
@ -43,7 +43,7 @@ if(wxWidgets_FOUND)
|
|||
Src/ISOProperties.cpp
|
||||
Src/InputConfigDiag.cpp
|
||||
Src/InputConfigDiagBitmaps.cpp
|
||||
Src/LogConfigDiag.cpp
|
||||
Src/LogConfigWindow.cpp
|
||||
Src/LogWindow.cpp
|
||||
Src/Main.cpp
|
||||
Src/MemcardManager.cpp
|
||||
|
|
|
@ -245,7 +245,7 @@ xcopy "$(SolutionDir)..\Externals\SDL\$(PlatformName)\*.dll" "$(TargetDir)" /e /
|
|||
<ClCompile Include="Src\ISOFile.cpp" />
|
||||
<ClCompile Include="Src\ISOProperties.cpp" />
|
||||
<ClCompile Include="Src\Debugger\JitWindow.cpp" />
|
||||
<ClCompile Include="Src\LogConfigDiag.cpp" />
|
||||
<ClCompile Include="Src\LogConfigWindow.cpp" />
|
||||
<ClCompile Include="Src\LogWindow.cpp" />
|
||||
<ClCompile Include="Src\Main.cpp" />
|
||||
<ClCompile Include="Src\MainNoGUI.cpp">
|
||||
|
@ -305,7 +305,7 @@ xcopy "$(SolutionDir)..\Externals\SDL\$(PlatformName)\*.dll" "$(TargetDir)" /e /
|
|||
<ClInclude Include="Src\ISOFile.h" />
|
||||
<ClInclude Include="Src\ISOProperties.h" />
|
||||
<ClInclude Include="Src\Debugger\JitWindow.h" />
|
||||
<ClInclude Include="Src\LogConfigDiag.h" />
|
||||
<ClInclude Include="Src\LogConfigWindow.h" />
|
||||
<ClInclude Include="Src\LogWindow.h" />
|
||||
<ClInclude Include="Src\Main.h" />
|
||||
<ClInclude Include="Src\MemcardManager.h" />
|
||||
|
@ -390,4 +390,4 @@ xcopy "$(SolutionDir)..\Externals\SDL\$(PlatformName)\*.dll" "$(TargetDir)" /e /
|
|||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
||||
</Project>
|
||||
|
|
|
@ -126,7 +126,7 @@
|
|||
<ClCompile Include="Src\Debugger\BreakpointView.cpp">
|
||||
<Filter>GUI\Debugger</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Src\LogConfigDiag.cpp">
|
||||
<ClCompile Include="Src\LogConfigWindow.cpp">
|
||||
<Filter>GUI</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
|
@ -249,7 +249,7 @@
|
|||
<ClInclude Include="Src\Debugger\BreakpointView.h">
|
||||
<Filter>GUI\Debugger</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Src\LogConfigDiag.h">
|
||||
<ClInclude Include="Src\LogConfigWindow.h">
|
||||
<Filter>GUI</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
|
@ -291,4 +291,4 @@
|
|||
<Filter>Resources</Filter>
|
||||
</ResourceCompile>
|
||||
</ItemGroup>
|
||||
</Project>
|
||||
</Project>
|
||||
|
|
|
@ -90,6 +90,7 @@ void CCodeWindow::Load()
|
|||
|
||||
const char* SettingName[] = {
|
||||
"Log",
|
||||
"LogConfig",
|
||||
"Console",
|
||||
"Registers",
|
||||
"Breakpoints",
|
||||
|
@ -131,6 +132,7 @@ void CCodeWindow::Save()
|
|||
|
||||
const char* SettingName[] = {
|
||||
"Log",
|
||||
"LogConfig",
|
||||
"Console",
|
||||
"Registers",
|
||||
"Breakpoints",
|
||||
|
@ -415,6 +417,8 @@ void CCodeWindow::OpenPages()
|
|||
ToggleCodeWindow(true);
|
||||
if (bShowOnStart[0])
|
||||
Parent->ToggleLogWindow(true);
|
||||
if (bShowOnStart[IDM_LOGCONFIGWINDOW - IDM_LOGWINDOW])
|
||||
Parent->ToggleLogConfigWindow(true);
|
||||
if (bShowOnStart[IDM_CONSOLEWINDOW - IDM_LOGWINDOW])
|
||||
Parent->ToggleConsole(true);
|
||||
if (bShowOnStart[IDM_REGISTERWINDOW - IDM_LOGWINDOW])
|
||||
|
|
|
@ -263,7 +263,6 @@ EVT_MENU(IDM_CONFIG_DSP_EMULATOR, CFrame::OnConfigDSP)
|
|||
EVT_MENU(IDM_CONFIG_PAD_PLUGIN, CFrame::OnConfigPAD)
|
||||
EVT_MENU(IDM_CONFIG_WIIMOTE_PLUGIN, CFrame::OnConfigWiimote)
|
||||
EVT_MENU(IDM_CONFIG_HOTKEYS, CFrame::OnConfigHotkey)
|
||||
EVT_MENU(IDM_CONFIG_LOGGER, CFrame::OnConfigLogger)
|
||||
|
||||
EVT_MENU(IDM_SAVE_PERSPECTIVE, CFrame::OnToolBar)
|
||||
EVT_AUITOOLBAR_TOOL_DROPDOWN(IDM_SAVE_PERSPECTIVE, CFrame::OnDropDownToolbarItem)
|
||||
|
@ -347,7 +346,7 @@ CFrame::CFrame(wxFrame* parent,
|
|||
, m_ToolBar(NULL), m_ToolBarDebug(NULL), m_ToolBarAui(NULL)
|
||||
, m_GameListCtrl(NULL), m_Panel(NULL)
|
||||
, m_RenderFrame(NULL), m_RenderParent(NULL)
|
||||
, m_LogWindow(NULL), UseDebugger(_UseDebugger)
|
||||
, m_LogWindow(NULL), m_LogConfigWindow(NULL), UseDebugger(_UseDebugger)
|
||||
, m_bBatchMode(_BatchMode), m_bEdit(false), m_bTabSplit(false), m_bNoDocking(false)
|
||||
, m_bGameLoading(false)
|
||||
{
|
||||
|
@ -442,6 +441,8 @@ CFrame::CFrame(wxFrame* parent,
|
|||
{
|
||||
if (SConfig::GetInstance().m_InterfaceLogWindow)
|
||||
ToggleLogWindow(true);
|
||||
if (SConfig::GetInstance().m_InterfaceLogConfigWindow)
|
||||
ToggleLogConfigWindow(true);
|
||||
if (SConfig::GetInstance().m_InterfaceConsole)
|
||||
ToggleConsole(true);
|
||||
}
|
||||
|
@ -710,7 +711,8 @@ void CFrame::OnRenderWindowSizeRequest(int width, int height)
|
|||
m_RenderFrame->GetClientSize(&old_width, &old_height);
|
||||
|
||||
// Add space for the log/console/debugger window
|
||||
if ((SConfig::GetInstance().m_InterfaceLogWindow || SConfig::GetInstance().m_InterfaceConsole) &&
|
||||
if ((SConfig::GetInstance().m_InterfaceLogWindow || SConfig::GetInstance().m_InterfaceConsole ||
|
||||
SConfig::GetInstance().m_InterfaceLogConfigWindow) &&
|
||||
!m_Mgr->GetPane(wxT("Pane 1")).IsFloating())
|
||||
{
|
||||
switch (m_Mgr->GetPane(wxT("Pane 1")).dock_direction)
|
||||
|
|
|
@ -31,6 +31,7 @@
|
|||
#include "CDUtils.h"
|
||||
#include "Debugger/CodeWindow.h"
|
||||
#include "LogWindow.h"
|
||||
#include "LogConfigWindow.h"
|
||||
#if defined(HAVE_X11) && HAVE_X11
|
||||
#include "X11Utils.h"
|
||||
#endif
|
||||
|
@ -120,6 +121,7 @@ class CFrame : public CRenderFrame
|
|||
void UpdateGUI();
|
||||
void UpdateGameList();
|
||||
void ToggleLogWindow(bool bShow);
|
||||
void ToggleLogConfigWindow(bool bShow);
|
||||
void ToggleConsole(bool bShow);
|
||||
void PostEvent(wxCommandEvent& event);
|
||||
void StatusBarMessage(const char * Text, ...);
|
||||
|
@ -170,6 +172,7 @@ class CFrame : public CRenderFrame
|
|||
CRenderFrame* m_RenderFrame;
|
||||
wxPanel* m_RenderParent;
|
||||
CLogWindow* m_LogWindow;
|
||||
LogConfigWindow* m_LogConfigWindow;
|
||||
bool UseDebugger;
|
||||
bool m_bBatchMode;
|
||||
bool m_bEdit;
|
||||
|
@ -304,7 +307,6 @@ class CFrame : public CRenderFrame
|
|||
void OnConfigPAD(wxCommandEvent& event);
|
||||
void OnConfigWiimote(wxCommandEvent& event);
|
||||
void OnConfigHotkey(wxCommandEvent& event);
|
||||
void OnConfigLogger(wxCommandEvent& event);
|
||||
|
||||
void OnToggleFullscreen(wxCommandEvent& event);
|
||||
void OnToggleDualCore(wxCommandEvent& event);
|
||||
|
|
|
@ -42,14 +42,17 @@ void CFrame::OnPaneClose(wxAuiManagerEvent& event)
|
|||
|
||||
if (!g_pCodeWindow)
|
||||
{
|
||||
if ((nb->GetPage(0)->GetId() == IDM_LOGWINDOW ||
|
||||
nb->GetPage(0)->GetId() == IDM_CONSOLEWINDOW))
|
||||
if (nb->GetPage(0)->GetId() == IDM_LOGWINDOW ||
|
||||
nb->GetPage(0)->GetId() == IDM_LOGCONFIGWINDOW ||
|
||||
nb->GetPage(0)->GetId() == IDM_CONSOLEWINDOW)
|
||||
{
|
||||
// Closing a pane containing the logwindow or a console closes both
|
||||
SConfig::GetInstance().m_InterfaceConsole = false;
|
||||
SConfig::GetInstance().m_InterfaceLogWindow = false;
|
||||
SConfig::GetInstance().m_InterfaceLogConfigWindow = false;
|
||||
ToggleConsole(false);
|
||||
ToggleLogWindow(false);
|
||||
ToggleLogConfigWindow(false);
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -94,6 +97,29 @@ void CFrame::ToggleLogWindow(bool bShow)
|
|||
TogglePane();
|
||||
}
|
||||
|
||||
void CFrame::ToggleLogConfigWindow(bool bShow)
|
||||
{
|
||||
GetMenuBar()->FindItem(IDM_LOGCONFIGWINDOW)->Check(bShow);
|
||||
|
||||
if (bShow)
|
||||
{
|
||||
if (!m_LogConfigWindow)
|
||||
m_LogConfigWindow = new LogConfigWindow(this, m_LogWindow, IDM_LOGCONFIGWINDOW);
|
||||
DoAddPage(m_LogConfigWindow,
|
||||
g_pCodeWindow ? g_pCodeWindow->iNbAffiliation[1] : 0,
|
||||
g_pCodeWindow ? bFloatWindow[1] : false);
|
||||
}
|
||||
else
|
||||
{
|
||||
DoRemovePage(m_LogConfigWindow, false);
|
||||
m_LogConfigWindow = NULL;
|
||||
}
|
||||
|
||||
// Hide or Show the pane
|
||||
if (!g_pCodeWindow)
|
||||
TogglePane();
|
||||
}
|
||||
|
||||
void CFrame::ToggleConsole(bool bShow)
|
||||
{
|
||||
#ifdef _WIN32
|
||||
|
@ -155,6 +181,11 @@ void CFrame::OnToggleWindow(wxCommandEvent& event)
|
|||
SConfig::GetInstance().m_InterfaceLogWindow = bShow;
|
||||
ToggleLogWindow(bShow);
|
||||
break;
|
||||
case IDM_LOGCONFIGWINDOW:
|
||||
if (!g_pCodeWindow)
|
||||
SConfig::GetInstance().m_InterfaceLogConfigWindow = bShow;
|
||||
ToggleLogConfigWindow(bShow);
|
||||
break;
|
||||
case IDM_CONSOLEWINDOW:
|
||||
if (!g_pCodeWindow)
|
||||
SConfig::GetInstance().m_InterfaceConsole = bShow;
|
||||
|
@ -186,6 +217,7 @@ void CFrame::OnToggleWindow(wxCommandEvent& event)
|
|||
void CFrame::ClosePages()
|
||||
{
|
||||
ToggleLogWindow(false);
|
||||
ToggleLogConfigWindow(false);
|
||||
ToggleConsole(false);
|
||||
if (g_pCodeWindow)
|
||||
{
|
||||
|
@ -224,6 +256,8 @@ void CFrame::OnNotebookPageClose(wxAuiNotebookEvent& event)
|
|||
|
||||
if (Ctrl->GetPage(event.GetSelection())->GetId() == IDM_LOGWINDOW)
|
||||
ToggleLogWindow(false);
|
||||
if (Ctrl->GetPage(event.GetSelection())->GetId() == IDM_LOGCONFIGWINDOW)
|
||||
ToggleLogConfigWindow(false);
|
||||
if (Ctrl->GetPage(event.GetSelection())->GetId() == IDM_CONSOLEWINDOW)
|
||||
ToggleConsole(false);
|
||||
if (Ctrl->GetPage(event.GetSelection())->GetId() == IDM_REGISTERWINDOW)
|
||||
|
|
|
@ -50,7 +50,7 @@ Core::GetWindowHandle().
|
|||
#include "GameListCtrl.h"
|
||||
#include "BootManager.h"
|
||||
#include "LogWindow.h"
|
||||
#include "LogConfigDiag.h"
|
||||
#include "LogConfigWindow.h"
|
||||
#include "WxUtils.h"
|
||||
|
||||
#include "ConfigManager.h" // Core
|
||||
|
@ -192,7 +192,6 @@ void CFrame::CreateMenu()
|
|||
pOptionsMenu->Append(IDM_CONFIG_PAD_PLUGIN, _("Gamecube &Pad Settings"));
|
||||
pOptionsMenu->Append(IDM_CONFIG_WIIMOTE_PLUGIN, _("&Wiimote Settings"));
|
||||
pOptionsMenu->Append(IDM_CONFIG_HOTKEYS, _("&Hotkey Settings"));
|
||||
pOptionsMenu->Append(IDM_CONFIG_LOGGER, _("&Logger Settings"));
|
||||
if (g_pCodeWindow)
|
||||
{
|
||||
pOptionsMenu->AppendSeparator();
|
||||
|
@ -234,6 +233,7 @@ void CFrame::CreateMenu()
|
|||
viewMenu->Check(IDM_TOGGLE_STATUSBAR, SConfig::GetInstance().m_InterfaceStatusbar);
|
||||
viewMenu->AppendSeparator();
|
||||
viewMenu->AppendCheckItem(IDM_LOGWINDOW, _("Show &Log"));
|
||||
viewMenu->AppendCheckItem(IDM_LOGCONFIGWINDOW, _("Show Log &Configuration"));
|
||||
viewMenu->AppendCheckItem(IDM_CONSOLEWINDOW, _("Show &Console"));
|
||||
viewMenu->AppendSeparator();
|
||||
|
||||
|
@ -266,6 +266,7 @@ void CFrame::CreateMenu()
|
|||
else
|
||||
{
|
||||
viewMenu->Check(IDM_LOGWINDOW, SConfig::GetInstance().m_InterfaceLogWindow);
|
||||
viewMenu->Check(IDM_LOGCONFIGWINDOW, SConfig::GetInstance().m_InterfaceLogConfigWindow);
|
||||
viewMenu->Check(IDM_CONSOLEWINDOW, SConfig::GetInstance().m_InterfaceConsole);
|
||||
}
|
||||
|
||||
|
@ -1229,12 +1230,6 @@ void CFrame::OnConfigHotkey(wxCommandEvent& WXUNUSED (event))
|
|||
UpdateGUI();
|
||||
}
|
||||
|
||||
void CFrame::OnConfigLogger(wxCommandEvent& WXUNUSED (event))
|
||||
{
|
||||
LogConfigDiag *m_LogConfigDiag = new LogConfigDiag(this, m_LogWindow);
|
||||
m_LogConfigDiag->Show();
|
||||
}
|
||||
|
||||
void CFrame::OnHelp(wxCommandEvent& event)
|
||||
{
|
||||
switch (event.GetId())
|
||||
|
|
|
@ -545,16 +545,16 @@ void CGameListCtrl::ScanForISOs()
|
|||
for (u32 i = 0; i < Directories.size(); i++)
|
||||
{
|
||||
File::FSTEntry FST_Temp;
|
||||
File::ScanDirectoryTree(Directories.at(i).c_str(), FST_Temp);
|
||||
File::ScanDirectoryTree(Directories[i].c_str(), FST_Temp);
|
||||
for (u32 j = 0; j < FST_Temp.children.size(); j++)
|
||||
{
|
||||
if (FST_Temp.children.at(j).isDirectory)
|
||||
if (FST_Temp.children[j].isDirectory)
|
||||
{
|
||||
bool duplicate = false;
|
||||
for (u32 k = 0; k < Directories.size(); k++)
|
||||
{
|
||||
if (strcmp(Directories.at(k).c_str(),
|
||||
FST_Temp.children.at(j).physicalName.c_str()) == 0)
|
||||
if (strcmp(Directories[k].c_str(),
|
||||
FST_Temp.children[j].physicalName.c_str()) == 0)
|
||||
{
|
||||
duplicate = true;
|
||||
break;
|
||||
|
@ -562,7 +562,7 @@ void CGameListCtrl::ScanForISOs()
|
|||
}
|
||||
if (!duplicate)
|
||||
Directories.push_back(
|
||||
FST_Temp.children.at(j).physicalName.c_str());
|
||||
FST_Temp.children[j].physicalName.c_str());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -841,7 +841,11 @@ void CGameListCtrl::OnKeyPress(wxListEvent& event)
|
|||
|
||||
wxString text = bleh.GetText();
|
||||
|
||||
if (text.MakeUpper().at(0) == event.GetKeyCode())
|
||||
#ifdef __WXGTK__
|
||||
if (text.MakeLower()[0] == event.GetKeyCode())
|
||||
#else
|
||||
if (text.MakeUpper()[0] == event.GetKeyCode())
|
||||
#endif
|
||||
{
|
||||
if (lastKey == event.GetKeyCode() && Loop < sLoop)
|
||||
{
|
||||
|
@ -889,7 +893,7 @@ void CGameListCtrl::OnMouseMotion(wxMouseEvent& event)
|
|||
// The subitem parameter of HitTest is only implemented for wxMSW. On
|
||||
// all other platforms it will always be -1. Check the x position
|
||||
// instead.
|
||||
GetItemRect(item, Rect);
|
||||
GetItemRect(item, Rect);
|
||||
if (Rect.GetX() + Rect.GetWidth() - GetColumnWidth(COLUMN_EMULATION_STATE) < event.GetX())
|
||||
#endif
|
||||
{
|
||||
|
|
|
@ -125,6 +125,7 @@ enum
|
|||
|
||||
// Views
|
||||
IDM_LOGWINDOW,
|
||||
IDM_LOGCONFIGWINDOW,
|
||||
IDM_CONSOLEWINDOW,
|
||||
IDM_REGISTERWINDOW,
|
||||
IDM_BREAKPOINTWINDOW,
|
||||
|
@ -136,6 +137,7 @@ enum
|
|||
|
||||
// Float Window IDs
|
||||
IDM_LOGWINDOW_PARENT,
|
||||
IDM_LOGCONFIGWINDOW_PARENT,
|
||||
IDM_CONSOLEWINDOW_PARENT,
|
||||
IDM_REGISTERWINDOW_PARENT,
|
||||
IDM_BREAKPOINTWINDOW_PARENT,
|
||||
|
@ -147,6 +149,7 @@ enum
|
|||
|
||||
// Float popup menu IDs
|
||||
IDM_FLOAT_LOGWINDOW,
|
||||
IDM_FLOAT_LOGCONFIGWINDOW,
|
||||
IDM_FLOAT_CONSOLEWINDOW,
|
||||
IDM_FLOAT_REGISTERWINDOW,
|
||||
IDM_FLOAT_BREAKPOINTWINDOW,
|
||||
|
|
|
@ -15,7 +15,7 @@
|
|||
// Official SVN repository and contact information can be found at
|
||||
// http://code.google.com/p/dolphin-emu/
|
||||
|
||||
#include "LogConfigDiag.h"
|
||||
#include "LogConfigWindow.h"
|
||||
#include "LogManager.h"
|
||||
#include "ConsoleListener.h"
|
||||
#include "LogWindow.h"
|
||||
|
@ -24,17 +24,21 @@
|
|||
#define _connect_macro_(b, f, c, s) \
|
||||
(b)->Connect(wxID_ANY, (c), wxCommandEventHandler(f), (wxObject*)0, (wxEvtHandler*)s)
|
||||
|
||||
LogConfigDiag::LogConfigDiag(wxWindow* parent, CLogWindow *log_window)
|
||||
: wxDialog(parent, wxID_ANY, _("Logger Configuration"), wxDefaultPosition, wxDefaultSize)
|
||||
LogConfigWindow::LogConfigWindow(wxWindow* parent, CLogWindow *log_window, wxWindowID id)
|
||||
: wxPanel(parent, id, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL, _("Log Configuration"))
|
||||
, m_LogWindow(log_window), enableAll(true)
|
||||
{
|
||||
Connect(wxID_ANY, wxEVT_CLOSE_WINDOW, wxCloseEventHandler(LogConfigDiag::OnClose), (wxObject*)0, this);
|
||||
m_LogManager = LogManager::GetInstance();
|
||||
CreateGUIControls();
|
||||
LoadSettings();
|
||||
}
|
||||
|
||||
void LogConfigDiag::CreateGUIControls()
|
||||
LogConfigWindow::~LogConfigWindow()
|
||||
{
|
||||
SaveSettings();
|
||||
}
|
||||
|
||||
void LogConfigWindow::CreateGUIControls()
|
||||
{
|
||||
// Verbosity
|
||||
wxArrayString wxLevels, wxLevelsUse;
|
||||
|
@ -48,59 +52,44 @@ void LogConfigDiag::CreateGUIControls()
|
|||
m_verbosity = new wxRadioBox(this, wxID_ANY, _("Verbosity"),
|
||||
wxDefaultPosition, wxDefaultSize, wxLevelsUse, 0,
|
||||
wxRA_SPECIFY_ROWS, wxDefaultValidator);
|
||||
_connect_macro_(m_verbosity, LogConfigDiag::OnVerbosityChange, wxEVT_COMMAND_RADIOBOX_SELECTED, this);
|
||||
_connect_macro_(m_verbosity, LogConfigWindow::OnVerbosityChange, wxEVT_COMMAND_RADIOBOX_SELECTED, this);
|
||||
|
||||
// Options
|
||||
m_writeFileCB = new wxCheckBox(this, wxID_ANY, _("Write to File"));
|
||||
_connect_macro_(m_writeFileCB, LogConfigDiag::OnWriteFileChecked, wxEVT_COMMAND_CHECKBOX_CLICKED, this);
|
||||
_connect_macro_(m_writeFileCB, LogConfigWindow::OnWriteFileChecked, wxEVT_COMMAND_CHECKBOX_CLICKED, this);
|
||||
m_writeConsoleCB = new wxCheckBox(this, wxID_ANY, _("Write to Console"));
|
||||
_connect_macro_(m_writeConsoleCB, LogConfigDiag::OnWriteConsoleChecked, wxEVT_COMMAND_CHECKBOX_CLICKED, this);
|
||||
_connect_macro_(m_writeConsoleCB, LogConfigWindow::OnWriteConsoleChecked, wxEVT_COMMAND_CHECKBOX_CLICKED, this);
|
||||
m_writeWindowCB = new wxCheckBox(this, wxID_ANY, _("Write to Window"));
|
||||
_connect_macro_(m_writeWindowCB, LogConfigDiag::OnWriteWindowChecked, wxEVT_COMMAND_CHECKBOX_CLICKED, this);
|
||||
_connect_macro_(m_writeWindowCB, LogConfigWindow::OnWriteWindowChecked, wxEVT_COMMAND_CHECKBOX_CLICKED, this);
|
||||
|
||||
wxButton *btn_toggle_all = new wxButton(this, wxID_ANY, _("Toggle All Log Types"),
|
||||
wxDefaultPosition, wxDefaultSize, wxBU_EXACTFIT);
|
||||
_connect_macro_(btn_toggle_all, LogConfigDiag::OnToggleAll, wxEVT_COMMAND_BUTTON_CLICKED, this);
|
||||
_connect_macro_(btn_toggle_all, LogConfigWindow::OnToggleAll, wxEVT_COMMAND_BUTTON_CLICKED, this);
|
||||
m_checks = new wxCheckListBox(this, wxID_ANY);
|
||||
_connect_macro_(m_checks, LogConfigDiag::OnLogCheck, wxEVT_COMMAND_CHECKLISTBOX_TOGGLED, this);
|
||||
_connect_macro_(m_checks, LogConfigWindow::OnLogCheck, wxEVT_COMMAND_CHECKLISTBOX_TOGGLED, this);
|
||||
for (int i = 0; i < LogTypes::NUMBER_OF_LOGS; i++)
|
||||
m_checks->Append(wxString::FromAscii(m_LogManager->getFullName((LogTypes::LOG_TYPE)i)));
|
||||
|
||||
// Sizers
|
||||
wxStaticBoxSizer* sbOptions = new wxStaticBoxSizer(wxVERTICAL, this, _("Logger Outputs"));
|
||||
sbOptions->Add(m_writeFileCB, 0, wxDOWN, 1);
|
||||
sbOptions->Add(m_writeConsoleCB, 0, wxDOWN, 1);
|
||||
sbOptions->Add(m_writeWindowCB, 0);
|
||||
wxStaticBoxSizer* sbOutputs = new wxStaticBoxSizer(wxVERTICAL, this, _("Logger Outputs"));
|
||||
sbOutputs->Add(m_writeFileCB, 0, wxDOWN, 1);
|
||||
sbOutputs->Add(m_writeConsoleCB, 0, wxDOWN, 1);
|
||||
sbOutputs->Add(m_writeWindowCB, 0);
|
||||
|
||||
wxStaticBoxSizer* sbLogTypes = new wxStaticBoxSizer(wxVERTICAL, this, _("Log Types"));
|
||||
sbLogTypes->Add(m_checks, 1, wxEXPAND);
|
||||
|
||||
wxBoxSizer* sButtons = new wxBoxSizer(wxHORIZONTAL);
|
||||
sButtons->AddStretchSpacer();
|
||||
wxButton *btn_close = new wxButton(this, wxID_CLOSE);
|
||||
_connect_macro_(btn_close, LogConfigDiag::OnClickClose, wxEVT_COMMAND_BUTTON_CLICKED, this);
|
||||
sButtons->Add(btn_close, 0, wxALL, 5);
|
||||
|
||||
wxBoxSizer *sLeft = new wxBoxSizer(wxVERTICAL);
|
||||
sLeft->Add(m_verbosity, 0, wxEXPAND | wxLEFT | wxRIGHT, 5);
|
||||
sLeft->Add(sbOptions, 0, wxEXPAND | wxLEFT | wxRIGHT, 5);
|
||||
sLeft->AddStretchSpacer();
|
||||
sLeft->Add(btn_toggle_all, 0, wxEXPAND | wxLEFT | wxRIGHT, 5);
|
||||
|
||||
wxBoxSizer *sTop = new wxBoxSizer(wxHORIZONTAL);
|
||||
sTop->Add(sLeft, 0, wxEXPAND);
|
||||
sTop->Add(sbLogTypes, 0, wxEXPAND | wxRIGHT, 5);
|
||||
|
||||
wxBoxSizer *sMain = new wxBoxSizer(wxVERTICAL);
|
||||
sMain->Add(sTop, 0, wxEXPAND);
|
||||
sMain->Add(sButtons, 0, wxEXPAND);
|
||||
sMain->Add(m_verbosity, 0, wxEXPAND | wxLEFT | wxRIGHT, 5);
|
||||
sMain->Add(sbOutputs, 0, wxEXPAND | wxLEFT | wxRIGHT, 5);
|
||||
sMain->Add(btn_toggle_all, 0, wxEXPAND | wxLEFT | wxRIGHT, 5);
|
||||
sMain->Add(sbLogTypes, 1, wxEXPAND | wxLEFT | wxRIGHT, 5);
|
||||
|
||||
SetSizer(sMain);
|
||||
Layout();
|
||||
Fit();
|
||||
}
|
||||
|
||||
void LogConfigDiag::LoadSettings()
|
||||
void LogConfigWindow::LoadSettings()
|
||||
{
|
||||
IniFile ini;
|
||||
ini.Load(File::GetUserPath(F_LOGGERCONFIG_IDX));
|
||||
|
@ -126,7 +115,7 @@ void LogConfigDiag::LoadSettings()
|
|||
}
|
||||
}
|
||||
|
||||
void LogConfigDiag::SaveSettings()
|
||||
void LogConfigWindow::SaveSettings()
|
||||
{
|
||||
IniFile ini;
|
||||
ini.Load(File::GetUserPath(F_LOGGERCONFIG_IDX));
|
||||
|
@ -140,7 +129,7 @@ void LogConfigDiag::SaveSettings()
|
|||
ini.Save(File::GetUserPath(F_LOGGERCONFIG_IDX));
|
||||
}
|
||||
|
||||
void LogConfigDiag::OnVerbosityChange(wxCommandEvent& event)
|
||||
void LogConfigWindow::OnVerbosityChange(wxCommandEvent& event)
|
||||
{
|
||||
int v = m_verbosity->GetSelection() + 1;
|
||||
for (int i = 0; i < LogTypes::NUMBER_OF_LOGS; i++)
|
||||
|
@ -148,7 +137,7 @@ void LogConfigDiag::OnVerbosityChange(wxCommandEvent& event)
|
|||
event.Skip();
|
||||
}
|
||||
|
||||
void LogConfigDiag::OnWriteFileChecked(wxCommandEvent& event)
|
||||
void LogConfigWindow::OnWriteFileChecked(wxCommandEvent& event)
|
||||
{
|
||||
for (int i = 0; i < LogTypes::NUMBER_OF_LOGS; ++i)
|
||||
{
|
||||
|
@ -163,7 +152,7 @@ void LogConfigDiag::OnWriteFileChecked(wxCommandEvent& event)
|
|||
}
|
||||
}
|
||||
|
||||
void LogConfigDiag::OnWriteConsoleChecked(wxCommandEvent& event)
|
||||
void LogConfigWindow::OnWriteConsoleChecked(wxCommandEvent& event)
|
||||
{
|
||||
for (int i = 0; i < LogTypes::NUMBER_OF_LOGS; ++i)
|
||||
{
|
||||
|
@ -178,7 +167,7 @@ void LogConfigDiag::OnWriteConsoleChecked(wxCommandEvent& event)
|
|||
}
|
||||
}
|
||||
|
||||
void LogConfigDiag::OnWriteWindowChecked(wxCommandEvent& event)
|
||||
void LogConfigWindow::OnWriteWindowChecked(wxCommandEvent& event)
|
||||
{
|
||||
for (int i = 0; i < LogTypes::NUMBER_OF_LOGS; ++i)
|
||||
{
|
||||
|
@ -193,7 +182,7 @@ void LogConfigDiag::OnWriteWindowChecked(wxCommandEvent& event)
|
|||
}
|
||||
}
|
||||
|
||||
void LogConfigDiag::OnToggleAll(wxCommandEvent& WXUNUSED(event))
|
||||
void LogConfigWindow::OnToggleAll(wxCommandEvent& WXUNUSED(event))
|
||||
{
|
||||
for (int i = 0; i < LogTypes::NUMBER_OF_LOGS; ++i)
|
||||
ToggleLog(i, enableAll);
|
||||
|
@ -201,7 +190,7 @@ void LogConfigDiag::OnToggleAll(wxCommandEvent& WXUNUSED(event))
|
|||
enableAll = !enableAll;
|
||||
}
|
||||
|
||||
void LogConfigDiag::ToggleLog(int _logType, bool enable)
|
||||
void LogConfigWindow::ToggleLog(int _logType, bool enable)
|
||||
{
|
||||
LogTypes::LOG_TYPE logType = (LogTypes::LOG_TYPE)_logType;
|
||||
|
||||
|
@ -226,19 +215,8 @@ void LogConfigDiag::ToggleLog(int _logType, bool enable)
|
|||
}
|
||||
}
|
||||
|
||||
void LogConfigDiag::OnLogCheck(wxCommandEvent& event)
|
||||
void LogConfigWindow::OnLogCheck(wxCommandEvent& event)
|
||||
{
|
||||
int i = event.GetInt();
|
||||
ToggleLog(i, m_checks->IsChecked(i));
|
||||
}
|
||||
|
||||
void LogConfigDiag::OnClickClose(wxCommandEvent& WXUNUSED(event))
|
||||
{
|
||||
Close();
|
||||
}
|
||||
|
||||
void LogConfigDiag::OnClose(wxCloseEvent& event)
|
||||
{
|
||||
SaveSettings();
|
||||
event.Skip();
|
||||
}
|
|
@ -25,10 +25,11 @@ class CFrame;
|
|||
class LogManager;
|
||||
class CLogWindow;
|
||||
|
||||
class LogConfigDiag : public wxDialog
|
||||
class LogConfigWindow : public wxPanel
|
||||
{
|
||||
public:
|
||||
LogConfigDiag(wxWindow* parent, CLogWindow *log_window);
|
||||
LogConfigWindow(wxWindow* parent, CLogWindow *log_window, wxWindowID id = wxID_ANY);
|
||||
~LogConfigWindow();
|
||||
|
||||
void SaveSettings();
|
||||
void LoadSettings();
|
||||
|
@ -52,8 +53,6 @@ private:
|
|||
void OnToggleAll(wxCommandEvent& event);
|
||||
void ToggleLog(int _logType, bool enable);
|
||||
void OnLogCheck(wxCommandEvent& event);
|
||||
void OnClickClose(wxCommandEvent& WXUNUSED(event));
|
||||
void OnClose(wxCloseEvent& event);
|
||||
};
|
||||
|
||||
#endif // _LOG_CONFIG_DIAG_H_
|
|
@ -20,7 +20,7 @@ else:
|
|||
'FrameAui.cpp',
|
||||
'FrameTools.cpp',
|
||||
'LogWindow.cpp',
|
||||
'LogConfigDiag.cpp',
|
||||
'LogConfigWindow.cpp',
|
||||
'GameListCtrl.cpp',
|
||||
'HotkeyDlg.cpp',
|
||||
'InputConfigDiag.cpp',
|
||||
|
|
Loading…
Reference in New Issue