On Mon, Jun 24, 2013 at 2:58 PM, Oliver Sims <
oliver.s...@simsassociates.co.uk> wrote:
> In Exercise08 of the ooDialog Guide, I've introduced drag/drop of Product
> and/or Customer onto the Order Form.
> All works fine except for the following sequence:
> (a) Surface an Order Form (by dbl-clk on OrderForm icon in the Order
> Management dialog)
> (b) Surface a Product (dbl-clk on Product List then dbl-clk on any item in
> the listview)
> (c) Drag the Product to the OrderForm.
> In this case, the following error occurs:
> Error 97 running D:\...\Exercise08\Order\OrderFormView.rex line 809:
> Object method not found
> Error 97.001: Object "ECPRODNUM" does not understand message "SETTEXT"
>
You can not use setText() until the underlying edit control has been
created.
>
> However, this error does not occur if, before the first drag of a product
> to the order form, I click on the "Order Lines" tab on the Order Form.
>
> I believe what's happening in the error situation is that the Order Lines
> control dialog is not being initialised properly. It's necessary first to
> click on the Order Lines tab. After that, I can drag a product onto the
> Customer tab and all works fine (except of course I don't see the result
> until the Order Lines tab is clicked) or onto the Order Lines tab.
>
In the example code I wrote for using ControlDialog dialogs, the underlying
dialog window is not created until it is actually used. If you have a tab
control with 7 tabs and the user never visits tabs 3,4,5,6,7, there is,
usually, no sense in creating the underlying windows for those tabs.
>
> So to my question: How do I initialise a control dialog that is initially
> hidden (i.e. not on top) without clicking on its tab?
>
You need to change the basic logic of the program so that you start
(execute) all of the ControlDialog dialogs but do not show them until their
tab is clicked on.
Start by changing this:
-- set up tabs for Customer Details and Order Lines:
cd1 = .CustDetailsDlg~new("Order\OrderFormView.rc", IDD_ORDFORM_CUST_DIALOG)
cd2 = .OrderLinesDlg~new("Order\OrderFormView.rc",
IDD_ORDFORM_ORDLINES_DIALOG)
tabContent = .array~of(cd1, cd2)
cd1~ownerDialog = self
self~prep(tabContent)
-- set up tabs for Customer Details and Order Lines:
cd1 = .CustDetailsDlg~new("Order\OrderFormView.rc", IDD_ORDFORM_CUST_DIALOG)
cd2 = .OrderLinesDlg~new("Order\OrderFormView.rc",
IDD_ORDFORM_ORDLINES_DIALOG)
tabContent = .array~of(cd1, cd2)
cd1~ownerDialog = self
*cd2~ownerDialog = self*
self~prep(tabContent)
Then you need to start both dialogs, but only show and position the first
one. It is a matter of reworking the logic of the program, and then
getting it to work. ;-)
--
Mark Miesfeld
------------------------------------------------------------------------------
This SF.net email is sponsored by Windows:
Build for Windows Store.
http://p.sf.net/sfu/windows-dev2dev
_______________________________________________
Oorexx-users mailing list
Oorexx-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/oorexx-users