FindPath::FindPath( wxWindow *parent, wxWindowID id, const wxString &title, const wxPoint &position, const wxSize& size, long style ) : wxFrame( parent, id, title, position, size, style ) { CreateMyMenuBar(); CreateMyToolBar(); CreateStatusBar(1); SetStatusText( wxT("Welcome!") ); // insert main window here }
MyFrame::MyFrame(const wxString & title) : wxFrame(NULL, wxID_ANY, title) { wxMenu * fileMenu = new wxMenu; wxMenu * helpMenu = new wxMenu; helpMenu->Append(wxID_ABOUT, wxT("About"), wxT("About dialog")); fileMenu->Append(wxID_EXIT, wxT("Exit"), wxT("Quit this program")); wxMenuBar *menuBar = new wxMenuBar(); menuBar->Append(fileMenu,wxT("File")); menuBar->Append(helpMenu,wxT("Help")); SetMenuBar(menuBar); CreateStatusBar(2); SetStatusText(wxT("Welcome to PTA Tool")); }
MyFrame::MyFrame(const wxString& title) : wxFrame(NULL, wxID_ANY, title, wxDefaultPosition, wxSize(500,300)) { m_simplePopup = m_scrolledPopup = NULL; SetIcon(wxICON(sample)); #if wxUSE_MENUS wxMenu *menuFile = new wxMenu; // the "About" item should be in the help menu wxMenu *helpMenu = new wxMenu; helpMenu->Append(Minimal_About, wxT("&About\tF1"), wxT("Show about dialog")); menuFile->Append(Minimal_TestDialog, wxT("&Test dialog\tAlt-T"), wxT("Test dialog")); menuFile->Append(Minimal_Quit, wxT("E&xit\tAlt-X"), wxT("Quit this program")); // now append the freshly created menu to the menu bar... wxMenuBar *menuBar = new wxMenuBar(); menuBar->Append(menuFile, wxT("&File")); menuBar->Append(helpMenu, wxT("&Help")); // ... and attach this menu bar to the frame SetMenuBar(menuBar); #endif // wxUSE_MENUS #if wxUSE_STATUSBAR // create a status bar just for fun (by default with 1 pane only) CreateStatusBar(2); SetStatusText(wxT("Welcome to wxWidgets!")); #endif // wxUSE_STATUSBAR wxPanel *panel = new wxPanel(this, -1); wxButton *button1 = new wxButton( panel, Minimal_StartSimplePopup, wxT("Show simple popup"), wxPoint(20,20) ); wxButton *button2 = new wxButton( panel, Minimal_StartScrolledPopup, wxT("Show scrolled popup"), wxPoint(20,70) ); m_logWin = new wxTextCtrl( panel, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE ); m_logWin->SetEditable(false); wxLogTextCtrl* logger = new wxLogTextCtrl( m_logWin ); m_logOld = logger->SetActiveTarget( logger ); logger->DisableTimestamp(); wxBoxSizer *topSizer = new wxBoxSizer( wxVERTICAL ); topSizer->Add( button1, 0, wxALL, 5 ); topSizer->Add( button2, 0, wxALL, 5 ); topSizer->Add( m_logWin, 1, wxEXPAND|wxALL, 5 ); panel->SetSizer( topSizer ); }
bool wxGISApplication::CreateApp(void) { CreateStatusBar(); wxFrame::GetStatusBar()->SetStatusText(_("Ready")); if(!wxGISApplicationBase::CreateApp()) return false; //load commandbars SerializeCommandBars(); //load accelerators m_pGISAcceleratorTable = new wxGISAcceleratorTable(this); wxGISAppConfig oConfig = GetConfig(); if(!oConfig.IsOk()) return false; // create MenuBar wxXmlNode* pMenuBarNode = oConfig.GetConfigNode(enumGISHKCU, GetAppName() + wxString(wxT("/frame/menubar"))); m_pMenuBar = new wxGISMenuBar(wxMB_DOCKABLE, this, pMenuBarNode); //wxMB_DOCKABLE SetMenuBar(static_cast<wxMenuBar*>(m_pMenuBar)); //mark menues from menu bar as enumGISTAMMenubar for(size_t i = 0; i < m_CommandBarArray.GetCount(); ++i) if(m_pMenuBar->IsMenuBarMenu(m_CommandBarArray[i]->GetName())) m_CommandBarArray[i]->SetType(enumGISCBMenubar); // min size for the frame itself isn't completely done. // see the end up wxAuiManager::Update() for the test // code. For now, just hard code a frame minimum size SetMinSize(wxSize(800,480)); SerializeFramePos(false); SetAcceleratorTable(m_pGISAcceleratorTable->GetAcceleratorTable()); SetApplication( this ); // wxHtmlWindow *pHtmlText = new wxHtmlWindow(this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxHW_DEFAULT_STYLE | wxBORDER_THEME); // pHtmlText->SetPage(wxT("<html><body><h1>Error</h1>Some error occurred :-H)</body></hmtl>")); // pHtmlText->Show(false); // RegisterChildWindow(pHtmlText->GetId()); // //#ifdef __WXGTK__ // // wxGISToolBarMenu* pToolBarMenu = dynamic_cast<wxGISToolBarMenu*>(GetCommandBar(TOOLBARMENUNAME)); // //if(pToolBarMenu) // // PushEventHandler(pToolBarMenu); //// m_pMenuBar->PushEventHandler(this); //#endif return true; }
END_EVENT_TABLE() EDA_3D_FRAME::EDA_3D_FRAME( PCB_BASE_FRAME* parent, const wxString& title, long style ) : EDA_BASE_FRAME( parent, DISPLAY3D_FRAME_TYPE, title, wxDefaultPosition, wxDefaultSize, style, wxT( "Frame3D" ) ) { m_canvas = NULL; m_reloadRequest = false; m_ortho = false; // Give it an icon wxIcon icon; icon.CopyFromBitmap( KiBitmap( icon_3d_xpm ) ); SetIcon( icon ); GetSettings(); SetSize( m_FramePos.x, m_FramePos.y, m_FrameSize.x, m_FrameSize.y ); // Create the status line static const int dims[5] = { -1, 100, 100, 100, 140 }; CreateStatusBar( 5 ); SetStatusWidths( 5, dims ); CreateMenuBar(); ReCreateMainToolbar(); // Make a EDA_3D_CANVAS int attrs[] = { WX_GL_RGBA, WX_GL_DOUBLEBUFFER, WX_GL_DEPTH_SIZE, 16, 0 }; m_canvas = new EDA_3D_CANVAS( this, attrs ); m_auimgr.SetManagedWindow( this ); EDA_PANEINFO horiztb; horiztb.HorizontalToolbarPane(); m_auimgr.AddPane( m_mainToolBar, wxAuiPaneInfo( horiztb ).Name( wxT( "m_mainToolBar" ) ).Top() ); m_auimgr.AddPane( m_canvas, wxAuiPaneInfo().Name( wxT( "DrawFrame" ) ).CentrePane() ); m_auimgr.Update(); // Fixes bug in Windows (XP and possibly others) where the canvas requires the focus // in order to receive mouse events. Otherwise, the user has to click somewhere on // the canvas before it will respond to mouse wheel events. m_canvas->SetFocus(); }
// frame constructor MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size) : wxFrame((wxFrame *)NULL, wxID_ANY, title, pos, size) { SetIcon(wxICON(sample)); // create a menu bar wxMenu *menuFile = new wxMenu; menuFile->Append(Minimal_Open, _("Open...\tCtrl-O")); menuFile->AppendSeparator(); menuFile->Append(Minimal_PageSetup, _("Page &Setup")); menuFile->Append(Minimal_Preview, _("Print pre&view...")); menuFile->Append(Minimal_Print, _("Print...\tCtrl-P")); menuFile->AppendSeparator(); menuFile->Append(wxID_ABOUT, _("&About")); menuFile->AppendSeparator(); menuFile->Append(Minimal_Quit, _("&Exit")); wxMenu *menuFonts = new wxMenu; menuFonts->AppendRadioItem(Minimal_PrintSmall, _("&Small Printer Fonts")); menuFonts->AppendRadioItem(Minimal_PrintNormal, _("&Normal Printer Fonts")); menuFonts->AppendRadioItem(Minimal_PrintHuge, _("&Huge Printer Fonts")); // now append the freshly created menu to the menu bar... wxMenuBar *menuBar = new wxMenuBar; menuBar->Append(menuFile, _("&File")); menuBar->Append(menuFonts, _("F&onts")); // ... and attach this menu bar to the frame SetMenuBar(menuBar); #if wxUSE_STATUSBAR CreateStatusBar(1); #endif // wxUSE_STATUSBAR m_Html = new wxHtmlWindow(this); m_Html -> SetRelatedFrame(this, _("HTML : %s")); #if wxUSE_STATUSBAR m_Html -> SetRelatedStatusBar(0); #endif // wxUSE_STATUSBAR m_Name = wxT("test.htm"); m_Html -> LoadPage(m_Name); m_Prn = new wxHtmlEasyPrinting(_("Easy Printing Demo"), this); m_Prn -> SetHeader(m_Name + wxT("(@PAGENUM@/@PAGESCNT@)<hr>"), wxPAGE_ALL); // To specify where the AFM files are kept on Unix, // you may wish to do something like this // m_Prn->GetPrintData()->SetFontMetricPath(wxT("/home/julians/afm")); }
CFrameWnd::CFrameWnd( const wxString& x_sTitle, const wxPoint& x_ptWin, const wxSize& x_sizeWin ) : wxFrame( (wxFrame*)NULL, -1, x_sTitle, x_ptWin, x_sizeWin, wxFULL_REPAINT_ON_RESIZE | wxDEFAULT_FRAME_STYLE ) {_STT(); m_pTimer = NULL; // SetIcon( wxIcon( mondrian_xpm ) ); wxImage::AddHandler( new wxJPEGHandler ); wxMenu *pcMenuFile = new wxMenu; if ( pcMenuFile ) pcMenuFile->Append( WXIDM_Open, _T( "&Open" ) ), pcMenuFile->AppendSeparator(), pcMenuFile->Append( WXIDM_Exit, _T( "E&xit" ) ); wxMenuBar *pcMenuBar = new wxMenuBar; if ( pcMenuBar ) pcMenuBar->Append( pcMenuFile, _T( "&File" ) ), SetMenuBar( pcMenuBar ); CreateStatusBar(); // SetStatusText( _T( "This is a status text" ) ); // Open the capture device if ( !m_cCapture.Open( oexVIDSUB_AUTO, 0, 0, 320, 240, 0, 15, oex::oexTRUE ) ) // if ( !m_cCapture.Open( oexVIDSUB_DSHOW, 0, 0, 320, 240, 24, 15, oex::oexTRUE ) ) // if ( !m_cCapture.Open( oexVIDSUB_VFW, 0, 0, 320, 240, 24, 15, oex::oexTRUE ) ) SetStatusText( _T( "Failed to open catpure device" ) ); else SetStatusText( oexLocalTimeStr( oexT( "%W, %B %D, %Y - %h:%m:%s %A" ) ).Ptr() ); if ( m_cCapture.IsOpen() ) { //m_cCapture.WaitForFrame(); m_cCapture.StartCapture(); // +++ Just a hack till we get the callbacks going m_pTimer = new wxTimer( this ); m_pTimer->Start( 1000 / 15 ); } // end if // wxMessageBox( oex::os::CTrace::GetBacktrace().Ptr(), _T( "Stack Trace" ), wxOK, this ); // SetStatusText( m_v4lCap.GetLastErrorStr().Ptr() ); }
MyFrame::MyFrame() : wxFrame( (wxFrame *)NULL, wxID_ANY, wxT("wxImage sample"), wxPoint(20, 20), wxSize(950, 700) ) { SetIcon(wxICON(sample)); wxMenuBar *menu_bar = new wxMenuBar(); wxMenu *menuImage = new wxMenu; menuImage->Append( ID_NEW, wxT("&Show any image...\tCtrl-O")); menuImage->Append( ID_INFO, wxT("Show image &information...\tCtrl-I")); #ifdef wxHAVE_RAW_BITMAP menuImage->AppendSeparator(); menuImage->Append( ID_SHOWRAW, wxT("Test &raw bitmap...\tCtrl-R")); #endif #if wxUSE_GRAPHICS_CONTEXT menuImage->AppendSeparator(); menuImage->Append(ID_GRAPHICS, "Test &graphics context...\tCtrl-G"); #endif // wxUSE_GRAPHICS_CONTEXT menuImage->AppendSeparator(); menuImage->Append( ID_SHOWTHUMBNAIL, wxT("Test &thumbnail...\tCtrl-T"), "Test scaling the image during load (try with JPEG)"); menuImage->AppendSeparator(); menuImage->Append( ID_ABOUT, wxT("&About\tF1")); menuImage->AppendSeparator(); menuImage->Append( ID_QUIT, wxT("E&xit\tCtrl-Q")); menu_bar->Append(menuImage, wxT("&Image")); #if wxUSE_CLIPBOARD wxMenu *menuClipboard = new wxMenu; menuClipboard->Append(wxID_COPY, wxT("&Copy test image\tCtrl-C")); menuClipboard->Append(wxID_PASTE, wxT("&Paste image\tCtrl-V")); menu_bar->Append(menuClipboard, wxT("&Clipboard")); #endif // wxUSE_CLIPBOARD SetMenuBar( menu_bar ); #if wxUSE_STATUSBAR CreateStatusBar(2); int widths[] = { -1, 100 }; SetStatusWidths( 2, widths ); #endif // wxUSE_STATUSBAR m_canvas = new MyCanvas( this, wxID_ANY, wxPoint(0,0), wxSize(10,10) ); // 500 width * 2750 height m_canvas->SetScrollbars( 10, 10, 50, 275 ); m_canvas->SetCursor(wxImage("cursor.png")); }
WConfig::WConfig(WMain* main, const wxString& title, const wxPoint& pos, const wxSize& size, long style) : wxFrame(NULL, wxID_ANY, title, pos, size, style) { //this->SetSize(size); wxPanel *panel = new wxPanel(this, wxID_ANY); T_nElectrode = new wxStaticText(panel, ID_TxtnElectrode, _T("Número de Eletrodos"), wxPoint(10,10), wxSize(220, 28)); T_tCycle = new wxStaticText(panel, ID_TxttCycle, _T("Tempo de Ciclo (us)"), wxPoint(10,40), wxSize(220, 28)); T_Pattern = new wxStaticText(panel, ID_TxtPattern, _T("Padrão (Pula)"), wxPoint(10,70), wxSize(220, 28)); T_nMeasure = new wxStaticText(panel, ID_TxtnMeasure, _T("Número de Medidas"), wxPoint(10,100), wxSize(220, 28)); T_tTimeout = new wxStaticText(panel, ID_TxttTimeout, _T("Tempo de Timeout (us)"), wxPoint(10,130), wxSize(220, 28)); T_fSample = new wxStaticText(panel, ID_TxtfSample, _T("Frequência de Amostragem (kHz)"), wxPoint(10,160), wxSize(220, 28)); T_nUnstable = new wxStaticText(panel, ID_TxtnUnstable, _T("Medidas para Estabilização"), wxPoint(10,190), wxSize(220, 28)); T_fExcitation = new wxStaticText(panel, ID_TxtfExcitation, _T("Frequência de Excitação (kHz)"), wxPoint(10,220), wxSize(220, 28)); P_nElectrode = new wxTextCtrl(panel, ID_CfgnElectrode, _T("???"), wxPoint(240,5), wxSize(80,28), wxTE_PROCESS_ENTER); P_tCycle = new wxTextCtrl(panel, ID_CfgtCycle, _T("???"), wxPoint(240,35), wxSize(80,28), wxTE_PROCESS_ENTER); P_Pattern = new wxTextCtrl(panel, ID_CfgPattern, _T("???"), wxPoint(240,65), wxSize(80,28), wxTE_PROCESS_ENTER); P_nMeasure = new wxTextCtrl(panel, ID_CfgnMeasure, _T("???"), wxPoint(240,95), wxSize(80,28), wxTE_PROCESS_ENTER); P_tTimeout = new wxTextCtrl(panel, ID_CfgtTimeout, _T("???"), wxPoint(240,125), wxSize(80,28), wxTE_PROCESS_ENTER); P_fSample = new wxTextCtrl(panel, ID_CfgfSample, _T("???"), wxPoint(240,155), wxSize(80,28), wxTE_PROCESS_ENTER); P_nUnstable = new wxTextCtrl(panel, ID_CfgnUnstable, _T("???"), wxPoint(240,185), wxSize(80,28), wxTE_PROCESS_ENTER); P_fExcitation = new wxTextCtrl(panel, ID_CfgfExcitation, _T("???"), wxPoint(240,215), wxSize(80,28), wxTE_PROCESS_ENTER); btnUpdate = new wxButton(panel, ID_Update, "OK", wxPoint(160,250), wxSize(70,28)); btnCancel = new wxButton(panel, ID_Cancel, "Cancelar", wxPoint(240,250), wxSize(70,28)); btnUpdate->Disable(); //update = new wxTimer(this, ID_CfgTimer); //update->Start(1000); //opProtocol = new wxChoice(panel, ID_ChkBoxProto, wxPoint(100,61), wxSize(330,28)); //opProtocol->Append("BasicBus V.01"); //opProtocol->Append("Sniffer"); //opProtocol->SetSelection(0); //opMode = new wxChoice(panel, ID_ChkBoxMode, wxPoint(100,1), wxSize(100,28), 2, commModes); //opMode->SetSelection(1); CreateStatusBar(); SetStatusText("Atualizando Dados..."); //SetSize(520,380); //run = (Scan*)main->run; //FileData = main->FileData; //run->Send(5); }
MyFrame::MyFrame(wxWindow* parent, const wxString& title) :wxFrame(parent,wxID_ANY, title) { //SetIcon(wxIcon(mondrian_xpm)); wxMenu* fileMenu = new wxMenu; wxMenu* helpMenu = new wxMenu; helpMenu->Append(wxID_ABOUT, wxT("&About...\tF1"), wxT("Show about dialog")); fileMenu->Append(wxID_EXIT, wxT("E&xit\tAlt-X"), wxT("Quit this program")); wxMenuBar* menuBar = new wxMenuBar(); menuBar->Append(fileMenu, wxT("&File")); menuBar->Append(helpMenu, wxT("&Help")); SetMenuBar(menuBar); CreateStatusBar(2); SetStatusText(wxT("Welcome to WxWidgets!")); }
MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size) : wxFrame(NULL, wxID_ANY, title, pos, size) { wxMenu *menuFile = new wxMenu; menuFile->Append(ID_Hello, wxT("&Hello...\tCtrl-H"), wxT("Help string shown in status bar for this menu item")); menuFile->AppendSeparator(); menuFile->Append(wxID_EXIT); wxMenu *menuHelp = new wxMenu; menuHelp->Append(wxID_ABOUT); wxMenuBar *menuBar = new wxMenuBar; menuBar->Append( menuFile, wxT("&File") ); menuBar->Append( menuHelp, wxT("&Help") ); SetMenuBar( menuBar ); CreateStatusBar(); SetStatusText(wxT("Welcome to wxWidgets!")); }
MyFrame::MyFrame( wxWindow *parent, wxWindowID id, const wxString &title, const wxPoint &position, const wxSize& size, long style ) : wxFrame( parent, id, title, position, size, style ) { CreateMyMenuBar(); CreateStatusBar(1); SetStatusText( wxT("Welcome to minimal!") ); #ifndef __WXMAC__ SetIcon(wxICON(mondrian)); #endif // insert main window here }
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!")); } }
static BOOL InitMainWnd(PMAIN_WND_INFO Info) { HANDLE DevEnumThread; HMENU hMenu; if (!pCreateToolbar(Info)) DisplayString(_T("error creating toolbar")); if (!CreateTreeView(Info)) { DisplayString(_T("error creating list view")); return FALSE; } if (!CreateStatusBar(Info)) DisplayString(_T("error creating status bar")); UpdateViewMenu(Info); /* make 'properties' bold */ hMenu = GetMenu(Info->hMainWnd); hMenu = GetSubMenu(hMenu, 1); SetMenuDefaultItem(hMenu, IDC_PROP, FALSE); /* Create Popup Menu */ Info->hShortcutMenu = LoadMenu(hInstance, MAKEINTRESOURCE(IDR_POPUP)); Info->hShortcutMenu = GetSubMenu(Info->hShortcutMenu, 0); SetMenuDefaultItem(Info->hShortcutMenu, IDC_PROP, FALSE); /* create seperate thread to emum devices */ DevEnumThread = CreateThread(NULL, 0, DeviceEnumThread, Info, 0, NULL); if (!DevEnumThread) { DisplayString(_T("Failed to enumerate devices")); return FALSE; } CloseHandle(DevEnumThread); return TRUE; }
//Construtor da Frame MainFrame::MainFrame(const wxString& title, const wxPoint& pos, const wxSize& size) :wxFrame(NULL, wxID_ANY, title, pos, size){ //Criação do Menu Menu *MenuBar = new Menu(); SetMenuBar(MenuBar); Centre(); //Setando o ícone SetIcon(wxIcon(wxString(_T("/../Images/Icones/icone"), wxBITMAP_TYPE_BMP))); //Criando barra de ferramentas m_toolbar = CreateToolBar(wxTB_FLAT | wxTB_HORIZONTAL | wxTB_TEXT,wxID_ANY); m_toolbar->AddTool(ID_NEW, wxString(_("Novo")), wxBitmap(wxT("../../Images/Icones/newfile.bmp"), wxBITMAP_TYPE_BMP), wxString(_("Novo"))); m_toolbar->AddTool(ID_SAVE, wxString(_("Salvar")), wxBitmap(wxT("../../Images/Icones/save.bmp"), wxBITMAP_TYPE_BMP), wxString(_("Salvar"))); m_toolbar->AddTool(ID_OPEN, wxString(_("Abrir")), wxBitmap(wxT("../../Images/Icones/open.bmp"), wxBITMAP_TYPE_BMP), wxString(_("Abrir"))); m_toolbar->AddSeparator(); m_toolbar->AddTool(ID_HELP, wxString(_("Ajuda")), wxBitmap(wxT("../../Images/Icones/help.bmp"), wxBITMAP_TYPE_BMP), wxString(_("Ajuda"))); m_toolbar->AddTool(wxID_EXIT, wxString(_("Sair")), wxBitmap(wxT("../../Images/Icones/close.bmp"), wxBITMAP_TYPE_BMP), wxString(_("Sair"))); //Para atualizar a barra de ferramentas com os ícones bitmap m_toolbar->Realize(); //Setanto barra de ferramentas SetToolBar(m_toolbar); //Barra de Status CreateStatusBar(3); SetStatusText("TP2 PAC", 0); // connectando eventos de menu da frame aos "handlers" da classe menu Connect(ID_NEW, wxEVT_COMMAND_MENU_SELECTED,wxCommandEventHandler(Menu::OnNew)); Connect(ID_OPEN, wxEVT_COMMAND_MENU_SELECTED,wxCommandEventHandler(Menu::OnOpen)); Connect(ID_SAVE, wxEVT_COMMAND_MENU_SELECTED,wxCommandEventHandler(Menu::OnSave)); Connect(ID_HELP, wxEVT_COMMAND_MENU_SELECTED,wxCommandEventHandler(Menu::OnHelp)); Connect(ID_PORTUGUESE, wxEVT_COMMAND_MENU_SELECTED,wxCommandEventHandler(Menu::OnPortuguese)); Connect(ID_ENGLISH, wxEVT_COMMAND_MENU_SELECTED,wxCommandEventHandler(Menu::OnEnglish)); Connect(ID_SPANISH, wxEVT_COMMAND_MENU_SELECTED,wxCommandEventHandler(Menu::OnSpanish)); Connect(wxID_EXIT, wxEVT_COMMAND_MENU_SELECTED,wxCommandEventHandler(Menu::OnExit)); Connect(wxID_ABOUT, wxEVT_COMMAND_MENU_SELECTED,wxCommandEventHandler(Menu::OnAbout)); };
MainWindow::MainWindow( const wxChar *title, int xpos, int ypos, int width, int height) : wxFrame ( (wxFrame *) NULL, -1, title, wxPoint(xpos, ypos), wxSize(width, height)) { //Gui erstellen top_panel = new wxPanel (this, ID_PANELTOP, wxPoint(0, 0), wxSize(850, 40)); top_panel->Show(true); CreateStatusBar(1); //Anwendungobjekte instanziiern db = new DBConnectionManager(); //Datenhaltungobjekte instanziieren config = new ConfigurationManager(wxT("Artikelverwaltung")); bool connected; db->SetDBData(config->GetDBIPAdress(), config->GetDBName(), config->GetDBUser(), config->GetDBPassword()); connected = db->Connect(); //UpdateDaemon starten updater = new UpdateDaemon(this); if(connected) { locked = false; this->CreateContentPanels(); } tbutton_artikel = new wxToggleButton(top_panel, ID_TBUTTONARTIKEL, wxT("Artikel"), wxPoint(10, 5), wxSize(80, -1)); tbutton_lieferant = new wxToggleButton(top_panel, ID_TBUTTONLIEFERANT, wxT("Lieferanten"), wxPoint(100, 5), wxSize(90, -1)); tbutton_hersteller = new wxToggleButton(top_panel, ID_TBUTTONHERSTELLER, wxT("Hersteller"), wxPoint(200, 5), wxSize(80, -1)); tfield_searchBox = new wxTextCtrl( top_panel, ID_TFIELDSEARCHBOX, wxT(""), wxPoint(300, 7), wxSize(200, -1), wxTE_HT_BELOW ); button_removeObject = new wxButton( top_panel, ID_BUTTONREMOVE, wxT("-"), wxPoint(820, 5) , wxSize(30, -1)); button_removeObject->Enable(false); button_addObject = new wxButton (top_panel, ID_BUTTONADD, wxT("+"), wxPoint(785, 5), wxSize(30, -1)); button_addObject->Enable(false); settings_panel = new SettingsPanel(this, ID_PANELMAIN, wxPoint(0, 45), wxSize(850, 430)); SetStatusText((connected) ? wxT("Geklappt") : wxT("scheisse")); }
bool Create(wxFrame *parent, const wxString& desc, const wxBitmap& bitmap, int numImages = 1) { if ( !wxFrame::Create(parent, wxID_ANY, wxString::Format(wxT("Image from %s"), desc), wxDefaultPosition, wxDefaultSize, wxDEFAULT_FRAME_STYLE | wxFULL_REPAINT_ON_RESIZE) ) return false; m_bitmap = bitmap; m_zoom = 1.; wxMenu *menu = new wxMenu; menu->Append(wxID_SAVEAS); menu->AppendSeparator(); menu->AppendCheckItem(ID_PAINT_BG, wxT("&Paint background"), "Uncheck this for transparent images"); menu->AppendSeparator(); menu->Append(ID_RESIZE, wxT("&Fit to window\tCtrl-F")); menu->Append(wxID_ZOOM_IN, "Zoom &in\tCtrl-+"); menu->Append(wxID_ZOOM_OUT, "Zoom &out\tCtrl--"); menu->Append(wxID_ZOOM_100, "Reset zoom to &100%\tCtrl-1"); menu->AppendSeparator(); menu->Append(ID_ROTATE_LEFT, wxT("Rotate &left\tCtrl-L")); menu->Append(ID_ROTATE_RIGHT, wxT("Rotate &right\tCtrl-R")); wxMenuBar *mbar = new wxMenuBar; mbar->Append(menu, wxT("&Image")); SetMenuBar(mbar); mbar->Check(ID_PAINT_BG, true); CreateStatusBar(2); if ( numImages != 1 ) SetStatusText(wxString::Format("%d images", numImages), 1); SetClientSize(bitmap.GetWidth(), bitmap.GetHeight()); UpdateStatusBar(); Show(); return true; }
MainFrame::MainFrame(const wxString& title, const wxPoint& pos, const wxSize& size) : wxFrame((wxFrame *)NULL, -1, title, pos, size) { wxMenu *menuFile = new wxMenu; menuFile->Append( ID_About, "&About..." ); menuFile->AppendSeparator(); menuFile->Append( ID_Quit, "E&xit" ); wxMenuBar *menuBar = new wxMenuBar; menuBar->Append( menuFile, "&File" ); SetMenuBar( menuBar ); CreateStatusBar(); SetStatusText( "Ready" ); }
MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size) : wxFrame((wxFrame *)NULL, -1, title, pos, size) { wxMenu *menuFile = new wxMenu; menuFile->Append( ID_About, _T("&About...") ); menuFile->AppendSeparator(); menuFile->Append( ID_Quit, _T("E&xit") ); wxMenuBar *menuBar = new wxMenuBar; menuBar->Append( menuFile, _T("&File") ); SetMenuBar( menuBar ); CreateStatusBar(); SetStatusText( _T("Welcome to wxWidgets!") ); }
MyChild::MyChild(wxMDIParentFrame *parent, const wxString& title, const wxPoint& pos, const wxSize& size, const long style) : wxMDIChildFrame(parent, wxID_ANY, title, pos, size, style) { m_frame = (MyFrame *) parent; #if wxUSE_STATUSBAR CreateStatusBar(); SetStatusText(title); #endif // wxUSE_STATUSBAR m_canvas = new MyCanvas(this, wxPoint(0, 0), GetClientSize()); // Give it scrollbars m_canvas->SetScrollbars(20, 20, 50, 50); }
BOOL OnCreate(HWND hwnd, LPCREATESTRUCT /*lpCreateStruct*/) { BOOL fSuccess = FALSE; IMFAttributes* pAttributes = NULL; HRESULT hr = S_OK; hPreview = CreatePreviewWindow(GetModuleHandle(NULL), hwnd); if (hPreview == NULL) { goto done; } hStatus = CreateStatusBar(hwnd, IDC_STATUS_BAR); if (hStatus == NULL) { goto done; } if (FAILED(CaptureManager::CreateInstance(hwnd, &g_pEngine))) { goto done; } hr = g_pEngine->InitializeCaptureManager(hPreview, pSelectedDevice); if (FAILED(hr)) { ShowError(hwnd, IDS_ERR_SET_DEVICE, hr); goto done; } // Register for connected standy changes. This should come through the normal // WM_POWERBROADCAST messages that we're already handling below. // We also want to hook into the monitor on/off notification for AOAC (SOC) systems. g_hPowerNotify = RegisterSuspendResumeNotification((HANDLE)hwnd, DEVICE_NOTIFY_WINDOW_HANDLE); g_hPowerNotifyMonitor = RegisterPowerSettingNotification((HANDLE)hwnd, &GUID_MONITOR_POWER_ON, DEVICE_NOTIFY_WINDOW_HANDLE); ZeroMemory(&g_pwrCaps, sizeof(g_pwrCaps)); GetPwrCapabilities(&g_pwrCaps); UpdateUI(hwnd); fSuccess = TRUE; done: SafeRelease(&pAttributes); return fSuccess; }
// main frame constructor MyFrame::MyFrame(wxLocale& locale) : wxFrame(NULL, wxID_ANY, _("International wxWidgets App")), m_locale(locale) { SetIcon(wxICON(sample)); // Make a menubar wxMenu *file_menu = new wxMenu; file_menu->Append(INTERNAT_TEST, _("&Test locale availability...\tCtrl-T")); file_menu->AppendSeparator(); // since wxID_ABOUT and wxID_EXIT are stock IDs they will automatically get // translated help strings; nice isn't it? file_menu->Append(wxID_ABOUT, _("&About")); file_menu->AppendSeparator(); file_menu->Append(wxID_EXIT, _("E&xit")); wxMenu *test_menu = new wxMenu; test_menu->Append(wxID_OPEN, _("&Open bogus file"), _("Shows a wxWidgets localized error message")); test_menu->Append(INTERNAT_PLAY, _("&Play a game"), _("A little game; hint: 17 is a lucky number for many")); test_menu->AppendSeparator(); test_menu->Append(INTERNAT_TEST_1, _("&1 _() (gettext)"), _("Tests the _() macro")); test_menu->Append(INTERNAT_TEST_2, _("&2 _N() (ngettext)"), _("Tests the _N() macro")); test_menu->Append(INTERNAT_TEST_3, _("&3 wxTRANSLATE() (gettext_noop)"), _("Tests the wxTRANSLATE() macro")); test_menu->Append(INTERNAT_TEST_MSGBOX, _("&Message box test"), _("Tests message box buttons labels translation")); wxMenuBar *menu_bar = new wxMenuBar; menu_bar->Append(file_menu, _("&File")); menu_bar->Append(test_menu, _("&Test")); SetMenuBar(menu_bar); // this demonstrates RTL support in wxStatusBar: CreateStatusBar(1); // this demonstrates RTL layout mirroring for Arabic locales wxSizer *sizer = new wxBoxSizer(wxHORIZONTAL); sizer->Add(new wxStaticText(this, wxID_ANY, _("First")), wxSizerFlags().Border()); sizer->Add(new wxStaticText(this, wxID_ANY, _("Second")), wxSizerFlags().Border()); SetSizer(sizer); }
MyFrame::MyFrame(const wxString& title) : wxFrame(NULL, wxID_ANY, title) { SetIcon(wxICON(colinux)); wxMenu *fileMenu = new wxMenu; fileMenu->Append(wxID_EXIT, _T("E&xit\tAlt-X"), _T("Quit this program")); wxMenu *helpMenu = new wxMenu; helpMenu->Append(wxID_ABOUT, _T("&About...\tF1"), _T("Show about dialog")); wxMenuBar *menuBar = new wxMenuBar(); menuBar->Append(fileMenu, _T("&File")); menuBar->Append(helpMenu, _T("&Help")); SetMenuBar(menuBar); CreateStatusBar(2); SetStatusText(_T("Not connected"),1); }
BOOL CCamFrame::CreateToolbars() { #if 0 // Create the status bar m_pStatusBar = CreateStatusBar(); String_256 strStatus( _R(IDS_NO_OBJECTS_SEL) ); m_pStatusBar->SetStatusText( strStatus ); #endif CColourBar* pColourBar = new CColourBar(); if (pColourBar) { pColourBar->Create(this, 12345); wxAuiPaneInfo paneinfo; paneinfo.BottomDockable().Bottom(); paneinfo.CaptionVisible(false); m_pFrameManager->AddPane(pColourBar, paneinfo); m_pFrameManager->Update(); } // Enable alpha on XP true-color #if defined(__WXMSW__) if( wxTheApp->GetComCtl32Version() >= 600 && ::wxDisplayDepth() >= 32 ) { wxSystemOptions::SetOption( wxT("msw.remap"), 2 ); } #endif wxCommandEvent sbe(wxEVT_COMMAND_MENU_SELECTED, _R(IDD_BUTTBAR_STANDARD)); OnStandardBar(sbe); wxCommandEvent tbe(wxEVT_COMMAND_MENU_SELECTED, _R(IDD_BUTTBAR_TOOLBAR)); OnStandardBar(tbe); wxCommandEvent sbbe(wxEVT_COMMAND_MENU_SELECTED, _R(IDD_BUTTBAR_STATUS)); OnStandardBar(sbbe); // wxCommandEvent gbe(wxEVT_COMMAND_MENU_SELECTED, _R(IDD_BUTTBAR_GALLERIES)); // OnStandardBar(gbe); return TRUE; }
static BOOL InitMainWnd(PMAIN_WND_INFO Info) { if (!pCreateToolbar(Info)) { DisplayString(_T("error creating toolbar")); return FALSE; } if (!CreateListView(Info)) { DisplayString(_T("error creating list view")); return FALSE; } if (!CreateStatusBar(Info)) DisplayString(_T("error creating status bar")); /* Create Popup Menu */ Info->hShortcutMenu = LoadMenu(hInstance, MAKEINTRESOURCE(IDR_POPUP)); Info->bIsUserAnAdmin = IsUserAnAdmin(); if (Info->bIsUserAnAdmin) { HMENU hMainMenu = GetMenu(Info->hMainWnd); SendMessage(Info->hTool, TB_SETSTATE, ID_CREATE, (LPARAM)MAKELONG(TBSTATE_ENABLED, 0)); if (hMainMenu) { EnableMenuItem(hMainMenu, ID_CREATE, MF_ENABLED); } EnableMenuItem(GetSubMenu(Info->hShortcutMenu, 0), ID_CREATE, MF_ENABLED); } return TRUE; }
MyFrame::MyFrame(const wxString& title):wxFrame(NULL,wxID_ANY,title,wxDefaultPosition,wxDefaultSize) { Maximize(true); int width,height; GetClientSize(&width,&height); int minWIDTH = width/7; int minHEIGHT = height/7; int defSashPos1 = width - width/5; int defSashPos0 = width/5; wxSplitterWindow * mainWindow = new wxSplitterWindow(this,wxID_ANY); wxSplitterWindow * subWindowV = new wxSplitterWindow(mainWindow,wxID_ANY); wxSplitterWindow * subWindowH = new wxSplitterWindow(mainWindow,wxID_ANY); subWindowH->SetSashGravity(0.7); subWindowV->SetSashGravity(0); subWindowV->SetMinimumPaneSize(minWIDTH); mainWindow->SetSashGravity(1); mainWindow->SetMinimumPaneSize(minWIDTH); subWindowH->SetMinimumPaneSize(minHEIGHT); PanelA * panelA = new PanelA(subWindowV); panelA->IT(); PanelB * panelB = new PanelB(subWindowV); //panelB->SetMinSize(wxSize(500,NULL)); panelB->SetUpGUI(); PanelC * panelC = new PanelC(subWindowH); panelC->SetUpGUI(); PanelD * panelD = new PanelD(subWindowH); panelD->SetUpGUI(); subWindowV->SplitVertically(panelA,panelB); subWindowH->SplitHorizontally(panelC,panelD); mainWindow->SplitVertically(subWindowV,subWindowH); subWindowV->SetSashPosition(defSashPos0); mainWindow->SetSashPosition(defSashPos1); wxMenu * fMenu = new wxMenu; wxMenu * hMenu = new wxMenu; hMenu->Append(wxID_ABOUT,wxT("About...\tF2"),wxT("Show about Dialog")); fMenu->Append(wxID_EXIT,wxT("Exit\tAlt-X"),wxT("Quit This Program")); wxMenuBar * menuBar = new wxMenuBar(); menuBar->Append(fMenu,wxT("File")); menuBar->Append(hMenu,wxT("Help")); SetMenuBar(menuBar); CreateStatusBar(2); SetStatusText("Welcome"); }
my1Form::my1Form(const wxString &title) : wxFrame( NULL, wxID_ANY, title, wxDefaultPosition, wxSize(320, 240), wxDEFAULT_FRAME_STYLE & ~ (wxRESIZE_BORDER | wxMAXIMIZE_BOX) ) { wxInitAllImageHandlers(); SetIcon(wxIcon(wxT(MY1APP_ICON))); wxIcon mIconExit(wxT(MY1BITMAP_EXIT)); wxIcon mIconClear(wxT(MY1BITMAP_NEW)); wxIcon mIconLoad(wxT(MY1BITMAP_OPEN)); wxIcon mIconSave(wxT(MY1BITMAP_SAVE)); wxIcon mIconGenerate(wxT(MY1BITMAP_BINARY)); wxIcon mIconOptions(wxT(MY1BITMAP_OPTION)); wxToolBar *mainTool = CreateToolBar(); // our icon is 16x16, windows defaults to 24x24 //mainTool->SetToolBitmapSize(wxSize(16,16)); mainTool->AddTool(MY1ID_EXIT, wxT("Exit"), mIconExit); mainTool->AddSeparator(); mainTool->AddTool(MY1ID_CLEAR, wxT("Clear"), mIconClear); mainTool->AddTool(MY1ID_LOAD, wxT("Load"), mIconLoad); mainTool->AddTool(MY1ID_SAVE, wxT("Save"), mIconSave); mainTool->AddSeparator(); mainTool->AddTool(MY1ID_GENERATE, wxT("Generate"), mIconGenerate); mainTool->AddTool(MY1ID_OPTIONS, wxT("Options"), mIconOptions); mainTool->Realize(); CreateStatusBar(2); SetStatusText(_T("Welcome to my1GoLCD!")); mCanvas = new my1Canvas(this); SetClientSize(mCanvas->mImageWidth*mCanvas->mImageGridSize, mCanvas->mImageHeight*mCanvas->mImageGridSize); // SendSizeEvent(); // just in case?? // actions! this->Connect(MY1ID_EXIT, wxEVT_COMMAND_TOOL_CLICKED, wxCommandEventHandler(my1Form::OnQuit)); this->Connect(MY1ID_CLEAR, wxEVT_COMMAND_TOOL_CLICKED, wxCommandEventHandler(my1Form::OnClear)); this->Connect(MY1ID_LOAD, wxEVT_COMMAND_TOOL_CLICKED, wxCommandEventHandler(my1Form::OnLoad)); this->Connect(MY1ID_SAVE, wxEVT_COMMAND_TOOL_CLICKED, wxCommandEventHandler(my1Form::OnSave)); this->Connect(MY1ID_GENERATE, wxEVT_COMMAND_TOOL_CLICKED, wxCommandEventHandler(my1Form::OnGenerate)); this->Connect(MY1ID_OPTIONS, wxEVT_COMMAND_TOOL_CLICKED, wxCommandEventHandler(my1Form::OnCheckOptions)); Centre(); }
MyFrame::MyFrame(const wxString &title) : wxFrame(NULL, wxID_ANY, title) { wxMenu* fileMenu = new wxMenu; wxMenu* helpMenu = new wxMenu; helpMenu->Append(wxID_ABOUT, wxT("&About...\tF1"), wxT("Show about dialog")); fileMenu->Append(wxID_EXIT, wxT("E&xit\tAlt-X"), wxT("Quit this program")); wxMenuBar* menuBar = new wxMenuBar(); menuBar->Append(fileMenu, wxT("&File")); menuBar->Append(helpMenu, wxT("&Help")); wxButton* okButton = new wxButton(this, wxID_OK, wxT("OK"), wxPoint(200, 200)); SetMenuBar(menuBar); CreateStatusBar(2); SetStatusText(wxT("Welcome to wxWidgets!")); }
MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size) : wxFrame( NULL, -1, title, pos, size ) { wxMenu *menuFile = new wxMenu; //this->CaptureMouse(); //this->Release Mouse(); menuFile->Append( ID_About, _("&About...") ); menuFile->AppendSeparator(); menuFile->Append( ID_Quit, _("E&xit") ); wxMenuBar *menuBar = new wxMenuBar; menuBar->Append( menuFile, _("&File") ); SetMenuBar( menuBar ); m_x = 0; m_y = 0; CreateStatusBar(); SetStatusText( _("Welcome to wxWidgets!") ); }
// In the constructor of the main window (or later on) we create a menu with two menu items // as well as a status bar to be shown at the bottom of the main window. MyFrame::MyFrame(const wxString& title, const wxPoint& pos, const wxSize& size) : wxFrame( NULL, -1, title, pos, size ) { wxMenuBar *menuBar = new wxMenuBar; wxMenu *menuFile = new wxMenu; menuFile->Append( ID_About, _("&About...") ); menuFile->AppendSeparator(); menuFile->Append( ID_Quit, _("E&xit") ); menuBar->Append(menuFile, _("&File") ); SetMenuBar(menuBar); CreateStatusBar(); SetStatusText( _("Poti sa faci asta sa mearga pe MacOS ?") ); }