Update of /cvsroot/freevo/freevo/src/gui
In directory sc8-pr-cvs1:/tmp/cvs-serv17780

Modified Files:
        AlertBox.py Button.py ConfirmBox.py Container.py GUIObject.py 
        Label.py LayoutManagers.py LetterBoxGroup.py OptionBox.py 
        Panel.py PopupBox.py RegionScroller.py Scrollbar.py 
        ZIndexRenderer.py 
Log Message:
Allow 'frame' containers to grow verticly to hold all contents.  Also 
better control of object's background images.


Index: AlertBox.py
===================================================================
RCS file: /cvsroot/freevo/freevo/src/gui/AlertBox.py,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -d -r1.14 -r1.15
*** AlertBox.py 27 May 2003 17:53:34 -0000      1.14
--- AlertBox.py 25 Jun 2003 02:27:39 -0000      1.15
***************
*** 10,13 ****
--- 10,17 ----
  # -----------------------------------------------------------------------
  # $Log$
+ # Revision 1.15  2003/06/25 02:27:39  rshortt
+ # Allow 'frame' containers to grow verticly to hold all contents.  Also
+ # better control of object's background images.
+ #
  # Revision 1.14  2003/05/27 17:53:34  dischi
  # Added new event handler module
***************
*** 127,134 ****
      def __init__(self, parent='osd', text=" ", handler=None, left=None, 
                   top=None, width=300, height=150, bg_color=None, fg_color=None,
!                  icon=None, border=None, bd_color=None, bd_width=None):
  
          PopupBox.__init__(self, parent, text, handler, left, top, width, height,
!                           bg_color, fg_color, icon, border, bd_color, bd_width)
  
          b1 = Button('OK')
--- 131,140 ----
      def __init__(self, parent='osd', text=" ", handler=None, left=None, 
                   top=None, width=300, height=150, bg_color=None, fg_color=None,
!                  icon=None, border=None, bd_color=None, bd_width=None,
!                  vertical_expansion=1):
  
          PopupBox.__init__(self, parent, text, handler, left, top, width, height,
!                           bg_color, fg_color, icon, border, bd_color, bd_width,
!                           vertical_expansion)
  
          b1 = Button('OK')

Index: Button.py
===================================================================
RCS file: /cvsroot/freevo/freevo/src/gui/Button.py,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** Button.py   27 May 2003 17:53:34 -0000      1.11
--- Button.py   25 Jun 2003 02:27:39 -0000      1.12
***************
*** 10,13 ****
--- 10,17 ----
  # -----------------------------------------------------------------------
  # $Log$
+ # Revision 1.12  2003/06/25 02:27:39  rshortt
+ # Allow 'frame' containers to grow verticly to hold all contents.  Also
+ # better control of object's background images.
+ #
  # Revision 1.11  2003/05/27 17:53:34  dischi
  # Added new event handler module
***************
*** 167,171 ****
          Container._draw(self)
  
!         self.parent.surface.blit(self.surface, self.get_position())
  
      
--- 171,175 ----
          Container._draw(self)
  
!         self.blit_parent()
  
      

Index: ConfirmBox.py
===================================================================
RCS file: /cvsroot/freevo/freevo/src/gui/ConfirmBox.py,v
retrieving revision 1.15
retrieving revision 1.16
diff -C2 -d -r1.15 -r1.16
*** ConfirmBox.py       27 May 2003 17:53:34 -0000      1.15
--- ConfirmBox.py       25 Jun 2003 02:27:39 -0000      1.16
***************
*** 11,14 ****
--- 11,18 ----
  # -----------------------------------------------------------------------
  # $Log$
+ # Revision 1.16  2003/06/25 02:27:39  rshortt
+ # Allow 'frame' containers to grow verticly to hold all contents.  Also
+ # better control of object's background images.
+ #
  # Revision 1.15  2003/05/27 17:53:34  dischi
  # Added new event handler module
***************
*** 124,131 ****
                   left=None, top=None, width=300, height=150, bg_color=None, 
                   fg_color=None, icon=None, border=None, bd_color=None, 
!                  bd_width=None):
  
          PopupBox.__init__(self, parent, text, handler, left, top, width, height, 
!                           bg_color, fg_color, icon, border, bd_color, bd_width)
  
  
--- 128,136 ----
                   left=None, top=None, width=300, height=150, bg_color=None, 
                   fg_color=None, icon=None, border=None, bd_color=None, 
!                  bd_width=None, vertical_expansion=1):
  
          PopupBox.__init__(self, parent, text, handler, left, top, width, height, 
!                           bg_color, fg_color, icon, border, bd_color, bd_width,
!                           vertical_expansion)
  
  

Index: Container.py
===================================================================
RCS file: /cvsroot/freevo/freevo/src/gui/Container.py,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** Container.py        2 May 2003 01:09:02 -0000       1.4
--- Container.py        25 Jun 2003 02:27:39 -0000      1.5
***************
*** 7,10 ****
--- 7,14 ----
  #-----------------------------------------------------------------------
  # $Log$
+ # Revision 1.5  2003/06/25 02:27:39  rshortt
+ # Allow 'frame' containers to grow verticly to hold all contents.  Also
+ # better control of object's background images.
+ #
  # Revision 1.4  2003/05/02 01:09:02  rshortt
  # Changes in the way these objects draw.  They all maintain a self.surface
***************
*** 63,74 ****
                   bg_color=None, fg_color=None, selected_bg_color=None, 
                   selected_fg_color=None, border=None, bd_color=None, 
!                  bd_width=None):
  
          GUIObject.__init__(self, left, top, width, height, bg_color, fg_color)
  
!         self.layout         = None
          self.border         = border
          self.bd_color       = bd_color
          self.bd_width       = bd_width
  
          self.internal_h_align = Align.LEFT
--- 67,79 ----
                   bg_color=None, fg_color=None, selected_bg_color=None, 
                   selected_fg_color=None, border=None, bd_color=None, 
!                  bd_width=None, vertical_expansion=0):
  
          GUIObject.__init__(self, left, top, width, height, bg_color, fg_color)
  
!         self.layout_manager = None
          self.border         = border
          self.bd_color       = bd_color
          self.bd_width       = bd_width
+         self.vertical_expansion = vertical_expansion
  
          self.internal_h_align = Align.LEFT
***************
*** 151,168 ****
      def set_layout(self, layout=None):
          if not layout: layout = FlowLayout(self)
!         self.layout = layout
  
  
      def get_layout(self):
!         return self.layout 
  
  
!     def _draw(self):
!         if DEBUG: print 'Container::draw %s' % self
  
!         if not self.layout:
!             self.layout = FlowLayout(self)
  
!         self.layout.layout()
  
          for child in self.children:
--- 156,175 ----
      def set_layout(self, layout=None):
          if not layout: layout = FlowLayout(self)
!         self.layout_manager = layout
  
  
      def get_layout(self):
!         return self.layout_manager 
  
  
!     def layout(self):
!         if not self.layout_manager:
!             self.layout_manager = FlowLayout(self)
  
!         self.layout_manager.layout()
  
! 
!     def _draw(self):
!         if DEBUG: print 'Container::draw %s' % self
  
          for child in self.children:

Index: GUIObject.py
===================================================================
RCS file: /cvsroot/freevo/freevo/src/gui/GUIObject.py,v
retrieving revision 1.23
retrieving revision 1.24
diff -C2 -d -r1.23 -r1.24
*** GUIObject.py        27 May 2003 17:53:34 -0000      1.23
--- GUIObject.py        25 Jun 2003 02:27:39 -0000      1.24
***************
*** 8,11 ****
--- 8,15 ----
  #-----------------------------------------------------------------------
  # $Log$
+ # Revision 1.24  2003/06/25 02:27:39  rshortt
+ # Allow 'frame' containers to grow verticly to hold all contents.  Also
+ # better control of object's background images.
+ #
  # Revision 1.23  2003/05/27 17:53:34  dischi
  # Added new event handler module
***************
*** 278,282 ****
  
          self.visible = 0
!         self.zir.update_hide(self)
          self.osd.update(self.get_rect())
  
--- 282,289 ----
  
          self.visible = 0
!         if self.parent and self.parent.visible:
!             self.zir.update_hide(self)
!             self.bg_replace()
! 
          self.osd.update(self.get_rect())
  
***************
*** 356,359 ****
--- 363,373 ----
  
  
+     def layout(self):
+         """
+         To be overriden by Container.
+         """
+         pass
+ 
+ 
      def draw(self, surface=None):
          if DEBUG: print 'GUIObject::draw %s' % self
***************
*** 361,367 ****
          if self.is_visible() == 0: return FALSE
  
!         if self.bg_surface:
!             if DEBUG: print 'GUIObject::draw: have bg_surface'
!             self.osd.putsurface(self.bg_surface, self.left, self.top)
  
          if surface:
--- 375,381 ----
          if self.is_visible() == 0: return FALSE
  
!         # self.bg_replace()
! 
!         self.layout()
  
          if surface:
***************
*** 381,384 ****
--- 395,423 ----
  
  
+     def blit_parent(self):
+         if self.parent.surface:
+             p = self.parent.surface
+         else:
+             p = self.osd.screen
+ 
+         self.bg_surface = pygame.Surface((self.width, self.height))
+         self.bg_surface.blit(p, (0,0), 
+                              (self.left, self.top, self.width, self.height))
+ 
+         p.blit(self.surface, self.get_position())
+ 
+ 
+     def bg_replace(self):
+         if not self.bg_surface: return
+         if DEBUG: print 'GUIObject::draw: have bg_surface'
+ 
+         if self.parent.surface:
+             p = self.parent.surface
+         else:
+             p = self.osd.screen
+ 
+         p.blit(self.bg_surface, (self.left, self.top))
+ 
+ 
      def set_parent(self, parent):
          """Set the parent of this widget
***************
*** 410,413 ****
--- 449,454 ----
  
      def destroy(self):
+         self.visible = 0
+ 
          if DEBUG:
              if self.bg_image:
***************
*** 436,442 ****
                  if DEBUG: print 'focus has %s not %s' % (self.osd.focused_app, self)
                  
-             # We shouldn't need to call this if we replace the bg right
-             # self.parent.refresh()
- 
          self.hide()
          if self.parent:
--- 477,480 ----

Index: Label.py
===================================================================
RCS file: /cvsroot/freevo/freevo/src/gui/Label.py,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** Label.py    21 May 2003 00:04:25 -0000      1.10
--- Label.py    25 Jun 2003 02:27:39 -0000      1.11
***************
*** 10,13 ****
--- 10,17 ----
  #-----------------------------------------------------------------------
  # $Log$
+ # Revision 1.11  2003/06/25 02:27:39  rshortt
+ # Allow 'frame' containers to grow verticly to hold all contents.  Also
+ # better control of object's background images.
+ #
  # Revision 1.10  2003/05/21 00:04:25  rshortt
  # General improvements to layout and drawing.
***************
*** 252,256 ****
              if self.width > pw: self.width = pw
              if self.height > ph: self.height = ph
-             # self.surface = self.parent.surface.subsurface((0, 0, self.width, 
self.height))
              self.surface = self.parent.surface.subsurface((self.left, self.top, 
self.width, self.height))
              if DEBUG: print '       surface=%s' % self.surface
--- 256,259 ----
***************
*** 292,297 ****
  
          if DEBUG: print '       draw position="%s,%s"' % self.get_position()
!         # self.parent.surface.blit(self.surface, self.get_position(), 
self.get_rect())
!         self.parent.surface.blit(self.surface, self.get_position())
          
   
--- 295,299 ----
  
          if DEBUG: print '       draw position="%s,%s"' % self.get_position()
!         self.blit_parent()
          
   

Index: LayoutManagers.py
===================================================================
RCS file: /cvsroot/freevo/freevo/src/gui/LayoutManagers.py,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** LayoutManagers.py   21 May 2003 00:04:25 -0000      1.7
--- LayoutManagers.py   25 Jun 2003 02:27:39 -0000      1.8
***************
*** 12,15 ****
--- 12,19 ----
  # -----------------------------------------------------------------------
  # $Log$
+ # Revision 1.8  2003/06/25 02:27:39  rshortt
+ # Allow 'frame' containers to grow verticly to hold all contents.  Also
+ # better control of object's background images.
+ #
  # Revision 1.7  2003/05/21 00:04:25  rshortt
  # General improvements to layout and drawing.
***************
*** 174,178 ****
              if y + child.height > \
                 self.container.height - self.container.v_margin:
!                 break
  
              next_x = x + child.width + self.container.h_spacing
--- 178,189 ----
              if y + child.height > \
                 self.container.height - self.container.v_margin:
!                 if self.container.vertical_expansion:
!                     self.container.height = y + child.height + \
!                                             self.container.v_margin
!                     if DEBUG: 
!                         print 'LAYOUT:  fit me in! (%s) - %s' % \
!                                      (self.container.height, self)
!                 else:
!                     break
  
              next_x = x + child.width + self.container.h_spacing

Index: LetterBoxGroup.py
===================================================================
RCS file: /cvsroot/freevo/freevo/src/gui/LetterBoxGroup.py,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** LetterBoxGroup.py   21 May 2003 00:04:26 -0000      1.11
--- LetterBoxGroup.py   25 Jun 2003 02:27:39 -0000      1.12
***************
*** 11,14 ****
--- 11,18 ----
  # -----------------------------------------------------------------------
  # $Log$
+ # Revision 1.12  2003/06/25 02:27:39  rshortt
+ # Allow 'frame' containers to grow verticly to hold all contents.  Also
+ # better control of object's background images.
+ #
  # Revision 1.11  2003/05/21 00:04:26  rshortt
  # General improvements to layout and drawing.
***************
*** 198,202 ****
          Container._draw(self)
  
!         self.parent.surface.blit(self.surface, self.get_position())
  
      
--- 202,206 ----
          Container._draw(self)
  
!         self.blit_parent()
  
      

Index: OptionBox.py
===================================================================
RCS file: /cvsroot/freevo/freevo/src/gui/OptionBox.py,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** OptionBox.py        21 May 2003 00:04:26 -0000      1.8
--- OptionBox.py        25 Jun 2003 02:27:39 -0000      1.9
***************
*** 10,13 ****
--- 10,17 ----
  # -----------------------------------------------------------------------
  # $Log$
+ # Revision 1.9  2003/06/25 02:27:39  rshortt
+ # Allow 'frame' containers to grow verticly to hold all contents.  Also
+ # better control of object's background images.
+ #
  # Revision 1.8  2003/05/21 00:04:26  rshortt
  # General improvements to layout and drawing.
***************
*** 177,189 ****
          pygame.draw.polygon(self.surface, arrow_color, [ar_1, ar_2, ar_3])
  
-         # if self.border: self.border.draw()
- 
-         # self.label.draw()
- 
          if isinstance(self.list, ListBox):
              self.list.set_position(self.left, self.top+self.height)
  
          Container._draw(self)
!         self.parent.surface.blit(self.surface, self.get_position())
          if self.list:   self.list.draw(self.parent.surface)
      
--- 181,189 ----
          pygame.draw.polygon(self.surface, arrow_color, [ar_1, ar_2, ar_3])
  
          if isinstance(self.list, ListBox):
              self.list.set_position(self.left, self.top+self.height)
  
          Container._draw(self)
!         self.blit_parent()
          if self.list:   self.list.draw(self.parent.surface)
      

Index: Panel.py
===================================================================
RCS file: /cvsroot/freevo/freevo/src/gui/Panel.py,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** Panel.py    24 Apr 2003 19:56:26 -0000      1.3
--- Panel.py    25 Jun 2003 02:27:39 -0000      1.4
***************
*** 7,10 ****
--- 7,14 ----
  #-----------------------------------------------------------------------
  # $Log$
+ # Revision 1.4  2003/06/25 02:27:39  rshortt
+ # Allow 'frame' containers to grow verticly to hold all contents.  Also
+ # better control of object's background images.
+ #
  # Revision 1.3  2003/04/24 19:56:26  dischi
  # comment cleanup for 1.3.2-pre4
***************
*** 80,82 ****
          Container._draw(self)
  
!         self.parent.surface.blit(self.surface, self.get_position())
--- 84,86 ----
          Container._draw(self)
  
!         self.blit_parent()

Index: PopupBox.py
===================================================================
RCS file: /cvsroot/freevo/freevo/src/gui/PopupBox.py,v
retrieving revision 1.20
retrieving revision 1.21
diff -C2 -d -r1.20 -r1.21
*** PopupBox.py 27 May 2003 17:53:34 -0000      1.20
--- PopupBox.py 25 Jun 2003 02:27:39 -0000      1.21
***************
*** 11,14 ****
--- 11,18 ----
  #-----------------------------------------------------------------------
  # $Log$
+ # Revision 1.21  2003/06/25 02:27:39  rshortt
+ # Allow 'frame' containers to grow verticly to hold all contents.  Also
+ # better control of object's background images.
+ #
  # Revision 1.20  2003/05/27 17:53:34  dischi
  # Added new event handler module
***************
*** 125,134 ****
      def __init__(self, parent='osd', text=' ', handler=None, left=None, 
                   top=None, width=360, height=120, bg_color=None, fg_color=None,
!                  icon=None, border=None, bd_color=None, bd_width=None):
  
          self.handler = handler
  
          Container.__init__(self, 'frame', left, top, width, height, bg_color, 
!                            fg_color, None, None, border, bd_color, bd_width)
  
          if not parent or parent == 'osd':
--- 129,140 ----
      def __init__(self, parent='osd', text=' ', handler=None, left=None, 
                   top=None, width=360, height=120, bg_color=None, fg_color=None,
!                  icon=None, border=None, bd_color=None, bd_width=None,
!                  vertical_expansion=1):
  
          self.handler = handler
  
          Container.__init__(self, 'frame', left, top, width, height, bg_color, 
!                            fg_color, None, None, border, bd_color, bd_width,
!                            vertical_expansion)
  
          if not parent or parent == 'osd':
***************
*** 264,269 ****
          Container._draw(self)
  
!         # self.parent.surface.blit(self.surface, self.get_position())
!         self.osd.screen.blit(self.surface, self.get_position())
  
      
--- 270,274 ----
          Container._draw(self)
  
!         self.blit_parent()
  
      

Index: RegionScroller.py
===================================================================
RCS file: /cvsroot/freevo/freevo/src/gui/RegionScroller.py,v
retrieving revision 1.14
retrieving revision 1.15
diff -C2 -d -r1.14 -r1.15
*** RegionScroller.py   2 Jun 2003 03:28:41 -0000       1.14
--- RegionScroller.py   25 Jun 2003 02:27:39 -0000      1.15
***************
*** 10,13 ****
--- 10,17 ----
  # -----------------------------------------------------------------------
  # $Log$
+ # Revision 1.15  2003/06/25 02:27:39  rshortt
+ # Allow 'frame' containers to grow verticly to hold all contents.  Also
+ # better control of object's background images.
+ #
  # Revision 1.14  2003/06/02 03:28:41  rshortt
  # Fixes for event changes.
***************
*** 274,278 ****
              surface.blit(self.surface, self.get_position())
          else:
!             self.parent.surface.blit(self.surface, self.get_position())
      
  
--- 278,282 ----
              surface.blit(self.surface, self.get_position())
          else:
!             self.blit_parent()
      
  

Index: Scrollbar.py
===================================================================
RCS file: /cvsroot/freevo/freevo/src/gui/Scrollbar.py,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** Scrollbar.py        15 May 2003 02:21:54 -0000      1.9
--- Scrollbar.py        25 Jun 2003 02:27:39 -0000      1.10
***************
*** 10,13 ****
--- 10,17 ----
  # -----------------------------------------------------------------------
  # $Log$
+ # Revision 1.10  2003/06/25 02:27:39  rshortt
+ # Allow 'frame' containers to grow verticly to hold all contents.  Also
+ # better control of object's background images.
+ #
  # Revision 1.9  2003/05/15 02:21:54  rshortt
  # got RegionScroller, ListBox, ListItem, OptionBox working again, although
***************
*** 235,239 ****
  
          if DEBUG: print 'SB::_draw: pos=%s,%s' % (self.left, self.top)
!         self.parent.surface.blit(self.surface, self.get_position())
  
  
--- 239,243 ----
  
          if DEBUG: print 'SB::_draw: pos=%s,%s' % (self.left, self.top)
!         self.blit_parent()
  
  

Index: ZIndexRenderer.py
===================================================================
RCS file: /cvsroot/freevo/freevo/src/gui/ZIndexRenderer.py,v
retrieving revision 1.7
retrieving revision 1.8
diff -C2 -d -r1.7 -r1.8
*** ZIndexRenderer.py   9 Mar 2003 21:37:06 -0000       1.7
--- ZIndexRenderer.py   25 Jun 2003 02:27:39 -0000      1.8
***************
*** 7,10 ****
--- 7,14 ----
  #-----------------------------------------------------------------------
  # $Log$
+ # Revision 1.8  2003/06/25 02:27:39  rshortt
+ # Allow 'frame' containers to grow verticly to hold all contents.  Also
+ # better control of object's background images.
+ #
  # Revision 1.7  2003/03/09 21:37:06  rshortt
  # Improved drawing.  draw() should now be called instead of _draw(). draw()
***************
*** 201,206 ****
              if o == object:
                  if o.bg_surface:
!                     osd.putsurface(o.bg_surface, o.left, o.top)
!                     osd.update()
                      if DEBUG:
                          o.bg_image = o.bg_surface.convert()
--- 205,210 ----
              if o == object:
                  if o.bg_surface:
!                     # osd.putsurface(o.bg_surface, o.left, o.top)
!                     # osd.update()
                      if DEBUG:
                          o.bg_image = o.bg_surface.convert()
***************
*** 241,246 ****
          for o in self.zindex:
              if o == object:
!                 o.bg_surface = osd.getsurface(o.left, o.top, 
!                                               o.width, o.height)
                  if DEBUG:
                      o.bg_image = o.bg_surface.convert()
--- 245,250 ----
          for o in self.zindex:
              if o == object:
!                 # o.bg_surface = osd.getsurface(o.left, o.top, 
!                 #                               o.width, o.height)
                  if DEBUG:
                      o.bg_image = o.bg_surface.convert()




-------------------------------------------------------
This SF.Net email is sponsored by: INetU
Attention Web Developers & Consultants: Become An INetU Hosting Partner.
Refer Dedicated Servers. We Manage Them. You Get 10% Monthly Commission!
INetU Dedicated Managed Hosting http://www.inetu.net/partner/index.php
_______________________________________________
Freevo-cvslog mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/freevo-cvslog

Reply via email to