use proper APIs for activate/deactivate
This commit is contained in:
parent
622087a3ed
commit
a73f78b6ec
|
@ -65,7 +65,10 @@ class ControlWidget(Wbase.ClickableWidget):
|
||||||
def activate(self, onoff):
|
def activate(self, onoff):
|
||||||
self._activated = onoff
|
self._activated = onoff
|
||||||
if self._enabled:
|
if self._enabled:
|
||||||
self._control.HiliteControl((not onoff) and 255)
|
if onoff:
|
||||||
|
self._control.ActivateControl()
|
||||||
|
else:
|
||||||
|
self._control.DeactivateControl()
|
||||||
|
|
||||||
def draw(self, visRgn = None):
|
def draw(self, visRgn = None):
|
||||||
if self._visible:
|
if self._visible:
|
||||||
|
@ -105,7 +108,7 @@ class Button(ControlWidget):
|
||||||
if not self._enabled:
|
if not self._enabled:
|
||||||
return
|
return
|
||||||
import time
|
import time
|
||||||
self._control.HiliteControl(1)
|
self._control.HiliteControl(Controls.kControlButtonPart)
|
||||||
time.sleep(0.1)
|
time.sleep(0.1)
|
||||||
self._control.HiliteControl(0)
|
self._control.HiliteControl(0)
|
||||||
if self._callback:
|
if self._callback:
|
||||||
|
@ -116,11 +119,6 @@ class Button(ControlWidget):
|
||||||
self._control.HiliteControl((not onoff) and 255)
|
self._control.HiliteControl((not onoff) and 255)
|
||||||
self._enabled = onoff
|
self._enabled = onoff
|
||||||
|
|
||||||
def activate(self, onoff):
|
|
||||||
self._activated = onoff
|
|
||||||
if self._enabled:
|
|
||||||
self._control.HiliteControl((not onoff) and 255)
|
|
||||||
|
|
||||||
def show(self, onoff):
|
def show(self, onoff):
|
||||||
ControlWidget.show(self, onoff)
|
ControlWidget.show(self, onoff)
|
||||||
|
|
||||||
|
@ -332,16 +330,6 @@ class Scrollbar(ControlWidget):
|
||||||
Qd.FrameRect(self._bounds)
|
Qd.FrameRect(self._bounds)
|
||||||
self.GetWindow().ValidWindowRect(self._bounds)
|
self.GetWindow().ValidWindowRect(self._bounds)
|
||||||
|
|
||||||
def activate(self, onoff):
|
|
||||||
self._activated = onoff
|
|
||||||
if self._visible:
|
|
||||||
if onoff:
|
|
||||||
self._control.ShowControl()
|
|
||||||
else:
|
|
||||||
self._control.HideControl()
|
|
||||||
self.draw(None)
|
|
||||||
self.GetWindow().ValidWindowRect(self._bounds)
|
|
||||||
|
|
||||||
def set(self, value):
|
def set(self, value):
|
||||||
if self._control:
|
if self._control:
|
||||||
self._control.SetControlValue(value)
|
self._control.SetControlValue(value)
|
||||||
|
|
Loading…
Reference in New Issue