void pgDialog::PostCreation() { if (!statusBar && FindWindow(STATUSBAR_CONTAINER)) AddStatusBar(); if (GetWindowStyle() & wxRESIZE_BORDER) // is designed with sizers; don't change return; if (!btnCancel) return; wxSize size = btnCancel->GetSize(); wxPoint pos = btnCancel->GetPosition(); int height = pos.y + size.GetHeight() + ConvertDialogToPixels(wxSize(0, 3)).y; if (statusBar) height += statusBar->GetSize().GetHeight(); int right = pos.x + ConvertDialogToPixels(wxSize(50, 0)).x - size.GetWidth(); btnCancel->Move(right, pos.y); if (btnOK) { size = btnOK->GetSize(); right -= size.GetWidth() + ConvertDialogToPixels(wxSize(3, 0)).x; btnOK->Move(right, pos.y); } if (btnApply) { size = btnApply->GetSize(); right -= size.GetWidth() - ConvertDialogToPixels(wxSize(3, 0)).x; btnApply->Move(right, pos.y); } // On OS X, reverse the buttons for UI consistency #ifdef __WXMAC__ wxPoint pos2; pos = btnCancel->GetPosition(); if (btnOK) { pos2 = btnOK->GetPosition(); btnOK->Move(pos.x, pos.y); } if (btnApply) { pos2 = btnApply->GetPosition(); btnApply->Move(pos.x, pos.y); } btnCancel->Move(pos2.x, pos2.y); #endif int w, h; size = GetSize(); GetClientSize(&w, &h); SetSize(size.GetWidth(), size.GetHeight() + height - h); }
Shader::Shader() : wxFrame(NULL, wxID_ANY, wxT("FragmentShader")) { BuildMenu(); AddStatusBar(); LoadConfig(); m_Timer.SetOwner(this); m_Timer.Start(1000, wxTIMER_CONTINUOUS); }
void cMainWindow::OnInit() { // Add our menu AddMenu(); // Add our status bar AddStatusBar(); // Initialise the taskbar taskBar.Init(*this); // Create our OpenGL control photoBrowserView.Create(ID_CONTROL_OPENGL); { // Get a typical selection colour for the selections on our photo browser const win32mm::cColorRef colour = theme.GetHighlightBackgroundColour(); const spitfire::math::cColour colourSelected(float(colour.GetRed()) / 255.0f, float(colour.GetGreen()) / 255.0f, float(colour.GetBlue()) / 255.0f, 1.0f); photoBrowserViewController.SetSelectionColour(colourSelected); } // Create our path combobox comboBoxPath.CreateComboBox(*this, ID_CONTROL_PATH); // Get the visited history std::list<string_t> items; settings.GetPreviousPhotoBrowserFolders(items); // Add the previous items std::list<string_t>::const_iterator iter = items.begin(); const std::list<string_t>::const_iterator iterEnd = items.end(); while (iter != iterEnd) { comboBoxPath.AddItem(*iter); iter++; } const string_t sLastPhotoBrowserFolder = settings.GetLastPhotoBrowserFolder(); comboBoxPath.SetText(sLastPhotoBrowserFolder); win32mm::cIcon iconUp; iconUp.LoadFromFile(TEXT("data/icons/windows/folder_up.ico"), 32); buttonPathUp.Create(*this, ID_CONTROL_UP, iconUp); win32mm::cIcon iconShowFolder; iconShowFolder.LoadFromFile(TEXT("data/icons/windows/folder_show.ico"), 32); buttonPathShowFolder.Create(*this, ID_CONTROL_SHOW_FOLDER, iconShowFolder); scrollBar.CreateVertical(*this, 101); // Load the previous window position LoadWindowPosition(); }