Exemple #1
0
 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));
 }
Exemple #2
0
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 AddUnitSymbol( wxStaticText& Stext, EDA_UNITS_T aUnit )
{
    wxString msg = Stext.GetLabel();

    msg += ReturnUnitSymbol( aUnit );

    Stext.SetLabel( msg );
}
	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
			));
		}
	}
Exemple #5
0
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"));
		
	}
}
Exemple #6
0
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 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 SjViewSettingsPage::UpdateCoverHeightText()
{
	long v = m_coverHeightSlider->GetValue();
	m_coverHeightText->SetLabel(wxString::Format(wxT("%i%%"), (int)v));
}
void SjViewSettingsPage::UpdateColumnWidthText()
{
	long v = m_columnWidthSlider->GetValue() * COLUMNWIDTH_DIVISOR;
	m_columnWidthText->SetLabel(wxString::Format(wxT("%i"), (int)v));
}
void SjViewSettingsPage::UpdateFontPtText(bool addSpaces)
{
	long v = m_fontPtSlider->GetValue();
	m_fontPtText->SetLabel(wxString::Format(wxT("%i Pt%s"), (int)v, addSpaces? wxT("    ") : wxT("")));
}
Exemple #14
0
 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));
 }
Exemple #15
0
 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 onLumChanged(wxCommandEvent& e)
	{
		redraw();
		label_lum->SetLabel(S_FMT("%d%%", slider_lum->GetValue()));
	}
Exemple #17
0
	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)));
	}
Exemple #18
0
 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));
 }