On Sep 4, 2006, at 7:51 AM, Miguel Lopes wrote:
I have some extra questions on how to use the ide tools (I'm not
forgeting it's work in progress ;-).
1 - app.MainFormClass = 'frmMain.cdxml':
If we have two classes a bizobj derived and a connection derived
one in our main script, they are not accessible via Class Designer.
Unless we define these classes in a separate file (or more) and
then import these files as needed in each method in the Class
Designer method editor.
Would this (defining in separate files the code to be accessed by
methods in the Class Designer) be the right approach?
Yes, at least for now. One thing to keep in mind is that Dabo has
several tools that have been designed to eventually integrate with
each other, but that project (the Dabo IDE) has not yet begun. So for
now you have to manually code some things that would be more
automatic when the IDE is completed.
Normally you would add connections and bizobjs in the form's
afterInit() method.
2 - createForm() and addObject()
I've played around with createForm() and I figured out I can't use
it before app.start() has been called (because the the wx.App
object hasn't been created). This makes me think createForm() is
designed to be used after the main app class is already
instantiated (like in your example with "searchForm.cdxml"). Is
this so?
You can create it after app.setup() has been called, because that's
what sets up the UI. Once the UI is established, you can create and
display UI objects. Try the following from the Python command line:
>>> import dabo
>>> app = dabo.dApp()
>>> app.setup()
Dabo Info Log: Mon Sep 4 10:33:06 2006: 1 database connection
definition(s) loaded.
Dabo Info Log: Mon Sep 4 10:33:06 2006: User interface set to 'wx'
by dApp.
Dabo Info Log: Mon Sep 4 10:33:06 2006: wxPython Version: 2.6.3.3
wxMac (unicode)
>>> z=dabo.ui.dForm(None)
>>> z.addObject(dabo.ui.dButton, Caption="Click")
<dabo.ui.uiwx.dButton.dButton; proxy of C++ wxButton instance at
_50e6cc03_p_wxButton>
>>> z.Visible = True
At this point the forms are both visible, but you can't interact
with them
>>> app.start()
The forms are now live. You can move them, click on the button, etc.
When you close both of them, there are no more windows, and the app
finishes.
Dabo Info Log: Mon Sep 4 10:35:19 2006: Application finished.
But the app object is still there! Try this next:
>>> z=dabo.ui.dForm(None)
>>> z.addObject(dabo.ui.dButton, Caption="Foo")
<dabo.ui.uiwx.dButton.dButton; proxy of C++ wxButton instance at
_40f1c903_p_wxButton>
>>> z.Visible = True
Again, the form is visible, but you can't interact with it.
>>> app.start()
Now you can interact with the form normally. When you close it you get:
Dabo Info Log: Mon Sep 4 10:35:59 2006: Application finished.
Considering the IDE Tools are work in progress I guess some of
these questions are not straightforward, but I would like to have a
general idea of the approach you would defend.
Well, if you give me an idea as to what you hope to accomplish, I
can recommend a sound approach.
-- Ed Leafe
-- http://leafe.com
-- http://dabodev.com
_______________________________________________
Post Messages to: [email protected]
Subscription Maintenance: http://leafe.com/mailman/listinfo/dabo-users