/[papo]/gnue/common/src/cursing/Button.py
ViewVC logotype

Diff of /gnue/common/src/cursing/Button.py

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1 by styxman, Fri Nov 15 15:32:55 2002 UTC revision 1.1.2.1 by anthonyl, Tue Mar 4 22:09:33 2003 UTC
# Line 16  Line 16 
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  # Button.py  # Button.py
# Line 29  Line 29 
29  from gnue.common import GDebug  from gnue.common import GDebug
30  from constants import *  from constants import *
31  from Control import Control  from Control import Control
32    import curses
33  import sio  import sio
34    
35  #  #
# Line 54  class Button(Control): Line 55  class Button(Control):
55      self.SetMethod("GOTFOCUS", None)  # user event      self.SetMethod("GOTFOCUS", None)  # user event
56      self.SetMethod("SYSRUN", self.Run)  # system event      self.SetMethod("SYSRUN", self.Run)  # system event
57      self.EXITFORM = 0      self.EXITFORM = 0
58      self.COLOR = sio.C_BUTTON      self.SetColor('BUTTON','BUTTON_FOCUS')
     self.FOCUSCOLOR = sio.C_BUTTON_FOCUS  
 #    self.SetColor(sio.C_BUTTON)  
59    
60    
61    def Run(self, v1, v2, v3):    # handle user actions    def Run(self, v1, v2, v3):    # handle user actions
# Line 101  class Button(Control): Line 100  class Button(Control):
100      if Container == None:      if Container == None:
101        raise "No container!"        raise "No container!"
102      if HaveFocus:      if HaveFocus:
103        self.SetColor(sio.C_BUTTON_FOCUS)        color = self.FOCUSCOLOR
       self.HiLight()  
104      else:      else:
105        self.SetColor(sio.C_BUTTON)        color = self.COLOR
       self.LoLight()  
106      tROW, tCOL = self._ABSY, self._ABSX      tROW, tCOL = self._ABSY, self._ABSX
107      tCaption = self.CAPTION      tCaption = self.CAPTION
108      tW = self.W      tW = self.W
# Line 124  class Button(Control): Line 121  class Button(Control):
121          spaces += 1          spaces += 1
122    
123        tCaption = (" " * leadingSpaces) + tCaption + (" " * spaces)        tCaption = (" " * leadingSpaces) + tCaption + (" " * spaces)
124      Container.PrintAt(tROW, tCOL, "<" + tCaption + ">")      Container.PrintAt(tROW, tCOL, "<" + tCaption + ">", color)
125    
126    def GotFocus(self, Arg1, Arg2, Arg3):    def GotFocus(self, Arg1, Arg2, Arg3):
127      self.FOCUS = 1      self.FOCUS = 1

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.1.2.1

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26