commit-gnue
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

gnue designer/src/navigator/Instance.py designe...


From: Jason Cater
Subject: gnue designer/src/navigator/Instance.py designe...
Date: Tue, 22 Jan 2002 18:16:05 -0500

CVSROOT:        /cvsroot/gnue
Module name:    gnue
Changes by:     Jason Cater <address@hidden>    02/01/22 18:16:05

Modified files:
        designer/src/navigator: Instance.py LayoutEditor.py 
        forms/src      : UIwxpython.py 

Log message:
        convenience attributes for layout font

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue/designer/src/navigator/Instance.py.diff?tr1=1.3&tr2=1.4&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue/designer/src/navigator/LayoutEditor.py.diff?tr1=1.1&tr2=1.2&r1=text&r2=text
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/gnue/forms/src/UIwxpython.py.diff?tr1=1.129&tr2=1.130&r1=text&r2=text

Patches:
Index: gnue/designer/src/navigator/Instance.py
diff -c gnue/designer/src/navigator/Instance.py:1.3 
gnue/designer/src/navigator/Instance.py:1.4
*** gnue/designer/src/navigator/Instance.py:1.3 Tue Jan 22 14:19:15 2002
--- gnue/designer/src/navigator/Instance.py     Tue Jan 22 18:16:04 2002
***************
*** 68,74 ****
  
  
    def createVisualEditor(self):
!     return LayoutEditor(self, self)
  
  
    def addTools(self):
--- 68,74 ----
  
  
    def createVisualEditor(self):
!     return LayoutEditor(self, self.rootObject, self)
  
  
    def addTools(self):
Index: gnue/designer/src/navigator/LayoutEditor.py
diff -c gnue/designer/src/navigator/LayoutEditor.py:1.1 
gnue/designer/src/navigator/LayoutEditor.py:1.2
*** gnue/designer/src/navigator/LayoutEditor.py:1.1     Tue Jan 22 14:15:30 2002
--- gnue/designer/src/navigator/LayoutEditor.py Tue Jan 22 18:16:04 2002
***************
*** 33,42 ****
  
  class LayoutEditor (wxPanel):
  
!   def __init__(self, instance, parentWindow):
      wxPanel.__init__(self,parentWindow,-1)
! 
      
    def onSetCurrentObject (self, object, handler):
      if object == None:
        return
--- 33,52 ----
  
  class LayoutEditor (wxPanel):
  
!   def __init__(self, instance, rootObject, parentWindow):
      wxPanel.__init__(self,parentWindow,-1)
!     self.instance = instance
!     self.rootObject = rootObject
!     self.frame = parentWindow
      
+ 
+     rootObject.walk(self.inventoryObject)
+ 
+ 
+   def inventoryObject(self, object):
+     pass
+ 
+ 
    def onSetCurrentObject (self, object, handler):
      if object == None:
        return
Index: gnue/forms/src/UIwxpython.py
diff -c gnue/forms/src/UIwxpython.py:1.129 gnue/forms/src/UIwxpython.py:1.130
*** gnue/forms/src/UIwxpython.py:1.129  Sat Jan 19 16:43:24 2002
--- gnue/forms/src/UIwxpython.py        Tue Jan 22 18:16:04 2002
***************
*** 75,84 ****
  #
  # Little global helper routine to set font according to options
  #
! def initFont(widget):
!   if int(GConfig.get('fixedWidthFont')):
      
widget.SetFont(wxFont(int(GConfig.get('pointSize')),wxMODERN,wxNORMAL,wxNORMAL))
  
  # Helps out with layout
  def getLargest(val1, val2):
    if val1 > val2:
--- 75,101 ----
  #
  # Little global helper routine to set font according to options
  #
! def initFont(widget, affectsLayout=1):
! 
!   if not (affectsLayout or (not affectsLayout and \
!           int(GConfig.get('fixedWidthEntries','1')))):
!     return
! 
!   face = GConfig.get('fontface',None)
! 
!   if face != None:
!     if string.lower(GConfig.get('fontweight',None)) == 'bold':
!       weight = wxBOLD
!     else:
!       weight = wxNORMAL
! 
!     widget.SetFont(wxFont(int(GConfig.get('PointSize')),wxMODERN,
!           wxNORMAL,weight, faceName=face))
! 
!   elif int(GConfig.get('fixedWidthFont')):
      
widget.SetFont(wxFont(int(GConfig.get('pointSize')),wxMODERN,wxNORMAL,wxNORMAL))
  
+ 
  # Helps out with layout
  def getLargest(val1, val2):
    if val1 > val2:
***************
*** 215,221 ****
      #
      self.mainWindow = wxFrame(NULL, -1, "", wxDefaultPosition)
  
!     initFont(self.mainWindow)
  
      maxWidth, maxHeight, maxDescent, maxLeading = [0,0,0,0]
  
--- 232,238 ----
      #
      self.mainWindow = wxFrame(NULL, -1, "", wxDefaultPosition)
  
!     initFont(self.mainWindow,1)
  
      maxWidth, maxHeight, maxDescent, maxLeading = [0,0,0,0]
  
***************
*** 244,251 ****
      self.statusBar = self.mainWindow.CreateStatusBar()
      self.statusBar.SetFieldsCount(5)
      self.statusBar.SetStatusWidths([-1,50,50,75,75])
!     initFont(self.statusBar)
!     
      self.mainWindow.SetStatusText( "Let's get started" )
  
      fileMenu = wxMenu()
--- 261,268 ----
      self.statusBar = self.mainWindow.CreateStatusBar()
      self.statusBar.SetFieldsCount(5)
      self.statusBar.SetStatusWidths([-1,50,50,75,75])
!     initFont(self.statusBar,0)
! 
      self.mainWindow.SetStatusText( "Let's get started" )
  
      fileMenu = wxMenu()
***************
*** 754,760 ****
                             
wxPoint(int(object.x)*int(widgetWidth),(int(object.y)+spacer)*int(widgetHeight)),
                             
wxSize(int(object.width)*int(widgetWidth),int(object.height)*int(widgetHeight)),
                             wxSB_VERTICAL)
!     initFont(newWidget)
      return newWidget
  #
  # UIButton
--- 771,777 ----
                             
wxPoint(int(object.x)*int(widgetWidth),(int(object.y)+spacer)*int(widgetHeight)),
                             
wxSize(int(object.width)*int(widgetWidth),int(object.height)*int(widgetHeight)),
                             wxSB_VERTICAL)
!     initFont(newWidget,0)
      return newWidget
  #
  # UIButton
***************
*** 768,775 ****
                           
wxSize(int(object.width)*int(widgetWidth),int(object.height)*int(widgetHeight))
                           )
  
!     initFont(newWidget)
!     if initialize: 
        EVT_BUTTON(newWidget,newWidget.GetId(),interface.uiEventTrap)
      return newWidget
  
--- 785,792 ----
                           
wxSize(int(object.width)*int(widgetWidth),int(object.height)*int(widgetHeight))
                           )
  
!     initFont(newWidget,0)
!     if initialize:
        EVT_BUTTON(newWidget,newWidget.GetId(),interface.uiEventTrap)
      return newWidget
  
***************
*** 790,796 ****
                              
      if initialize: 
        EVT_CHAR(newWidget, interface.uiEventTrap)
!     initFont(newWidget)
      interface._pageList.append(newWidget)
      return newWidget
  
--- 807,813 ----
                              
      if initialize: 
        EVT_CHAR(newWidget, interface.uiEventTrap)
!     initFont(newWidget,0)
      interface._pageList.append(newWidget)
      return newWidget
  
***************
*** 875,881 ****
          EVT_CHAR(newWidget, interface.uiEventTrap)
          EVT_MOUSE_EVENTS(newWidget, interface.uiEventTrap)
  
!     initFont(newWidget)
      return newWidget
  
  #
--- 892,898 ----
          EVT_CHAR(newWidget, interface.uiEventTrap)
          EVT_MOUSE_EVENTS(newWidget, interface.uiEventTrap)
  
!     initFont(newWidget, 0)
      return newWidget
  
  #



reply via email to

[Prev in Thread] Current Thread [Next in Thread]