Пример #1
0
 function mainFrame()
 {
     parent::__construct(null, null, "Minimal wxPHP App", wxDefaultPosition, wxDefaultSize);
     $mb = new wxMenuBar();
     $mn = new wxMenu();
     $mn->Append(2, "E&xit", "Quit this program");
     $mb->Append($mn, "&File");
     $mn = new wxMenu();
     $mn->AppendCheckItem(4, "&About...", "Show about dialog");
     $mb->Append($mn, "&Help");
     $this->SetMenuBar($mb);
     $this->scite = new wxStyledTextCtrl($this);
     $this->scite->StyleClearAll();
     $this->scite->SetMarginWidth(0, 50);
     $this->scite->StyleSetForeground(wxSTC_STYLE_LINENUMBER, new wxColour(75, 75, 75));
     $this->scite->StyleSetBackground(wxSTC_STYLE_LINENUMBER, new wxColour(220, 220, 220));
     $this->scite->SetMarginType(0, wxSTC_MARGIN_NUMBER);
     $this->scite->SetWrapMode(wxSTC_WRAP_WORD);
     $this->scite->SetText("<?php\n\n\$myvar = 1 + 2;\n\nprint 'Hello World';\n\n?>\n");
     $this->scite->SetStyleBits(7);
     $this->scite->SetLexer(wxSTC_LEX_PHPSCRIPT);
     $this->scite->StyleSetForeground(wxSTC_HPHP_DEFAULT, new wxColour(0, 0, 0));
     $this->scite->StyleSetForeground(wxSTC_HPHP_HSTRING, new wxColour(255, 0, 0));
     $this->scite->StyleSetForeground(wxSTC_HPHP_SIMPLESTRING, new wxColour(255, 0, 0));
     $this->scite->StyleSetForeground(wxSTC_HPHP_WORD, new wxColour(0, 0, 155));
     $this->scite->StyleSetForeground(wxSTC_HPHP_NUMBER, new wxColour(0, 150, 0));
     $this->scite->StyleSetForeground(wxSTC_HPHP_VARIABLE, new wxColour(0, 0, 150));
     $this->scite->StyleSetForeground(wxSTC_HPHP_COMMENT, new wxColour(150, 150, 150));
     $this->scite->StyleSetForeground(wxSTC_HPHP_COMMENTLINE, new wxColour(150, 150, 150));
     $this->scite->StyleSetForeground(wxSTC_HPHP_HSTRING_VARIABLE, new wxColour(0, 0, 150));
     $this->scite->StyleSetForeground(wxSTC_HPHP_OPERATOR, new wxColour(0, 150, 0));
     $sbar = $this->CreateStatusBar(2);
     $sbar->SetStatusText("Welcome to wxPHP...");
     $this->Connect(2, wxEVT_COMMAND_MENU_SELECTED, array($this, "onQuit"));
     $this->Connect(4, wxEVT_COMMAND_MENU_SELECTED, array($this, "onAbout"));
 }
Пример #2
0
 function mainFrame()
 {
     parent::__construct(null, null, "Minimal wxPHP App", wxDefaultPosition, new wxSize(350, 260));
     /*$ico = new wxIcon();
     		$ico->CopyFromBitmap(new wxBitmap("sample.xpm",wxBITMAP_TYPE_XPM));
     		$this->SetIcon($ico);*/
     $mb = new wxMenuBar();
     $mn = new wxMenu();
     $mn->Append(2, "E&xit", "Quit this program");
     $mb->Append($mn, "&File");
     $mn = new wxMenu();
     $mn->AppendCheckItem(4, "&About...", "Show about dialog");
     $mb->Append($mn, "&Help");
     $this->SetMenuBar($mb);
     //$dummy = new wxPanel($this);
     //$sz = new wxBoxSizer(wxVERTICAL);
     $scite = new wxStyledTextCtrl($this);
     //$sz->Add($scite);
     //$dummy->SetSizer($sz);
     $sbar = $this->CreateStatusBar(2);
     $sbar->SetStatusText("Welcome to wxPHP...");
     $this->Connect(2, wxEVT_COMMAND_MENU_SELECTED, array($this, "onQuit"));
     $this->Connect(4, wxEVT_COMMAND_MENU_SELECTED, array($this, "onAbout"));
 }
Пример #3
0
 function __construct()
 {
     parent::__construct(null, null, "wxPHP Classes Selector, v0.2", new wxPoint(0, 0), new wxSize(600, 400));
     $this->SetIcon(new wxIcon("sample.xpm", wxBITMAP_TYPE_XPM));
     $this->sz = new wxBoxSizer(wxHORIZONTAL);
     $sw = new wxSplitterWindow($this, -1, new wxPoint(0, 0), new wxSize(0, 0), wxSP_NO_XP_THEME);
     $leftPanel = new wxPanel($sw);
     $rightPanel = new wxPanel($sw);
     $this->leftSizer = new wxBoxSizer(wxVERTICAL);
     $txtAutoCompletion = new wxTextCtrl($leftPanel, wxID_ANY);
     $tree = new wxTreeCtrl($leftPanel, -1);
     $this->leftSizer->Add($txtAutoCompletion, 0, wxEXPAND | wxALL);
     $this->leftSizer->Add($tree, 1, wxEXPAND | wxALL);
     $leftPanel->SetSizer($this->leftSizer);
     $this->sz2 = new wxBoxSizer(wxVERTICAL);
     $lstMethods = new wxCheckListBox();
     $lstMethods->Create($rightPanel, -1);
     $lstImplements = new wxCheckListBox();
     $lstImplements->Create($rightPanel, -1);
     $lstMethods->Connect(wxEVT_COMMAND_CHECKLISTBOX_TOGGLED, array($this, "onMethodChecked"));
     $lstImplements->Connect(wxEVT_COMMAND_CHECKLISTBOX_TOGGLED, array($this, "onParentChecked"));
     $this->sz2->Add($lstImplements, 1, wxEXPAND | wxALL);
     $this->sz2->Add($lstMethods, 1, wxEXPAND | wxALL);
     $rightPanel->SetSizer($this->sz2);
     $this->lstMethods = $lstMethods;
     $this->lstImplements = $lstImplements;
     $rtNode = $tree->AddRoot("wxPHP");
     global $cls;
     $this->treeItems = array();
     $class_names = array();
     foreach ($cls as $k => $v) {
         $clNode = $tree->AppendItem($rtNode, $k);
         $this->treeItems[] = $clNode;
         $class_names[] = $k;
     }
     $txtAutoCompletion->AutoComplete($class_names);
     $txtAutoCompletion->Connect(wxEVT_KEY_UP, array($this, "onAutoCompleteEnter"));
     $tree->ExpandAll();
     $tree->Connect(wxEVT_COMMAND_TREE_SEL_CHANGED, array($this, "onClassSelected"));
     $this->tree = $tree;
     $this->txtAutoCompletion = $txtAutoCompletion;
     $sw->SplitVertically($leftPanel, $rightPanel);
     $sw->SetMinimumPaneSize(150);
     $this->sz->Add($sw, 1, wxEXPAND | wxALL);
     $this->SetSizer($this->sz);
     $mb = new wxMenuBar();
     $mn = new wxMenu();
     $mn->Append(-1, "&Save", "save the changes to classes.json");
     $mb->Append($mn, "&File");
     $this->SetMenuBar($mb);
     $sbar = $this->CreateStatusBar(2);
     $sbar->SetStatusText("wxPHP Class Methods Selector");
     $sbar->SetStatusText("v0.2", 1);
     $this->SetStatusWidths(2, array(250, -1));
     $this->Connect(wxEVT_COMMAND_MENU_SELECTED, array($this, "onSave"));
     $this->Connect(wxEVT_CLOSE_WINDOW, array($this, "onWindowClose"));
     $this->taskBar = new wxTaskBarIconCustom();
     $this->taskBar->SetIcon(new wxIcon("sample.xpm", wxBITMAP_TYPE_XPM), "wxPHP Classes Selector v0.2");
     $this->taskBar->Connect(wxEVT_TASKBAR_LEFT_DCLICK, array($this, "onTaskBarClick"));
 }
Пример #4
0
 function __construct()
 {
     parent::__construct(0);
     $this->fileMenu = new wxMenu();
     $this->newCompanyMenuItem = new wxMenuItem($this->fileMenu, wxID_ANY, _("New Company") . "\t" . "Ctrl+N", _("Create a new company file."), wxITEM_NORMAL);
     $this->fileMenu->Append($this->newCompanyMenuItem);
     $this->openCompanyMenuItem = new wxMenuItem($this->fileMenu, wxID_ANY, _("Open Company") . "\t" . "Ctrl+O", _("Open a company file to start working."), wxITEM_NORMAL);
     $this->fileMenu->Append($this->openCompanyMenuItem);
     $this->backupCompanyMenuItem = new wxMenuItem($this->fileMenu, wxID_ANY, _("Backup Company") . "\t" . "Ctrl+B", _("Backup your company file to another location."), wxITEM_NORMAL);
     $this->fileMenu->Append($this->backupCompanyMenuItem);
     $this->passwordProtectMenuItem = new wxMenuItem($this->fileMenu, wxID_ANY, _("Password Protect"), _("Encrypt the company file with a password."), wxITEM_NORMAL);
     $this->fileMenu->Append($this->passwordProtectMenuItem);
     $this->companyInformationMenuItem = new wxMenuItem($this->fileMenu, wxID_ANY, _("Company Information") . "\t" . "Ctrl+I", _("Modify current company details."), wxITEM_NORMAL);
     $this->fileMenu->Append($this->companyInformationMenuItem);
     $this->preferencesMenuItem = new wxMenuItem($this->fileMenu, wxID_ANY, _("Preferences") . "\t" . "Ctrl+R", _("Edit company settings."), wxITEM_NORMAL);
     $this->fileMenu->Append($this->preferencesMenuItem);
     $this->quitMenuItem = new wxMenuItem($this->fileMenu, wxID_ANY, _("Quit") . "\t" . "Alt+F4", _("Exit Xiaris"), wxITEM_NORMAL);
     $this->fileMenu->Append($this->quitMenuItem);
     $this->Append($this->fileMenu, _("File"));
     $this->companyMenu = new wxMenu();
     $this->customerMenuItem = new wxMenuItem($this->companyMenu, wxID_ANY, _("Customers"), wxEmptyString, wxITEM_NORMAL);
     $this->companyMenu->Append($this->customerMenuItem);
     $this->vendorsMenuItem = new wxMenuItem($this->companyMenu, wxID_ANY, _("Vendors"), wxEmptyString, wxITEM_NORMAL);
     $this->companyMenu->Append($this->vendorsMenuItem);
     $this->othersMenuItem = new wxMenuItem($this->companyMenu, wxID_ANY, _("Others"), wxEmptyString, wxITEM_NORMAL);
     $this->companyMenu->Append($this->othersMenuItem);
     $this->accountsMenuItem = new wxMenuItem($this->companyMenu, wxID_ANY, _("Accounts"), wxEmptyString, wxITEM_NORMAL);
     $this->companyMenu->Append($this->accountsMenuItem);
     $this->itemsMenuItem = new wxMenuItem($this->companyMenu, wxID_ANY, _("Items"), wxEmptyString, wxITEM_NORMAL);
     $this->companyMenu->Append($this->itemsMenuItem);
     $this->termsMenuItem = new wxMenuItem($this->companyMenu, wxID_ANY, _("Terms"), wxEmptyString, wxITEM_NORMAL);
     $this->companyMenu->Append($this->termsMenuItem);
     $this->customerMessageMenuItem = new wxMenuItem($this->companyMenu, wxID_ANY, _("Customer Message"), wxEmptyString, wxITEM_NORMAL);
     $this->companyMenu->Append($this->customerMessageMenuItem);
     $this->paymentMethodsMenuItem = new wxMenuItem($this->companyMenu, wxID_ANY, _("Payment Methods"), wxEmptyString, wxITEM_NORMAL);
     $this->companyMenu->Append($this->paymentMethodsMenuItem);
     $this->Append($this->companyMenu, _("Company"));
     $this->reportsMenu = new wxMenu();
     $this->totalSalesCustomerMenuItem = new wxMenuItem($this->reportsMenu, wxID_ANY, _("Total Sales by Customer"), wxEmptyString, wxITEM_NORMAL);
     $this->reportsMenu->Append($this->totalSalesCustomerMenuItem);
     $this->totalSalesByItemMenuItem = new wxMenuItem($this->reportsMenu, wxID_ANY, _("Total Sales by Item"), wxEmptyString, wxITEM_NORMAL);
     $this->reportsMenu->Append($this->totalSalesByItemMenuItem);
     $this->allActivityByCustomerMenuItem = new wxMenuItem($this->reportsMenu, wxID_ANY, _("All Activity by Customer"), wxEmptyString, wxITEM_NORMAL);
     $this->reportsMenu->Append($this->allActivityByCustomerMenuItem);
     $this->customerBalanceMenuItem = new wxMenuItem($this->reportsMenu, wxID_ANY, _("Customer Balance"), wxEmptyString, wxITEM_NORMAL);
     $this->reportsMenu->Append($this->customerBalanceMenuItem);
     $this->accountsReceivableMenuItem = new wxMenuItem($this->reportsMenu, wxID_ANY, _("Accounts Receivable"), wxEmptyString, wxITEM_NORMAL);
     $this->reportsMenu->Append($this->accountsReceivableMenuItem);
     $this->totalExpensesByPayeeMenuItem = new wxMenuItem($this->reportsMenu, wxID_ANY, _("Total Expenses by Payee"), wxEmptyString, wxITEM_NORMAL);
     $this->reportsMenu->Append($this->totalExpensesByPayeeMenuItem);
     $this->allTransactionsByVendorMenuItem = new wxMenuItem($this->reportsMenu, wxID_ANY, _("All Transactions by Vendor"), wxEmptyString, wxITEM_NORMAL);
     $this->reportsMenu->Append($this->allTransactionsByVendorMenuItem);
     $this->taxReportsMenu = new wxMenu();
     $this->incomeTaxSummaryMenuItem = new wxMenuItem($this->taxReportsMenu, wxID_ANY, _("Income Tax Summary"), wxEmptyString, wxITEM_NORMAL);
     $this->taxReportsMenu->Append($this->incomeTaxSummaryMenuItem);
     $this->incomeTaxDetailsMenuItem = new wxMenuItem($this->taxReportsMenu, wxID_ANY, _("Income Tax Details"), wxEmptyString, wxITEM_NORMAL);
     $this->taxReportsMenu->Append($this->incomeTaxDetailsMenuItem);
     $this->reportsMenu->AppendSubMenu($this->taxReportsMenu, _("Tax Reports"));
     $this->accountantReportsMenu = new wxMenu();
     $this->profitsAndLossMenuItem = new wxMenuItem($this->accountantReportsMenu, wxID_ANY, _("Profits and Loss"), wxEmptyString, wxITEM_NORMAL);
     $this->accountantReportsMenu->Append($this->profitsAndLossMenuItem);
     $this->balanceSheetSummaryMenuItem = new wxMenuItem($this->accountantReportsMenu, wxID_ANY, _("Balance Sheet Summary"), wxEmptyString, wxITEM_NORMAL);
     $this->accountantReportsMenu->Append($this->balanceSheetSummaryMenuItem);
     $this->generalLedgerMenuItem = new wxMenuItem($this->accountantReportsMenu, wxID_ANY, _("General Ledger"), wxEmptyString, wxITEM_NORMAL);
     $this->accountantReportsMenu->Append($this->generalLedgerMenuItem);
     $this->journalMenuItem = new wxMenuItem($this->accountantReportsMenu, wxID_ANY, _("Journal"), wxEmptyString, wxITEM_NORMAL);
     $this->accountantReportsMenu->Append($this->journalMenuItem);
     $this->trialBalanceMenuItem = new wxMenuItem($this->accountantReportsMenu, wxID_ANY, _("Trial Balance"), wxEmptyString, wxITEM_NORMAL);
     $this->accountantReportsMenu->Append($this->trialBalanceMenuItem);
     $this->auditTrailMenuItem = new wxMenuItem($this->accountantReportsMenu, wxID_ANY, _("Audit Trail"), wxEmptyString, wxITEM_NORMAL);
     $this->accountantReportsMenu->Append($this->auditTrailMenuItem);
     $this->reportsMenu->AppendSubMenu($this->accountantReportsMenu, _("Accountant Reports"));
     $this->Append($this->reportsMenu, _("Reports"));
     $this->helpMenu = new wxMenu();
     $this->aboutMenuItem = new wxMenuItem($this->helpMenu, wxID_ANY, _("About...") . "\t" . "F1", wxEmptyString, wxITEM_NORMAL);
     $this->helpMenu->Append($this->aboutMenuItem);
     $this->Append($this->helpMenu, _("Help"));
 }
Пример #5
0
 public function __construct($title, $pos, $size)
 {
     parent::__construct(null, wxID_ANY, $title, $pos, $size);
     $this->SetIcon(new wxIcon(__DIR__ . '/sample.xpm', wxBITMAP_TYPE_XPM));
     $this->statbarPaneStyle = wxSB_NORMAL;
     $this->field = 1;
     // create a menu bar
     $menuFile = new wxMenu();
     $menuFile->Append(StatusBar_Quit, "E&xit\tAlt-X", "Quit this program");
     $statbarMenu = new wxMenu();
     $statbarStyleMenu = new wxMenu();
     $statbarStyleMenu->Append(StatusBar_SetStyleSizeGrip, "wxSTB_SIZE_GRIP", "Toggles the wxSTB_SIZE_GRIP style", true);
     $statbarStyleMenu->Append(StatusBar_SetStyleShowTips, "wxSTB_SHOW_TIPS", "Toggles the wxSTB_SHOW_TIPS style", true);
     $statbarStyleMenu->AppendSeparator();
     $statbarStyleMenu->AppendCheckItem(StatusBar_SetStyleEllipsizeStart, "wxSTB_ELLIPSIZE_START", "Toggle wxSTB_ELLIPSIZE_START style");
     $statbarStyleMenu->AppendCheckItem(StatusBar_SetStyleEllipsizeMiddle, "wxSTB_ELLIPSIZE_MIDDLE", "Toggle wxSTB_ELLIPSIZE_MIDDLE style");
     $statbarStyleMenu->AppendCheckItem(StatusBar_SetStyleEllipsizeEnd, "wxSTB_ELLIPSIZE_END", "Toggle wxSTB_ELLIPSIZE_END style");
     $statbarMenu->Append(StatusBar_SetPaneStyle, "Status bar style", $statbarStyleMenu);
     $statbarMenu->AppendSeparator();
     $statbarMenu->Append(StatusBar_SetField, "Set active field &number\tCtrl-N", "Set the number of field used by the next commands.");
     $statbarMenu->Append(StatusBar_SetText, "Set field &text\tCtrl-T", "Set the text of the selected field.");
     $statbarMenu->Append(StatusBar_PushText, "P&ush field text\tCtrl-P", "Push a message on top the selected field.");
     $statbarMenu->Append(StatusBar_PopText, "&Pop field text\tShift-Ctrl-P", "Restore the previous contents of the selected field.");
     $statbarMenu->AppendSeparator();
     $statbarMenu->Append(StatusBar_SetFields, "&Set field count\tCtrl-C", "Set the number of status bar fields");
     $statbarMenu->Append(StatusBar_SetFont, "&Set field font\tCtrl-F", "Set the font to use for status bar fields");
     $statbarPaneStyleMenu = new wxMenu();
     $statbarPaneStyleMenu->AppendCheckItem(StatusBar_SetPaneStyleNormal, "&Normal", "Sets the style of the first field to normal (sunken) look");
     $statbarPaneStyleMenu->AppendCheckItem(StatusBar_SetPaneStyleFlat, "&Flat", "Sets the style of the first field to flat look");
     $statbarPaneStyleMenu->AppendCheckItem(StatusBar_SetPaneStyleRaised, "&Raised", "Sets the style of the first field to raised look");
     $statbarMenu->Append(StatusBar_SetPaneStyle, "Field style", $statbarPaneStyleMenu);
     $statbarMenu->Append(StatusBar_ResetFieldsWidth, "Reset field widths", "Sets all fields to the same width");
     $statbarMenu->Append(StatusBar_ShowFieldsRect, "Sho&w field rectangles\tCtrl-W", "Visually show field rectangles");
     $statbarMenu->AppendSeparator();
     $statbarMenu->AppendCheckItem(StatusBar_Toggle, "&Toggle Status Bar", "Toggle the status bar display");
     $statbarMenu->Append(StatusBar_Recreate, "&Recreate\tCtrl-R", "Toggle status bar format");
     $helpMenu = new wxMenu();
     $helpMenu->Append(StatusBar_About, "&About\tCtrl-A", "Show about dialog");
     // now append the freshly created menu to the menu bar...
     $menuBar = new wxMenuBar();
     $menuBar->Append($menuFile, "&File");
     $menuBar->Append($statbarMenu, "&Status bar");
     $menuBar->Append($helpMenu, "&Help");
     // ... and attach this menu bar to the frame
     $this->SetMenuBar($menuBar);
     // create default status bar to start with
     $this->DoCreateStatusBar(self::StatBar_Default, wxSTB_DEFAULT_STYLE);
     $this->SetStatusText("Welcome to wxWidgets!");
     $this->Connect(StatusBar_Quit, wxEVT_COMMAND_MENU_SELECTED, array($this, 'OnQuit'));
     $this->Connect(StatusBar_SetFields, wxEVT_COMMAND_MENU_SELECTED, array($this, 'OnSetStatusFields'));
     $this->Connect(StatusBar_SetField, wxEVT_COMMAND_MENU_SELECTED, array($this, 'OnSetStatusField'));
     $this->Connect(StatusBar_SetText, wxEVT_COMMAND_MENU_SELECTED, array($this, 'OnSetStatusText'));
     $this->Connect(StatusBar_PushText, wxEVT_COMMAND_MENU_SELECTED, array($this, 'OnPushStatusText'));
     $this->Connect(StatusBar_PopText, wxEVT_COMMAND_MENU_SELECTED, array($this, 'OnPopStatusText'));
     $this->Connect(StatusBar_SetFont, wxEVT_COMMAND_MENU_SELECTED, array($this, 'OnSetStatusFont'));
     $this->Connect(StatusBar_ResetFieldsWidth, wxEVT_COMMAND_MENU_SELECTED, array($this, 'OnResetFieldsWidth'));
     $this->Connect(StatusBar_ShowFieldsRect, wxEVT_COMMAND_MENU_SELECTED, array($this, 'OnShowFieldsRect'));
     $this->Connect(StatusBar_Recreate, wxEVT_COMMAND_MENU_SELECTED, array($this, 'OnRecreateStatusBar'));
     $this->Connect(StatusBar_About, wxEVT_COMMAND_MENU_SELECTED, array($this, 'OnAbout'));
     $this->Connect(StatusBar_Toggle, wxEVT_COMMAND_MENU_SELECTED, array($this, 'OnStatusBarToggle'));
     $this->Connect(StatusBar_SetPaneStyleNormal, wxEVT_COMMAND_MENU_SELECTED, array($this, 'OnSetPaneStyle'));
     $this->Connect(StatusBar_SetPaneStyleFlat, wxEVT_COMMAND_MENU_SELECTED, array($this, 'OnSetPaneStyle'));
     $this->Connect(StatusBar_SetPaneStyleRaised, wxEVT_COMMAND_MENU_SELECTED, array($this, 'OnSetPaneStyle'));
     $this->Connect(StatusBar_SetStyleSizeGrip, wxEVT_COMMAND_MENU_SELECTED, array($this, 'OnSetStyle'));
     $this->Connect(StatusBar_SetStyleEllipsizeStart, wxEVT_COMMAND_MENU_SELECTED, array($this, 'OnSetStyle'));
     $this->Connect(StatusBar_SetStyleEllipsizeMiddle, wxEVT_COMMAND_MENU_SELECTED, array($this, 'OnSetStyle'));
     $this->Connect(StatusBar_SetStyleEllipsizeEnd, wxEVT_COMMAND_MENU_SELECTED, array($this, 'OnSetStyle'));
     $this->Connect(StatusBar_SetStyleShowTips, wxEVT_COMMAND_MENU_SELECTED, array($this, 'OnSetStyle'));
     $this->Connect(StatusBar_SetFields, StatusBar_ResetFieldsWidth, wxEVT_UPDATE_UI, array($this, 'OnUpdateForDefaultStatusbar'));
     $this->Connect(StatusBar_Toggle, wxEVT_UPDATE_UI, array($this, "OnUpdateStatusBarToggle"));
     $this->Connect(StatusBar_SetPaneStyleNormal, StatusBar_SetPaneStyleRaised, wxEVT_UPDATE_UI, array($this, 'OnUpdateSetPaneStyle'));
     $this->Connect(StatusBar_SetStyleSizeGrip, StatusBar_SetStyleShowTips, wxEVT_UPDATE_UI, array($this, 'OnUpdateSetStyle'));
 }
Пример #6
0
 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"));
 }