Ejemplo n.º 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"));
 }
Ejemplo n.º 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"));
 }
Ejemplo n.º 3
0
 function onPeerRightClick($event)
 {
     $menu = new wxMenu();
     $menu->Append(15, "Send File");
     $this->m_usersList->PopupMenu($menu);
 }
Ejemplo n.º 4
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"));
 }
Ejemplo n.º 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'));
 }