Dabo-0.6 (2006-03-27) (Revision 2044)
- Fixed a problem when switching to the Browse page of the datanav grid without first running a query. Also, there was an error being thrown if a previous query had results, and a subsequent query had no results.
- Modified the code in _setCurrentRow() of dGrid so that it wasn't calling SetGridCursor() unless the position had actually changed. I had recorded up to 10 calls to this function, all with the exact same values each time I switched to the Browse page.
- Removed the code that lower-cased field names, as it was preventing the code from working with case-sensitive backends and columns containing capital letters.
- Also fixed a problem where str values were not able to be properly converted to unicode.
- Added a parameter to the promptForFileName() method to specify the default path for the dialog.
- Added the TreeItemContextMenu event. This differs from the normal ContextMenuEvent in that it returns the itemID of the node that was right-clicked.
- Added code in the event data gathering code to store the tree item ID for these events in EventData.itemID.
- The double-Activate on Windows is really getting in the way. I haven't heard anything from my bug report yet, so I added workaround code to ignore the first Activate.
- Cleaned up the order of releasing child objects for sizers. Also fixed problem with releasing the box for border sizers.
- Added getFunctionList() method to return a list of all 'class' and 'def' statements in the current file.
- First pass at integrating the dTable class into the dabo.db framework. Right now, if this works at all, it only works for SQLite.
- Fixed a bug wherein multiply-nested sizers might not release all of their content when release(True) is called.
- Added a 'setInactive()' method that will hide the auto-complete popup if one is visible.
- Disabled the fillGrid()'s setting of focus to the grid, as it causes problems with stealing focus away from another active form, at least on Windows. Also, it seems that such code really doesn't belong inside the function to build the grid, but perhaps we'll find it belongs somewhere else.
- The xml header wasn't being converted to native line endings. Fixed.
- No need to explicitly do the unicode conversion in the report fields, as that is done in the report writer.
- Added a Refresh event. This is raised when dForm.refresh() is called. All dPemMixin classes will receive it, and fire their refresh() hook method.
- Added dynamic properties. Every property can be made dynamic by prefixing it with 'Dynamic'. Dynamic props are set to any callable function; when the object receives a Refresh event, the function's return value is used to set the value of the underlying property.
[NOTE: The previous paragraph no longer applies.]
Example: given a label and a function 'currTime()' in a form that returns the current time, issuing the following:
label.DynamicCaption = label.Form.currTime
will result in the label's Caption property being updated every time label.Form.refresh() is called with the value of the current time.
- Also added two methods to dabo.ui for converting image data back to bitmaps and images. These were necessary because I noticed that when Editor.py was called from locations other than its own directory, the image file for the function button was not found. The solution was to convert the .png file to a data stream using wx.tools.img2py.py, and store that in Editor.py.
- This commit lets you set dApp.UI=None, and setup() won't try to load a UI.
You have to do it explicitly, though, such as:
app = dabo.dApp()
app.UI = None
app.setup()
--or--
app = dabo.dApp(UI=None)
app.setup()
- Major revamping of the whole refresh/update/dynamic design.
First, refresh() simply repaints the object and anything contained in it. It simply calls the wx.Refresh() method.
There is now a method named 'update()' which will update any dynamic aspects of a control, such as its Dynamic* properties, or its data bindings, if any. If the object is a form, calling update triggers a ValueUpdate event that all data-aware controls will receive. All objects with children will raise an Update event in order to propagate the update message. You can call update() on a specific object, and only that object and its children will be updated.
This clarifies the language we use: 'refresh' refers only to having the object repainted on the screen, while 'update' can change aspects of the object, such as its value or other properties.
Updated all the classes that referred to these events and methods by their old names.
- First crack at creating a double-buffered drawing surface. The new class, 'dDrawPanel', is a subclass of dPanel, but has its repainting handled through the double-buffer techniques outlined on the wxPython wiki.
- Bookmarks in dEditor now persist when you save the file. If you re-open a saved file with bookmarks, they are restored.
- Refactored dUserSettingProvider a little bit. Fixed a bug in getUserSettingKeys() that resulted in it always returning an empty list. Added deleteUserSetting() and deleteAllUserSettings(); these do just what you think they would.
- Simplified dPemMixin's __getattr__ and __setattr__ somewhat. I still believe it would be better to be explicit about dynamic properties, and will try to find some time to make that happen.
- Changed a couple exec() calls to setattr() calls instead, which may be safer if not faster, but definitely more explicit and easier to understand.
- Added back a needed test for deadObject that I removed from the onUpdate callback, and changed the test in update() back to testing for the deadObject instead of putting it in a try block.
-----------------------------------------------------------------------
Added makeDynamicProperty() function to dabo.ui, which creates a dynamic property definition for the passed normal property object. I wanted to put this in propertyHelperMixin but it doesn't appear to me that dynamic properties are really at all useful outside of a UI context (indeed, everything else having to do with dynamic props is defined inside dPemMixin...).
- Explicitly defined Dynamic properties for most of the existing properties defined in dPemMixin. Removed the automagical __getattr__/__setattr__ overrides.
This dynamism is really cool, and I'm sorry that we aren't seeing completely eye-to-eye on it. But here are some things that "just work" with my implementation:
1) Run SimpleFormWithBizobj, and in the command window type:
> def dfb(biz):
> return biz.ccity.strip() == "Arecibo"
> self.PageFrame.Pages[2].setAll("DynamicFontBold", (dfb, self.getBizobj()))
Now, go to the edit page and scroll through. The setAll() call just worked without any changes needed. Something is keeping it working with the original implementation but I admit that I don't see why, at first glance.
2) Notice when you are typing in the command window, that the dynamic properties show up in the list. This is really what I mean when I talk about things being documented.
3) Passing dynamic props to the constructor is the same as defining them in the class
txt = dabo.ui.dTextBox(self, DynamicEnabled=myFunc)
txt.DynamicFontItalic = myFunc
Both of the above calls work as usual WRT the Dabo Property Interface.
Granted, there's more work involved when defining a new class (gotta remember to tell Python about the dynamic props). But after all is said, done, and considered, it is my genuine hope and belief that this was the right way to go. But I am still sorry for stepping on toes.
I'll follow through with making other properties (those outside dPemMixin) dynamic as well.
There are things to consider in the future, such as:
+ Do we make a DynamicValue?
+ If so, does it override the value gotten from FieldSource, if set?
+ What bearing does this have on the dynamism already present in, e.g., the setting of dynamic values from non-bizobj data bindings?
Anyway, thanks for putting in the Dynamic stuff, Ed. Once we take care of the refresh overhead - perhaps by using the timer/observer-based approach I talked about this morning - this is really going to be killer.
- Implemented the handling of RowSpan/ColSpan for grid sizers. Added a GridSizerSpanException class that is raised if an attempt to set the span to a location that is already occupied.
- Sorted out some problems and redundancies in the update() cycle:
+ Removed the update delays, as they caused other problems.
+ Because of the recursive nature of the update() function, both ValueUpdate and Update events were triggering the controls to update themselves. Removed ValueUpdate event and consolidated into the update() cycle.
+ The Refresh() call inside update() was being called way too much. In testing different ways to limit this refreshing, I discovered that for all the cases I tested, the Refresh() wasn't needed at all. So I removed it. If you need a refresh() you need to call that explicitly now. I think this may be better anyway because they are different concepts.
Performance still isn't stellar, but it does seem much better now.
- Revamped the entire flow for transactions. These changes have been tested on MySQL and SQLite, but still need to be tested with Firebird and PostgreSQL.
- Changed the default for bizobjs, cursors, etc., to not autocommit. The AutoCommit property of the bizobj is simply a pass-through to the cursor's AutoCommit property.
- Modified datanav to allow for manual setups that don't use fieldSpecs or relationSpecs. I'll be committing a change to the AppWizard that allows for this option soon.
- Moved SelectPageClass, BrowsePageClass, and EditPageClass from PageFrame to Form, since that is a better central location for these properties.
- EXPERIMENTAL!
Added a splash screen to the Dabo app startup. This is based on Andrea Gavana's AdvancedSplash class, and allows for cool shaped windows, etc.
Right now on the Mac there is a noticeable delay from when the splash screen shaped frame appears and when the bitmap is drawn in the Paint event. I'm hoping to be able to figure out why, and also hope that this is just a Mac thing, as Andrea says he's tested this on WinXP and Gtk.
If this works, we may want to consider better artwork for our default splash screen, but this transparent 'dabo' lettering will do for now.
- Turned off the default for showing the splash screen. You can now pass the splash screen settings as parameters to the constructor of dApp, since that's the only practical way to override them.
- Changed the bulk of initialization to the constructor of uiApp. Previously the uiApp object was created, and then things like platform, app reference, etc., weren't established until setup(). dApp now passes a callback to uiApp that is used to continue the startup process once the uiApp has finished initializing.
- Many changes to the SplashScreen class. It now works decently on OS X and Windows, and still looks like crap on Gtk.
- Added the ability to set the DataSource to an object, rather than just a string that can be eval'd to an object.
- Changed the 'getMaxRow/Col' methods to 'getHighRow/Col' in order to avoid confusion with the MaxRows/Cols props in dGridSizer.
- Modified both sizer classes to accept windows and not just SizerItems when setting/getting prop values.
- Added the movePage() method, which takes either a page reference or a page index, and moves the page to the specified position. The page is then selected, unless the third parameter 'selecting' is False.
- Added a getInt() method to dabo.ui.uiwx.
- Added the ability to set the font face and size for the editor.
- Added the setCheck() method to dMenu. Given a caption, it will check any menus whose captions match. By default it will uncheck any that don't match; you can pass False as the second argument and leave non-matchers alone. Also added clearChecks() to uncheck all menu items in a menu.
- Exposed the FileName and FilePath properties in dEditor.
- Added some syntax sugar for referring to fields and variables. Where you used to have to refer to self.Record["clientname"], you can now do self.clientname. Same with self.Variables.
- Added the 'callEvery' function to dabo.ui. This function accepts an interval (in milliseconds), and callable reference, and optional arguments to that callable. It then creates a timer that fires the callable every milliseconds, passing along any optionally included arguments. The timer reference is then returned, where it can be controlled by calling stop(), start() or release(). This is based on the dCallEvery class that Brandon Singer proposed. I made it a function in dabo.ui because I felt it was more consistent with the existing functions callAfter() and callAfterInterval().
- Changed the default for forms to not automatically show "Record 1 of 0" or similar meaningless database information in the status bar. Set it back to True for the datanav Form class, so all datanav apps should remain unchanged. All of the apps in the demo and IDE directories that don't query data, though, no longer show that message.
- Creating an instance of dApp doesn't automatically create an instance of uiApp. Instead, it now asks dabo.ui to get it a reference, and dabo.ui either returns the current instance if one already exists, or creates one if not. This allows you to run wxPython apps from within wxPython apps.
- Added some rudimentary support for file drag/drop. Right now, you can call 'createFileDropTarget' on an object to make it able to respond to files dropped on it. Pass in an optional handler object reference; otherwise, the handler is set to the object itself. The drop event is passed on to the handler by calling its 'processDroppedFiles' method, which should be overridden in the handler object to do the specific processing of the files.
- Added a 'Column' property to dEditor; this represents the column position in the current line, and can be changed to move the cursor within the line.
- Added option in getItemByRowCol() to return the sizer item in the given position instead of the object managed by that sizer item.
- Added method 'isItemChecked()' to allow you to determine the checked status of any menu item.
- Added dabo.ui.getMousePosition(), which returns the position of the mouse on the screen. This is in contrast to dPemMixin.getMousePosition(), which gets the position of the mouse inside the client window.
- Update to allow execution of SQL statements without affecting the current data set. The bizobj has a new pass-through method named 'execute()', which takes a statement understood by the backend database and passes it to its cursor's execute method.
The cursor class has been modified to run all statements that don't begin with 'select' through its auxiliary cursor, thereby preserving its data set. Preliminary tests that I've run have confirmed that these are working correctly, but there should be a lot more testing done before I am confident that these changes are truly sound and can handle whatever we can toss at them.
- You can now set the DataSource to an actual object, instead of having to set it to a string that could be resolved to an object.
- Added basic support for storing lists/tuples in the user settings.
- Added a simple way of persisting MRU lists in applications. A new dApp property, '_persistentMRUs' is a dict that contains the name of the menu as the key for the entry, and the function to bind the items to as the value. The framework will then handle saving and restoring MRU lists upon app startup and closing.
- Modified the uiApp to accept just the menu caption as an identifier instead of requiring the actual menu. This is necessary to create MRU lists for context menus, or for restoring menus at app startup.
- Updated the requirement that a bizobj be found for all data sources. SInce that was written, Dabo's use of data binding has expanded to lots of non-bizobj uses.
- Completed the majority of the work needed to implement saved classes that can be used in other class designs; it was working from the Designer, but not when you ran the form. These changes implement the whole inheritance structure so that if you change the underlying class, any changes not explicitly overridden in the design that uses that class are reflected. This works for both property changes as well as code changes.
- Switched the default order of arguments in callAfterInterval(). It makes more sense to specify the interval first, followed by the function and its arguments. Sticking the interval between the function and its arguments seems very awkward. I added code to callAfterInterval() to check if it received a call in which the interval is the second argument (i.e., the original style) and switch them around in that event.
- Removed dDrawPanel as a class. Turns out that adding double-buffering to panels doesn't affect their performance noticeably, so it made sense to turn this on for all dPanel objects by default. However, if you run into a situation where this adversely affects your app, there is a new property named 'Buffered' that will turn this behavior off (i.e., make it work like it used to) when set to False.
*IF YOU USED dDrawPanel IN YOUR CODE, THIS WILL BREAK IT!*
You must update by changing all references to dDrawPanel to simply dPanel.
- Changed the default for double buffering back to off. Seems that it wasn't as transparently simple as I thought.
- Removed the old syntax for begin/commit/rollbackTransaction. The default for these actions in dBackendObject is to call the appropriate method on the connection, not to execute a command on the cursor.
- Removed the call to cursor.connection.begin() in the beginTransaction() method. This does not seem to be needed for most backends; in fact, it is typically used to override autocommit to create temporary explicit transactions.
- Table creation now works for MySQL also.
- The class dAutoBizobj is a bizobj that has a dTable.
- The function AutoCreateTables() will try to create all the tables that have been setup with dAutoBizobj objects. If it can't create the tables, a message pops up for the user and the db admin. The db admin can enter the username and password for access to create tables or the db admin can manualy execute the queries in the queries.sql.
- Also, having autotables for more than database or even more than one host does not messup or crash, it is handled.
- Converted the dTimer from a bitmap to a non-visible control based directly on wx.Timer. This makes it fit in much better with dabo.ui.callEvery(), which is much more convenient to use in many cases.
- Began coding for the Hover property, which will allow for easier visual coding of MouseOver events. It isn't fully implemented yet, so don't try working with it.
- Implemented the Hover property in dPemMixin. The reason for this rather than relying on MouseLeave to terminate the effect is that there are many time when it seems that the mouse leaves the area without triggering the MouseLeave event. The Hover mechanism employs a timer to check for mouse position, and fire the MouseLeave code if it detects that the mouse position is outside of the control.
- Added a CustomSQL property to the datanav form. If set, the settings in the select page will be ignored and the contents of CustomSQL used instead.
- Added defaults to dGrid.getValue(). If no row or col is specified, it defaults to the current row/column, respectively.
- Added fontMetricFromDrawObject() to dabo.ui. This enables simple calculation of the width/height of a drawn text object.
- Added a fitToSizer() method to dPemMixin. This will resize the object to fit the size required by the sizer represented in its Sizer property. You can also pass in extraWidth and extraHeight values to adjust the size further.
- Added 'Alignment' to the pre-init properties of dCheckBox. Cleaned up the property methods and definitions to make them alphabetized, and to make the strings localized. Also relaxed the values accepted for the Alignment property.
- Added an option to dEditor.changeFontSize() to accept strings in the format "+n" or "-n". These will increment or decrement the font size by 'n' points.
- Moved the _addCode() method out of dFormMixin, since it really is more generic than that. It now lives in dObject._addCodeAsMethod(), which takes a dict of method name/code pairs and adds them as methods of the object. dPemMixin now looks for a keyword argument called 'srcCode', and if found, adds it to the object.
- This class handles the conversion of cdxml text to a class object. It has one main method: classFromXml(), which takes a cdxml file and returns the main class stored in that file. This class can then be instantiated as part of a live app.
It is working for most simple classes. You can create layouts using sizers, panels, and add code to any object, and it will work. However, support for GRIDS and PAGEFRAMES is not completed yet. ANY SAVED DESIGN WITH GRIDS OR PAGEFRAMES WILL BE BROKEN NOW.
This will, of course, be temporary, until I can add that logic to this class.
- Updated dabo.ui to use the new cdxml converter in createForm().
- Added support for grids and pageframes. These are now re-created as they appeared in the design.
This is now ready for testing and bug reports.
- You can now call addObject() and pass a cdxml file instead of a Dabo class reference, and the class defined in the cdxml will be added to the parent.
- Cleaned up the dynamic code creation routines in dObject and DesignerXmlConverter.
- Modified xmltodict to handle property declarations. After 0.6 is out, we really need to move to a more automatic way of doing this. I'd like to look into things such as cElementTree, which is supposed to be incorporated into the next verison of Python. Our files are not so huge that we couldn't parse them into DOM trees.
- Added setAfter() and setAfterInterval() to dabo.ui. These work the same as callAfter() and callAfterInterval(), except you use them to set properties to particular values.
- Added the following properties to dGrid: MovableColumns, ResizableColumns, and ResizableRows. When any of these are set to False, the user cannot move/resize the column or row.
- Changed the keyboard datanav navigation from Ctrl+, and Ctrl+. to Alt+LEFT and Alt+RIGHT. I've confirmed this works on Win and Gtk. Will test Mac next. The original configuration, in addition to being nonintuitive, didn't work on Windows.
- Changed the nav keys to Ctrl+LEFT/Ctrl+Right because Alt+arrow on Mac translates to the Option+Arrow which is used for keyboard navigation of text entry fields. Note that because of a separate problem, only forward keyboard navigation is possible on Mac currently.
- Ok, using Ctrl+Arrow on Win and Lin causes the same problem that using Alt+Arrow causes on Mac. Therefore, I've added code to use the best alt key on the running platform.
- Added the ability to save screenshots in one of several graphics formats. While this was part of the Bubblet demo originally, it could have uses elsewhere. For example, combining this with dabo.ui.callAfterInterval() would enable timed screen shots.
Screenshots can be of any object. If no object is specified, the active form is used.
- In order to detect which graphic format was selected, the various file dialog methods have been augmented with similarly-named methods that also return the type selected by the user. For example, calling getFile("jpg", "png") simply returns the path to the selected file. But calling getFileAndType("jpg", "png") returns a 2-tuple: the first element is the path, and the second would be either "jpg" or "png", depending on which of the wildcard types was selected by the user.
- Hacked a bit to get getCaptureBitmap() to work well on GTTK, but it's still a bit of a mess. GTK doesn't capture the title bar, menu bar or frame decorations of a window, and I tried to compensate the sizing accordingly. Individual controls don't seem to work at all. I don't have more time to play around with this now, but this is hardly a show-stopper for release.
|
|