Author: bugman Date: Wed Jun 13 21:10:14 2012 New Revision: 16902 URL: http://svn.gna.org/viewcvs/relax?rev=16902&view=rev Log: Bug fix for sizing of the GUI about dialogs - the virtual sizes are now accurately calculated. To do this, the window contents (a wx.BufferedDC instance) is created twice, with the virtual window size exactly calculated in the first pass, and then used to set up the device context in the second. A space is also now added to the end to ensure the border is there. Modified: trunk/gui/about.py Modified: trunk/gui/about.py URL: http://svn.gna.org/viewcvs/relax/trunk/gui/about.py?rev=16902&r1=16901&r2=16902&view=diff ============================================================================== --- trunk/gui/about.py (original) +++ trunk/gui/about.py Wed Jun 13 21:10:14 2012 @@ -95,13 +95,11 @@ # Set the window size. self.SetSize((self.virt_x, self.dim_y)) - # Set the window virtual size. - self.window.SetVirtualSize((self.virt_x, self.virt_y)) - # Add y scrolling, if needed. self.window.SetScrollRate(0, self.SCROLL_RATE) - # Create the buffered device context. + # Create the buffered device context twice (to determine the real virtual size!). + self.create_buffered_dc() self.create_buffered_dc() # Add HTML content. @@ -185,6 +183,10 @@ # Build the rest of the about widget. self.build_widget() + + # Re-calculate the virtual size, and reset the offset. + self.virt_y = self.offset() + self.offset(-self.virt_y) # Finish. self.dc.EndDrawing() @@ -531,6 +533,9 @@ self.window.SetVirtualSize((dim_x, dim_y)) self.window.EnableScrolling(x_scrolling=False, y_scrolling=False) + # Add space to the bottom. + self.offset(self.border) + def draw_copyright(self): """Draw the copyright statements."""