[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Gnumed-devel] wxGlade and edit areas
From: |
Ian Haywood |
Subject: |
[Gnumed-devel] wxGlade and edit areas |
Date: |
Sun, 27 Nov 2005 19:20:55 +1100 |
User-agent: |
Debian Thunderbird 1.0.7 (X11/20051017) |
Karsten, Sebastian
I notice you guys have started using wxGlade. This is good.
I have been playing with gmEditArea and come to the same conclusion,
what do you think moving the common gnumed functionality to a base class
which is used in multiple inheritance with the wxGlade class to make
popups? Descendants will still need to have custom methods, but they can then
be quite
high-level.
Example:
class VaccEditArea (gmEditArea.cEditAreaBase, wxGladeWidgets.wxgVaccEditArea):
def __init__ (self, *args, **kwargs):
gmEditArea.cEditAreaBase.__init__ (self, kwargs)
wxGladeWidgets.wxgVaccEditArea (self, *args, **kwargs)
# now set up phrasewheels etc.
# cEditArea final init stuff
self.editarea_setup ()
def ValidateDTD (self, dtd):
"""
accepts a DTD (dictionary of widget values)
returns (True,) or (False, error_msg)
"""
def LoadClinItem (self. biz):
"""
Given a business object, loads it's values into the widget
"""
def Save2Business (self. biz. dtd):
"""
Given a DTD of changed values, loads them into the pre-existing business
object
Returns (True, biz) or (False, error_msg)
Can call SaveNewBusiness if that makes sense
"""
def SaveNewBusiness (class, dtd):
"""
Creates a new business object from a dictionary of widget data
Must run as a class method
Returns (True, biz_object) or (False, error_message)
"""
- [Gnumed-devel] wxGlade and edit areas,
Ian Haywood <=