void Resize(unsigned width, unsigned height) { vp_width_label->SetLabel(wxString::Format(wxT("%u"), width)); vp_height_label->SetLabel(wxString::Format(wxT("%u"), height)); vp_aspect_label->SetLabel( wxString::Format(wxT("%.3f"), double(width) / double(height))); vp_pixnum_label->SetLabel(wxString::Format(wxT("%u"), width * height)); }
void MyFrame::SetValues() { //Get values directly from Distortion filter and display via labels float tmp = distort->getDevice()->GetDistort(); txtDrive->SetLabelText(wxString::Format("Drive: %f", tmp)); tmp = distort->getDevice()->GetMix(); txtMix->SetLabelText(wxString::Format("Mix: %f", tmp)); }
void AddUnitSymbol( wxStaticText& Stext, EDA_UNITS_T aUnit ) { wxString msg = Stext.GetLabel(); msg += ReturnUnitSymbol( aUnit ); Stext.SetLabel( msg ); }
luNewProjTemplatePage(wxWizard* parent) : wxWizardPageSimple(parent) { this->SetSizeHints( wxDefaultSize, wxDefaultSize ); wxFlexGridSizer* fgSizer10; fgSizer10 = new wxFlexGridSizer( 3, 2, 0, 10 ); fgSizer10->AddGrowableCol( 1 ); fgSizer10->SetFlexibleDirection( wxBOTH ); fgSizer10->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); m_staticText5 = new wxStaticText( this, wxID_ANY, wxT("Project Templates"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticText5->Wrap( -1 ); fgSizer10->Add( m_staticText5, 0, wxALL, 5 ); m_textTitle = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_READONLY ); fgSizer10->Add( m_textTitle, 0, wxALL, 5 ); m_listTemplate = new wxListBox( this, ID_WIZARD_TEMPL_LIST, wxDefaultPosition, wxDefaultSize, 0, NULL, 0 ); fgSizer10->Add( m_listTemplate, 0, wxALL, 5 ); m_imgPreview = new wxStaticBitmap( this, wxID_ANY, wxBitmap("Data/Empty.xpm", wxBITMAP_TYPE_ANY), wxDefaultPosition, wxDefaultSize, 0 ); fgSizer10->Add( m_imgPreview, 0, wxALL, 5 ); m_staticText6 = new wxStaticText( this, wxID_ANY, wxT("Description"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticText6->Wrap( -1 ); fgSizer10->Add( m_staticText6, 0, wxALL, 5 ); m_textDesc = new wxTextCtrl( this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxTE_MULTILINE | wxTE_READONLY ); fgSizer10->Add( m_textDesc, 0, wxALL|wxEXPAND, 5 ); this->SetSizer( fgSizer10 ); this->Layout(); this->Centre( wxBOTH ); //-- luProjTempList *ptlist = getLuApp()->getProjTempList(); GK_ASSERT(ptlist); for (size_t i = 0; i < ptlist->size(); i++) { const luProjTemplate& templ = (*ptlist)[i]; m_listTemplate->Append(templ.name); } m_projTempList = ptlist; m_listTemplate->Connect( wxEVT_COMMAND_LISTBOX_SELECTED, wxCommandEventHandler( luNewProjTemplatePage::OnListItemSelected ), NULL, this ); m_listTemplate->SetSelection(0); wxCommandEvent evt(wxEVT_NULL, wxEVT_COMMAND_LISTBOX_SELECTED); OnListItemSelected(evt); SetSizerAndFit(fgSizer10); }
void AnimationSetItem::Init(int start, int end, float rate,int idx, SkeletonMeshEditor* pEditor) { m_staticText1->SetLabel(wxLongLong(start).ToString()); m_staticText2->SetLabel(wxLongLong(end).ToString()); m_staticText3->SetLabel(wxString::FromDouble(rate)); m_Index = idx; m_pSkeletonMeshEditor = pEditor; m_pSkeletonMeshEditor->FocusAnimation(m_Index); FocusThis(true); }
void LabelTestCase::GetLabel() { const wxString testLabelArray[] = { "label without mnemonics and markup", "label with &mnemonic", "label with <span foreground='blue'>some</span> <b>markup</b>", "label with <span foreground='blue'>some</span> <b>markup</b> and &mnemonic", }; // test calls to SetLabel() and then to GetLabel() for ( unsigned int s = 0; s < WXSIZEOF(testLabelArray); s++ ) { SET_LABEL(testLabelArray[s]); // GetLabel() should always return the string passed to SetLabel() CPPUNIT_ASSERT_EQUAL( testLabelArray[s], m_st->GetLabel() ); CPPUNIT_ASSERT_EQUAL( testLabelArray[s], m_cb->GetLabel() ); } // test calls to SetLabelText() and then to GetLabel() const wxString& testLabel = "label without mnemonics and markup"; SET_LABEL_TEXT(testLabel); CPPUNIT_ASSERT_EQUAL( testLabel, m_st->GetLabel() ); CPPUNIT_ASSERT_EQUAL( testLabel, m_cb->GetLabel() ); const wxString& testLabel2 = "label with &mnemonic"; const wxString& testLabelText2 = "label with &&mnemonic"; SET_LABEL_TEXT(testLabel2); CPPUNIT_ASSERT_EQUAL( testLabelText2, m_st->GetLabel() ); CPPUNIT_ASSERT_EQUAL( testLabelText2, m_cb->GetLabel() ); const wxString& testLabel3 = "label with <span foreground='blue'>some</span> <b>markup</b>"; SET_LABEL_TEXT(testLabel3); CPPUNIT_ASSERT_EQUAL( testLabel3, m_st->GetLabel() ); CPPUNIT_ASSERT_EQUAL( testLabel3, m_cb->GetLabel() ); const wxString& testLabel4 = "label with <span foreground='blue'>some</span> <b>markup</b> and &mnemonic"; const wxString& testLabelText4 = "label with <span foreground='blue'>some</span> <b>markup</b> and &&mnemonic"; SET_LABEL_TEXT(testLabel4); CPPUNIT_ASSERT_EQUAL( testLabelText4, m_st->GetLabel() ); CPPUNIT_ASSERT_EQUAL( testLabelText4, m_cb->GetLabel() ); }
void LabelTestCase::setUp() { m_st = new wxStaticText(wxTheApp->GetTopWindow(), wxID_ANY, ORIGINAL_LABEL); m_cb = new wxCheckBox(wxTheApp->GetTopWindow(), wxID_ANY, ORIGINAL_LABEL); CPPUNIT_ASSERT_EQUAL( ORIGINAL_LABEL, m_st->GetLabel() ); CPPUNIT_ASSERT_EQUAL( ORIGINAL_LABEL, m_cb->GetLabel() ); }
luNewProjNamePage(wxWizard* parent) : wxWizardPageSimple(parent) { //-- find a project file name wxString cwd = wxFileName::GetCwd(); wxString fileName; for (int i = 0; i < 100; i++) { fileName = wxString::Format("%s/Project%d.okproj", cwd, i); if (!wxFile::Exists(fileName)) break; } this->SetSizeHints( wxDefaultSize, wxDefaultSize ); wxFlexGridSizer* fgSizer10; fgSizer10 = new wxFlexGridSizer( 2, 2, 0, 10 ); fgSizer10->AddGrowableCol( 1 ); fgSizer10->SetFlexibleDirection( wxBOTH ); fgSizer10->SetNonFlexibleGrowMode( wxFLEX_GROWMODE_SPECIFIED ); m_staticText6 = new wxStaticText( this, wxID_ANY, wxT("Project Name"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticText6->Wrap( -1 ); fgSizer10->Add( m_staticText6, 0, wxALL, 5 ); m_textName= new wxTextCtrl( this, wxID_ANY, wxFileName(fileName).GetName(), wxDefaultPosition, wxDefaultSize, 0); fgSizer10->Add( m_textName , 0, wxALL|wxEXPAND, 5 ); m_staticText4 = new wxStaticText( this, wxID_ANY, wxT("Project File Name"), wxDefaultPosition, wxDefaultSize, 0 ); m_staticText4->Wrap( -1 ); fgSizer10->Add( m_staticText4, 0, wxALL, 5 ); m_filePicker = new wxFilePickerCtrl( this, wxID_ANY, fileName, wxT("Create Project File"), wxT("Project Files (*.okproj)|*.okproj"), wxDefaultPosition, wxDefaultSize, wxFLP_USE_TEXTCTRL | wxFLP_SAVE); fgSizer10->Add( m_filePicker, 0, wxALL|wxEXPAND, 5 ); this->SetSizer( fgSizer10 ); this->Layout(); this->Centre( wxBOTH ); SetSizerAndFit(fgSizer10); }
void OutputWinConfDlg::OnSystemFontCheckbox(wxCommandEvent& event) { bool checked = event.IsChecked(); font_label_->Enable(!checked); font_picker_->Enable(!checked); wxFont const& font = checked ? *wxNORMAL_FONT : font_picker_->GetSelectedFont(); ow_->SetDefaultStyle(wxTextAttr(wxNullColour, wxNullColour, font)); show_preview(); }
void syncControls(int value) { ArgsTextControl::setArgValue(value); if (value < 0) { slider_control->SetValue(0); speed_label->SetLabel(""); } else { slider_control->SetValue(value); speed_label->SetLabel(S_FMT( "%s (%.1f units per tic, %.1f units per sec)", arg_t::speedLabel(value), value / 8.0, // A tic is 28ms, slightly less than 1/35 of a second value / 8.0 * 1000.0 / 28.0 )); } }
void SimpleTransientPopup::OnMouse(wxMouseEvent &event) { wxRect rect(m_mouseText->GetRect()); rect.SetX(-100000); rect.SetWidth(1000000); wxColour colour(*wxLIGHT_GREY); if (rect.Contains(event.GetPosition())) { colour = wxSystemSettings::GetColour(wxSYS_COLOUR_HIGHLIGHT); wxLogMessage( "%p SimpleTransientPopup::OnMouse pos(%d, %d)", event.GetEventObject(), event.GetX(), event.GetY()); } if (colour != m_mouseText->GetBackgroundColour()) { m_mouseText->SetBackgroundColour(colour); m_mouseText->Refresh(); } event.Skip(); }
void wxMiniApp::DoIt() { download_file(wxT("check.txt")); status->AppendText(wxT("\n")); status_text->SetLabel(wxT("Checking files...")); ifstream checkfile("check.txt"); string line; vector<string> files_list; if(checkfile.is_open()) { while(checkfile.good()) { getline(checkfile,line); files_list.push_back(line); } checkfile.close(); for(int i=0; i<files_list.size();i+=2) { // Check all the files wxString mystring1(files_list[i].c_str(), wxConvUTF8); wxString mystring2(files_list[i+1].c_str(), wxConvUTF8); check_file_integrity(mystring1, mystring2); } // Say something status_text->SetLabel(wxT("Update finished")); start_button->Enable(true); } else { // Do nothing if check.txt fails status_text->SetLabel(wxT("Error while updating")); } }
void Frame::OnSubmit(wxCommandEvent&){ if(failed_login_txt->IsShown()) //If there was a previous failed login attempt failed_login_txt->Show(false); //remove the error message wxString msg = "Checking login info..."; SetStatusText(msg); std::string resp; bool loggedin = server_com->checkLogin(panel_login->getUsername().c_str(), panel_login->getPassword().c_str(), resp); if (loggedin) { SetStatusText(wxString(resp)); SwitchPanels(); } else{ wxString fail_txt = "Login failed: "; fail_txt += resp; SetStatusText(""); failed_login_txt->SetLabel(fail_txt); failed_login_txt->Show(true); } }//OnSubmit
void moveTitles() { wxArrayInt widths = m_LayerListFlexGridSizer->GetColWidths(); int offset = 0; wxSize txtz; txtz = m_NameStaticText->GetSize(); m_NameStaticText->Move( offset + (widths[0] - txtz.x)/2, 5 ); offset += widths[0]; txtz = m_EnabledStaticText->GetSize(); m_EnabledStaticText->Move( offset + (widths[1] - txtz.x)/2, 5 ); offset += widths[1]; txtz = m_TypeStaticText->GetSize(); m_TypeStaticText->Move( offset + (widths[2] - txtz.x)/2, 5 ); }
void onLumChanged(wxCommandEvent& e) { redraw(); label_lum->SetLabel(S_FMT("%d%%", slider_lum->GetValue())); }
void onSatChanged(wxCommandEvent& e) { redraw(); label_sat->SetLabel(S_FMT("%d%%", slider_sat->GetValue())); }
// Events void onHueChanged(wxCommandEvent& e) { redraw(); label_hue->SetLabel(S_FMT("%1.3f", getHue())); }
PaletteColourTweakDialog(wxWindow* parent, Palette8bit* pal) : wxDialog(parent, -1, "Tweak Colours", wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER) { // Init variables this->palette = pal; // Set dialog icon wxIcon icon; icon.CopyFromBitmap(Icons::getIcon(Icons::GENERAL, "palette_tweak")); SetIcon(icon); // Setup main sizer wxBoxSizer* msizer = new wxBoxSizer(wxVERTICAL); SetSizer(msizer); wxBoxSizer* sizer = new wxBoxSizer(wxVERTICAL); msizer->Add(sizer, 1, wxEXPAND|wxALL, 6); wxBoxSizer* hbox = new wxBoxSizer(wxHORIZONTAL); sizer->Add(hbox, 0, wxEXPAND|wxALL, 4); // Add 'hue shift' slider hbox = new wxBoxSizer(wxHORIZONTAL); sizer->Add(hbox, 0, wxEXPAND|wxLEFT|wxRIGHT|wxBOTTOM, 4); slider_hue = new wxSlider(this, -1, 0, 0, 500); label_hue = new wxStaticText(this, -1, "0.000"); hbox->Add(new wxStaticText(this, -1, "Hue Shift:"), 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 4); hbox->Add(slider_hue, 1, wxEXPAND|wxRIGHT, 4); hbox->Add(label_hue, 0, wxALIGN_CENTER_VERTICAL); // Add 'Saturation' slider hbox = new wxBoxSizer(wxHORIZONTAL); sizer->Add(hbox, 0, wxEXPAND|wxLEFT|wxRIGHT|wxBOTTOM, 4); slider_sat = new wxSlider(this, -1, 100, 0, 200); label_sat = new wxStaticText(this, -1, "100%"); hbox->Add(new wxStaticText(this, -1, "Saturation:"), 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 4); hbox->Add(slider_sat, 1, wxEXPAND|wxRIGHT, 4); hbox->Add(label_sat, 0, wxALIGN_CENTER_VERTICAL); // Add 'Luminosity' slider hbox = new wxBoxSizer(wxHORIZONTAL); sizer->Add(hbox, 0, wxEXPAND|wxLEFT|wxRIGHT|wxBOTTOM, 4); slider_lum = new wxSlider(this, -1, 100, 0, 200); label_lum = new wxStaticText(this, -1, "100%"); hbox->Add(new wxStaticText(this, -1, "Luminosity:"), 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 4); hbox->Add(slider_lum, 1, wxEXPAND|wxRIGHT, 4); hbox->Add(label_lum, 0, wxALIGN_CENTER_VERTICAL); // Add preview pal_preview = new PaletteCanvas(this, -1); sizer->Add(pal_preview, 1, wxEXPAND|wxLEFT|wxRIGHT|wxBOTTOM, 4); // Add buttons sizer->Add(CreateButtonSizer(wxOK|wxCANCEL), 0, wxEXPAND|wxBOTTOM|wxTOP, 4); // Setup preview pal_preview->allowSelection(2); pal_preview->SetInitialSize(wxSize(384, 384)); redraw(); // Init layout Layout(); // Bind events slider_hue->Bind(wxEVT_SLIDER, &PaletteColourTweakDialog::onHueChanged, this); slider_sat->Bind(wxEVT_SLIDER, &PaletteColourTweakDialog::onSatChanged, this); slider_lum->Bind(wxEVT_SLIDER, &PaletteColourTweakDialog::onLumChanged, this); pal_preview->Bind(wxEVT_LEFT_UP, &PaletteColourTweakDialog::onPaletteLeftUp, this); // Setup dialog size SetInitialSize(wxSize(-1, -1)); SetMinSize(GetSize()); CenterOnParent(); // Set values label_hue->SetLabel("0.000 "); label_sat->SetLabel("100% "); label_lum->SetLabel("100% "); }
PaletteTintDialog(wxWindow* parent, Palette8bit* pal) : wxDialog(parent, -1, "Tint", wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER) { // Init variables this->palette = pal; // Set dialog icon wxIcon icon; icon.CopyFromBitmap(Icons::getIcon(Icons::GENERAL, "palette_tint")); SetIcon(icon); // Setup main sizer wxBoxSizer* msizer = new wxBoxSizer(wxVERTICAL); SetSizer(msizer); wxBoxSizer* sizer = new wxBoxSizer(wxVERTICAL); msizer->Add(sizer, 1, wxEXPAND|wxALL, 6); // Add colour chooser wxBoxSizer* hbox = new wxBoxSizer(wxHORIZONTAL); sizer->Add(hbox, 0, wxEXPAND|wxALL, 4); cp_colour = new wxColourPickerCtrl(this, -1, wxColour(255, 0, 0)); hbox->Add(new wxStaticText(this, -1, "Colour:"), 1, wxALIGN_CENTER_VERTICAL|wxRIGHT, 4); hbox->Add(cp_colour, 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 8); // Add 'amount' slider hbox = new wxBoxSizer(wxHORIZONTAL); sizer->Add(hbox, 0, wxEXPAND|wxLEFT|wxRIGHT|wxBOTTOM, 4); slider_amount = new wxSlider(this, -1, 50, 0, 100); label_amount = new wxStaticText(this, -1, "100%"); hbox->Add(new wxStaticText(this, -1, "Amount:"), 0, wxALIGN_CENTER_VERTICAL|wxRIGHT, 4); hbox->Add(slider_amount, 1, wxEXPAND|wxRIGHT, 4); hbox->Add(label_amount, 0, wxALIGN_CENTER_VERTICAL); // Add preview pal_preview = new PaletteCanvas(this, -1); sizer->Add(pal_preview, 1, wxEXPAND|wxLEFT|wxRIGHT|wxBOTTOM, 4); // Add buttons sizer->Add(CreateButtonSizer(wxOK|wxCANCEL), 0, wxEXPAND|wxBOTTOM|wxTOP, 4); // Setup preview pal_preview->allowSelection(2); pal_preview->SetInitialSize(wxSize(384, 384)); redraw(); // Init layout Layout(); // Bind events cp_colour->Bind(wxEVT_COLOURPICKER_CHANGED, &PaletteTintDialog::onColourChanged, this); slider_amount->Bind(wxEVT_SLIDER, &PaletteTintDialog::onAmountChanged, this); pal_preview->Bind(wxEVT_LEFT_UP, &PaletteTintDialog::onPaletteLeftUp, this); // Setup dialog size SetInitialSize(wxSize(-1, -1)); SetMinSize(GetSize()); CenterOnParent(); // Set values label_amount->SetLabel("50% "); }
void FrameUpdate(unsigned frame_no, double frame_time, double real_time) { frame_no_label->SetLabel(wxString::Format(wxT("%u"), frame_no)); frame_time_label->SetLabel(wxString::Format(wxT("%.1f"), frame_time)); real_time_label->SetLabel(wxString::Format(wxT("%.1f"), real_time)); }
void RenderStats(double fps, double pps, double ppf) { fps_label->SetLabel(wxString::Format(wxT("%.1f"), fps)); pps_label->SetLabel(wxString::Format(wxT("%.1f"), pps)); ppf_label->SetLabel(wxString::Format(wxT("%.1f"), ppf)); }
void wxNotificationMessageWindow::SetMessage(const wxString& message) { m_messageText->SetLabelText(message); m_messageText->Show(!message.empty()); }
void wxNotificationMessageWindow::SetMessageTitle(const wxString& title) { m_messageTitle->SetLabelText(title); m_messageTitle->Show(!title.empty()); }
void SjViewSettingsPage::UpdateFontPtText(bool addSpaces) { long v = m_fontPtSlider->GetValue(); m_fontPtText->SetLabel(wxString::Format(wxT("%i Pt%s"), (int)v, addSpaces? wxT(" ") : wxT(""))); }
void SjViewSettingsPage::UpdateColumnWidthText() { long v = m_columnWidthSlider->GetValue() * COLUMNWIDTH_DIVISOR; m_columnWidthText->SetLabel(wxString::Format(wxT("%i"), (int)v)); }
void SjViewSettingsPage::UpdateCoverHeightText() { long v = m_coverHeightSlider->GetValue(); m_coverHeightText->SetLabel(wxString::Format(wxT("%i%%"), (int)v)); }
void UpdateDownload(ObserverDownloadInfo dl_info) { m_progres->SetRange(dl_info.size); m_progres->SetValue(dl_info.progress); m_info->SetLabel(wxString::Format(wxT("%i%%"), (int)((double)100.0 * dl_info.progress / (double)dl_info.size))); }
void MouseMove(unsigned mouse_x, unsigned mouse_y) { mouse_x_label->SetLabel(wxString::Format(wxT("%u"), mouse_x)); mouse_y_label->SetLabel(wxString::Format(wxT("%u"), mouse_y)); }