Okay. I've taken the plunge and registered a project to fork the development of PyUI. It's called, rather imaginatively, PyUI2. (Or should I say unimaginatively?)
I've already done a bunch of fixes and refactorings, and a couple of additions to the code, but I still have a little to do before I'm happy to check it in. I"ll probably get around to that this weekend. And I'll do a file release around the same time. It will be, however, version 0.1.
Hope to see you there.
I've done some minor changes as well (some may have been duplicated already). Some examples are :
How clipping works with listboxes (and some other text boxes). Although, in general I think the clipping needs to be totally redone for the entire project.
Another type of Console Box
Small Border Frame (no close/resizing - for static sized stuff)
Anyways in the downloaded source, have a look in the pyui part. I used to keep the game and pyui seperate, but decided against it later.
Cool. I'll have a look. I was going to implement radio buttins and something similar to the small border frame myself, but haven't got to that yet. I did fix some clipping and some other widget drawing issues. In fact, here's the list of changes I've made so far:
Changes since PyUI 1.0 Release
* Extracted classes from widgets.py into individual files named for each class under a widgets subdirectory/package.
* Extracted classes from layouts.py into individual files named for each class under a layouts subdirectory/package.
* Moved other widgets into the widgets directory.
* Added OSXTheme in themes/osx.py. This is a copy of themes/win2k.py.
* Added WinXPTheme in themes/winxp.py. This is a copy of themes/win2k.py.
* 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/captionbar.py
* Removed Escape 'special event handler' from handleEvent in desktop.py
* Modified the update method in pygame2D.py and openglPygame.py 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 core.py
* Added rendererBase and renderer3d imports to fix a crash
In file renderers\pygame2D.py
* 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 frame.py
* 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\win2k.py
* 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\winxp.py
* Added a method called drawDropDown to draw the dropDownBox widget.
* Added the getPreferredSize and getMaximumSize methods.
* Added a parameter to the constructor to create a checkbox already checked.
* 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.
Note that the XP and OSX themes are simple copies of the 2K theme. I still need to change them to suit.
Most of these changes are within the context of the original PyUI design. As you say, some things (such as clipping) may need to be redesigned, and probably will be. I'll leave that to a later release though.
Sounds good. I've got 60 changes to the last release of Pyui that I'll suggest and if you guys like migrate to Pyui2. I haven't changed anything fundamental so it should go smoothly.
I also have enhanced Frame and Button widgets, but they may be too specific to my game. Then again, perhaps it would be nice to have more features.
Once this is underway, it'd probably be a good idea to post about it to the pygame mail list as I suspect we're not the only ones who've been hacking PyUI.
That's excellent, I'd definitely like to have a look at those changes. Would it be too much to ask you to submit them as patches to the PyUI2 project? (The URL is https://sourceforge.net/projects/pyui2/\) I'd also like to take a look at your enhancements. I'm also of the opinion that it would be good to have more features. (Though not necessarily right away.)
That's a good idea about posting to the pygame list. I was also thinking it might not be a bad idea to post to python.org.
We should probably continue these discussions on the new forums now.
Sign up for the SourceForge newsletter:
You seem to have CSS turned off.
Please don't fill out this field.