FaceAttribsEditor::FaceAttribsEditor(wxWindow* parent, MapDocumentWPtr document, GLContextManager& contextManager) : wxPanel(parent), m_document(document), m_uvEditor(NULL), m_xOffsetEditor(NULL), m_yOffsetEditor(NULL), m_xScaleEditor(NULL), m_yScaleEditor(NULL), m_rotationEditor(NULL), m_surfaceValueLabel(NULL), m_surfaceValueEditor(NULL), m_faceAttribsSizer(NULL), m_surfaceFlagsLabel(NULL), m_surfaceFlagsEditor(NULL), m_contentFlagsLabel(NULL), m_contentFlagsEditor(NULL) { createGui(contextManager); bindEvents(); bindObservers(); }
// ----------------------------------------------------------------------------- // GfxCropDialog class constructor // ----------------------------------------------------------------------------- GfxCropDialog::GfxCropDialog(wxWindow* parent, SImage* image, Palette* palette) : wxDialog(parent, -1, "Crop", wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER) { // Set max crop size if (image) { max_width_ = image->width(); max_height_ = image->height(); } else max_width_ = max_height_ = 0; crop_rect_.set(0, 0, max_width_, max_height_); // Set dialog icon wxIcon icon; icon.CopyFromBitmap(Icons::getIcon(Icons::General, "settings")); SetIcon(icon); // Setup main sizer auto msizer = new wxBoxSizer(wxVERTICAL); SetSizer(msizer); auto sizer = new wxBoxSizer(wxVERTICAL); msizer->Add(sizer, 1, wxEXPAND | wxALL, UI::padLarge()); // Add preview canvas_preview_ = new CropCanvas(this, image, palette); sizer->Add(canvas_preview_, 1, wxEXPAND | wxBOTTOM, UI::pad()); // Add crop controls auto frame = new wxStaticBox(this, -1, "Crop Borders"); auto framesizer = new wxStaticBoxSizer(frame, wxVERTICAL); sizer->Add(framesizer, 0, wxEXPAND | wxBOTTOM, UI::padLarge()); // Absolute auto hbox = new wxBoxSizer(wxHORIZONTAL); framesizer->Add(hbox, 0, wxEXPAND | wxALL, UI::pad()); rb_absolute_ = new wxRadioButton(frame, -1, "Absolute"); rb_absolute_->SetValue(true); hbox->Add(rb_absolute_, 0, wxEXPAND | wxRIGHT, UI::pad()); // Relative rb_relative_ = new wxRadioButton(frame, -1, "Relative"); hbox->Add(rb_relative_, 0, wxEXPAND); auto gb_sizer = new wxGridBagSizer(UI::pad(), UI::pad()); framesizer->Add(gb_sizer, 1, wxEXPAND | wxALL, UI::pad()); // Left gb_sizer->Add(new wxStaticText(frame, -1, "Left:"), wxGBPosition(0, 0), wxDefaultSpan, wxALIGN_CENTER_VERTICAL); text_left_ = new NumberTextCtrl(frame); text_left_->SetWindowStyleFlag(wxTE_PROCESS_ENTER); text_left_->setNumber(0); gb_sizer->Add(text_left_, wxGBPosition(0, 1), wxDefaultSpan, wxEXPAND); // Top gb_sizer->Add(new wxStaticText(frame, -1, "Top:"), wxGBPosition(1, 0), wxDefaultSpan, wxALIGN_CENTER_VERTICAL); text_top_ = new NumberTextCtrl(frame); text_top_->SetWindowStyleFlag(wxTE_PROCESS_ENTER); text_top_->setNumber(0); gb_sizer->Add(text_top_, wxGBPosition(1, 1), wxDefaultSpan, wxEXPAND); // Right gb_sizer->Add(new wxStaticText(frame, -1, "Right:"), wxGBPosition(2, 0), wxDefaultSpan, wxALIGN_CENTER_VERTICAL); text_right_ = new NumberTextCtrl(frame); text_right_->SetWindowStyleFlag(wxTE_PROCESS_ENTER); text_right_->setNumber(image->width()); gb_sizer->Add(text_right_, wxGBPosition(2, 1), wxDefaultSpan, wxEXPAND); // Bottom gb_sizer->Add(new wxStaticText(frame, -1, "Bottom:"), wxGBPosition(3, 0), wxDefaultSpan, wxALIGN_CENTER_VERTICAL); text_bottom_ = new NumberTextCtrl(frame); text_bottom_->SetWindowStyleFlag(wxTE_PROCESS_ENTER); text_bottom_->setNumber(image->height()); gb_sizer->Add(text_bottom_, wxGBPosition(3, 1), wxDefaultSpan, wxEXPAND); gb_sizer->AddGrowableCol(1); // Add buttons sizer->Add(CreateButtonSizer(wxOK | wxCANCEL), 0, wxEXPAND); bindEvents(); // Setup dialog size SetInitialSize(wxSize(-1, -1)); wxTopLevelWindowBase::SetMinSize(GetSize()); CenterOnParent(); }
MousePreferencePane::MousePreferencePane(wxWindow* parent) : PreferencePane(parent) { createGui(); bindEvents(); }
void ofApp::onConnection () { isConnected = true; bindEvents(); }