commit-gnue
[Top][All Lists]
Advanced

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

gnue/forms/src UIwxpython.py


From: Jason Cater
Subject: gnue/forms/src UIwxpython.py
Date: Wed, 16 Jan 2002 02:05:16 -0500

CVSROOT:        /home/cvs
Module name:    gnue
Changes by:     Jason Cater <address@hidden>    02/01/16 02:05:16

Modified files:
        forms/src      : UIwxpython.py 

Log message:
        synching machines

CVSWeb URLs:
http://savannah.gnu.org/cgi-bin/viewcvs/gnue/forms/src/UIwxpython.py.diff?cvsroot=OldCVS&tr1=1.126&tr2=1.127&r1=text&r2=text

Patches:
Index: gnue/forms/src/UIwxpython.py
diff -c gnue/forms/src/UIwxpython.py:1.126 gnue/forms/src/UIwxpython.py:1.127
*** gnue/forms/src/UIwxpython.py:1.126  Wed Jan 16 00:33:29 2002
--- gnue/forms/src/UIwxpython.py        Wed Jan 16 02:05:15 2002
***************
*** 1,19 ****
  #
  # This file is part of GNU Enterprise.
  #
! # GNU Enterprise is free software; you can redistribute it 
! # and/or modify it under the terms of the GNU General Public 
! # License as published by the Free Software Foundation; either 
  # version 2, or (at your option) any later version.
  #
! # GNU Enterprise is distributed in the hope that it will be 
! # useful, but WITHOUT ANY WARRANTY; without even the implied 
! # warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
  # PURPOSE. See the GNU General Public License for more details.
  #
! # You should have received a copy of the GNU General Public 
! # License along with program; see the file COPYING. If not, 
! # write to the Free Software Foundation, Inc., 59 Temple Place 
  # - Suite 330, Boston, MA 02111-1307, USA.
  #
  # Copyright 2000, 2001 Free Software Foundation
--- 1,19 ----
  #
  # This file is part of GNU Enterprise.
  #
! # GNU Enterprise is free software; you can redistribute it
! # and/or modify it under the terms of the GNU General Public
! # License as published by the Free Software Foundation; either
  # version 2, or (at your option) any later version.
  #
! # GNU Enterprise is distributed in the hope that it will be
! # useful, but WITHOUT ANY WARRANTY; without even the implied
! # warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
  # PURPOSE. See the GNU General Public License for more details.
  #
! # You should have received a copy of the GNU General Public
! # License along with program; see the file COPYING. If not,
! # write to the Free Software Foundation, Inc., 59 Temple Place
  # - Suite 330, Boston, MA 02111-1307, USA.
  #
  # Copyright 2000, 2001 Free Software Foundation
***************
*** 25,31 ****
  # A wxPython based user interface for GNUE forms.
  #
  # NOTES:
! #  
  
  from wxPython.wx import *
  from wxPython.lib.splashscreen import SplashScreen
--- 25,31 ----
  # A wxPython based user interface for GNUE forms.
  #
  # NOTES:
! #
  
  from wxPython.wx import *
  from wxPython.lib.splashscreen import SplashScreen
***************
*** 149,155 ****
    #
    # mainLoop
    #
!   # The primary loop of the user interface.  Called once the UI is 
    # fully activated
    #
    def mainLoop(self):
--- 149,155 ----
    #
    # mainLoop
    #
!   # The primary loop of the user interface.  Called once the UI is
    # fully activated
    #
    def mainLoop(self):
***************
*** 168,181 ****
    # It is used the build the basic UI
    #
    def init(self):
!     
      #
      # SplashScreen
!     # 
      if not self._disableSplash:
        self.splash = 
SplashScreen(None,bitmapfile=os.environ['INSTALL_PREFIX']+'/'+GConfig.get('splashScreenPNG'),
                                   # duration=65535, callback=self.onMain,
!                                  duration = 4000, 
callback=self.onCloseSplash, 
                                   style=wxSIMPLE_BORDER|wxCENTRE_ON_SCREEN )
        swidth,sheight = self.splash.GetSizeTuple()
  
--- 168,181 ----
    # It is used the build the basic UI
    #
    def init(self):
! 
      #
      # SplashScreen
!     #
      if not self._disableSplash:
        self.splash = 
SplashScreen(None,bitmapfile=os.environ['INSTALL_PREFIX']+'/'+GConfig.get('splashScreenPNG'),
                                   # duration=65535, callback=self.onMain,
!                                  duration = 4000, callback=self.onCloseSplash,
                                   style=wxSIMPLE_BORDER|wxCENTRE_ON_SCREEN )
        swidth,sheight = self.splash.GetSizeTuple()
  
***************
*** 212,225 ****
      # Create the main window
      #
      self.mainWindow = wxFrame(NULL, -1, "", wxDefaultPosition)
!     
      initFont(self.mainWindow)
  
      maxWidth, maxHeight, maxDescent, maxLeading = [0,0,0,0]
  
      # need to add string.punctionation if we dump python 1.5.2
      checkchars = string.letters+string.digits+"-\|"
!     for letter in checkchars:   
        width,height,descent,leading = self.mainWindow.GetFullTextExtent(letter)
        maxWidth = maxWidth > width and maxWidth or width
        maxHeight = maxHeight > height and maxHeight or height
--- 212,225 ----
      # Create the main window
      #
      self.mainWindow = wxFrame(NULL, -1, "", wxDefaultPosition)
! 
      initFont(self.mainWindow)
  
      maxWidth, maxHeight, maxDescent, maxLeading = [0,0,0,0]
  
      # need to add string.punctionation if we dump python 1.5.2
      checkchars = string.letters+string.digits+"-\|"
!     for letter in checkchars:
        width,height,descent,leading = self.mainWindow.GetFullTextExtent(letter)
        maxWidth = maxWidth > width and maxWidth or width
        maxHeight = maxHeight > height and maxHeight or height
***************
*** 257,263 ****
      fileMenu.AppendSeparator()
      fileMenu.Append( 101, "E&xit",GConfig.get('msg_exit'))
      EVT_MENU(self._wxapp, 101,  self.menuExitEvent)
!      
      dataMenu = wxMenu()
      dataMenu.Append( 201, "Next Record             
(Up)",GConfig.get('msg_next'))
      EVT_MENU(self._wxapp, 201, lambda event, l=self: 
l.dispatchEvent(GFEvent('requestNEXTRECORD')))
--- 257,263 ----
      fileMenu.AppendSeparator()
      fileMenu.Append( 101, "E&xit",GConfig.get('msg_exit'))
      EVT_MENU(self._wxapp, 101,  self.menuExitEvent)
! 
      dataMenu = wxMenu()
      dataMenu.Append( 201, "Next Record             
(Up)",GConfig.get('msg_next'))
      EVT_MENU(self._wxapp, 201, lambda event, l=self: 
l.dispatchEvent(GFEvent('requestNEXTRECORD')))
***************
*** 369,375 ****
    # Called in UIbase functions to perform UI interaction with this specific
    # widget set.
    #
!    
    #
    # _exit
    #
--- 369,375 ----
    # Called in UIbase functions to perform UI interaction with this specific
    # widget set.
    #
! 
    #
    # _exit
    #
***************
*** 416,422 ****
      if insertWidth == 0:      insertWidth = 5
      if recordWidth == 0:      recordWidth = 5
      if pageWidth == 0:        pageWidth = 5
!       
      
self.statusBar.SetStatusWidths([tipWidth,statusWidth,insertWidth,recordWidth,pageWidth])
      
    
#############################################################################
--- 416,422 ----
      if insertWidth == 0:      insertWidth = 5
      if recordWidth == 0:      recordWidth = 5
      if pageWidth == 0:        pageWidth = 5
! 
      
self.statusBar.SetStatusWidths([tipWidth,statusWidth,insertWidth,recordWidth,pageWidth])
      
    
#############################################################################
***************
*** 459,465 ****
    def formAlert(self, event):
      wxBell()
      self.statusBar.SetStatusText(event.data,0)
!   
    
#############################################################################
    #
    # Internal Event Processors
--- 459,465 ----
    def formAlert(self, event):
      wxBell()
      self.statusBar.SetStatusText(event.data,0)
! 
    
#############################################################################
    #
    # Internal Event Processors
***************
*** 470,476 ****
    #
    # menuExitEvent
    #
!   # Catches the Exit event from the menu and make sure it closes in such a 
way to 
    # trigger the closeTrap method
    #
    def menuExitEvent(self, event):
--- 470,476 ----
    #
    # menuExitEvent
    #
!   # Catches the Exit event from the menu and make sure it closes in such a 
way to
    # trigger the closeTrap method
    #
    def menuExitEvent(self, event):
***************
*** 495,501 ****
    # intercepts the applications closure and generates an event to the form 
requesting
    # closure.  Allows the form to control closure.  If the form approves it'll 
send
    # back an event closing the application
!   #
    def closeTrap(self,event):
      # hack for swig shortcomming
      eo = event.GetEventObject()
--- 495,501 ----
    # intercepts the applications closure and generates an event to the form 
requesting
    # closure.  Allows the form to control closure.  If the form approves it'll 
send
    # back an event closing the application
!   #`
    def closeTrap(self,event):
      # hack for swig shortcomming
      eo = event.GetEventObject()
***************
*** 516,522 ****
      #
      # KeyBoard Events
      #
!     if event.GetEventType() in (wxEVT_CHAR,wxEVT_KEY_UP):
        if event.ShiftDown() == TRUE and event.KeyCode() == WXK_TAB:
          action = GFEvent('requestPREVENTRY')
        else:
--- 516,522 ----
      #
      # KeyBoard Events
      #
!     if event.GetEventType() == wxEVT_CHAR:
        if event.ShiftDown() == TRUE and event.KeyCode() == WXK_TAB:
          action = GFEvent('requestPREVENTRY')
        else:
***************
*** 653,659 ****
    def beginWait (self, event):
      wxBeginBusyCursor()
  
!   # Called whenever forms leaves a "wait" state 
    def endWait (self, event): 
      wxEndBusyCursor()
  
--- 653,659 ----
    def beginWait (self, event):
      wxBeginBusyCursor()
  
!   # Called whenever forms leaves a "wait" state
    def endWait (self, event): 
      wxEndBusyCursor()
  
***************
*** 739,745 ****
                                     (int(object.height)-1)*int(widgetHeight)))
      initFont(newWidget)
      return newWidget
!               
  #
  # UIScrollBar
  #
--- 739,745 ----
                                     (int(object.height)-1)*int(widgetHeight)))
      initFont(newWidget)
      return newWidget
! 
  #
  # UIScrollBar
  #
***************
*** 751,757 ****
      newWidget =wxScrollBar(container,-1,
                             
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
  #
--- 751,757 ----
      newWidget =wxScrollBar(container,-1,
                             
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
  #
***************
*** 765,771 ****
                           
wxPoint(int(object.x)*int(widgetWidth),(int(object.y)+spacer)*int(widgetHeight)),
                           
wxSize(int(object.width)*int(widgetWidth),int(object.height)*int(widgetHeight))
                           )
!     
      initFont(newWidget)
      if initialize: 
        EVT_BUTTON(newWidget,newWidget.GetId(),interface.uiEventTrap)
--- 765,771 ----
                           
wxPoint(int(object.x)*int(widgetWidth),(int(object.y)+spacer)*int(widgetHeight)),
                           
wxSize(int(object.width)*int(widgetWidth),int(object.height)*int(widgetHeight))
                           )
! 
      initFont(newWidget)
      if initialize: 
        EVT_BUTTON(newWidget,newWidget.GetId(),interface.uiEventTrap)
***************
*** 817,827 ****
                                       
(int(object.y)+spacer+(object._gap*spacer))*int(widgetHeight)),
                               wxSize(int(object.width)*int(textWidth),
                                      int(object.height)*int(textHeight)),
!                              choices, wxCB_DROPDOWN)
        newWidget.SetValue("")
  
        if initialize:
-         EVT_KEY_UP (newWidget, interface.uiEventTrap)
          EVT_CHAR(newWidget, interface.uiEventTrap)
          EVT_COMBOBOX(newWidget, newWidget.GetId(), interface.uiEventTrap)
      elif style == 'label':
--- 817,828 ----
                                       
(int(object.y)+spacer+(object._gap*spacer))*int(widgetHeight)),
                               wxSize(int(object.width)*int(textWidth),
                                      int(object.height)*int(textHeight)),
!                              choices, wxCB_DROPDOWN|wxWANTS_CHARS,
! #                             validator=MyComboBoxValidator()
!                             )
        newWidget.SetValue("")
  
        if initialize:
          EVT_CHAR(newWidget, interface.uiEventTrap)
          EVT_COMBOBOX(newWidget, newWidget.GetId(), interface.uiEventTrap)
      elif style == 'label':
***************
*** 1129,1134 ****
--- 1130,1161 ----
    #
    def destroyLoginDialog(self):
      self.dlg.Destroy()
+ 
+ 
+ 
+ class MyComboBoxValidator(wxPyValidator):
+ 
+   def __init__(self):
+     wxPyValidator.__init__(self)
+     EVT_CHAR(self, self.OnChar)
+     EVT_KEY_DOWN(self, self.OnKeyDown)
+     EVT_KEY_UP(self, self.OnKeyUp)
+ 
+   def Clone(self):
+     return MyComboBoxValidator()
+ 
+   def Validate(self, win):
+     return 1
+ 
+   def OnChar(self, event):
+     print "OnChar called %s" % event.KeyCode()
+ 
+   def OnKeyUp(self, event):
+     print "OnKeyDown called %s" % event.KeyCode()
+ 
+   def OnKeyDown(self, event):
+     print "OnKeyDown called %s" % event.KeyCode()
+ 
  
  
  WIDGETS = {'GFLabel'     : UILabel,



reply via email to

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