ArgsSpeedControl(wxWindow* parent) : ArgsTextControl(parent) { wxBoxSizer* row = new wxBoxSizer(wxHORIZONTAL); GetSizer()->Detach(text_control); row->Add(text_control, wxSizerFlags(1).Expand()); speed_label = new wxStaticText(this, -1, ""); row->AddSpacer(4); row->Add(speed_label, wxSizerFlags(4).Align(wxALIGN_CENTER_VERTICAL)); GetSizer()->Add(row, wxSizerFlags(1).Expand()); slider_control = new wxSlider(this, -1, 0, 0, 255); slider_control->SetLineSize(2); slider_control->SetPageSize(8); // These are the generalized Boom speeds slider_control->SetTick(8); slider_control->SetTick(16); slider_control->SetTick(32); slider_control->SetTick(64); slider_control->Bind(wxEVT_SLIDER, &ArgsSpeedControl::onSlide, this); GetSizer()->Add(slider_control, wxSizerFlags(1).Expand()); }
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% "); }