void wxDropSource::SetIcons(const wxIcon &iconCopy, const wxIcon &iconMove, const wxIcon &iconNone) { m_iconCopy = iconCopy; m_iconMove = iconMove; m_iconNone = iconNone; if ( !m_iconCopy.Ok() ) m_iconCopy = wxIcon(page_xpm); if ( !m_iconMove.Ok() ) m_iconMove = m_iconCopy; if ( !m_iconNone.Ok() ) m_iconNone = m_iconCopy; }
// My frame constructor MyFrame::MyFrame(wxFrame *frame, wxChar *title, int x, int y, int w, int h): wxFrame(frame, wxID_ANY, title, wxPoint(x, y), wxSize(w, h)) { // Give it an icon #ifdef __WXMSW__ SetIcon(wxIcon(_T("mondrian"))); #else SetIcon(wxIcon(mondrian_xpm)); #endif // Make a menubar wxMenu *file_menu = new wxMenu; file_menu->Append(DYNAMIC_ABOUT, _T("&About")); file_menu->Append(DYNAMIC_TEST, _T("&Test")); file_menu->Append(DYNAMIC_QUIT, _T("E&xit")); wxMenuBar *menu_bar = new wxMenuBar; menu_bar->Append(file_menu, _T("&File")); SetMenuBar(menu_bar); // Make a panel with a message wxPanel *panel = new wxPanel(this, wxID_ANY, wxPoint(0, 0), wxSize(400, 200), wxTAB_TRAVERSAL); (void)new wxStaticText(panel, 311, _T("Hello!"), wxPoint(10, 10), wxDefaultSize, 0); // You used to have to do some casting for param 4, but now there are type-safe handlers Connect( DYNAMIC_QUIT, wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MyFrame::OnQuit) ); Connect( DYNAMIC_TEST, wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MyFrame::OnTest) ); Connect( DYNAMIC_ABOUT, wxID_ANY, wxEVT_COMMAND_MENU_SELECTED, wxCommandEventHandler(MyFrame::OnAbout) ); CreateStatusBar(); m_shadow.AddMethod( wxT("OnTest"), &cb_MyFrame_InitStatusbar ); }
void V4StudioTree::CreateImageList(int size) { if ( size == -1 ) { SetImageList(NULL); return; } // Make an image list containing small icons wxImageList *images = new wxImageList(size, size, TRUE); // should correspond to TreeCtrlIcon_xxx enum wxBusyCursor wait; wxIcon icons[5]; icons[0] = wxIcon(icon1_xpm); icons[1] = wxIcon(icon2_xpm); icons[2] = wxIcon(icon3_xpm); icons[3] = wxIcon(icon4_xpm); icons[4] = wxIcon(icon5_xpm); int sizeOrig = icons[0].GetWidth(); for ( size_t i = 0; i < WXSIZEOF(icons); i++ ) { if ( size == sizeOrig ) images->Add(icons[i]); else images->Add(wxBitmap(wxBitmap(icons[i]).ConvertToImage().Rescale(size, size))); } AssignImageList(images); }
bool MyApp::OnInit() { // make sure we exit properly on macosx SetExitOnFrameDelete(true); wxPoint pos(100, 100); MyFrame *frame = new MyFrame(NULL, -1, "Motion Sensor Calibration Tool", pos, wxSize(1120,760), wxDEFAULT_FRAME_STYLE); #ifdef WINDOWS frame->SetIcon(wxIcon("MotionCal")); #endif frame->Show( true ); return true; }
BundlePane::BundlePane(EditorFrame& parent, TmSyntaxHandler& syntaxHandler) : wxPanel(&parent, wxID_ANY, wxPoint(-100,-100)), m_parentFrame(parent), m_imageList(16,16), m_syntaxHandler(syntaxHandler), m_plistHandler(m_syntaxHandler.GetPListHandler()) { // Build Imagelist m_imageList.Add(wxIcon(tmbundle_xpm)); m_imageList.Add(wxIcon(tmcommand_xpm)); m_imageList.Add(wxIcon(tmsnippet_xpm)); m_imageList.Add(wxIcon(tmdragcmd_xpm)); m_imageList.Add(wxIcon(tmprefs_xpm)); m_imageList.Add(wxIcon(tmlanguage_xpm)); m_imageList.Add(wxIcon(tmsubmenu_xpm)); m_imageList.Add(wxIcon(tmunknown_xpm)); m_imageList.Add(wxIcon(tmseparator_xpm)); // Create the controls m_bundleTree = new SortTreeCtrl(this, CTRL_BUNDLETREE, wxTR_LINES_AT_ROOT|wxTR_HAS_BUTTONS|wxTR_HIDE_ROOT|wxTR_EDIT_LABELS); m_bundleTree->SetMinSize(wxSize(50,50)); // ensure resizeability m_bundlePlus = new wxButton(this, CTRL_NEWBUNDLEITEM, wxT("+"), wxDefaultPosition, wxDefaultSize, wxBU_EXACTFIT); m_bundleMinus = new wxButton(this, CTRL_DELBUNDLE, wxT("-"), wxDefaultPosition, wxDefaultSize, wxBU_EXACTFIT); wxButton* bundleManage = new wxButton(this, CTRL_MANAGE, wxT("Manage..")); m_bundleTree->SetImageList(&m_imageList); // Set tooltips m_bundlePlus->SetToolTip(_("Add new item")); m_bundleMinus->SetToolTip(_("Delete item")); m_bundleMinus->Disable(); // Create the layout wxSizer* mainSizer = new wxBoxSizer(wxVERTICAL); mainSizer->Add(m_bundleTree, 1, wxEXPAND); wxSizer* buttonSizer = new wxBoxSizer(wxHORIZONTAL); buttonSizer->Add(m_bundlePlus, 0, wxRIGHT, 2); buttonSizer->Add(m_bundleMinus, 0, wxRIGHT, 2); buttonSizer->AddStretchSpacer(1); buttonSizer->Add(bundleManage, 0, wxALIGN_RIGHT); mainSizer->Add(buttonSizer, 0, wxEXPAND|wxALL, 2); SetSizer(mainSizer); // Bundles will be loaded in idle time }
void MerryFrame::ShowTrayIcon(const bool show) { if (!show) { wxDELETE(m_taskBarIcon); // if (m_taskBarIcon) // m_taskBarIcon->RemoveIcon(); return; } if (!m_taskBarIcon) m_taskBarIcon = new MerryTaskBarIcon(); if (m_taskBarIcon->IsIconInstalled()) return; m_taskBarIcon->SetIcon(wxIcon(MerryIcon_xpm), TASKBARICON_TIP); }
void YardEmployee::CreateImageList(wxTreeCtrl * tree) { // Make an image list containing small icons wxImageList *images = new wxImageList(16, 16, true); wxIcon icons[1]; icons[0] = wxIcon(worker_16x16_xpm); for ( size_t i = 0; i < WXSIZEOF(icons); i++ ) { images->Add(wxBitmap(icons[i])); } tree->AssignImageList(images); }
PlayerFrame::PlayerFrame(wxWindow* parent,wxWindowID id,const wxPoint& pos,const wxSize& size) { //(*Initialize(PlayerFrame) Create(parent, id, _("xPlayer"), wxDefaultPosition, wxDefaultSize, wxDEFAULT_FRAME_STYLE, _T("id")); SetClientSize(wxDefaultSize); Move(wxDefaultPosition); Connect(wxID_ANY,wxEVT_CLOSE_WINDOW,(wxObjectEventFunction)&PlayerFrame::OnClose); //*) SetIcon(wxIcon(xlights_xpm)); // // Create and attach the sizer // wxFlexGridSizer* sizer = new wxFlexGridSizer(1); this->SetSizer(sizer); this->SetAutoLayout(true); sizer->AddGrowableRow(0); sizer->AddGrowableCol(0); // // Create and attach the media control // MediaCtrl = new wxMediaCtrl(); wxString MediaBackend; #ifdef __WXMSW__ // this causes Windows to use latest installed Windows Media Player version // On XP, users were getting WMP 6.4 without this MediaBackend = wxMEDIABACKEND_WMP10; #endif playbackSpeed = 1.0; // Make sure creation was successful bool bOK = MediaCtrl->Create(this, wxID_MEDIACTRL, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxBORDER_NONE, MediaBackend); wxASSERT_MSG(bOK, "Could not create media control!"); wxUnusedVar(bOK); sizer->Add(MediaCtrl, 0, wxALIGN_CENTER_HORIZONTAL|wxALL|wxEXPAND, 0); PlayAfterLoad=false; Connect(wxID_MEDIACTRL, wxEVT_MEDIA_LOADED, wxMediaEventHandler(PlayerFrame::OnMediaLoaded)); }
VAutoDialog::VAutoDialog () { wxXmlResource::Get()->LoadDialog(this, NULL, "MainDialog"); SetIcon (wxIcon ("res/dslr.ico")); m_DeviceText = XRCCTRL(*this, "DEVICE_TEXT", wxStaticText); m_FindObject = XRCCTRL(*this, "ID_FIND_OBJECT", wxBitmapButton); m_buttonOptions = XRCCTRL(*this, "ID_OPTIONS", wxBitmapButton); m_buttonOpenPlan = XRCCTRL(*this, "ID_OPENPLAN", wxBitmapButton); m_buttonDeletePlan = XRCCTRL(*this, "ID_DELETEPLAN", wxBitmapButton); m_MoveButton = XRCCTRL(*this, "ID_MOVE", wxButton); m_ShootButton = XRCCTRL(*this, "ID_SHOOT", wxButton); m_AbortButton = XRCCTRL(*this, "ID_ABORT", wxButton); m_AutoButton = XRCCTRL(*this, "ID_AUTO", wxButton); m_SkipButton = XRCCTRL(*this, "ID_SKIP", wxButton); m_StatusBar = XRCCTRL(*this, "ID_STATUS_BAR", wxStaticText); m_StatusCoords = XRCCTRL(*this, "ID_STATUS_COORDS", wxStaticText); m_ObjectName = XRCCTRL(*this, "ID_OBJNAME", wxTextCtrl); m_DisplayName = XRCCTRL(*this, "ID_NAME", wxStaticText); m_DisplayRa = XRCCTRL(*this, "ID_RA", wxStaticText); m_DisplayDecl = XRCCTRL(*this, "ID_DECL", wxStaticText); m_Duration = XRCCTRL(*this, "ID_DURATION", wxSpinCtrl); m_FrameCount = XRCCTRL(*this, "ID_FRAMECOUNT", wxSpinCtrl); m_PlanList = XRCCTRL(*this, "ID_PLAN_LIST", wxListCtrl); wxSize s = m_PlanList->GetSize(); int sss = (s.GetWidth () - 24) / 2; m_PlanList->InsertColumn (0, "", wxLIST_FORMAT_LEFT, 24); m_PlanList->InsertColumn (1, _("Object name"), wxLIST_FORMAT_LEFT, sss); m_PlanList->InsertColumn (2, _("Coords"), wxLIST_FORMAT_LEFT, sss); m_PlanFile = XRCCTRL(*this, "ID_PLANFILE", wxStaticText); wxImageList* imageList = new wxImageList (13, 13); imageList->Add (wxBitmap (plan_ok_xpm)); imageList->Add (wxBitmap (plan_up_xpm)); imageList->Add (wxBitmap (plan_down_xpm)); imageList->Add (wxBitmap (plan_disabled_xpm)); // imageList->Add (wxBitmap (plan_moon_xpm)); m_PlanList->SetImageList (imageList, wxIMAGE_LIST_SMALL); }
//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)); };
wxIcon wxIconManager::GetIconFromMimeType(const String& type, const String& ext) { wxIcon icon; // use the system icons by default wxMimeTypesManager& mimeManager = mApplication->GetMimeManager(); wxFileType *fileType = mimeManager.GetFileTypeFromMimeType(type); if ( !fileType && !ext.empty() ) { fileType = mimeManager.GetFileTypeFromExtension(ext); } if ( fileType ) { #ifdef wxHAS_ICON_LOCATION wxIconLocation iconLoc; if ( fileType->GetIcon(&iconLoc) ) { wxLogNull noLog; icon = wxIcon(iconLoc); } #else // wx 2.4.x or very early 2.5.0 (void)fileType->GetIcon(&icon); #endif delete fileType; } if ( icon.Ok() ) return icon; // now try to find it by name icon = GetIcon(type); if ( icon.IsSameAs(m_unknownIcon) ) { // the generic icon for this class of things String primType = type.BeforeLast(_T('/')); if ( !primType.empty() ) icon = GetIcon(primType); } return icon; }
TemplateFrame::TemplateFrame(wxFrame *parent, Project* project_s, const wxString& title, const wxPoint& pos, const wxSize& size, const long style) : wxFrame(parent, -1, title, pos, size, style), template_canvas(0), template_legend(0), project(project_s), frames_manager(project_s->GetFramesManager()), table_state(project_s->GetTableState()), time_state(project_s->GetTimeState()), is_status_bar_visible(false), supports_timeline_changes(false), depends_on_non_simple_groups(true) { SetIcon(wxIcon(GeoDaIcon_16x16_xpm)); frames_manager->registerObserver(this); table_state->registerObserver(this); time_state->registerObserver(this); }
wxIcon InfoDialog::GetIconResource( const wxString& name ) { #include "../img/scope2.xpm" if (name == _T("scope2.png")) return wxIcon( scope2_xpm); return wxNullIcon; // // Icon retrieval //////@begin InfoDialog icon retrieval // wxUnusedVar(name); // if (name == _T("scope2.png")) // { // wxIcon icon(_T("scope2.png"), wxBITMAP_TYPE_PNG); // return icon; // } // return wxNullIcon; //////@end InfoDialog icon retrieval }
CheckoutDialog::CheckoutDialog(wxWindow* parent, const std::string& dir, bool fixed) : ExtDialog(parent, -1, _("TortoiseCVS - Checkout Module"), wxDefaultPosition, wxDefaultSize, wxMINIMIZE_BOX | wxMAXIMIZE_BOX | wxRESIZE_BORDER | wxDEFAULT_DIALOG_STYLE | wxCLIP_CHILDREN) { SetIcon(wxIcon(wxT("A_TORTOISE"), wxBITMAP_TYPE_ICO_RESOURCE)); // Main notebook wxBookCtrl *book = new wxNotebook(this, CHECKOUTDLG_ID_BOOK); myModuleBasicsPage = new ModuleBasicsPage(book, MB_CHECKOUT_MODULE, fixed); myRevOptions = new RevOptions(book); myModuleBasicsPage->SetRevOptions(myRevOptions); myRevOptions->SetDir(dir); myCheckoutOptionsPage = new CheckoutOptionsPage(book, myModuleBasicsPage); book->AddPage(myModuleBasicsPage, _("Module")); book->AddPage(myRevOptions, _("Revision")); book->AddPage(myCheckoutOptionsPage, _("Options")); myStatusBar = new wxStatusBar(this, -1); // OK/Cancel button wxBoxSizer *sizerConfirm = new wxBoxSizer(wxHORIZONTAL); wxButton* ok = new wxButton(this, wxID_OK, _("OK")); ok->SetDefault(); wxButton* cancel = new wxButton(this, wxID_CANCEL, _("Cancel")); sizerConfirm->Add(ok, 0, wxGROW | wxALL, 5); sizerConfirm->Add(cancel, 0, wxGROW | wxALL, 5); // Main box with text and button in it wxBoxSizer *sizerTop = new wxBoxSizer(wxVERTICAL); sizerTop->Add(book, 1, wxGROW | wxALL, 3); sizerTop->Add(sizerConfirm, 0, wxALIGN_CENTER | wxALL, 0); sizerTop->Add(myStatusBar, 0, wxGROW | wxALL, 0); // Overall dialog layout settings myModuleBasicsPage->UpdateSensitivity(); SetAutoLayout(TRUE); SetSizer(sizerTop); sizerTop->SetSizeHints(this); sizerTop->Fit(this); RestoreTortoiseDialogSize(this, "Checkout", wxDLG_UNIT(this, wxSize(200, 120))); SetTortoiseDialogPos(this, GetRemoteHandle()); RestoreTortoiseDialogState(this, "Checkout"); }
// Initialise this in OnInit, not statically bool MyApp::OnInit(void) { if ( !wxApp::OnInit() ) return false; // Create the main frame window frame = new MyFrame(NULL, wxID_ANY, wxT("Sash Demo"), wxPoint(0, 0), wxSize(500, 400), wxDEFAULT_FRAME_STYLE | wxNO_FULL_REPAINT_ON_RESIZE | wxHSCROLL | wxVSCROLL); // Give it an icon (this is ignored in MDI mode: uses resources) #ifdef __WXMSW__ frame->SetIcon(wxIcon(wxT("sashtest_icn"))); #endif // Make a menubar wxMenu *file_menu = new wxMenu; file_menu->Append(SASHTEST_NEW_WINDOW, wxT("&New window")); file_menu->Append(SASHTEST_TOGGLE_WINDOW, wxT("&Toggle window")); file_menu->Append(SASHTEST_QUIT, wxT("&Exit")); wxMenu *help_menu = new wxMenu; help_menu->Append(SASHTEST_ABOUT, wxT("&About")); wxMenuBar *menu_bar = new wxMenuBar; menu_bar->Append(file_menu, wxT("&File")); menu_bar->Append(help_menu, wxT("&Help")); // Associate the menu bar with the frame frame->SetMenuBar(menu_bar); #if wxUSE_STATUSBAR frame->CreateStatusBar(); #endif // wxUSE_STATUSBAR frame->Show(true); SetTopWindow(frame); return true; }
GroupChatWindow::GroupChatWindow(wxWindow * parent) : wxPanel(parent) { wxString filename(gAppPath); filename.append("/res/biwooman.bmp"); m_bitmapUI.LoadFile(filename, wxBITMAP_TYPE_BMP); m_imageListNormal = new wxImageList(32, 32, true); //m_imageListSmall = new wxImageList(16, 16, true); m_imageListNormal->Add(wxIcon(wxString::Format("%s/res/icon_man.ico", gAppPath.c_str()), wxBITMAP_TYPE_ICO)); m_listCtrl = new wxListCtrl(this, Ctrl_GroupContacts, wxDefaultPosition, wxDefaultSize, wxLC_ICON|wxSUNKEN_BORDER); m_listCtrl->AssignImageList(m_imageListNormal, wxIMAGE_LIST_NORMAL); //m_listCtrl->AssignImageList(m_imageListSmall, wxIMAGE_LIST_SMALL); }
void showAbout() { wxAboutDialogInfo info; if ( IsSettingsStandAlone() ) { info.SetName(_T("SpringSettings")); info.SetVersion(_T("0.2.1")); } else { info.SetName( GetAppName() ); info.SetVersion(GetSpringLobbyVersion()); } info.SetDescription(_("SpringSettings is a graphical frontend to the Settings of the Spring engine")); info.SetCopyright(_T("(C) 2007-2008 koshi <*****@*****.**>")); info.SetIcon(wxIcon(springsettings_xpm)); wxAboutBox(info); }
WizAppData::WizAppData() { ico=""; bmp=""; errlevel=256; sig.Printf("%s %s",APP_TITLE,APP_VERSION); title=APP_TITLE; // wxInitAllImageHandlers(); // png fails on cygwin // so instead only init what we need: wxImage::AddHandler(new wxBMPHandler); wxImage::AddHandler(new wxXPMHandler); bitmap=wxBitmap(wizapp_xpm); icon=wxIcon(wxWizApp_xpm); BuildInputEnvironment(); GetLabels(); GetFile(); }
MainFrame::MainFrame(const wxString& title, const wxPoint& pos, const wxSize& size, long style) : wxFrame((wxWindow *) NULL, -1, title, pos, size, style) { hf = 0; // set icon SetIcon(wxIcon(qedoicon_xpm)); panel_ = new wxPanel(this, -1, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL | wxCLIP_CHILDREN | wxNO_BORDER); wxSize notebook_size(800,600); wxPoint notebook_point(5,5); notebook_ = new ControllerNotebook(panel_, ID_NOTEBOOK, notebook_point, notebook_size); // create image list wxSize imagesize (32,32); wxImageList* notebook_image_list = new wxImageList(imagesize.GetWidth(), imagesize.GetHeight(), TRUE); notebook_image_list -> Add ( wxArtProvider::GetIcon(wxART_INFORMATION, wxART_OTHER, imagesize)); notebook_ -> SetImageList(notebook_image_list); sizerFrame_ = new wxBoxSizer(wxBOTH); panel_->SetSizer(sizerFrame_); notebook_ -> CreateControllerPages(sizerFrame_); // set Logo wxBitmap qedologo_xpm( qedologo_xpm ); wxStaticBitmap* qedo_logo = new wxStaticBitmap( panel_, wxID_STATIC, qedologo_xpm, wxPoint(605,20), wxSize(105, 31), 0 ); wxSize buttonsize(110,25); help = new wxButton(panel_, ID_HELP_BUTTON, _T("Help"),wxPoint(630,470),buttonsize,0); quit = new wxButton(panel_, ID_QUIT_CONTROLLER, _T("Close"), wxPoint(630,510),buttonsize,0); panel_->SetAutoLayout(TRUE); }
//---------------------------------------- bool CContourPropFrame::Create( wxWindow *parent, CGeoMap* geoMap, wxWindowID id, const wxString &title, const wxPoint &position, const wxSize& size, long style ) { wxFrame::Create(parent, id, title, position, size, style); Show(false); try { if (!wxGetApp().GetIconFile().IsEmpty()) { SetIcon(wxIcon(wxGetApp().GetIconFile(), ::wxGetApp().GetIconType())); } else { ::wxMessageBox(wxString::Format("WARNING: Unable to find Brat icon file %s", ::wxGetApp().GetIconFileName().c_str()) , "BRAT WARNING"); } } catch(...) { // Do nothing } #ifdef __WXMAC__ // On Mac OS X we override the menu to let the 'close window' shortcut work as expected SetMenuBar(ContourFrameMenuBarFunc()); #endif m_contourPropPanel = new CContourPropPanel(this, geoMap); wxBoxSizer* sizer = new wxBoxSizer(wxVERTICAL); sizer->Add(m_contourPropPanel, 1, wxEXPAND); SetSizer(sizer); UpdateMinSize(); InstallEventListeners(); InstallToolTips(); return true; }
wxKeyCodeDlg::wxKeyCodeDlg( wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, long style ) : wxDialog( parent, id, title, pos, size, style ) { SetIcon(wxIcon(charmap16_xpm)); this->SetSizeHints( wxSize( 260,70 ), wxSize( -1,70 ) ); wxBoxSizer* bSizer1; bSizer1 = new wxBoxSizer( wxHORIZONTAL ); m_textCtrl1 = new wxKeyCodeCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0, wxTextValidator(wxFILTER_NONE, &m_sKeyCode) ); bSizer1->Add( m_textCtrl1, 1, wxALL|wxEXPAND, 5 ); m_button = new wxButton( this, wxID_OK, _("OK"), wxDefaultPosition, wxDefaultSize, 0 ); bSizer1->Add( m_button, 0, wxALL, 5 ); this->SetSizer( bSizer1 ); this->Layout(); this->Centre( wxBOTH ); }
NAMESPACE_EDITOR_BEGIN //-----------------------------------// bool EditorApp::OnInit() { if( !wxApp::OnInit() ) return false; wxImage::AddHandler( new wxPNGHandler() ); mainFrame = new EditorFrame(VAPOR_EDITOR_NAME); mainFrame->SetSize(900, 550); mainFrame->SetIcon( wxIcon("iconEditor") ); SetTopWindow(mainFrame); mainFrame->Show(true); return true; }
MainFrame :: MainFrame () : wxMDIParentFrame ( 0, wxID_ANY, "ODBC (iTableCtrl)", wxDefaultPosition, wxSize ( 600, 400 ) ), env () { SetIcon ( wxIcon ( "ICON" ) ); wxMenuBar * menubar = new wxMenuBar (); wxMenu * filemenu = new wxMenu (); filemenu -> Append ( wxID_OPEN , "&Open..." , wxEmptyString ); filemenu -> AppendSeparator (); filemenu -> Append ( wxID_EXIT , "E&xit" , wxEmptyString ); menubar -> Append ( filemenu , "&File" ); SetMenuBar ( menubar ); dbc = new wxODBCDbc ( env ); }
// ---------------------------------------------------------------------------- // RegImageList // ---------------------------------------------------------------------------- RegImageList::RegImageList() : wxImageList(16, 16, true) { // should be in sync with enum RegImageList::RegIcon static const wxChar *aszIcons[] = { wxT("key1"),wxT("key2"),wxT("key3"),wxT("value1"),wxT("value2") }; wxString str = wxT("icon_"); #if defined(__INTEL_COMPILER) && 1 /* VDM auto patch */ # pragma ivdep # pragma swp # pragma unroll # pragma prefetch # if 0 # pragma simd noassert # endif #endif /* VDM auto patch */ for ( unsigned int n = 0; n < WXSIZEOF(aszIcons); n++ ) { Add(wxIcon(str + aszIcons[n], wxBITMAP_TYPE_ICO_RESOURCE)); } }
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(); }
SimulatedWorld::SimulatedWorld(World *world) { static int numWorld = 0; objConnected=false; wxString defName=wxT("World"); defName.Printf(wxT("%s %d"),defName, ++numWorld); name=defName.ToStdString(); m_world = world; childView = new ChildView(mainWin, wxT("WORLD"),this); childView ->SetTitle(name); childView ->SetIcon(wxIcon(worldSelect_xpm)); childView ->UpdateWorld(); childView ->RefreshChild(); mainNode = tree->GenerateSubTree(this); tree->UnselectAll(); tree->SelectItem(mainNode); }
/* MapEditorWindow::MapEditorWindow * MapEditorWindow class constructor *******************************************************************/ MapEditorWindow::MapEditorWindow() : STopWindow("SLADE", "map") { if (mew_maximized) Maximize(); setupLayout(); Show(false); custom_menus_begin = 2; backup_manager = new MapBackupManager(); // Set icon string icon_filename = appPath("slade.ico", DIR_TEMP); theArchiveManager->programResourceArchive()->getEntry("slade.ico")->exportFile(icon_filename); SetIcon(wxIcon(icon_filename, wxBITMAP_TYPE_ICO)); wxRemoveFile(icon_filename); // Bind events Bind(wxEVT_CLOSE_WINDOW, &MapEditorWindow::onClose, this); Bind(wxEVT_SIZE, &MapEditorWindow::onSize, this); }
void wxMaximaFrame::set_properties() { #if defined (__WXMSW__) SetIcon(wxICON(icon0)); #elif defined (__WXGTK__) wxString icon(wxT(PREFIX)); icon += wxT("/share/wxMaxima/wxmaxima.png"); SetIcon(wxIcon(icon, wxBITMAP_TYPE_PNG)); #endif #ifndef __WXMAC__ SetTitle(wxString::Format(_("wxMaxima %s "), wxT(VERSION)) + _("[ unsaved ]")); #else SetTitle(_("untitled")); #endif m_console->SetBackgroundColour(wxColour(wxT("WHITE"))); m_console->SetMinSize(wxSize(100, 100)); SetStatusText(_("Welcome to wxMaxima"), 0); }
PasteDialog::PasteDialog(wxWindow* parent, const wxString& message) : wxDialog(parent, -1, _("Flood warning"), wxDefaultPosition, wxDefaultSize, wxFRAME_FLOAT_ON_PARENT | wxDEFAULT_DIALOG_STYLE) { wxIcon mainIcon = wxIcon(); mainIcon.CopyFromBitmap(IconsCollection::Instance()->BMP_SPRINGLOBBY); SetIcon(mainIcon); //******** copied from wxsource/generic/msgdlgg.cpp with small modifications*********************************************************** m_main_sizer = new wxBoxSizer(wxVERTICAL); wxBoxSizer* icon_text = new wxBoxSizer(wxHORIZONTAL); wxBitmap bitmap = wxArtProvider::GetIcon(wxART_QUESTION, wxART_MESSAGE_BOX); wxStaticBitmap* info_icon = new wxStaticBitmap(this, wxID_ANY, bitmap); icon_text->Add(info_icon, 0, wxCENTER); // 2) text icon_text->Add(CreateTextSizer(message), 0, wxALIGN_TOP | wxLEFT, 10); m_main_sizer->Add(icon_text, 1, wxCENTER | wxLEFT | wxRIGHT | wxTOP, 10); m_main_sizer->Add(0, 10); // 3) buttons wxSizer* sizerBtn = CreateButtonSizer(wxYES_NO); if (sizerBtn) { wxButton* but = new wxButton(this, ID_PASTE_BUTTON, _("Use pastebin")); sizerBtn->Add(but, 0, wxALL, 10); m_main_sizer->Add(sizerBtn, 0, wxALIGN_CENTRE | wxALL, 10); but->SetFocus(); } SetAutoLayout(true); SetSizer(m_main_sizer); m_main_sizer->SetSizeHints(this); m_main_sizer->Fit(this); Centre(wxBOTH | wxCENTER_FRAME); /***************************************************************************************************/ }
//! This method is called right at the beginning and opens a frame for us. // bool MyApp::OnInit() { #ifdef __WXMAC__ // this hack enables to have a GUI on Mac OSX even if the // program was called from the command line (and isn't a bundle) ProcessSerialNumber psn; GetCurrentProcess( &psn ); CPSEnableForegroundOperation( &psn ); SetFrontProcess( &psn ); #endif wxPLplotwindow<wxFrame> *frame = new wxPLplotwindow<wxFrame>(); frame->Create( NULL, wxID_ANY, wxT( "wxPLplotDemo" ) ); frame->SetIcon( wxIcon( graph ) ); frame->Show(); Plot( frame ); return true; }