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

Diff of /gnue/common/src/cursing/MenuBar.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  # MenuBar.py  # MenuBar.py
# Line 36  class MenuBar(Frame): Line 36  class MenuBar(Frame):
36    def __init__(self, Root, Y, X, W,  **properties):    def __init__(self, Root, Y, X, W,  **properties):
37      Frame.__init__(self, Root, Y, X, Y+1, X + W - 1,      Frame.__init__(self, Root, Y, X, Y+1, X + W - 1,
38                     border=0, dropshadow=0, **properties)                     border=0, dropshadow=0, **properties)
39        GDebug.printMesg(0,'WIDTH=%s' % W)
40      self.rootwin = Root      self.rootwin = Root
41      self.CANGETFOCUS = 0      self.CANGETFOCUS = 0
42      self.Y = Y      self.Y = Y
43      self.X = X      self.X = X
44      self.H = 2      self.H = 1
45      self.W = 0      self.W = W
46      self.STATUSBAR = None      self.STATUSBAR = None
47      self.STATUSBAR_INDEX = 0      self.STATUSBAR_INDEX = 0
48      self.Controls = []      self.Controls = []
49        self.SetColor('MENUBAR')
50        self.VISIBLE = 1
51    
52    def NewMenu(self,Name,Caption):    def NewMenu(self,Name,Caption):
53      newEntry = Menu(self.rootwin, Name, 0,0, Caption, self)      newEntry = Menu(self.rootwin, Name, 0,0, Caption, self)
# Line 52  class MenuBar(Frame): Line 55  class MenuBar(Frame):
55      return newEntry      return newEntry
56    
57    def SetStatusBar(self, statusbar, index=0):    def SetStatusBar(self, statusbar, index=0):
58        GDebug.printMesg(0,'SETTING STATUSBAR')
59      self.STATUSBAR = statusbar      self.STATUSBAR = statusbar
60      self.STATUSBAR_INDEX = index      self.STATUSBAR_INDEX = index
61    
62    def _AddMenu(self,menu):    def _AddMenu(self,menu):
63      newX = 0      newX = 1
64      if len(self.Controls) > 0:      if len(self.Controls) > 0:
65        newX  = self.Controls[-1:][0].X        newX  = self.Controls[-1:][0].X
66        newX += len(self.Controls[-1:][0].CAPTION) + 2        newX += len(self.Controls[-1:][0].CAPTION) + 2
# Line 66  class MenuBar(Frame): Line 70  class MenuBar(Frame):
70    
71      self.AddControl(menu)      self.AddControl(menu)
72    
73    #  def Paint(self, *args, **parms):
74    #    Container = self.PARENT.Screen()
75    #    color = self.COLOR
76    #    #Y = self._ABSY
77    #    #X = self._ABSX
78    #    Y = self.Y
79    #    X = self.X
80    #    caption = self.CAPTION
81    #    Container.PrintAt(Y,X," " * self.W, color)
82    
83    

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