예제 #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
파일: controller.php 프로젝트: halfer/wxphp
 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);
 }