Bluecat - 2005-05-04

I am busy making changes to the original PyUI source code to fix bugs, do a bit of refactoring, and adding some additional functionality. I'm using the 1.0 release of PyUI (which probably never should have been released as 1.0) as the starting point. As of today, the following changes have been made:

* Extracted classes from into individual files named for each class under a widgets subdirectory/package.
* Extracted classes from into individual files named for each class under a layouts subdirectory/package.
* Moved other widgets into the widgets directory.
* Added OSXTheme in themes/ This is a copy of themes/
* Added WinXPTheme in themes/ This is a copy of themes/
* Added flags when creating frames.
  - NO_CAPTION stops the frame from displaying a caption bar.
  - NO_RESIZE creates a fixed size frame without a resizing area.
  - TOPMOST replaces the topmost parameter passed to the Frame constructor.

* Added CaptionBar widget in widgets/
* Removed Escape 'special event handler' from handleEvent in
* Modified the update method in and to post a pyui2.locals.QUIT event, when a Pygame QUIT event is received. This fixes the issue where the app doesn't close when the application window is closed and it then hangs.
* Searched through code base and corrected spelling of 'primative' to 'primitive.'

In file
* Added rendererBase and renderer3d imports to fix a crash

In file renderers\
* Added createFont method and removed old font creation from __init__ method. Now uses a pygame/sdl font object. If unable to load normally, will now use pygame.SysFont instead of Font(none) initially.
* Modified getTextSize to return the size of the text using pygame/sdl font object.
* Modified doDrawCommand to use the default font when rendering text.
* Fixed a problem where title text was not displaying in the main window title bar. Added pygame.display.set_caption(title) in the __init__ method.

In file
* Added a new method called centerInDesktop, to the Frame class.
* The caption bar is now a widget. Several methods added or modified to handle this.

In file themes\
* Added the drawDropDown method for drawing the dropDownBox widget.
* Moved caption bar drawing from drawFrame to a new method called drawCaptionBar.
* Modified drawFrame to actually draw a border.
* Modifed the frameColor to gray.
* Changed the color used for drawing the checkbox check from white to the defined foreground color since the white was really hard to see.
* Changed the color used for drawing the background of the selected area in an edit field.
* Fixed problem where text that was longer than the edit box was drawing over the end of the border.
* If the edit is read only, it is no longer possible to select text and the caret no longer draws.

In file themes\
* Added a method called drawDropDown to draw the dropDownBox widget.

In widgets\
* Added the getPreferredSize and getMaximumSize methods.
* Added a parameter to the constructor to create a checkbox already checked.

In widgets\
* Fixed up the draw function to properly render the drop box and selection list.
* Modifed the constructor to initialise the widget with a list of items, the item to be selected, and to flag the widget as editable.
* Added the getPreferredSize and getMaximumSize methods.
* Adding an item to the DropDownBox no longer sets the selection to that item.

I've got a few more structural changes to make, and some additional test code to write, and then I'll make a 0.1 release. This will involve adding the project to CVS and uploading version 0.1 files. I hope to do that this coming weekend, but no promises. Okay?

I've decided to start again at 0.1, since there is a lot of work to do yet, but I reckon that PyUI2 should progress rapidly to a 1.0 release. I just want to make sure it is easy to use, well documented and most of all stable, before then.