CVS: anygui/lib/anygui/backends qtgui.py,1.24,1.25

"Dallas T. Johnston" <[email protected]> Sat, 16 Nov 2002 08:45:01 -0800
Newsgroups gmane.comp.python.anygui.cvs
Message-ID <[email protected]>
Update of /cvsroot/anygui/anygui/lib/anygui/backends
In directory usw-pr-cvs1:/tmp/cvs-serv9861/lib/anygui/backends

Modified Files:
	qtgui.py 
Log Message:
things are looking pretty good now.
i decided to just make the file selection ('open') a callback
via link & send. the client has to specify the link, of course.
we still need to figure out a way to fix tkinter's focus deal.




Index: qtgui.py
===================================================================
RCS file: /cvsroot/anygui/anygui/lib/anygui/backends/qtgui.py,v
retrieving revision 1.24
retrieving revision 1.25
diff -C2 -r1.24 -r1.25
*** qtgui.py	16 Nov 2002 12:41:11 -0000	1.24
--- qtgui.py	16 Nov 2002 16:44:59 -0000	1.25
***************
*** 12,16 ****
      from anygui.Menus import Menu, MenuCommand, MenuCheck, MenuSeparator
  
!     # qtgui specific imports        
      import sys
      from weakref import ref as wr
--- 12,16 ----
      from anygui.Menus import Menu, MenuCommand, MenuCheck, MenuSeparator
  
!     # qtgui specific imports
      import sys
      from weakref import ref as wr
***************
*** 166,170 ****
                  # Widget has no text.
                  return ""
!             
      def setupChildWidgets(self):
          pass
--- 166,170 ----
                  # Widget has no text.
                  return ""
! 
      def setupChildWidgets(self):
          pass
***************
*** 178,182 ****
      temp fix for some slight problems with PyQt.
      """
!     
      _comp = None
      _events = {}
--- 178,182 ----
      temp fix for some slight problems with PyQt.
      """
! 
      _comp = None
      _events = {}
***************
*** 272,278 ****
  class ButtonWrapper(ButtonWrapperBase):
  
-     def __init__(self, *args, **kws):
-         ButtonWrapperBase.__init__(self, *args, **kws)
- 
      def widgetFactory(self, *args, **kwds):
          return QPushButton(*args, **kwds)
--- 272,275 ----
***************
*** 283,289 ****
  class ToggleButtonWrapperBase(ButtonWrapperBase):
  
-     def __init__(self, *args, **kws):
-         ButtonWrapperBase.__init__(self, *args, **kws)
- 
      def setOn(self, on):
          if self.widget:
--- 280,283 ----
***************
*** 299,305 ****
  class CheckBoxWrapper(ToggleButtonWrapperBase):
  
-     def __init__(self, *args, **kws):
-         ToggleButtonWrapperBase.__init__(self, *args, **kws)
- 
      def widgetFactory(self, *args, **kwds):
          return QCheckBox(*args, **kwds)
--- 293,296 ----
***************
*** 311,317 ****
      groupMap = {}
  
-     def __init__(self, *args, **kws):
-         ComponentWrapper.__init__(self, *args, **kws)
- 
      def widgetFactory(self, *args, **kwds):
          return QRadioButton(*args, **kwds)
--- 302,305 ----
***************
*** 343,349 ****
      connected = 0
  
-     def __init__(self, *args, **kws):
-         ComponentWrapper.__init__(self, *args, **kws)
- 
      def widgetSetUp(self):
          if not self.connected:
--- 331,334 ----
***************
*** 366,370 ****
          self.proxy.pull('text')
          if int(event.key()) == 0x1004: #Qt Return Key Code
!             if DEBUG: print 'enter key was pressed in ', self 
              send(self.proxy, 'enterkey')
          return 1
--- 351,355 ----
          self.proxy.pull('text')
          if int(event.key()) == 0x1004: #Qt Return Key Code
!             if DEBUG: print 'enter key was pressed in ', self
              send(self.proxy, 'enterkey')
          return 1
***************
*** 396,402 ****
  class TextFieldWrapper(TextWrapperBase):
  
-     def __init__(self, *args, **kws):
-         TextWrapperBase.__init__(self, *args, **kws)
- 
      def widgetFactory(self, *args, **kwds):
          return QLineEdit(*args, **kwds)
--- 381,384 ----
***************
*** 407,411 ****
              start, end = selection
              self.widget.setSelection(start, end-start)
!         
      def getSelection(self):
          if self.widget:
--- 389,393 ----
              start, end = selection
              self.widget.setSelection(start, end-start)
! 
      def getSelection(self):
          if self.widget:
***************
*** 422,428 ****
  class TextAreaWrapper(TextWrapperBase):
  
-     def __init__(self, *args, **kws):
-         TextWrapperBase.__init__(self, *args, **kws)
- 
      def widgetFactory(self, *args, **kwds):
          return QTextEdit(*args, **kwds)
--- 404,407 ----
***************
*** 494,500 ****
  class FrameWrapper(ComponentWrapper):
  
-     def __init__(self, *args, **kws):
-         ComponentWrapper.__init__(self, *args, **kws)
- 
      def widgetFactory(self, *args, **kws):
          widget = QFrame(*args, **kws)
--- 473,476 ----
***************
*** 515,529 ****
      mainWindow = None
  
-     def __init__(self, proxy):
-         ComponentWrapper.__init__(self, proxy)
- 
      def setText(self, text):
          if self.widget:
              self.mainWindow.setCaption(QString(str(text)))
  
      def setTitle(self, title):
          if self.widget:
              self.mainWindow.setCaption(QString(str(title)))
  
      def widgetSetUp(self):
          if not self.connected:
--- 491,508 ----
      mainWindow = None
  
      def setText(self, text):
          if self.widget:
              self.mainWindow.setCaption(QString(str(text)))
  
+     def getText(self):
+         return str(self.widget.title())
+ 
      def setTitle(self, title):
          if self.widget:
              self.mainWindow.setCaption(QString(str(title)))
  
+     def getTitle(self):
+         return str(self.widget.title())
+ 
      def widgetSetUp(self):
          if not self.connected:
***************
*** 538,544 ****
              self.connected = 1
  
-     def getTitle(self):
-         return str(self.widget.title())
- 
      def resizeHandler(self, event):
          if DEBUG: print 'in resizeHandler of: ', self.widget
--- 517,520 ----
***************
*** 635,641 ****
  class GroupBoxWrapper(ComponentWrapper):
  
-     def __init__(self, *args, **kws):
-         ComponentWrapper.__init__(self, *args, **kws)
- 
      def widgetFactory(self, *args, **kws):
          widget = QButtonGroup(*args, **kws)
--- 611,614 ----
***************
*** 663,667 ****
      def setEnabled(self,enabled):
          if self.proxy.container is not None \
! 		   and self.proxy.container.wrapper.widget is not None:
              self.proxy.container.wrapper.rebuild()
  
--- 636,640 ----
      def setEnabled(self,enabled):
          if self.proxy.container is not None \
!            and self.proxy.container.wrapper.widget is not None:
              self.proxy.container.wrapper.rebuild()
  
***************
*** 729,733 ****
          """
          if self.proxy.container is not None and \
! 		   self.proxy.container.wrapper.widget is not None:
              parent = self.proxy.container.wrapper.widget
              if DEBUG: print "\nREBUILDING: ", self,self.proxy.contents
--- 702,706 ----
          """
          if self.proxy.container is not None and \
!            self.proxy.container.wrapper.widget is not None:
              parent = self.proxy.container.wrapper.widget
              if DEBUG: print "\nREBUILDING: ", self,self.proxy.contents
***************
*** 739,743 ****
                  else:
                      self.create(None)
!             
              for item in self.proxy.contents:
                  item.wrapper.createIfNeeded()
--- 712,716 ----
                  else:
                      self.create(None)
! 
              for item in self.proxy.contents:
                  item.wrapper.createIfNeeded()
***************
*** 748,752 ****
      def enterMainLoop(self): # ...
          self.proxy.push() # FIXME: Why is this needed when push
! 		                  # is called in internalProd (by prod)?
  
      def insertInto(self, widget):
--- 721,725 ----
      def enterMainLoop(self): # ...
          self.proxy.push() # FIXME: Why is this needed when push
!                           # is called in internalProd (by prod)?
  
      def insertInto(self, widget):
***************
*** 760,764 ****
          widget.clear()
          return widget
!     
  
  class MenuCommandWrapper(MenuItemMixin, AbstractWrapper):
--- 733,737 ----
          widget.clear()
          return widget
! 
  
  class MenuCommandWrapper(MenuItemMixin, AbstractWrapper):
***************
*** 789,797 ****
      def clickHandler(self,*args,**kws):
          self.setOn(not self.getOn())
!         MenuCommandWrapper.clickHandler(self,*args,**kws) 
  
  
  class MenuSeparatorWrapper(MenuItemMixin, AbstractWrapper):
!     
      def insertInto(self, widget):
          widget.insertSeparator()
--- 762,770 ----
      def clickHandler(self,*args,**kws):
          self.setOn(not self.getOn())
!         MenuCommandWrapper.clickHandler(self,*args,**kws)
  
  
  class MenuSeparatorWrapper(MenuItemMixin, AbstractWrapper):
! 
      def insertInto(self, widget):
          widget.insertSeparator()



-------------------------------------------------------
This sf.net email is sponsored by: To learn the basics of securing 
your web site with SSL, click here to get a FREE TRIAL of a Thawte 
Server Certificate: http://www.gothawte.com/rd524.html