Paul McNett wrote:
I think that is certainly possible. Write a tool to convert a cdxml
class into a .py file (generated Python code). Say you had
TestPanel.cdxml, the tool would create TestPanel_Layout.py with
comments at the top warning you to not edit the file and to not save
it to source control.
Then, create your own .py file that is going to use the file generated
by CD converted to .py to write most of your code. You would then have
code like:
import dabo
import TestPanel_Layout.py
class TestPanel(TestPanel_Layout.TestPanel_Layout):
def afterInit(self):
dabo.ui.info("hi")
And note that you could have indeed written your afterInit from within
the CD, and in that case the afterInit in the manually-edited file
would have overridden the code in the CD version, unless you called
self.super(), which is all as you'd expect.
This could indeed give a "best of both worlds" temporary solution. And
when the CD is finally done, it wouldn't be too difficult to merge all
this custom app code back together again, if that is what is desired.
When you save the cdxml after modifying it, you'd have to also
remember to run the cdxml->py script as well (or we'd just make that
automatic from the CD and/or eventual project manager 'build' function).
Comments on this idea?
I'd be unhappy about the extra step of cdxml -> py conversion - I'd be
bound to forget it, or find it annoying enough that I was less likely to
change the UI when I should.
What I was thinking of (and I repeat this is a stop-gap until CD becomes
a fully-capable IDE) was something like
write my code just as I would today as "pure api" - but omitting the
part that would create and layout out the API
add a call to a new lib function read and layout the cdxml file
- it creates the controls and sizers as needed
and the rest of the code then works just like today.
There's a lot of handwaving there, but I think it's not too hard,
especially borrowing chunks of code from ClassDesigner - give me a day
or two to see if bears fruit (or if I need to ask more questions.
--
Alex Tweedly http://www.tweedly.net
--
No virus found in this outgoing message.
Checked by AVG Free Edition.
Version: 7.1.394 / Virus Database: 268.8.2/356 - Release Date: 05/06/2006
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users