public function __construct() { parent::__construct(); // Attach some GUI event handlers $this->Connect(wxEVT_CLOSE_WINDOW, array($this, "onWindowClose")); $this->Connect(wxEVT_COMMAND_BUTTON_CLICKED, array($this, "onButtonClick")); }
public function Show() { // Set the tickboxes as per the GUI settings $this->setManagerFlags(); // Enable/disable tickboxes as appropriate $this->resetEnablements(); // Move the window out of the way of the main one $this->SetPosition(new wxPoint(200, 200)); // Set up event handlers $this->Connect(wxEVT_COMMAND_SPINCTRL_UPDATED, array($this, "onSpinnerChangeEvent")); // Read and set the default pane captions $this->captureFrameCaptions(); $this->setCurrentPane(); // Disable the resize property for now - see notes in main.php. It's too crashy at // present, but I'm minded to keep it visible, so users know at least it is available // for their own experimentation. $this->setTickBoxEnabled('tickResizable', false, false); return parent::Show(); }
function __construct($parent = null) { parent::__construct($parent, wxID_ANY, "server.properties", wxDefaultPosition, new \wxSize(500, 300), wxDEFAULT_DIALOG_STYLE); $this->SetSizeHints(wxDefaultSize, wxDefaultSize); $bSizer = new \wxBoxSizer(wxVERTICAL); $this->gridProp = new \wxGrid($this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0); $this->gridProp->CreateGrid(25, 1); $this->gridProp->EnableEditing(true); $this->gridProp->EnableGridLines(true); $this->gridProp->EnableDragGridSize(false); $this->gridProp->SetMargins(0, 0); $this->gridProp->SetColSize(0, 267); $this->gridProp->EnableDragColMove(false); $this->gridProp->EnableDragColSize(false); $this->gridProp->SetColLabelSize(30); $this->gridProp->SetColLabelValue(0, "Values"); $this->gridProp->SetColLabelAlignment(wxALIGN_LEFT, wxALIGN_CENTRE); $this->gridProp->AutoSizeRows(); $this->gridProp->EnableDragRowSize(false); $this->gridProp->SetRowLabelSize(200); $this->gridProp->SetRowLabelValue(0, "server-name"); $this->gridProp->SetRowLabelValue(1, "server-port"); $this->gridProp->SetRowLabelValue(2, "memory-limit"); $this->gridProp->SetRowLabelValue(3, "gamemode"); $this->gridProp->SetRowLabelValue(4, "max-players"); $this->gridProp->SetRowLabelValue(5, "spawn-protection"); $this->gridProp->SetRowLabelValue(6, "white-list"); $this->gridProp->SetRowLabelValue(7, "enable-query"); $this->gridProp->SetRowLabelValue(8, "enable-rcon"); $this->gridProp->SetRowLabelValue(9, "send-usage"); $this->gridProp->SetRowLabelValue(10, "motd"); $this->gridProp->SetRowLabelValue(11, "announce-player-achievements"); $this->gridProp->SetRowLabelValue(12, "view-distance"); $this->gridProp->SetRowLabelValue(13, "allow-flight"); $this->gridProp->SetRowLabelValue(14, "spawn-animals"); $this->gridProp->SetRowLabelValue(15, "spawn-mobs"); $this->gridProp->SetRowLabelValue(16, "hardcore"); $this->gridProp->SetRowLabelValue(17, "pvp"); $this->gridProp->SetRowLabelValue(18, "difficulty"); $this->gridProp->SetRowLabelValue(19, "generator-settings"); $this->gridProp->SetRowLabelValue(20, "level-name"); $this->gridProp->SetRowLabelValue(21, "level-seed"); $this->gridProp->SetRowLabelValue(22, "level-type"); $this->gridProp->SetRowLabelValue(23, "rcon.password"); $this->gridProp->SetRowLabelValue(24, "auto-save"); $this->gridProp->SetRowLabelAlignment(wxALIGN_LEFT, wxALIGN_CENTRE); $this->gridProp->SetDefaultCellAlignment(wxALIGN_LEFT, wxALIGN_TOP); $bSizer->Add($this->gridProp, 1, wxALL | wxEXPAND, 5); $sdbSizer = new \wxStdDialogButtonSizer(); $this->sdbSizerSave = new \wxButton($this, wxID_SAVE); $sdbSizer->AddButton($this->sdbSizerSave); $this->sdbSizerCancel = new \wxButton($this, wxID_CANCEL); $sdbSizer->AddButton($this->sdbSizerCancel); $sdbSizer->Realize(); $bSizer->Add($sdbSizer, 0, wxEXPAND, 5); $this->SetSizer($bSizer); $this->Layout(); $this->Centre(wxBOTH); $this->sdbSizerCancel->Connect(wxEVT_COMMAND_BUTTON_CLICKED, array($this, "OnCancelButtonClick")); $this->sdbSizerSave->Connect(wxEVT_COMMAND_BUTTON_CLICKED, array($this, "OnSaveButtonClick")); }
function __construct($parent = null) { parent::__construct($parent, wxID_ANY, _("Company Details"), wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE); $this->SetSizeHints(wxDefaultSize, wxDefaultSize); $mainSizer = new wxBoxSizer(wxVERTICAL); $bSizer4 = new wxBoxSizer(wxHORIZONTAL); $this->m_staticText3 = new wxStaticText($this, wxID_ANY, _("Company Name:"), wxDefaultPosition, wxDefaultSize, 0); $this->m_staticText3->Wrap(-1); $bSizer4->Add($this->m_staticText3, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); $this->txtCompany = new wxTextCtrl($this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0); $bSizer4->Add($this->txtCompany, 2, wxALIGN_CENTER_VERTICAL | wxALL, 5); $mainSizer->Add($bSizer4, 0, wxEXPAND, 5); $mainSizer->Add(1, 5, 0, wxALL | wxEXPAND, 5, null); $sbSizer3 = new wxStaticBoxSizer(new wxStaticBox($this, wxID_ANY, _("Address")), wxVERTICAL); $bSizer5 = new wxBoxSizer(wxHORIZONTAL); $this->m_staticText4 = new wxStaticText($this, wxID_ANY, _("Line 1:"), wxDefaultPosition, wxDefaultSize, 0); $this->m_staticText4->Wrap(-1); $bSizer5->Add($this->m_staticText4, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); $this->txtAddressLineOne = new wxTextCtrl($this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0); $bSizer5->Add($this->txtAddressLineOne, 1, wxALL, 5); $sbSizer3->Add($bSizer5, 1, wxEXPAND, 5); $bSizer51 = new wxBoxSizer(wxHORIZONTAL); $this->m_staticText41 = new wxStaticText($this, wxID_ANY, _("Line 2:"), wxDefaultPosition, wxDefaultSize, 0); $this->m_staticText41->Wrap(-1); $bSizer51->Add($this->m_staticText41, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); $this->txtAddressLineTwo = new wxTextCtrl($this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0); $bSizer51->Add($this->txtAddressLineTwo, 1, wxALL, 5); $sbSizer3->Add($bSizer51, 1, wxEXPAND, 5); $bSizer521 = new wxBoxSizer(wxHORIZONTAL); $this->m_staticText421 = new wxStaticText($this, wxID_ANY, _("City:"), wxDefaultPosition, wxDefaultSize, 0); $this->m_staticText421->Wrap(-1); $bSizer521->Add($this->m_staticText421, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); $this->txtCity = new wxTextCtrl($this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0); $bSizer521->Add($this->txtCity, 3, wxALL, 5); $this->m_staticText131 = new wxStaticText($this, wxID_ANY, _("State:"), wxDefaultPosition, wxDefaultSize, 0); $this->m_staticText131->Wrap(-1); $bSizer521->Add($this->m_staticText131, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); $this->txtState = new wxTextCtrl($this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0); $bSizer521->Add($this->txtState, 3, wxALL, 5); $sbSizer3->Add($bSizer521, 1, wxEXPAND, 5); $bSizer522 = new wxBoxSizer(wxHORIZONTAL); $this->m_staticText422 = new wxStaticText($this, wxID_ANY, _("Zip Code:"), wxDefaultPosition, wxDefaultSize, 0); $this->m_staticText422->Wrap(-1); $bSizer522->Add($this->m_staticText422, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); $this->txtZipcode = new wxTextCtrl($this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0); $bSizer522->Add($this->txtZipcode, 3, wxALL, 5); $this->m_staticText132 = new wxStaticText($this, wxID_ANY, _("Country:"), wxDefaultPosition, wxDefaultSize, 0); $this->m_staticText132->Wrap(-1); $bSizer522->Add($this->m_staticText132, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); $this->txtCountry = new wxTextCtrl($this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0); $bSizer522->Add($this->txtCountry, 3, wxALL, 5); $sbSizer3->Add($bSizer522, 1, wxEXPAND, 5); $mainSizer->Add($sbSizer3, 0, wxEXPAND, 5); $mainSizer->Add(1, 5, 0, wxALL | wxEXPAND, 5, null); $sbSizer7 = new wxStaticBoxSizer(new wxStaticBox($this, wxID_ANY, _("Contact Information")), wxVERTICAL); $bSizer52 = new wxBoxSizer(wxHORIZONTAL); $this->m_staticText42 = new wxStaticText($this, wxID_ANY, _("Phone:"), wxDefaultPosition, wxDefaultSize, 0); $this->m_staticText42->Wrap(-1); $bSizer52->Add($this->m_staticText42, 1, wxALIGN_CENTER_VERTICAL | wxALL, 5); $this->txtPhone = new wxTextCtrl($this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0); $bSizer52->Add($this->txtPhone, 3, wxALL, 5); $this->m_staticText13 = new wxStaticText($this, wxID_ANY, _("Fax:"), wxDefaultPosition, wxDefaultSize, 0); $this->m_staticText13->Wrap(-1); $bSizer52->Add($this->m_staticText13, 1, wxALIGN_CENTER_VERTICAL | wxALL, 5); $this->txtFax = new wxTextCtrl($this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0); $bSizer52->Add($this->txtFax, 3, wxALL, 5); $sbSizer7->Add($bSizer52, 1, wxEXPAND, 5); $bSizer53 = new wxBoxSizer(wxHORIZONTAL); $this->m_staticText43 = new wxStaticText($this, wxID_ANY, _("E-mail:"), wxDefaultPosition, wxDefaultSize, 0); $this->m_staticText43->Wrap(-1); $bSizer53->Add($this->m_staticText43, 1, wxALIGN_CENTER_VERTICAL | wxALL, 5); $this->txtEmail = new wxTextCtrl($this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0); $bSizer53->Add($this->txtEmail, 4, wxALL, 5); $sbSizer7->Add($bSizer53, 1, wxEXPAND, 5); $bSizer54 = new wxBoxSizer(wxHORIZONTAL); $this->m_staticText44 = new wxStaticText($this, wxID_ANY, _("Website:"), wxDefaultPosition, wxDefaultSize, 0); $this->m_staticText44->Wrap(-1); $bSizer54->Add($this->m_staticText44, 1, wxALIGN_CENTER_VERTICAL | wxALL, 5); $this->txtWebsite = new wxTextCtrl($this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0); $bSizer54->Add($this->txtWebsite, 4, wxALL, 5); $sbSizer7->Add($bSizer54, 1, wxEXPAND, 5); $mainSizer->Add($sbSizer7, 0, wxEXPAND, 5); $bSizer16 = new wxBoxSizer(wxHORIZONTAL); $this->btnCancel = new wxButton($this, id_cancel_button, _("C&ancel"), wxDefaultPosition, wxDefaultSize, 0); $bSizer16->Add($this->btnCancel, 0, wxALIGN_BOTTOM | wxALL, 5); $this->btnSave = new wxButton($this, wxID_ANY, _("&Create"), wxDefaultPosition, wxDefaultSize, 0); $this->btnSave->SetDefault(); $bSizer16->Add($this->btnSave, 0, wxALIGN_BOTTOM | wxALL, 5); $mainSizer->Add($bSizer16, 1, wxALIGN_RIGHT | wxBOTTOM, 5); $this->SetSizer($mainSizer); $this->Layout(); $mainSizer->Fit($this); $this->Centre(wxBOTH); }
function __construct($parent = null) { parent::__construct($parent, wxID_ANY, "型號值與庫存編輯", wxDefaultPosition, new wxSize(360, 310), wxDEFAULT_DIALOG_STYLE); $this->SetSizeHints(wxDefaultSize, wxDefaultSize); $fgSizer2 = new wxFlexGridSizer(0, 2, 0, 0); $fgSizer2->AddGrowableCol(1); $fgSizer2->AddGrowableRow(8); $fgSizer2->SetFlexibleDirection(wxBOTH); $fgSizer2->SetNonFlexibleGrowMode(wxFLEX_GROWMODE_SPECIFIED); $this->lbl_SpecValue1 = new wxStaticText($this, wxID_ANY, "規格 1", wxDefaultPosition, wxDefaultSize, 0); $this->lbl_SpecValue1->Wrap(-1); $fgSizer2->Add($this->lbl_SpecValue1, 0, wxALL, 5); $this->text_SpecValue1 = new wxTextCtrl($this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0); $fgSizer2->Add($this->text_SpecValue1, 1, wxALL | wxEXPAND, 5); $this->lbl_SpecValue2 = new wxStaticText($this, wxID_ANY, "規格 2", wxDefaultPosition, wxDefaultSize, 0); $this->lbl_SpecValue2->Wrap(-1); $fgSizer2->Add($this->lbl_SpecValue2, 0, wxALL, 5); $this->text_SpecValue2 = new wxTextCtrl($this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0); $fgSizer2->Add($this->text_SpecValue2, 1, wxALL | wxEXPAND, 5); $this->lbl_Stock = new wxStaticText($this, wxID_ANY, "庫存量", wxDefaultPosition, wxDefaultSize, 0); $this->lbl_Stock->Wrap(-1); $fgSizer2->Add($this->lbl_Stock, 0, wxALL, 5); $this->text_Stock = new wxTextCtrl($this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0); $fgSizer2->Add($this->text_Stock, 1, wxALL | wxEXPAND, 5); $this->lbl_CustomId1 = new wxStaticText($this, wxID_ANY, "貨號 1", wxDefaultPosition, wxDefaultSize, 0); $this->lbl_CustomId1->Wrap(-1); $fgSizer2->Add($this->lbl_CustomId1, 0, wxALL, 5); $this->text_CustomId1 = new wxTextCtrl($this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0); $fgSizer2->Add($this->text_CustomId1, 1, wxALL | wxEXPAND, 5); $this->lbl_CustomId2 = new wxStaticText($this, wxID_ANY, "貨號 2", wxDefaultPosition, wxDefaultSize, 0); $this->lbl_CustomId2->Wrap(-1); $fgSizer2->Add($this->lbl_CustomId2, 0, wxALL, 5); $this->text_CustomId2 = new wxTextCtrl($this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0); $fgSizer2->Add($this->text_CustomId2, 1, wxALL | wxEXPAND, 5); $this->lbl_Barcode = new wxStaticText($this, wxID_ANY, "商品條碼", wxDefaultPosition, wxDefaultSize, 0); $this->lbl_Barcode->Wrap(-1); $fgSizer2->Add($this->lbl_Barcode, 0, wxALL, 5); $this->text_Barcode = new wxTextCtrl($this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0); $fgSizer2->Add($this->text_Barcode, 1, wxALL | wxEXPAND, 5); $this->lbl_PicSmall = new wxStaticText($this, wxID_ANY, "規格小圖", wxDefaultPosition, wxDefaultSize, 0); $this->lbl_PicSmall->Wrap(-1); $fgSizer2->Add($this->lbl_PicSmall, 0, wxALL, 5); $this->text_PicSmall = new wxTextCtrl($this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0); $fgSizer2->Add($this->text_PicSmall, 1, wxALL | wxEXPAND, 5); $this->lbl_PicLarge = new wxStaticText($this, wxID_ANY, "規格大圖", wxDefaultPosition, wxDefaultSize, 0); $this->lbl_PicLarge->Wrap(-1); $fgSizer2->Add($this->lbl_PicLarge, 0, wxALL, 5); $this->text_PicLarge = new wxTextCtrl($this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, 0); $fgSizer2->Add($this->text_PicLarge, 1, wxALL | wxEXPAND, 5); $fgSizer2->Add(0, 0, 1, wxEXPAND, 5, null); $this->btn_Save = new wxButton($this, wxID_ANY, "確定 (OK)", wxDefaultPosition, wxDefaultSize, 0); $fgSizer2->Add($this->btn_Save, 0, wxALL | wxALIGN_RIGHT | wxALIGN_BOTTOM, 5); $this->SetSizer($fgSizer2); $this->Layout(); $this->Centre(wxBOTH); // Connect Events $this->Connect(wxEVT_CLOSE_WINDOW, array($this, "onWindowClose")); $this->text_PicSmall->Connect(wxEVT_LEFT_DCLICK, array($this, "on_FocusPicSmall")); $this->text_PicSmall->Connect(wxEVT_SET_FOCUS, array($this, "on_FocusPicSmall")); $this->text_PicLarge->Connect(wxEVT_LEFT_DCLICK, array($this, "on_FocusPicLarge")); $this->text_PicLarge->Connect(wxEVT_SET_FOCUS, array($this, "on_FocusPicLarge")); $this->btn_Save->Connect(wxEVT_COMMAND_BUTTON_CLICKED, array($this, "do_Save")); }
public function __construct($parent) { parent::__construct($parent, wxID_ANY, "About statbar", wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE | wxRESIZE_BORDER); $text = new wxStaticText($this, wxID_ANY, "wxStatusBar sample\n" . "(c) 2000 Vadim Zeitlin\n\n" . "Ported to wxPHP by Thomas Sahlin"); $btn = new wxButton($this, wxID_OK, "&Close"); // create the top status bar without the size grip (default style), // otherwise it looks weird $statbarTop = new wxStatusBar($this, wxID_ANY, 0); $statbarTop->SetFieldsCount(3); $statbarTop->SetStatusText("This is a top status bar", 0); $statbarTop->SetStatusText("in a dialog", 1); $statbarTop->SetStatusText("Great, isn't it?", 2); $statbarBottom = new wxStatusBar($this, wxID_ANY); $statbarBottom->SetFieldsCount(2); $statbarBottom->SetStatusText("This is a bottom status bar", 0); $statbarBottom->SetStatusText("in a dialog", 1); $sizerTop = new wxBoxSizer(wxVERTICAL); $sizerTop->Add($statbarTop, 0, wxGROW); $sizerTop->Add(-1, 10, 1, wxGROW); $sizerTop->Add($text, 0, wxCENTRE | wxRIGHT | wxLEFT, 20); $sizerTop->Add(-1, 10, 1, wxGROW); $sizerTop->Add($btn, 0, wxCENTRE | wxRIGHT | wxLEFT, 20); $sizerTop->Add(-1, 10, 1, wxGROW); $sizerTop->Add($statbarBottom, 0, wxGROW); $this->SetSizerAndFit($sizerTop); }
function __construct($parent = null) { parent::__construct($parent, wxID_ANY, "File Viewer", wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE); $this->SetSizeHints(new wxSize(800, 600), wxDefaultSize); $this->Centre(wxBOTH); }