示例#1
0
文件: main.php 项目: halfer/wxphp
 public function OnInit()
 {
     $resource = new wxXmlResource();
     $resource->InitAllHandlers();
     $resource->Load(__DIR__ . '/forms.xrc.xml');
     $frame = new resourceDemoDialog();
     $resource->LoadDialog($frame, NULL, 'frmOne');
     // Re-wrap and re-fit the text control - this gets the correct amount of vertical
     // size for the wrapped text and its borders
     $textCtrl = wxDynamicCast($frame->FindWindow('staticHelp'), "wxStaticText");
     $textCtrl->Wrap(460);
     $frame->Show();
     $frame->Fit();
 }
示例#2
0
 function OnInit()
 {
     global $mf;
     $mf = new mainFrame();
     $value = wxMessageBox("Show the frame?", "", wxYES_NO, $mf);
     if ($value == wxYES) {
         $mf->Show();
         $mf->Centre();
         //Static Method Call Test
         $window = wxWindow::FindWindowById(10);
         //Dynamic cast test
         $window = wxDynamicCast($window, "wxFrame");
         print $window->GetTitle() . "\n";
     } else {
         $mf->Close();
     }
     return 0;
 }
示例#3
0
文件: manager.php 项目: halfer/wxphp
 /**
  * Forced *Hint items to be mutually exclusive
  */
 protected function resetManagerMutExChoices(wxEvent $event)
 {
     // Is the control one of the affected mutually-exclusive choices?
     $ctrl = wxDynamicCast($event->GetEventObject(), "wxCheckBox");
     /* @var $ctrl wxCheckBox */
     $hintNames = ['tickTransHint', 'tickVenetianHint', 'tickRectangleHint'];
     if (!in_array($ctrl->GetName(), $hintNames)) {
         return;
     }
     // Only proceed if the control is ticked
     if (!$ctrl->GetValue()) {
         return;
     }
     // Deselect the others
     foreach ($hintNames as $controlName) {
         if ($controlName != $ctrl->GetName()) {
             $this->setTickBoxValue($controlName, false);
         }
     }
 }
示例#4
0
 protected function setTickBoxValue($controlName, $ticked)
 {
     // Find the control
     $window = $this->FindWindow($controlName);
     if ($window) {
         $ctrl = wxDynamicCast($window, "wxCheckBox");
         /* @var $ctrl \wxCheckBox */
         $ctrl->SetValue($ticked);
     }
 }
示例#5
0
文件: pane.php 项目: halfer/wxphp
 /**
  * Resets the pane tick boxes for the given pane
  *
  * @param integer $pane
  */
 protected function setPaneTickBoxValues($pane)
 {
     // Read the settings for the specified pane
     $paneInfo = $this->getManagedWindow()->getPaneSettings('auiPane' . $pane);
     // Use these methods to set the tickbox values
     foreach ($this->getPaneGetterMethods() as $controlName => $methodName) {
         $boolean = $paneInfo->{$methodName}();
         $this->setTickBoxValue($controlName, $boolean);
     }
     // Apply special rules at the start
     $ctrl = wxDynamicCast($this->FindWindow('tickGripper'), "wxCheckBox");
     $this->applySpecialRules($ctrl);
 }