void wxAuiDefaultDockArt::SetColour(int id, const wxColor& colour) { switch (id) { case wxAUI_DOCKART_BACKGROUND_COLOUR: m_backgroundBrush.SetColour(colour); break; case wxAUI_DOCKART_SASH_COLOUR: m_sashBrush.SetColour(colour); break; case wxAUI_DOCKART_INACTIVE_CAPTION_COLOUR: m_inactiveCaptionColour = colour; break; case wxAUI_DOCKART_INACTIVE_CAPTION_GRADIENT_COLOUR: m_inactiveCaptionGradientColour = colour; break; case wxAUI_DOCKART_INACTIVE_CAPTION_TEXT_COLOUR: m_inactiveCaptionTextColour = colour; break; case wxAUI_DOCKART_ACTIVE_CAPTION_COLOUR: m_activeCaptionColour = colour; break; case wxAUI_DOCKART_ACTIVE_CAPTION_GRADIENT_COLOUR: m_activeCaptionGradientColour = colour; break; case wxAUI_DOCKART_ACTIVE_CAPTION_TEXT_COLOUR: m_activeCaptionTextColour = colour; break; case wxAUI_DOCKART_BORDER_COLOUR: m_borderPen.SetColour(colour); break; case wxAUI_DOCKART_GRIPPER_COLOUR: m_gripperBrush.SetColour(colour); m_gripperPen1.SetColour(colour.ChangeLightness(40)); m_gripperPen2.SetColour(colour.ChangeLightness(60)); break; default: wxFAIL_MSG(wxT("Invalid Metric Ordinal")); break; } InitBitmaps(); }
// Class CCodeWindow::CCodeWindow(const SCoreStartupParameter& _LocalCoreStartupParameter, CFrame *parent, wxWindowID id, const wxPoint& position, const wxSize& size, long style, const wxString& name) : wxPanel((wxWindow*)parent, id, position, size, style, name) , Parent(parent) , m_RegisterWindow(NULL) , m_BreakpointWindow(NULL) , m_MemoryWindow(NULL) , m_JitWindow(NULL) , m_SoundWindow(NULL) , m_VideoWindow(NULL) , codeview(NULL) { InitBitmaps(); wxBoxSizer* sizerBig = new wxBoxSizer(wxHORIZONTAL); wxBoxSizer* sizerLeft = new wxBoxSizer(wxVERTICAL); DebugInterface* di = &PowerPC::debug_interface; codeview = new CCodeView(di, &g_symbolDB, this, ID_CODEVIEW); sizerBig->Add(sizerLeft, 2, wxEXPAND); sizerBig->Add(codeview, 5, wxEXPAND); sizerLeft->Add(callstack = new wxListBox(this, ID_CALLSTACKLIST, wxDefaultPosition, wxSize(90, 100)), 0, wxEXPAND); sizerLeft->Add(symbols = new wxListBox(this, ID_SYMBOLLIST, wxDefaultPosition, wxSize(90, 100), 0, NULL, wxLB_SORT), 1, wxEXPAND); sizerLeft->Add(calls = new wxListBox(this, ID_CALLSLIST, wxDefaultPosition, wxSize(90, 100), 0, NULL, wxLB_SORT), 0, wxEXPAND); sizerLeft->Add(callers = new wxListBox(this, ID_CALLERSLIST, wxDefaultPosition, wxSize(90, 100), 0, NULL, wxLB_SORT), 0, wxEXPAND); SetSizer(sizerBig); sizerLeft->Fit(this); sizerBig->Fit(this); }
void CGradeDialog::ConstructL() { iGradeNum=5; InitBitmaps(); }
CFrame::CFrame(wxFrame* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, bool _UseDebugger, bool _BatchMode, bool ShowLogWindow, long style) : CRenderFrame(parent, id, title, pos, size, style) , g_pCodeWindow(NULL), g_NetPlaySetupDiag(NULL), g_CheatsWindow(NULL) , m_ToolBar(NULL), m_ToolBarDebug(NULL), m_ToolBarAui(NULL) , m_GameListCtrl(NULL), m_Panel(NULL) , m_RenderFrame(NULL), m_RenderParent(NULL) , m_LogWindow(NULL), m_LogConfigWindow(NULL) , m_FifoPlayerDlg(NULL), UseDebugger(_UseDebugger) , m_bBatchMode(_BatchMode), m_bEdit(false), m_bTabSplit(false), m_bNoDocking(false) , m_bGameLoading(false) { for (int i = 0; i <= IDM_CODEWINDOW - IDM_LOGWINDOW; i++) bFloatWindow[i] = false; if (ShowLogWindow) SConfig::GetInstance().m_InterfaceLogWindow = true; // Give it a console early to show potential messages from this onward ConsoleListener *Console = LogManager::GetInstance()->GetConsoleListener(); if (SConfig::GetInstance().m_InterfaceConsole) Console->Open(); // Start debugging maximized if (UseDebugger) this->Maximize(true); // Debugger class if (UseDebugger) { g_pCodeWindow = new CCodeWindow(SConfig::GetInstance().m_LocalCoreStartupParameter, this, IDM_CODEWINDOW); LoadIniPerspectives(); g_pCodeWindow->Load(); } // Create toolbar bitmaps InitBitmaps(); // Give it a status bar SetStatusBar(CreateStatusBar(2, wxST_SIZEGRIP, ID_STATUSBAR)); if (!SConfig::GetInstance().m_InterfaceStatusbar) GetStatusBar()->Hide(); // Give it a menu bar CreateMenu(); // --------------- // Main panel // This panel is the parent for rendering and it holds the gamelistctrl m_Panel = new CPanel(this, IDM_MPANEL); m_GameListCtrl = new CGameListCtrl(m_Panel, LIST_CTRL, wxDefaultPosition, wxDefaultSize, wxLC_REPORT | wxSUNKEN_BORDER | wxLC_ALIGN_LEFT); wxBoxSizer *sizerPanel = new wxBoxSizer(wxHORIZONTAL); sizerPanel->Add(m_GameListCtrl, 1, wxEXPAND | wxALL); m_Panel->SetSizer(sizerPanel); // --------------- // Manager m_Mgr = new wxAuiManager(this, wxAUI_MGR_DEFAULT | wxAUI_MGR_LIVE_RESIZE); m_Mgr->AddPane(m_Panel, wxAuiPaneInfo() .Name(_T("Pane 0")).Caption(_T("Pane 0")).PaneBorder(false) .CaptionVisible(false).Layer(0).Center().Show()); if (!g_pCodeWindow) m_Mgr->AddPane(CreateEmptyNotebook(), wxAuiPaneInfo() .Name(_T("Pane 1")).Caption(_("Logging")).CaptionVisible(true) .Layer(0).FloatingSize(wxSize(600, 350)).CloseButton(true).Hide()); AuiFullscreen = m_Mgr->SavePerspective(); // Create toolbar RecreateToolbar(); if (!SConfig::GetInstance().m_InterfaceToolbar) DoToggleToolbar(false); m_LogWindow = new CLogWindow(this, IDM_LOGWINDOW); m_LogWindow->Hide(); m_LogWindow->Disable(); g_TASInputDlg = new TASInputDlg(this); Movie::SetInputManip(TASManipFunction); State::SetOnAfterLoadCallback(OnAfterLoadCallback); // Setup perspectives if (g_pCodeWindow) { // Load perspective DoLoadPerspective(); } else { if (SConfig::GetInstance().m_InterfaceLogWindow) ToggleLogWindow(true); if (SConfig::GetInstance().m_InterfaceLogConfigWindow) ToggleLogConfigWindow(true); if (SConfig::GetInstance().m_InterfaceConsole) ToggleConsole(true); } // Show window Show(); // Commit m_Mgr->Update(); #ifdef _WIN32 SetToolTip(wxT("")); GetToolTip()->SetAutoPop(25000); #endif #if defined(HAVE_XRANDR) && HAVE_XRANDR m_XRRConfig = new X11Utils::XRRConfiguration(X11Utils::XDisplayFromHandle(GetHandle()), X11Utils::XWindowFromHandle(GetHandle())); #endif // ------------------------- // Connect event handlers m_Mgr->Bind(wxEVT_AUI_RENDER, &CFrame::OnManagerResize, this); // ---------- // Update controls UpdateGUI(); }
void CGameListCtrl::Update() { int scrollPos = wxWindow::GetScrollPos(wxVERTICAL); // Don't let the user refresh it while a game is running if (Core::GetState() != Core::CORE_UNINITIALIZED) return; if (m_imageListSmall) { delete m_imageListSmall; m_imageListSmall = NULL; } // NetPlay : Set/Reset the GameList string m_gameList.clear(); m_gamePath.clear(); Hide(); ScanForISOs(); ClearAll(); if (m_ISOFiles.size() != 0) { // Don't load bitmaps unless there are games to list InitBitmaps(); // add columns InsertColumn(COLUMN_DUMMY,_T("")); InsertColumn(COLUMN_PLATFORM, _T("")); InsertColumn(COLUMN_BANNER, _("Banner")); InsertColumn(COLUMN_TITLE, _("Title")); // Instead of showing the notes + the company, which is unknown with // wii titles We show in the same column : company for GC games and // description for wii/wad games InsertColumn(COLUMN_NOTES, _("Notes")); InsertColumn(COLUMN_COUNTRY, _T("")); InsertColumn(COLUMN_SIZE, _("Size")); InsertColumn(COLUMN_EMULATION_STATE, _("State")); #ifdef __WXMSW__ const int platform_padding = 0; #else const int platform_padding = 8; #endif // set initial sizes for columns SetColumnWidth(COLUMN_DUMMY,0); SetColumnWidth(COLUMN_PLATFORM, 35 + platform_padding); SetColumnWidth(COLUMN_BANNER, 96 + platform_padding); SetColumnWidth(COLUMN_TITLE, 200 + platform_padding); SetColumnWidth(COLUMN_NOTES, 200 + platform_padding); SetColumnWidth(COLUMN_COUNTRY, 32 + platform_padding); SetColumnWidth(COLUMN_EMULATION_STATE, 50 + platform_padding); // add all items for (int i = 0; i < (int)m_ISOFiles.size(); i++) { InsertItemInReportView(i); if (m_ISOFiles[i]->IsCompressed()) SetItemTextColour(i, wxColour(0xFF0000)); } // Sort items by Title if (!sorted) last_column = 0; sorted = false; wxListEvent event; event.m_col = SConfig::GetInstance().m_ListSort2; OnColumnClick(event); event.m_col = SConfig::GetInstance().m_ListSort; OnColumnClick(event); sorted = true; SetColumnWidth(COLUMN_SIZE, wxLIST_AUTOSIZE); } else { wxString errorString; // We just check for one hide setting to be enabled, as we may only // have GC games for example, and hide them, so we should show the // second message instead if ((SConfig::GetInstance().m_ListGC && SConfig::GetInstance().m_ListWii && SConfig::GetInstance().m_ListWad) && (SConfig::GetInstance().m_ListJap && SConfig::GetInstance().m_ListUsa && SConfig::GetInstance().m_ListPal)) { errorString = _("Dolphin could not find any GC/Wii ISOs. Doubleclick here to browse for files..."); } else { errorString = _("Dolphin is currently set to hide all games. Doubleclick here to show all games..."); } InsertColumn(0, _("No ISOs or WADS found")); long index = InsertItem(0, errorString); SetItemFont(index, *wxITALIC_FONT); SetColumnWidth(0, wxLIST_AUTOSIZE); } if (GetSelectedISO() == NULL) main_frame->UpdateGUI(); Show(); AutomaticColumnWidth(); ScrollLines(scrollPos); SetFocus(); }
void CGameListCtrl::Update() { int scrollPos = wxWindow::GetScrollPos(wxVERTICAL); // Don't let the user refresh it while a game is running if (Core::GetState() != Core::CORE_UNINITIALIZED) return; if (m_imageListSmall) { delete m_imageListSmall; m_imageListSmall = nullptr; } Hide(); ScanForISOs(); ClearAll(); if (m_ISOFiles.size() != 0) { // Don't load bitmaps unless there are games to list InitBitmaps(); // add columns InsertColumn(COLUMN_DUMMY, ""); InsertColumn(COLUMN_PLATFORM, ""); InsertColumn(COLUMN_BANNER, _("Banner")); InsertColumn(COLUMN_TITLE, _("Title")); InsertColumn(COLUMN_MAKER, _("Maker")); InsertColumn(COLUMN_FILENAME, _("File")); InsertColumn(COLUMN_ID, _("ID")); InsertColumn(COLUMN_COUNTRY, ""); InsertColumn(COLUMN_SIZE, _("Size")); InsertColumn(COLUMN_EMULATION_STATE, _("State")); #ifdef __WXMSW__ const int platform_padding = 0; #else const int platform_padding = 8; #endif const int platform_icon_padding = 1; // set initial sizes for columns SetColumnWidth(COLUMN_DUMMY, 0); SetColumnWidth(COLUMN_PLATFORM, SConfig::GetInstance().m_showSystemColumn ? 32 + platform_icon_padding + platform_padding : 0); SetColumnWidth(COLUMN_BANNER, SConfig::GetInstance().m_showBannerColumn ? 96 + platform_padding : 0); SetColumnWidth(COLUMN_TITLE, 175 + platform_padding); SetColumnWidth(COLUMN_MAKER, SConfig::GetInstance().m_showMakerColumn ? 150 + platform_padding : 0); SetColumnWidth(COLUMN_FILENAME, SConfig::GetInstance().m_showFileNameColumn ? 100 + platform_padding : 0); SetColumnWidth(COLUMN_ID, SConfig::GetInstance().m_showIDColumn ? 75 + platform_padding : 0); SetColumnWidth(COLUMN_COUNTRY, SConfig::GetInstance().m_showRegionColumn ? 32 + platform_padding : 0); SetColumnWidth(COLUMN_EMULATION_STATE, SConfig::GetInstance().m_showStateColumn ? 48 + platform_padding : 0); // add all items for (int i = 0; i < (int)m_ISOFiles.size(); i++) { InsertItemInReportView(i); if (SConfig::GetInstance().m_ColorCompressed && m_ISOFiles[i]->IsCompressed()) SetItemTextColour(i, wxColour(0xFF0000)); } // Sort items by Title if (!sorted) last_column = 0; sorted = false; wxListEvent event; event.m_col = SConfig::GetInstance().m_ListSort2; OnColumnClick(event); event.m_col = SConfig::GetInstance().m_ListSort; OnColumnClick(event); sorted = true; SetColumnWidth(COLUMN_SIZE, SConfig::GetInstance().m_showSizeColumn ? wxLIST_AUTOSIZE : 0); } else { wxString errorString; // We just check for one hide setting to be enabled, as we may only // have GC games for example, and hide them, so we should show the // first message instead if (IsHidingItems()) { errorString = _("Dolphin is currently set to hide all games. Double-click here to show all games..."); } else { errorString = _("Dolphin could not find any GameCube/Wii ISOs or WADs. Double-click here to set a games directory..."); } InsertColumn(0, ""); long index = InsertItem(0, errorString); SetItemFont(index, *wxITALIC_FONT); SetColumnWidth(0, wxLIST_AUTOSIZE); } if (GetSelectedISO() == nullptr) main_frame->UpdateGUI(); Show(); AutomaticColumnWidth(); ScrollLines(scrollPos); SetFocus(); }
CCodeWindow::CCodeWindow(const SConfig& _LocalCoreStartupParameter, CFrame *parent, wxWindowID id, const wxPoint& position, const wxSize& size, long style, const wxString& name) : wxPanel(parent, id, position, size, style, name) , Parent(parent) , m_RegisterWindow(nullptr) , m_WatchWindow(nullptr) , m_BreakpointWindow(nullptr) , m_MemoryWindow(nullptr) , m_JitWindow(nullptr) , m_SoundWindow(nullptr) , m_VideoWindow(nullptr) , codeview(nullptr) { InitBitmaps(); DebugInterface* di = &PowerPC::debug_interface; codeview = new CCodeView(di, &g_symbolDB, this, wxID_ANY); callstack = new wxListBox(this, wxID_ANY); callstack->Bind(wxEVT_LISTBOX, &CCodeWindow::OnCallstackListChange, this); symbols = new wxListBox(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0, nullptr, wxLB_SORT); symbols->Bind(wxEVT_LISTBOX, &CCodeWindow::OnSymbolListChange, this); calls = new wxListBox(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0, nullptr, wxLB_SORT); calls->Bind(wxEVT_LISTBOX, &CCodeWindow::OnCallsListChange, this); callers = new wxListBox(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0, nullptr, wxLB_SORT); callers->Bind(wxEVT_LISTBOX, &CCodeWindow::OnCallersListChange, this); m_aui_toolbar = new wxAuiToolBar(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxAUI_TB_HORIZONTAL | wxAUI_TB_PLAIN_BACKGROUND); wxSearchCtrl* const address_searchctrl = new wxSearchCtrl(m_aui_toolbar, IDM_ADDRBOX); address_searchctrl->Bind(wxEVT_TEXT, &CCodeWindow::OnAddrBoxChange, this); address_searchctrl->SetDescriptiveText(_("Search Address")); m_aui_toolbar->AddControl(address_searchctrl); m_aui_toolbar->Realize(); m_aui_manager.SetManagedWindow(this); m_aui_manager.SetFlags(wxAUI_MGR_DEFAULT | wxAUI_MGR_LIVE_RESIZE); m_aui_manager.AddPane(m_aui_toolbar, wxAuiPaneInfo().ToolbarPane().Top().Floatable(false)); m_aui_manager.AddPane(callstack, wxAuiPaneInfo().MinSize(150, 100).Left().CloseButton(false).Floatable(false).Caption(_("Callstack"))); m_aui_manager.AddPane(symbols, wxAuiPaneInfo().MinSize(150, 100).Left().CloseButton(false).Floatable(false).Caption(_("Symbols"))); m_aui_manager.AddPane(calls, wxAuiPaneInfo().MinSize(150, 100).Left().CloseButton(false).Floatable(false).Caption(_("Function calls"))); m_aui_manager.AddPane(callers, wxAuiPaneInfo().MinSize(150, 100).Left().CloseButton(false).Floatable(false).Caption(_("Function callers"))); m_aui_manager.AddPane(codeview, wxAuiPaneInfo().CenterPane().CloseButton(false).Floatable(false)); m_aui_manager.Update(); // Menu Bind(wxEVT_MENU, &CCodeWindow::OnCPUMode, this, IDM_INTERPRETER, IDM_JIT_SR_OFF); Bind(wxEVT_MENU, &CCodeWindow::OnChangeFont, this, IDM_FONT_PICKER); Bind(wxEVT_MENU, &CCodeWindow::OnJitMenu, this, IDM_CLEAR_CODE_CACHE, IDM_SEARCH_INSTRUCTION); Bind(wxEVT_MENU, &CCodeWindow::OnSymbolsMenu, this, IDM_CLEAR_SYMBOLS, IDM_PATCH_HLE_FUNCTIONS); Bind(wxEVT_MENU, &CCodeWindow::OnProfilerMenu, this, IDM_PROFILE_BLOCKS, IDM_WRITE_PROFILE); // Toolbar Bind(wxEVT_MENU, &CCodeWindow::OnCodeStep, this, IDM_STEP, IDM_GOTOPC); // Other Bind(wxEVT_HOST_COMMAND, &CCodeWindow::OnHostMessage, this); }
wxAuiDefaultDockArt::wxAuiDefaultDockArt() { #if defined( __WXMAC__ ) && wxOSX_USE_COCOA_OR_CARBON wxColor baseColour = wxColour( wxMacCreateCGColorFromHITheme(kThemeBrushToolbarBackground)); #else wxColor baseColour = wxSystemSettings::GetColour(wxSYS_COLOUR_3DFACE); #endif // the baseColour is too pale to use as our base colour, // so darken it a bit -- if ((255-baseColour.Red()) + (255-baseColour.Green()) + (255-baseColour.Blue()) < 60) { baseColour = baseColour.ChangeLightness(92); } m_baseColour = baseColour; wxColor darker1Colour = baseColour.ChangeLightness(85); wxColor darker2Colour = baseColour.ChangeLightness(75); wxColor darker3Colour = baseColour.ChangeLightness(60); //wxColor darker4Colour = baseColour.ChangeLightness(50); wxColor darker5Colour = baseColour.ChangeLightness(40); m_activeCaptionColour = wxSystemSettings::GetColour(wxSYS_COLOUR_HIGHLIGHT); m_activeCaptionGradientColour = wxAuiLightContrastColour(wxSystemSettings::GetColour(wxSYS_COLOUR_HIGHLIGHT)); m_activeCaptionTextColour = wxSystemSettings::GetColour(wxSYS_COLOUR_HIGHLIGHTTEXT); m_inactiveCaptionColour = darker1Colour; m_inactiveCaptionGradientColour = baseColour.ChangeLightness(97); m_inactiveCaptionTextColour = *wxBLACK; m_sashBrush = wxBrush(baseColour); m_backgroundBrush = wxBrush(baseColour); m_gripperBrush = wxBrush(baseColour); m_borderPen = wxPen(darker2Colour); m_gripperPen1 = wxPen(darker5Colour); m_gripperPen2 = wxPen(darker3Colour); m_gripperPen3 = *wxWHITE_PEN; #ifdef __WXMAC__ m_captionFont = *wxSMALL_FONT; #else m_captionFont = wxFont(8, wxFONTFAMILY_DEFAULT, wxFONTSTYLE_NORMAL, wxFONTWEIGHT_NORMAL); #endif // default metric values #if defined( __WXMAC__ ) && wxOSX_USE_COCOA_OR_CARBON SInt32 height; GetThemeMetric( kThemeMetricSmallPaneSplitterHeight , &height ); m_sashSize = height; #elif defined(__WXGTK__) m_sashSize = wxRendererNative::Get().GetSplitterParams(NULL).widthSash; #else m_sashSize = 4; #endif m_captionSize = 17; m_borderSize = 1; m_buttonSize = 14; m_gripperSize = 9; m_gradientType = wxAUI_GRADIENT_VERTICAL; InitBitmaps(); }
void CInputDialog::ConstructL() { iIsNull=EFalse; iType=1; InitBitmaps(); }