Exemple #1
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"));
 }
Exemple #2
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"));
 }