PqwxFrame::PqwxFrame(const wxString& title) : wxFrame(NULL, wxID_ANY, title), titlePrefix(title), currentEditor(NULL), haveCurrentServer(false) { #ifdef __WXMSW__ SetIcon(wxIcon(_T("Pqwx_appicon"))); #else wxIconBundle icons; icons.AddIcon(StaticResources::LoadVFSIcon(_T("memory:PqwxFrame/pqwx-appicon-64.png"))); icons.AddIcon(StaticResources::LoadVFSIcon(_T("memory:PqwxFrame/pqwx-appicon-48.png"))); icons.AddIcon(StaticResources::LoadVFSIcon(_T("memory:PqwxFrame/pqwx-appicon-32.png"))); icons.AddIcon(StaticResources::LoadVFSIcon(_T("memory:PqwxFrame/pqwx-appicon-16.png"))); SetIcons(icons); #endif SetMenuBar(wxXmlResource::Get()->LoadMenuBar(_T("mainmenu"))); wxSplitterWindow *mainSplitter = new wxSplitterWindow(this, wxID_ANY); PushEventHandler(&(::wxGetApp().GetObjectBrowserModel())); objectBrowserModelTimer = new wxTimer(&(::wxGetApp().GetObjectBrowserModel()), ObjectBrowserModel::TIMER_MAINTAIN); objectBrowserModelTimer->Start(30 * 1000, wxTIMER_CONTINUOUS); // 30 seconds objectBrowser = new ObjectBrowser(::wxGetApp().GetObjectBrowserModel(), mainSplitter, Pqwx_ObjectBrowser); documentsBook = new DocumentsNotebook(mainSplitter, Pqwx_DocumentsNotebook); mainSplitter->SplitVertically(objectBrowser, documentsBook); mainSplitter->SetSashGravity(0.2); mainSplitter->SetMinimumPaneSize(100); LoadFrameGeometry(); mainSplitter->SetSashPosition(GetSize().GetWidth()/4); }
ToasterBoxWindow::ToasterBoxWindow(wxWindow* parent, wxTimer *_parent2) : ToasterBase(parent, wxNO_BORDER|wxSTAY_ON_TOP|wxFRAME_NO_TASKBAR) { startTime = wxGetLocalTime(); parent2 = _parent2; sleepTime = 10; step = 4; pauseTime = 1700; textColor = *wxWHITE; popupText = _T("Change Me!"); //the size we want the dialog to be wxSize dialogSize(150, 170); count++; bottomRight = wxPoint(wxGetDisplaySize().GetWidth(), wxGetDisplaySize().GetHeight()); SetSize(bottomRight.x, bottomRight.y, dialogSize.GetWidth(), dialogSize.GetHeight()); ToasterBase::Connect( wxEVT_ERASE_BACKGROUND, (wxObjectEventFunction)& ToasterBoxWindow::OnEraseBackground); ToasterBase::Connect( wxEVT_PAINT, (wxObjectEventFunction)& ToasterBoxWindow::OnPaint); #ifndef __WXMSW__ PushEventHandler( new wxBackgroundBitmap( charArr2wxBitmap( notif_bg_png, sizeof(notif_bg_png) ) ) ); #endif }
void MyFrame::OnPushEventHandler(wxCommandEvent& WXUNUSED(event)) { PushEventHandler(new MyEvtHandler(++m_nPush)); #if wxUSE_STATUSBAR SetStatusText(wxString::Format(wxT("Push count: %u"), m_nPush), Status_Push); #endif // wxUSE_STATUSBAR }
/***************************************************************************** * Constructor. *****************************************************************************/ DialogsProvider::DialogsProvider( intf_thread_t *_p_intf, wxWindow *p_parent ) : wxFrame( p_parent, -1, wxT("") ) { /* Initializations */ p_intf = _p_intf; p_open_dialog = NULL; p_file_dialog = NULL; p_playlist_dialog = NULL; p_messages_dialog = NULL; p_fileinfo_dialog = NULL; p_prefs_dialog = NULL; p_file_generic_dialog = NULL; p_wizard_dialog = NULL; p_bookmarks_dialog = NULL; p_dir_dialog = NULL; p_updatevlc_dialog = NULL; p_vlm_dialog = NULL; /* Give our interface a nice little icon */ p_intf->p_sys->p_icon = new wxIcon( vlc_xpm ); /* Create the messages dialog so it can begin storing logs */ p_messages_dialog = new Messages( p_intf, p_parent ? p_parent : this ); /* Check if user wants to show the bookmarks dialog by default */ wxCommandEvent dummy_event; if( config_GetInt( p_intf, "wx-bookmarks" ) ) OnBookmarks( dummy_event ); /* Intercept all menu events in our custom event handler */ PushEventHandler( new MenuEvtHandler( p_intf, NULL ) ); WindowSettings *ws = p_intf->p_sys->p_window_settings; wxPoint p; wxSize s; bool b_shown; #define INIT( id, w, N, S ) \ if( ws->GetSettings( WindowSettings::id, b_shown, p, s ) && b_shown ) \ { \ if( !w ) \ w = N; \ w->SetSize( s ); \ w->Move( p ); \ w->S( true ); \ } INIT( ID_PLAYLIST, p_playlist_dialog, new Playlist(p_intf,this), ShowPlaylist ); INIT( ID_MESSAGES, p_messages_dialog, new Messages(p_intf,this), Show ); INIT( ID_FILE_INFO, p_fileinfo_dialog, new FileInfo(p_intf,this), Show ); INIT( ID_BOOKMARKS, p_bookmarks_dialog, new BookmarksDialog(p_intf,this), Show); #undef INIT }
CustomizedFrame::CustomizedFrame( wxWindow* parent ) : wxFrame(parent, wxID_ANY, _T(""), wxDefaultPosition, wxSize( -1,-1 ), wxCAPTION|wxCLOSE_BOX|wxDEFAULT_FRAME_STYLE|wxTAB_TRAVERSAL ) { SetIcon( SLcustomizations().GetAppIcon() ); SetTitle( SLcustomizations().GetModname() ); this->SetSizeHints( wxDefaultSize, wxDefaultSize ); this->SetExtraStyle( wxFRAME_EX_METAL ); SetSize( SLcustomizations().GetBackgroundSize() ); Layout(); PushEventHandler( new wxBackgroundBitmap( SLcustomizations().GetBackground() ) ); }
MyChild::MyChild(wxMDIParentFrame *parent) : wxMDIChildFrame ( parent, wxID_ANY, wxString::Format("Child %u", ++ms_numChildren) ), MenuEventLogger("child", this) { m_canvas = new MyCanvas(this, wxPoint(0, 0), GetClientSize()); SetIcon(wxICON(chart)); const bool canBeResized = !IsAlwaysMaximized(); // create our menu bar: it will be shown instead of the main frame one when // we're active #if wxUSE_MENUS wxMenuBar *mbar = MyFrame::CreateMainMenubar(); mbar->GetMenu(0)->Insert(1, wxID_CLOSE, "&Close child\tCtrl-W", "Close this window"); wxMenu *menuChild = new wxMenu; menuChild->Append(MDI_REFRESH, "&Refresh picture"); menuChild->Append(MDI_CHANGE_TITLE, "Change &title...\tCtrl-T"); if ( canBeResized ) { menuChild->AppendSeparator(); menuChild->Append(MDI_CHANGE_POSITION, "Move frame\tCtrl-M"); menuChild->Append(MDI_CHANGE_SIZE, "Resize frame\tCtrl-S"); } #if wxUSE_CLIPBOARD menuChild->AppendSeparator(); menuChild->Append(wxID_PASTE, "Copy text from clipboard\tCtrl-V"); #endif // wxUSE_CLIPBOARD mbar->Insert(1, menuChild, "&Child"); // Associate the menu bar with the frame SetMenuBar(mbar); #endif // wxUSE_MENUS // this should work for MDI frames as well as for normal ones, provided // they can be resized at all if ( canBeResized ) SetSizeHints(100, 100); // test that event handlers pushed on top of MDI children do work (this // used to be broken, see #11225) PushEventHandler(new EventHandler(ms_numChildren)); }
TimelinePanel::TimelinePanel(wxScrolledWindow* scrollMe, int timeline, bool isConstant, wxString timelineTitle, wxString addLabel, wxWindow *parent, wxWindowID id) : wxPanel(parent, id, wxDefaultPosition, wxDefaultSize) { this->timeline = timeline; this->isConstant = isConstant; this->scrollMe = scrollMe; inst = 0; speedChange = 0; PushEventHandler(new WheelCatcher(scrollMe)); wxStaticText *text; wxStaticBox *staticBox = new wxStaticBox (this, wxID_ANY, timelineTitle); topBox = new wxStaticBoxSizer (staticBox, wxVERTICAL ); staticBox->PushEventHandler(new WheelCatcher(scrollMe)); SetSizer( topBox ); SetAutoLayout( true ); if (isConstant == false) { speedBox = new wxBoxSizer(wxHORIZONTAL); topBox->Add(speedBox, wxSizerFlags(0).Expand().Border(wxBOTTOM, 5)); text = new wxStaticText( this, wxID_ANY, _T("Slow "), wxDefaultPosition, wxDefaultSize); speedBox->Add(text, wxSizerFlags(0)); text->PushEventHandler(new WheelCatcher(scrollMe)); speedSlider = new wxSlider( this, SPEED_SLIDER, 0, 0, 254, wxDefaultPosition, wxSize(125,wxDefaultCoord), wxSL_AUTOTICKS); speedBox->Add(speedSlider, wxSizerFlags(1)); speedSlider->PushEventHandler(new WheelCatcher(scrollMe)); text = new wxStaticText( this, wxID_ANY, _T(" Fast"), wxDefaultPosition, wxDefaultSize); speedBox->Add(text, wxSizerFlags(0)); text->PushEventHandler(new WheelCatcher(scrollMe)); speedBox->Show(false); } else { speedBox = 0; speedSlider = 0; } effectBox = new wxBoxSizer(wxVERTICAL); topBox->Add(effectBox, wxSizerFlags(0).Expand()); addButton = new wxButton(this, ADD_BUTTON, addLabel, wxDefaultPosition, wxDefaultSize); topBox->Add(addButton, wxSizerFlags(0).Center()); addButton->PushEventHandler(new WheelCatcher(scrollMe)); }
NaviMainFrame::NaviMainFrame() : wxFrame((wxFrame*) NULL, wxID_ANY, wxT("Navi")), m_noteBook(NULL), m_taskBarIcon(NULL) { // create our menu here initMenu(); // navigation up top (play pause buttons) wxPanel* panelMain = new wxPanel(this); wxBoxSizer* sizer = new wxBoxSizer(wxVERTICAL); panelMain->SetSizer(sizer); m_navigation = new NavigationContainer(panelMain, this); // bottom part: wxPanel* p = createBottom(panelMain); // Add the components to the sizer. Add a border of 5 px so the widgets aren't // 'attached' to the edges of the wxFrame itself (looks neater). // add navigation to the sizer sizer->Add(m_navigation, wxSizerFlags().Expand().Border(wxALL, 5)); // add the bottom pieces to the sizer. Note that we user a proportion of 1 here to max // it out all the way to the bottom. sizer->Add(p, wxSizerFlags(1).Expand().Border(wxALL, 5)); CreateStatusBar(); // create the track status handler event handling stuff. This thing // is created on the heap, without a parent wxWindow. this pointer is // given still though, but by destroying this frame, the trackstatushandler // instance will not be destroyed automatically. Not that it matters, // since after we destroyed this frame, the program should end anyway. m_trackStatusHandler = new TrackStatusHandler(this); // Push that event handler, otherwise events will not be propagated to // this new track status handler. PushEventHandler(m_trackStatusHandler); // create a systray icon. bool trayEnabled; wxConfigBase::Get()->Read(Preferences::MINIMIZE_TO_TRAY, &trayEnabled, false); if (trayEnabled) { m_taskBarIcon = new SystrayIcon(this); wxBitmap bm(wxT("./data/icons/navi.png"), wxBITMAP_TYPE_PNG); wxIcon icon; icon.CopyFromBitmap(bm); m_taskBarIcon->SetIcon(icon, wxT("Navi - Hey, listen!")); } }
void wxGISApplication::OnToolDropDown(wxAuiToolBarEvent& event) { if(event.IsDropDownClicked()) { wxGISCommand* pCmd = GetCommand(event.GetToolId()); m_pDropDownCommand = dynamic_cast<IDropDownCommand*>(pCmd); if(m_pDropDownCommand) { wxMenu* pMenu = m_pDropDownCommand->GetDropDownMenu(); if(pMenu) { PushEventHandler(pMenu); PopupMenu(pMenu, event.GetItemRect().GetBottomLeft()); PopEventHandler(); delete pMenu; return; } } } event.Skip(); }
// ------------------------------------------------------------------------ MainEmuFrame::MainEmuFrame(wxWindow* parent, const wxString& title) : wxFrame(parent, wxID_ANY, title, wxDefaultPosition, wxDefaultSize, wxDEFAULT_FRAME_STYLE & ~(wxMAXIMIZE_BOX | wxRESIZE_BORDER) ) , m_statusbar( *CreateStatusBar(2, 0) ) , m_background( this, wxID_ANY, wxGetApp().GetLogoBitmap() ) // All menu components must be created on the heap! , m_menubar( *new wxMenuBar() ) , m_menuCDVD ( *new wxMenu() ) , m_menuSys ( *new wxMenu() ) , m_menuConfig ( *new wxMenu() ) , m_menuMisc ( *new wxMenu() ) , m_menuDebug ( *new wxMenu() ) , m_LoadStatesSubmenu( *MakeStatesSubMenu( MenuId_State_Load01, MenuId_State_LoadBackup ) ) , m_SaveStatesSubmenu( *MakeStatesSubMenu( MenuId_State_Save01 ) ) , m_MenuItem_Console( *new wxMenuItem( &m_menuMisc, MenuId_Console, _("Show Console"), wxEmptyString, wxITEM_CHECK ) ) , m_MenuItem_Console_Stdio( *new wxMenuItem( &m_menuMisc, MenuId_Console_Stdio, _("Console to Stdio"), wxEmptyString, wxITEM_CHECK ) ) { m_RestartEmuOnDelete = false; for( int i=0; i<PluginId_Count; ++i ) m_PluginMenuPacks[i].Populate( (PluginsEnum_t)i ); // ------------------------------------------------------------------------ // Initial menubar setup. This needs to be done first so that the menu bar's visible size // can be factored into the window size (which ends up being background+status+menus) //m_menubar.Append( &m_menuBoot, _("&Boot") ); m_menubar.Append( &m_menuSys, _("&System") ); m_menubar.Append( &m_menuCDVD, _("CD&VD") ); m_menubar.Append( &m_menuConfig, _("&Config") ); m_menubar.Append( &m_menuMisc, _("&Misc") ); #ifdef PCSX2_DEVBUILD m_menubar.Append( &m_menuDebug, _("&Debug") ); #endif SetMenuBar( &m_menubar ); // ------------------------------------------------------------------------ wxSize backsize( m_background.GetSize() ); wxString wintitle; if( PCSX2_isReleaseVersion ) { // stable releases, with a simple title. wintitle.Printf( _("%s %d.%d.%d %s"), pxGetAppName().c_str(), PCSX2_VersionHi, PCSX2_VersionMid, PCSX2_VersionLo, SVN_MODS ? _("(modded)") : wxEmptyString ); } else { // beta / development editions, which feature revision number and compile date. wintitle.Printf( _("%s %d.%d.%d.%d%s (svn) %s"), pxGetAppName().c_str(), PCSX2_VersionHi, PCSX2_VersionMid, PCSX2_VersionLo, SVN_REV, SVN_MODS ? L"m" : wxEmptyString, fromUTF8(__DATE__).c_str() ); } SetTitle( wintitle ); // Ideally the __WXMSW__ port should use the embedded IDI_ICON2 icon, because wxWidgets sucks and // loses the transparency information when loading bitmaps into icons. But for some reason // I cannot get it to work despite following various examples to the letter. SetIcons( wxGetApp().GetIconBundle() ); int m_statusbar_widths[] = { (int)(backsize.GetWidth()*0.73), (int)(backsize.GetWidth()*0.25) }; m_statusbar.SetStatusWidths(2, m_statusbar_widths); //m_statusbar.SetStatusText( L"The Status is Good!", 0); m_statusbar.SetStatusText( wxEmptyString, 0); wxBoxSizer& joe( *new wxBoxSizer( wxVERTICAL ) ); joe.Add( &m_background ); SetSizerAndFit( &joe ); // Use default window position if the configured windowpos is invalid (partially offscreen) if( g_Conf->MainGuiPosition == wxDefaultPosition || !pxIsValidWindowPosition( *this, g_Conf->MainGuiPosition) ) g_Conf->MainGuiPosition = GetScreenPosition(); else SetPosition( g_Conf->MainGuiPosition ); // Updating console log positions after the main window has been fitted to its sizer ensures // proper docked positioning, since the main window's size is invalid until after the sizer // has been set/fit. InitLogBoxPosition( g_Conf->ProgLogBox ); // ------------------------------------------------------------------------ // Some of the items in the System menu are configured by the UpdateCoreStatus() method. m_menuSys.Append(MenuId_Boot_CDVD, _("Initializing...")); m_menuSys.Append(MenuId_Boot_CDVD2, _("Initializing...")); m_menuSys.Append(MenuId_Boot_ELF, _("Run ELF..."), _("For running raw PS2 binaries directly")); m_menuSys.AppendSeparator(); m_menuSys.Append(MenuId_Sys_SuspendResume, _("Initializing...")); m_menuSys.AppendSeparator(); //m_menuSys.Append(MenuId_Sys_Close, _("Close"), // _("Stops emulation and closes the GS window.")); m_menuSys.Append(MenuId_Sys_LoadStates, _("Load state"), &m_LoadStatesSubmenu); m_menuSys.Append(MenuId_Sys_SaveStates, _("Save state"), &m_SaveStatesSubmenu); m_menuSys.Append(MenuId_EnableBackupStates, _("Backup before save"), wxEmptyString, wxITEM_CHECK); m_menuSys.AppendSeparator(); m_menuSys.Append(MenuId_EnablePatches, _("Automatic Gamefixes"), _("Automatically applies needed Gamefixes to known problematic games"), wxITEM_CHECK); m_menuSys.Append(MenuId_EnableCheats, _("Enable Cheats"), wxEmptyString, wxITEM_CHECK); m_menuSys.Append(MenuId_EnableWideScreenPatches, _("Enable Widescreen Patches"), wxEmptyString, wxITEM_CHECK); m_menuSys.Append(MenuId_EnableHostFs, _("Enable Host Filesystem"), wxEmptyString, wxITEM_CHECK); m_menuSys.AppendSeparator(); m_menuSys.Append(MenuId_Sys_Shutdown, _("Shutdown"), _("Wipes all internal VM states and shuts down plugins.")); m_menuSys.Append(MenuId_Exit, _("Exit"), AddAppName(_("Closing %s may be hazardous to your health"))); // ------------------------------------------------------------------------ wxMenu& isoRecents( wxGetApp().GetRecentIsoMenu() ); //m_menuCDVD.AppendSeparator(); m_menuCDVD.Append( MenuId_IsoSelector, _("Iso Selector"), &isoRecents ); m_menuCDVD.Append( GetPluginMenuId_Settings(PluginId_CDVD), _("Plugin Menu"), m_PluginMenuPacks[PluginId_CDVD] ); m_menuCDVD.AppendSeparator(); m_menuCDVD.Append( MenuId_Src_Iso, _("Iso"), _("Makes the specified ISO image the CDVD source."), wxITEM_RADIO ); m_menuCDVD.Append( MenuId_Src_Plugin, _("Plugin"), _("Uses an external plugin as the CDVD source."), wxITEM_RADIO ); m_menuCDVD.Append( MenuId_Src_NoDisc, _("No disc"), _("Use this to boot into your virtual PS2's BIOS configuration."), wxITEM_RADIO ); //m_menuCDVD.AppendSeparator(); //m_menuCDVD.Append( MenuId_SkipBiosToggle,_("Enable BOOT2 injection"), // _("Skips PS2 splash screens when booting from Iso or DVD media"), wxITEM_CHECK ); // ------------------------------------------------------------------------ m_menuConfig.Append(MenuId_Config_SysSettings, _("Emulation &Settings") ); m_menuConfig.Append(MenuId_Config_McdSettings, _("&Memory cards") ); m_menuConfig.Append(MenuId_Config_BIOS, _("&Plugin/BIOS Selector") ); if (IsDebugBuild) m_menuConfig.Append(MenuId_Config_GameDatabase, _("Game Database Editor") ); // Empty menu // m_menuConfig.Append(MenuId_Config_Language, _("Appearance...") ); m_menuConfig.AppendSeparator(); m_menuConfig.Append(MenuId_Config_GS, _("&Video (GS)"), m_PluginMenuPacks[PluginId_GS]); m_menuConfig.Append(MenuId_Config_SPU2, _("&Audio (SPU2)"), m_PluginMenuPacks[PluginId_SPU2]); m_menuConfig.Append(MenuId_Config_PAD, _("&Controllers (PAD)"),m_PluginMenuPacks[PluginId_PAD]); m_menuConfig.Append(MenuId_Config_DEV9, _("Dev9"), m_PluginMenuPacks[PluginId_DEV9]); m_menuConfig.Append(MenuId_Config_USB, _("USB"), m_PluginMenuPacks[PluginId_USB]); m_menuConfig.Append(MenuId_Config_FireWire, _("Firewire"), m_PluginMenuPacks[PluginId_FW]); //m_menuConfig.AppendSeparator(); //m_menuConfig.Append(MenuId_Config_Patches, _("Patches (unimplemented)"), wxEmptyString); m_menuConfig.AppendSeparator(); m_menuConfig.Append(MenuId_Config_Multitap0Toggle, _("Multitap 1"), wxEmptyString, wxITEM_CHECK ); m_menuConfig.Append(MenuId_Config_Multitap1Toggle, _("Multitap 2"), wxEmptyString, wxITEM_CHECK ); m_menuConfig.AppendSeparator(); m_menuConfig.Append(MenuId_Config_ResetAll, _("Clear all settings..."), AddAppName(_("Clears all %s settings and re-runs the startup wizard."))); // ------------------------------------------------------------------------ m_menuMisc.Append( &m_MenuItem_Console ); #ifdef __LINUX__ m_menuMisc.Append( &m_MenuItem_Console_Stdio ); #endif //Todo: Though not many people need this one :p //m_menuMisc.Append(MenuId_Profiler, _("Show Profiler"), wxEmptyString, wxITEM_CHECK); //m_menuMisc.AppendSeparator(); // No dialogs implemented for these yet... //m_menuMisc.Append(41, "Patch Browser...", wxEmptyString, wxITEM_NORMAL); //m_menuMisc.Append(42, "Patch Finder...", wxEmptyString, wxITEM_NORMAL); m_menuMisc.AppendSeparator(); //Todo: //There's a great working "open website" in the about panel. Less clutter by just using that. //m_menuMisc.Append(MenuId_Website, _("Visit Website..."), // _("Opens your web-browser to our favorite website.")); m_menuMisc.Append(MenuId_About, _("About...") ); m_menuMisc.AppendSeparator(); m_menuMisc.Append( MenuId_ChangeLang, L"Change Language" ); // Always in English #ifdef PCSX2_DEVBUILD //m_menuDebug.Append(MenuId_Debug_Open, _("Open Debug Window..."), wxEmptyString); //m_menuDebug.Append(MenuId_Debug_MemoryDump, _("Memory Dump..."), wxEmptyString); m_menuDebug.Append(MenuId_Debug_Logging, _("Logging..."), wxEmptyString); #endif m_MenuItem_Console.Check( g_Conf->ProgLogBox.Visible ); ConnectMenus(); Connect( wxEVT_MOVE, wxMoveEventHandler (MainEmuFrame::OnMoveAround) ); Connect( wxEVT_CLOSE_WINDOW, wxCloseEventHandler (MainEmuFrame::OnCloseWindow) ); Connect( wxEVT_SET_FOCUS, wxFocusEventHandler (MainEmuFrame::OnFocus) ); Connect( wxEVT_ACTIVATE, wxActivateEventHandler (MainEmuFrame::OnActivate) ); PushEventHandler( &wxGetApp().GetRecentIsoManager() ); SetDropTarget( new IsoDropTarget( this ) ); ApplyCoreStatus(); ApplySettings(); }
//////////////////////////////////////////////////////////////////////////////// // SetupDebugger() // // This function creates the debugger views... // void frmDebugger::SetupDebugger() { SetFont(settings->GetSystemFont()); // Initializing Stack Frame Window if (m_stackWindow == NULL) { m_stackWindow = new ctlStackWindow(this, WINDOW_ID_STACK, wxDefaultPosition, wxDefaultSize, 0); m_manager.AddPane(m_stackWindow, wxAuiPaneInfo().Name(wxT("stackPane")).Caption(_("Stack pane")).Right() .MinSize(wxSize(100, 100)).BestSize(wxSize(250, 200))); } // Initializing Tab Window if (m_tabWindow == NULL) { m_tabWindow = new ctlTabWindow(this, WINDOW_ID_TABS, wxDefaultPosition, wxDefaultSize, wxAUI_NB_BOTTOM | wxAUI_NB_TAB_SPLIT | wxAUI_NB_TAB_MOVE | wxAUI_NB_SCROLL_BUTTONS | wxAUI_NB_WINDOWLIST_BUTTON); m_manager.AddPane(m_tabWindow, wxAuiPaneInfo().Name(wxT("outputPane")).Caption(_("Output pane")).Bottom() .MinSize(wxSize(200, 100)).BestSize(wxSize(550, 300))); } // Initialing Code viewer Window if (m_codeViewer == NULL) { m_codeViewer = new ctlSQLBox(this, -1); // Set up the markers that we use to indicate the current line and // the break-point m_codeViewer->MarkerDefine(MARKER_CURRENT, wxSTC_MARK_ARROW, *wxGREEN, *wxGREEN); m_codeViewer->MarkerDefine(MARKER_CURRENT_BG, wxSTC_MARK_BACKGROUND, *wxGREEN, *wxGREEN); m_codeViewer->MarkerDefine(MARKER_BREAKPOINT, wxSTC_MARK_CIRCLEPLUS, *wxRED, *wxRED); m_codeViewer->SetMarginWidth(1, 16); m_codeViewer->SetMarginType(1, wxSTC_MARGIN_SYMBOL); // Make sure that the text control tells us when the user clicks in the // left margin m_codeViewer->SetMarginSensitive(0, true); m_codeViewer->SetMarginSensitive(1, true); m_codeViewer->SetMarginSensitive(2, true); m_manager.AddPane(m_codeViewer, wxAuiPaneInfo().Name(wxT("sourcePane")).Caption(_("Source pane")).Center() .CaptionVisible(false).CloseButton(false).MinSize(wxSize(200, 100)) .BestSize(wxSize(350, 200))); } // Make sure the user can't edit the source code for this function m_codeViewer->SetReadOnly(true); // Now (re)load the layout wxString perspective; settings->Read( wxT("Debugger/frmDebugger/Perspective-") + wxString(FRMDEBUGGER_PERSPECTIVE_VER), &perspective, FRMDEBUGGER_DEFAULT_PERSPECTIVE); m_manager.LoadPerspective(perspective, true); // And reset the captions m_manager.GetPane(wxT("sourcePane")).Caption(_("Source pane")); m_manager.GetPane(wxT("stackPane")).Caption(_("Stack pane")); m_manager.GetPane(wxT("outputPane")).Caption(_("Output pane")); // Sync the View menu options m_viewMenu->Check(MENU_ID_VIEW_STACKPANE, m_manager.GetPane(wxT("stackPane")).IsShown()); m_viewMenu->Check(MENU_ID_VIEW_OUTPUTPANE, m_manager.GetPane(wxT("outputPane")).IsShown()); // Enable the options for these controls m_viewMenu->Enable(MENU_ID_VIEW_OUTPUTPANE, true); m_viewMenu->Enable(MENU_ID_VIEW_STACKPANE, true); m_manager.Update(); // force EnableToolsAndMenus(false); PushEventHandler(m_controller); }
EffectPanel::EffectPanel(wxScrolledWindow* scrollMe, Effect* effect, bool isConstant, TimelinePanel *parent, wxWindowID id) : wxPanel(parent, id, wxDefaultPosition, wxDefaultSize) { timelineParent = parent; this->isConstant = isConstant; this->effect = effect; this->scrollMe = scrollMe; depthChange = 0; PushEventHandler(new WheelCatcher(scrollMe)); wxBoxSizer *vBox; wxStaticText *text; vBox = new wxBoxSizer(wxVERTICAL); SetSizer( vBox ); SetAutoLayout( true ); effectTypeChoice = new wxChoice(this, EFFECT_TYPE_CHOICE, wxDefaultPosition, wxDefaultSize, NUM_EFFECT_TYPES + 1, effectChoices); effectTypeChoice->PushEventHandler(new WheelCatcher(scrollMe)); vBox->Add(effectTypeChoice, wxSizerFlags(0).Center().Expand()); effectTypeChoice->Select(effect->type); sliderBox = new wxBoxSizer(wxHORIZONTAL); vBox->Add(sliderBox, wxSizerFlags(0).Expand().Border(wxBOTTOM, 2)); if (isConstant) { if (isFinite()) { text = new wxStaticText( this, wxID_ANY, _T("Offset: "), wxDefaultPosition, wxDefaultSize); } else { text = new wxStaticText( this, wxID_ANY, _T("Range: "), wxDefaultPosition, wxDefaultSize); } } else { text = new wxStaticText( this, wxID_ANY, _T("Range: "), wxDefaultPosition, wxDefaultSize); } text->PushEventHandler(new WheelCatcher(scrollMe)); sliderBox->Add(text, wxSizerFlags(0)); depthSlider = new wxSlider( this, DEPTH_SLIDER, 0, 0, 254, wxDefaultPosition, wxSize(125,wxDefaultCoord), wxSL_AUTOTICKS); sliderBox->Add(depthSlider, wxSizerFlags(1)); depthSlider->PushEventHandler(new WheelCatcher(scrollMe)); depthSlider->SetValue(effect->inst->getDepth(effect->type, effect->timeline)); if (isConstant == false) { if (!isFinite()) { sliderBox->Show(false); } effectCanvas = new EffectCanvas(effect, this, EFFECT_CANVAS, wxDefaultPosition, wxSize(192,80)); vBox->Add(effectCanvas, wxSizerFlags(0).Border(wxBOTTOM, 10)); effectCanvas->PushEventHandler(new WheelCatcher(scrollMe)); } else { effectCanvas = 0; } vBox->Layout(); Monitor::addCallback( &effect->type, new Callback<char, EffectPanel> (this, &EffectPanel::typeChangedCallback) ); oldType = effect->type; Monitor::addCallback( &effect->inst->original->depths[effect->timeline][effect->type], new Callback<unsigned char, EffectPanel> (this, &EffectPanel::depthChangedCallback) ); }
// ---------------------------------------------------------------------------- bool ThreadSearchFrame::InitThreadSearchFrame(wxFrame* appFrame, const wxString& title) // ---------------------------------------------------------------------------- { GetConfig()->SetThreadSearchFrame( this ); // create a menu bar CreateMenuBar(); // create a status bar with some information about the used wxWidgets version CreateStatusBar(2); SetStatusText(_("CodeSnippets Search"),0); SetStatusText(wxbuildinfo(short_f), 1); InitializeRecentFilesHistory(); // -not used yet- // allocate a separate EditorManager/Notebook if (not GetConfig()->GetEditorManager(this)) { SEditorManager* m_pEdMan = new SEditorManager(this); GetConfig()->RegisterEditorManager(this, m_pEdMan); }//if GetEditorManager // create ThreadSearch and alter its menu items m_pThreadSearch = new ThreadSearch( this ); if ( m_pThreadSearch ) do { m_pThreadSearch->ThreadSearch::m_IsAttached = true; m_pThreadSearch->OnAttach(); PushEventHandler(m_pThreadSearch); m_pThreadSearch->SetEvtHandlerEnabled( true ); // add View and Search menu items wxMenuBar* pMenuBar = this->GetMenuBar(); wxMenu* pMenuView = new wxMenu(); //-wxMenu* pMenuSearch = pMenuBar->GetMenu( pMenuBar->FindMenu(_T("Search"))); pMenuBar->Insert( 1, pMenuView, _T("View")); //-pMenuBar->Insert( 2, pMenuSearch, _T("Search")); m_pThreadSearch->BuildMenu( pMenuBar ); // Change 'View/ThreadSearch' to 'View/Options' int idOptionsThreadSearch = pMenuBar->FindMenuItem(_T("View"),_T("Snippets search")); if (idOptionsThreadSearch not_eq wxNOT_FOUND) { pMenuBar->SetLabel( idOptionsThreadSearch, _T("Options...") ); m_pThreadSearch->Connect(idOptionsThreadSearch, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(ThreadSearchFrame::OnMenuOptions), NULL, this); } // create tool bar and hide it (avoids bar reference crashes) wxToolBar* pToolBar = new wxToolBar(this, -1); if ( m_pThreadSearch ) m_pThreadSearch->BuildToolBar( pToolBar ); pToolBar->Hide(); // move frame to last know frame position ConfigManager* pCfg = Manager::Get()->GetConfigManager(_T("SnippetsSearch")); int xPos = pCfg->ReadInt( wxT("/FramePosX"), 120); int yPos = pCfg->ReadInt( wxT("/FramePosY"), 60); int width = pCfg->ReadInt( wxT("/FrameWidth"), 120); int height = pCfg->ReadInt( wxT("/FrameHeight"), 60); SetSize( xPos, yPos, width, height); // Catch Destroyed windows Connect( wxEVT_DESTROY, (wxObjectEventFunction) (wxEventFunction) (wxCommandEventFunction) &ThreadSearchFrame::OnWindowDestroy); // Allow filenames to be dropped/opened on ThreadSearchFrame SetDropTarget(new wxMyFileDropTarget(this)); GetConfig()->GetEditorManager(this)->GetNotebook()->SetDropTarget(new wxMyFileDropTarget(this)); }while(false);//if m_pThreadSearch do return m_pThreadSearch; }//initThreadSearchFrame ctor