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 mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/gnumed-devel

Reply via email to