16 |
# write to the Free Software Foundation, Inc., 59 Temple Place |
# write to the Free Software Foundation, Inc., 59 Temple Place |
17 |
# - Suite 330, Boston, MA 02111-1307, USA. |
# - Suite 330, Boston, MA 02111-1307, USA. |
18 |
# |
# |
19 |
# Copyright 2002 Free Software Foundation |
# Copyright 2002-2003 Free Software Foundation |
20 |
# |
# |
21 |
# FILE: |
# FILE: |
22 |
# Control.py |
# Control.py |
35 |
apply (GraphicObject.__init__, (self, Parent.SCREEN), |
apply (GraphicObject.__init__, (self, Parent.SCREEN), |
36 |
properties) |
properties) |
37 |
self.NAME = CName |
self.NAME = CName |
38 |
self.FOCUSCOLOR = 2 |
self.SetColor('DIALOG','BACKGROUND') |
|
self.COLOR = 1 |
|
39 |
self.X = -1 |
self.X = -1 |
40 |
self.Y = -1 |
self.Y = -1 |
41 |
self.VISIBLE = 1 |
self.VISIBLE = 1 |
49 |
self.Methods["LOSTFOCUS"] = None |
self.Methods["LOSTFOCUS"] = None |
50 |
self.Methods["ACTION"] = None |
self.Methods["ACTION"] = None |
51 |
|
|
52 |
def DetermineAndSetColor(self, HasFocus): |
## def DetermineAndSetColor(self, HasFocus): |
53 |
if self.active: |
## if self.active: |
54 |
if HasFocus : |
## if HasFocus : |
55 |
self.SetColor(self.FOCUSCOLOR) |
## self.SetColor(self.FOCUSCOLOR) |
56 |
else: |
## else: |
57 |
self.SetColor(self.COLOR) |
## self.SetColor(self.COLOR) |
58 |
else: |
## else: |
59 |
pass |
## pass |
60 |
##self.SetColor(4) |
## ##self.SetColor(4) |
61 |
|
|
62 |
def CreateProperty(self, Property, Value): |
def CreateProperty(self, Property, Value): |
63 |
self.__dict__[Property] = Value |
self.__dict__[Property] = Value |
83 |
|
|
84 |
def DeActivate(self, state): |
def DeActivate(self, state): |
85 |
if self.active != state: |
if self.active != state: |
|
if state : |
|
|
self.SetColor(self.PRIOR_COLOR) |
|
|
else: |
|
|
self.PRIOR_COLOR = self.LOLIGHT_COLOR |
|
|
self.SetColor(4) |
|
|
self.LoLight() |
|
86 |
self.active = state |
self.active = state |
87 |
self.Paint(0,0,0) |
self.Paint(0,0,0) |
88 |
self.ExecMethod("REFRESH",None,None,None) |
self.ExecMethod("REFRESH",None,None,None) |
89 |
|
|
90 |
|
|
91 |
def SetActiveState( self, state): |
def SetActiveState( self, state): |
|
"""Wrapper for DeActivate -- which is non-intuitively named :)""" |
|
92 |
self.DeActivate( state) |
self.DeActivate( state) |
93 |
|
|
94 |
|
|