function __construct($parent = null) { parent::__construct($parent, wxID_ANY, wxEmptyString, wxDefaultPosition, new wxSize(500, 300), wxDEFAULT_FRAME_STYLE | wxTAB_TRAVERSAL); $this->SetSizeHints(wxDefaultSize, wxDefaultSize); $layoutBoxSizer = new wxBoxSizer(wxVERTICAL); $panelBatchMetaSelector = new wxBoxSizer(wxHORIZONTAL); $this->label_CategorySelect = new wxStaticText($this, wxID_ANY, "Category", wxDefaultPosition, wxDefaultSize, 0); $this->label_CategorySelect->Wrap(-1); $panelBatchMetaSelector->Add($this->label_CategorySelect, 0, wxALL, 5); $CategorySelectorChoices = array(); $this->CategorySelector = new wxComboBox($this, wxID_ANY, "Category", wxDefaultPosition, wxDefaultSize, $CategorySelectorChoices, wxCB_READONLY); $this->CategorySelector->SetMinSize(new wxSize(200, -1)); $panelBatchMetaSelector->Add($this->CategorySelector, 1, wxALL, 5); $this->btnApplyCategory = new wxButton($this, wxID_ANY, "套用 (Apply)", wxDefaultPosition, wxDefaultSize, 0); $panelBatchMetaSelector->Add($this->btnApplyCategory, 0, wxALL, 5); $this->btnClearCategory = new wxButton($this, wxID_ANY, "重置 (Clear)", wxDefaultPosition, wxDefaultSize, 0); $panelBatchMetaSelector->Add($this->btnClearCategory, 0, wxALL, 5); $layoutBoxSizer->Add($panelBatchMetaSelector, 0, wxEXPAND, 5); $panelActionTrigger = new wxBoxSizer(wxHORIZONTAL); $this->btnExportTrigger = new wxButton($this, wxID_ANY, "匯出 (Export)", wxDefaultPosition, wxDefaultSize, 0); $panelActionTrigger->Add($this->btnExportTrigger, 0, wxALL, 5); $this->btnImportTrigger = new wxButton($this, wxID_ANY, "匯入 (Import)", wxDefaultPosition, wxDefaultSize, 0); $panelActionTrigger->Add($this->btnImportTrigger, 0, wxALL, 5); $layoutBoxSizer->Add($panelActionTrigger, 0, wxALIGN_RIGHT, 5); $this->panelContent = new wxNotebook($this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0); $this->panelAllContent = new wxPanel($this->panelContent, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL); $this->panelContent->AddPage($this->panelAllContent, "所有項目", false); $this->panelSuccessContent = new wxPanel($this->panelContent, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL); $this->panelContent->AddPage($this->panelSuccessContent, "成功", false); $this->panelFailedContent = new wxPanel($this->panelContent, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTAB_TRAVERSAL); $this->panelContent->AddPage($this->panelFailedContent, "失敗", false); $layoutBoxSizer->Add($this->panelContent, 1, wxEXPAND | wxALL, 5); $panelUploadAction = new wxBoxSizer(wxHORIZONTAL); $this->btnVerifyTrigger = new wxButton($this, wxID_ANY, "驗證 (Verify)", wxDefaultPosition, wxDefaultSize, 0); $panelUploadAction->Add($this->btnVerifyTrigger, 0, wxALL, 5); $this->btnPublishTrigger = new wxButton($this, wxID_ANY, "發佈 (Publish)", wxDefaultPosition, wxDefaultSize, 0); $panelUploadAction->Add($this->btnPublishTrigger, 0, wxALL, 5); $layoutBoxSizer->Add($panelUploadAction, 0, wxALIGN_RIGHT, 5); $this->SetSizer($layoutBoxSizer); $this->Layout(); $this->Centre(wxBOTH); // Connect Events $this->Connect(wxEVT_CLOSE_WINDOW, array($this, "onWindowClose")); $this->CategorySelector->Connect(wxEVT_COMMAND_COMBOBOX_SELECTED, array($this, "onPickedCategoryChanged")); $this->btnApplyCategory->Connect(wxEVT_COMMAND_BUTTON_CLICKED, array($this, "doApplyCategory")); $this->btnClearCategory->Connect(wxEVT_COMMAND_BUTTON_CLICKED, array($this, "doResetCategory")); $this->btnExportTrigger->Connect(wxEVT_COMMAND_BUTTON_CLICKED, array($this, "doDataExport")); $this->btnImportTrigger->Connect(wxEVT_COMMAND_BUTTON_CLICKED, array($this, "doDataImport")); $this->panelContent->Connect(wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED, array($this, "doContentPageChange")); $this->btnVerifyTrigger->Connect(wxEVT_COMMAND_BUTTON_CLICKED, array($this, "doVerify")); $this->btnPublishTrigger->Connect(wxEVT_COMMAND_BUTTON_CLICKED, array($this, "doPublish")); }
private function createDataGridWidget(&$panel) { $sizer = new wxBoxSizer(wxVERTICAL); $widget = new wxStaticText($panel, wxID_ANY, "(No Data)", wxDefaultPosition, wxDefaultSize, 0); $sizer->Add($widget, 1, wxALL | wxEXPAND, 5); $panel->SetSizer($sizer); $panel->Layout(); $sizer->Fit($panel); return array($sizer, $widget); }
public function __construct(array $demoNames, $parent = null) { parent::__construct($parent, wxID_TOP, "Controller", wxDefaultPosition, new wxSize(300, 200)); $this->SetPosition(new wxPoint(100, 100)); $this->choiceCtrl = new wxChoice($this, wxID_ANY, wxDefaultPosition, new wxSize(250, 29), $demoNames); $sizer = new wxBoxSizer(wxVERTICAL); $sizer->Add($this->choiceCtrl, 0, wxALL, 8); $this->Connect(wxEVT_CHOICE, [$this, "controlChangeEvent"]); $this->SetSizer($sizer); }
function __construct($parent = null) { parent::__construct($parent, wxID_ANY, wxEmptyString, wxDefaultPosition, new wxSize(500, 300), wxDEFAULT_FRAME_STYLE | wxTAB_TRAVERSAL); $this->SetSizeHints(wxDefaultSize, wxDefaultSize); $bSizer1 = new wxBoxSizer(wxVERTICAL); $this->m_webView = wxWebView::NewMethod($this, wxID_ANY, "http://wxphp.org/"); $bSizer1->Add($this->m_webView, 1, wxALL | wxEXPAND, 5); $this->SetSizer($bSizer1); $this->Layout(); $this->Centre(wxBOTH); }
function __construct($parent = null) { parent::__construct($parent, wxID_ANY, "Drag and Drop Sample", wxDefaultPosition, new wxSize(500, 300), wxDEFAULT_FRAME_STYLE | wxTAB_TRAVERSAL); $this->SetSizeHints(wxDefaultSize, wxDefaultSize); $bSizer1 = new wxBoxSizer(wxVERTICAL); $bSizer4 = new wxBoxSizer(wxVERTICAL); $this->m_staticText1 = new wxStaticText($this, wxID_ANY, "Drop Text:", wxDefaultPosition, wxDefaultSize, 0); $this->m_staticText1->Wrap(-1); $bSizer4->Add($this->m_staticText1, 0, wxALL, 5); $bSizer1->Add($bSizer4, 0, wxEXPAND, 5); $bSizer2 = new wxBoxSizer(wxVERTICAL); $this->m_textCtrl1 = new wxTextCtrl($this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxHSCROLL | wxTE_MULTILINE); $bSizer2->Add($this->m_textCtrl1, 1, wxALL | wxEXPAND, 5); $bSizer1->Add($bSizer2, 1, wxEXPAND, 5); $bSizer41 = new wxBoxSizer(wxVERTICAL); $this->m_staticText11 = new wxStaticText($this, wxID_ANY, "Drop Files:", wxDefaultPosition, wxDefaultSize, 0); $this->m_staticText11->Wrap(-1); $bSizer41->Add($this->m_staticText11, 0, wxALL, 5); $bSizer1->Add($bSizer41, 0, wxEXPAND, 5); $bSizer21 = new wxBoxSizer(wxVERTICAL); $this->m_textCtrl11 = new wxTextCtrl($this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxHSCROLL | wxTE_MULTILINE | wxTE_READONLY); $bSizer21->Add($this->m_textCtrl11, 1, wxALL | wxEXPAND, 5); $bSizer1->Add($bSizer21, 1, wxEXPAND, 5); $this->SetSizer($bSizer1); $this->Layout(); $this->m_menubar1 = new wxMenuBar(0); $this->m_menu1 = new wxMenu(); $this->m_menuItem1 = new wxMenuItem($this->m_menu1, wxID_ANY, "&Quit", wxEmptyString, wxITEM_NORMAL); $this->m_menu1->Append($this->m_menuItem1); $this->m_menubar1->Append($this->m_menu1, "&File"); $this->SetMenuBar($this->m_menubar1); $this->Centre(wxBOTH); // Drag stuff $dt2 = new TextDropTarget($this->m_textCtrl1); $this->m_textCtrl1->SetDropTarget($dt2); $dt3 = new FileDropTarget($this->m_textCtrl11); $this->m_textCtrl11->SetDropTarget($dt3); // Connect Events $this->Connect($this->m_menuItem1->GetId(), wxEVT_COMMAND_MENU_SELECTED, array($this, "CloseWindow")); }
function __construct($parent = null) { parent::__construct($parent, wxID_ANY, "Simple PDF to SWF", wxDefaultPosition, new wxSize(700, 500), wxDEFAULT_FRAME_STYLE | wxTAB_TRAVERSAL); $this->SetSizeHints(wxDefaultSize, wxDefaultSize); $mainSizer = new wxBoxSizer(wxHORIZONTAL); $leftSizer = new wxBoxSizer(wxVERTICAL); $this->fileNavigator = new wxGenericDirCtrl($this, wxID_ANY, wxEmptyString, wxDefaultPosition, wxDefaultSize, wxDIRCTRL_3D_INTERNAL | wxSUNKEN_BORDER, "PDF Files (*.pdf)|*.pdf", 0); $this->fileNavigator->ShowHidden(false); $leftSizer->Add($this->fileNavigator, 1, wxALL | wxEXPAND, 5); $mainSizer->Add($leftSizer, 1, wxEXPAND, 5); $rightSizer = new wxBoxSizer(wxVERTICAL); $bSizer4 = new wxBoxSizer(wxHORIZONTAL); $this->m_lblDocumentsToConvert = new wxStaticText($this, wxID_ANY, "Documents to convert:", wxDefaultPosition, wxDefaultSize, 0); $this->m_lblDocumentsToConvert->Wrap(-1); $bSizer4->Add($this->m_lblDocumentsToConvert, 1, wxALIGN_CENTER_VERTICAL | wxALL, 5); $this->m_clear = new wxButton($this, wxID_ANY, "Clear List", wxDefaultPosition, wxDefaultSize, 0); $bSizer4->Add($this->m_clear, 0, wxALIGN_RIGHT | wxALL, 5); $rightSizer->Add($bSizer4, 0, wxEXPAND, 5); $m_pdfListChoices = array(); $this->m_pdfList = new wxCheckListBox($this, wxID_ANY, wxDefaultPosition, wxDefaultSize, $m_pdfListChoices, 0); $rightSizer->Add($this->m_pdfList, 1, wxALL | wxEXPAND, 5); $bSizer5 = new wxBoxSizer(wxHORIZONTAL); $this->m_lblOutputDir = new wxStaticText($this, wxID_ANY, "Output:", wxDefaultPosition, wxDefaultSize, 0); $this->m_lblOutputDir->Wrap(-1); $bSizer5->Add($this->m_lblOutputDir, 0, wxALIGN_CENTER_VERTICAL | wxALL, 5); $this->m_outpurDir = new wxDirPickerCtrl($this, wxID_ANY, wxEmptyString, "Select the output directory", wxDefaultPosition, wxDefaultSize, wxDIRP_DEFAULT_STYLE); $bSizer5->Add($this->m_outpurDir, 1, wxALL | wxEXPAND, 5); $this->m_convert = new wxButton($this, wxID_ANY, "Convert All", wxDefaultPosition, wxDefaultSize, 0); $bSizer5->Add($this->m_convert, 0, wxALIGN_CENTER | wxALL, 5); $rightSizer->Add($bSizer5, 0, wxEXPAND, 5); $this->m_status = new wxGauge($this, wxID_ANY, 100, wxDefaultPosition, wxDefaultSize, wxGA_HORIZONTAL); $rightSizer->Add($this->m_status, 0, wxALL | wxEXPAND, 5); $mainSizer->Add($rightSizer, 1, wxEXPAND, 5); $this->SetSizer($mainSizer); $this->Layout(); $this->Centre(wxBOTH); $this->converting = false; $this->m_timer = new wxTimer($this); $this->document_converter = new DocumentConverter($this); // Connect Events $this->fileNavigator->Connect(wxEVT_KEY_DOWN, array($this, "onFileNagivationKeyDown")); $this->fileNavigator->GetTreeCtrl()->Connect(wxEVT_LEFT_DCLICK, array($this, "onFileNavigationDClick")); $this->m_clear->Connect(wxEVT_COMMAND_BUTTON_CLICKED, array($this, "onClearClick")); $this->m_pdfList->Connect(wxEVT_COMMAND_CHECKLISTBOX_TOGGLED, array($this, "onPdfListItemToggled")); $this->m_convert->Connect(wxEVT_COMMAND_BUTTON_CLICKED, array($this, "onConvertClick")); $this->Connect(wxEVT_TIMER, array($this, "onTimer")); }
function __construct($parent = null) { parent::__construct($parent, wxID_ANY, wxEmptyString, wxDefaultPosition, new wxSize(500, 300), wxDEFAULT_FRAME_STYLE | wxTAB_TRAVERSAL); $this->SetSizeHints(wxDefaultSize, wxDefaultSize); $bSizer1 = new wxBoxSizer(wxVERTICAL); $this->m_grid1 = new wxGrid($this, wxID_ANY, wxDefaultPosition, wxDefaultSize, 0); # Grid $this->m_grid1->CreateGrid(5, 5); $this->m_grid1->EnableEditing(true); $this->m_grid1->EnableGridLines(true); $this->m_grid1->EnableDragGridSize(false); $this->m_grid1->SetMargins(0, 0); # Columns $this->m_grid1->EnableDragColMove(false); $this->m_grid1->EnableDragColSize(true); $this->m_grid1->SetColLabelSize(30); $this->m_grid1->SetColLabelAlignment(wxALIGN_CENTRE, wxALIGN_CENTRE); # Rows $this->m_grid1->EnableDragRowSize(true); $this->m_grid1->SetRowLabelSize(80); $this->m_grid1->SetRowLabelAlignment(wxALIGN_CENTRE, wxALIGN_CENTRE); # Label Appearance # Cell Defaults $this->m_grid1->SetDefaultCellAlignment(wxALIGN_LEFT, wxALIGN_TOP); $bSizer1->Add($this->m_grid1, 1, wxALL | wxEXPAND, 5); # Set renderer for last column $this->attr = new wxGridCellAttr(); $this->attr->SetReadOnly(true); $this->attr->SetRenderer(new wxGridButtonRenderer("...")); $this->m_grid1->SetColAttr(4, $this->attr); # Add grid left click event $this->m_grid1->Connect(wxEVT_GRID_CELL_LEFT_CLICK, array($this, "OnGridCellLeftClick")); $this->SetSizer($bSizer1); $this->Layout(); $this->Centre(wxBOTH); $font = $this->GetFont(); var_dump($font->GetFaceName()); }
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")); }
protected function initBorderSizeControl(wxSizer $sizer) { $hSizer = new wxBoxSizer(wxHORIZONTAL); $labelCtrl = new wxStaticText($this, wxID_ANY, "Width:", wxDefaultPosition, new wxSize(-1, -1)); // I'm leaving the spinner at a generous fixed with, since GTK renders it rather // wide otherwise $this->borderSizeCtrl = new wxSpinCtrl($this, wxID_ANY, "8", wxDefaultPosition, new wxSize(100, -1), wxSP_ARROW_KEYS, 0, 12); $hSizer->Add($labelCtrl, 0, wxALIGN_CENTER_VERTICAL); $hSizer->AddSpacer(8); $hSizer->Add($this->borderSizeCtrl); // Add the child sizer to the main one (going down) $this->addItemToSizer($sizer, $hSizer); }
function __construct($parent = null) { parent::__construct($parent, wxID_ANY, wxDefaultPosition, new wxSize(500, 300), wxTAB_TRAVERSAL); $mainSizer = new wxBoxSizer(wxVERTICAL); $buttonsSizer = new wxBoxSizer(wxHORIZONTAL); $this->btnNew = new wxButton($this, wxID_ANY, _("New"), wxDefaultPosition, wxDefaultSize, 0); $buttonsSizer->Add($this->btnNew, 0, wxALL, 5); $this->btnEdit = new wxButton($this, wxID_ANY, _("Edit"), wxDefaultPosition, wxDefaultSize, 0); $this->btnEdit->Enable(false); $buttonsSizer->Add($this->btnEdit, 0, wxALL, 5); $this->btnDelete = new wxButton($this, wxID_ANY, _("Delete"), wxDefaultPosition, wxDefaultSize, 0); $this->btnDelete->Enable(false); $buttonsSizer->Add($this->btnDelete, 0, wxALL, 5); $mainSizer->Add($buttonsSizer, 0, wxEXPAND, 5); $this->listItems = new wxListCtrl($this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxLC_REPORT); $mainSizer->Add($this->listItems, 1, wxALL | wxEXPAND, 5); $this->SetSizer($mainSizer); $this->Layout(); }
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 myFrame() { parent::__construct(null, null, "wxPhp Source Maker GUI, v0.1", wxDefaultPosition, new wxSize(600, 400)); $this->SetIcon(new wxIcon("sample.xpm", wxBITMAP_TYPE_XPM)); $sz = new wxBoxSizer(wxHORIZONTAL); $sw = new wxSplitterWindow($this, -1, wxDefaultPosition, wxDefaultSize, wxSP_NO_XP_THEME); $tree = new wxTreeCtrl($sw, -1); $dummy = new wxPanel($sw); $sz2 = new wxBoxSizer(wxVERTICAL); $lst = new wxCheckListBox($dummy, -1); $lst2 = new wxCheckListBox($dummy, -1); $lst->Connect(wxEVT_COMMAND_CHECKLISTBOX_TOGGLED, array($this, "checkLst")); $lst2->Connect(wxEVT_COMMAND_CHECKLISTBOX_TOGGLED, array($this, "saveImplements")); $sz2->Add($lst2, 1, wxEXPAND | wxALL); $sz2->Add($lst, 1, wxEXPAND | wxALL); $dummy->SetSizer($sz2); $this->lst = $lst; $this->lst2 = $lst2; //var_dump($dummy->AppendTextColumn("Nome",0)); //$dummy = new wxListCtrl($sw,-1,wxDefaultPosition,wxDefaultSize,wxLC_REPORT); //$dummy->InsertColumn(0,"Nome"); //var_dump(wxLC_ICON); //$dummy = new wxTextCtrl($sw,-1,""); //$dummy->Connect(wxEVT_COMMAND_TEXT_UPDATED,array($this,'simpleCB')); $rtNode = $tree->AddRoot("wxPHP"); global $cls; foreach ($cls as $k => $v) { $clNode = $tree->AppendItem($rtNode, $k); /*foreach($v as $k1=>$v1) { if($k1[0]=="_") continue; $tree->AppendItem($clNode,$k1); }*/ } $tree->Connect(wxEVT_COMMAND_TREE_SEL_CHANGED, array($this, "treeSelection")); //$tree->ExpandAll(); $this->tree = $tree; $sw->SplitVertically($tree, $dummy); $sw->SetMinimumPaneSize(150); $sz->Add($sw, 1, wxEXPAND | wxALL); $this->SetSizer($sz); $tb = $this->CreateToolBar(); $tb->AddTool(-1, "Abrir", new wxBitmap("sample.xpm", wxBITMAP_TYPE_XPM), "Abrir documentos"); $tb->AddSeparator(); $tb->Realize(); $mb = new wxMenuBar(); $mn = new wxMenu(); $mn->AppendCheckItem(-1, "&Salvar"); //$mn->Append(15,"abrir","serve para abrir"); $mb->Append($mn, "&File"); $this->SetMenuBar($mb); $this->Connect(wxEVT_COMMAND_MENU_SELECTED, array($this, "simpleCB")); }
function __construct($parent = null) { parent::__construct($parent, wxID_ANY, "Phar GUI", wxDefaultPosition, new wxSize(640, 480), wxDEFAULT_FRAME_STYLE | wxTAB_TRAVERSAL); $this->SetSizeHints(wxDefaultSize, wxDefaultSize); $this->m_menubar = new wxMenuBar(0); $this->m_menuFile = new wxMenu(); $this->m_menuItemNew = new wxMenuItem($this->m_menuFile, wxID_NEW, "New" . "\t" . "Ctrl-N", "Create a new phar file.", wxITEM_NORMAL); $this->m_menuFile->Append($this->m_menuItemNew); $this->m_menuItemOpen = new wxMenuItem($this->m_menuFile, wxID_OPEN, "Open" . "\t" . "Ctrl-O", "Open an existing phar file.", wxITEM_NORMAL); $this->m_menuFile->Append($this->m_menuItemOpen); $this->m_menuItemBuild = new wxMenuItem($this->m_menuFile, wxID_ANY, "Build from directory" . "\t" . "Ctrl-B", "Create a new phar file using the content of a given directory.", wxITEM_NORMAL); $this->m_menuFile->Append($this->m_menuItemBuild); $this->m_menuFile->AppendSeparator(); $this->m_menuItemReload = new wxMenuItem($this->m_menuFile, wxID_REFRESH, "Reload" . "\t" . "Ctrl-R", "Reload the content of the current phar file.", wxITEM_NORMAL); $this->m_menuFile->Append($this->m_menuItemReload); $this->m_menuItemPreferences = new wxMenuItem($this->m_menuFile, wxID_PREFERENCES, "Preferences" . "\t" . "Ctrl-P", "Configure the current phar options.", wxITEM_NORMAL); $this->m_menuFile->Append($this->m_menuItemPreferences); $this->m_menuItemExtract = new wxMenuItem($this->m_menuFile, wxID_ANY, "Extract" . "\t" . "Ctrl-E", "Extract a selected file from the phar.", wxITEM_NORMAL); $this->m_menuFile->Append($this->m_menuItemExtract); $this->m_menuItemExtractAll = new wxMenuItem($this->m_menuFile, wxID_ANY, "Extract All" . "\t" . "Shift-Ctrl-E", "Extract all the files and directories on the phar.", wxITEM_NORMAL); $this->m_menuFile->Append($this->m_menuItemExtractAll); $this->m_menuFile->AppendSeparator(); $this->m_menuItemQuit = new wxMenuItem($this->m_menuFile, wxID_CLOSE, "Quit" . "\t" . "Alt-F4", wxEmptyString, wxITEM_NORMAL); $this->m_menuFile->Append($this->m_menuItemQuit); $this->m_menubar->Append($this->m_menuFile, "&File"); $this->m_menuEdit = new wxMenu(); $this->m_menuItemAddDir = new wxMenuItem($this->m_menuEdit, wxID_ADD, "Add Directory" . "\t" . "Ctrl-D", "Add new empty directory to the phar.", wxITEM_NORMAL); $this->m_menuEdit->Append($this->m_menuItemAddDir); $this->m_menuItemAddFile = new wxMenuItem($this->m_menuEdit, wxID_FILE, "Add File" . "\t" . "Ctrl-F", "Add a new file to the phar.", wxITEM_NORMAL); $this->m_menuEdit->Append($this->m_menuItemAddFile); $this->m_menuItemDelete = new wxMenuItem($this->m_menuEdit, wxID_DELETE, "Delete" . "\t" . "Shift-Ctrl-D", "Delete a selected file from the phar.", wxITEM_NORMAL); $this->m_menuEdit->Append($this->m_menuItemDelete); $this->m_menuItemStub = new wxMenuItem($this->m_menuEdit, wxID_EXECUTE, "Stub" . "\t" . "Ctrl-T", "PHP bootstrap code that is executed when invoking the phar file.", wxITEM_NORMAL); $this->m_menuEdit->Append($this->m_menuItemStub); $this->m_menuItemAlias = new wxMenuItem($this->m_menuEdit, wxID_ANY, "Alias" . "\t" . "Ctrl-L", "Alias used internally to reference the phar file.", wxITEM_NORMAL); $this->m_menuEdit->Append($this->m_menuItemAlias); $this->m_menubar->Append($this->m_menuEdit, "&Edit"); $this->m_menuHelp = new wxMenu(); $this->m_menuItemAbout = new wxMenuItem($this->m_menuHelp, wxID_ABOUT, "About" . "\t" . "F1", "Information about PharGUI", wxITEM_NORMAL); $this->m_menuHelp->Append($this->m_menuItemAbout); $this->m_menubar->Append($this->m_menuHelp, "&Help"); $this->SetMenuBar($this->m_menubar); $this->m_statusBar = $this->CreateStatusBar(1, wxST_SIZEGRIP, wxID_ANY); $mainSizer = new wxBoxSizer(wxVERTICAL); $this->m_treeCtrlFiles = new wxTreeCtrl($this, wxID_ANY, wxDefaultPosition, wxDefaultSize, wxTR_DEFAULT_STYLE); $mainSizer->Add($this->m_treeCtrlFiles, 1, wxALL | wxEXPAND | wxALIGN_CENTER_HORIZONTAL, 5); $this->SetSizer($mainSizer); $this->Layout(); $this->Centre(wxBOTH); // Connect Events $this->Connect($this->m_menuItemNew->GetId(), wxEVT_COMMAND_MENU_SELECTED, array($this, "OnMenuNew")); $this->Connect($this->m_menuItemOpen->GetId(), wxEVT_COMMAND_MENU_SELECTED, array($this, "OnMenuOpen")); $this->Connect($this->m_menuItemBuild->GetId(), wxEVT_COMMAND_MENU_SELECTED, array($this, "OnMenuBuild")); $this->Connect($this->m_menuItemReload->GetId(), wxEVT_COMMAND_MENU_SELECTED, array($this, "OnMenuReload")); $this->Connect($this->m_menuItemPreferences->GetId(), wxEVT_COMMAND_MENU_SELECTED, array($this, "OnMenuPreferences")); $this->Connect($this->m_menuItemExtract->GetId(), wxEVT_COMMAND_MENU_SELECTED, array($this, "OnMenuExtract")); $this->Connect($this->m_menuItemExtractAll->GetId(), wxEVT_COMMAND_MENU_SELECTED, array($this, "OnMenuExtractAll")); $this->Connect($this->m_menuItemQuit->GetId(), wxEVT_COMMAND_MENU_SELECTED, array($this, "OnMenuQuit")); $this->Connect($this->m_menuItemAddDir->GetId(), wxEVT_COMMAND_MENU_SELECTED, array($this, "OnMenuAddDir")); $this->Connect($this->m_menuItemAddFile->GetId(), wxEVT_COMMAND_MENU_SELECTED, array($this, "OnMenuAddFile")); $this->Connect($this->m_menuItemDelete->GetId(), wxEVT_COMMAND_MENU_SELECTED, array($this, "OnMenuDelete")); $this->Connect($this->m_menuItemStub->GetId(), wxEVT_COMMAND_MENU_SELECTED, array($this, "OnMenuStub")); $this->Connect($this->m_menuItemAlias->GetId(), wxEVT_COMMAND_MENU_SELECTED, array($this, "OnMenuAlias")); $this->Connect($this->m_menuItemAbout->GetId(), wxEVT_COMMAND_MENU_SELECTED, array($this, "OnMenuAbout")); $this->m_treeCtrlFiles->Connect(wxEVT_LEFT_DCLICK, array($this, "OnTreeLeftClick")); $this->m_treeCtrlFiles->Connect(wxEVT_COMMAND_TREE_ITEM_RIGHT_CLICK, array($this, "OnTreeRightClick")); $this->m_treeCtrlFiles->Connect(wxEVT_COMMAND_TREE_SEL_CHANGED, array($this, "OnTreeSelChanged")); }