Update of /cvsroot/freevo/freevo/src/gui
In directory sc8-pr-cvs1:/tmp/cvs-serv23647/gui
Modified Files:
Label.py LayoutManagers.py
Log Message:
Fixed a bug wit drawstringframed hard. Its return coords were always 0's
which made it impossible to judge the size.
Index: Label.py
===================================================================
RCS file: /cvsroot/freevo/freevo/src/gui/Label.py,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** Label.py 25 Jun 2003 02:27:39 -0000 1.11
--- Label.py 26 Jun 2003 01:41:16 -0000 1.12
***************
*** 10,13 ****
--- 10,17 ----
#-----------------------------------------------------------------------
# $Log$
+ # Revision 1.12 2003/06/26 01:41:16 rshortt
+ # Fixed a bug wit drawstringframed hard. Its return coords were always 0's
+ # which made it impossible to judge the size.
+ #
# Revision 1.11 2003/06/25 02:27:39 rshortt
# Allow 'frame' containers to grow verticly to hold all contents. Also
***************
*** 104,108 ****
from osd import Font
! DEBUG = 0
--- 108,112 ----
from osd import Font
! DEBUG = 1
***************
*** 226,230 ****
! def render(self, dummy_surface=None):
if DEBUG: print 'Label::_draw %s' % self
if DEBUG: print ' text=%s' % self.text
--- 230,263 ----
! def get_rendered_size(self):
! (rest_words, (return_x0,return_y0, return_x1, return_y1)) = \
! self.osd.drawstringframed(self.text,
! 0,
! 0,
! self.width,
! self.height,
! fgcolor=None,
! bgcolor=None,
! font=self.font_name,
! ptsize=self.font_size,
! align_h='left',
! align_v='top',
! mode='hard',
! layer='null layer')
!
! if DEBUG: print ' %s,%s,%s,%s,%s' %
(rest_words,return_x0,return_y0,return_x1,return_y1)
! # LABEL: ,71,17,294,43
! self.width = return_x1 - return_x0
! # self.width = return_x1
! # self.width = self.surface.get_width()
! self.height = return_y1 - return_y0
! # self.height = self.surface.get_height()
! # self.height = return_y1
!
! return self.width, self.height
!
!
!
! def render(self):
if DEBUG: print 'Label::_draw %s' % self
if DEBUG: print ' text=%s' % self.text
***************
*** 251,261 ****
(pw, ph) = self.parent.get_size()
! if dummy_surface:
! self.surface = pygame.Surface((pw, ph), 0, 32)
! else:
! if self.width > pw: self.width = pw
! if self.height > ph: self.height = ph
! self.surface = self.parent.surface.subsurface((self.left, self.top,
self.width, self.height))
! if DEBUG: print ' surface=%s' % self.surface
(rest_words, (return_x0,return_y0, return_x1, return_y1)) = \
--- 284,291 ----
(pw, ph) = self.parent.get_size()
! if self.width > pw: self.width = pw
! if self.height > ph: self.height = ph
! self.surface = self.parent.surface.subsurface((self.left, self.top,
self.width, self.height))
! if DEBUG: print ' surface=%s' % self.surface
(rest_words, (return_x0,return_y0, return_x1, return_y1)) = \
***************
*** 271,281 ****
align_h='left',
align_v='top',
! mode='soft',
layer=self.surface)
if DEBUG: print ' %s,%s,%s,%s,%s' %
(rest_words,return_x0,return_y0,return_x1,return_y1)
# LABEL: ,71,17,294,43
! # self.width = return_x1 - return_x0
! self.width = return_x1
# self.width = self.surface.get_width()
self.height = return_y1 - return_y0
--- 301,311 ----
align_h='left',
align_v='top',
! mode='hard',
layer=self.surface)
if DEBUG: print ' %s,%s,%s,%s,%s' %
(rest_words,return_x0,return_y0,return_x1,return_y1)
# LABEL: ,71,17,294,43
! self.width = return_x1 - return_x0
! # self.width = return_x1
# self.width = self.surface.get_width()
self.height = return_y1 - return_y0
Index: LayoutManagers.py
===================================================================
RCS file: /cvsroot/freevo/freevo/src/gui/LayoutManagers.py,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** LayoutManagers.py 25 Jun 2003 02:27:39 -0000 1.8
--- LayoutManagers.py 26 Jun 2003 01:41:16 -0000 1.9
***************
*** 12,15 ****
--- 12,19 ----
# -----------------------------------------------------------------------
# $Log$
+ # Revision 1.9 2003/06/26 01:41:16 rshortt
+ # Fixed a bug wit drawstringframed hard. Its return coords were always 0's
+ # which made it impossible to judge the size.
+ #
# Revision 1.8 2003/06/25 02:27:39 rshortt
# Allow 'frame' containers to grow verticly to hold all contents. Also
***************
*** 69,73 ****
from Label import *
! DEBUG = 0
--- 73,77 ----
from Label import *
! DEBUG = 1
***************
*** 150,157 ****
if child.height == -1 and isinstance(child, Label):
! child.height = self.container.height - \
! self.container.v_margin - y
if DEBUG: print ' child was %sx%s' %
(child.width,child.height)
! child.render('dummy')
if DEBUG: print ' child now %sx%s' %
(child.width,child.height)
--- 154,164 ----
if child.height == -1 and isinstance(child, Label):
! if self.container.vertical_expansion:
! child.height = config.CONF.height - 20
! else:
! child.height = self.container.height - \
! self.container.v_margin - y
if DEBUG: print ' child was %sx%s' %
(child.width,child.height)
! child.get_rendered_size()
if DEBUG: print ' child now %sx%s' %
(child.width,child.height)
-------------------------------------------------------
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