On Thu, May 26, 2011 at 6:00 PM, Mark Miesfeld <[email protected]> wrote:
> On Thu, May 26, 2011 at 4:41 PM,  <[email protected]> wrote:
>
>> Using ResDialog, I cannot initially display data in an edit control. The
>> test I ran to try to isolate the problem is as follows:
>  ...
>> I have two identical programs, except that one uses RcDialog while the other
>> uses ResDialog.
>
> I would expect the same problem to exist in the RcDialog.

Although the programs are similar, they are not identical.  In the
program for the RcDialog, you use this for the new() method:

  dlg = .ProductView~new("ProductView.rc", IDD_PRODUCT_VIEW, dlgData.,
"ProductView.h")

and in the program for the ResDialog you use this:

  dlg = .ProductView~new("ProductView.dll", IDD_PRODUCT_VIEW, , "ProductView.h")

So, in the Rc dialog you supply the 3rd dialog data stem argument, and
in the Res dialog, you omit that 3rd argument.

If you either use the argument in both programs, or omit the argument
in both programs, they will behave exactly the same.

When you use the argument, after initDialog() is executed, the
ooDialog framework will use the stem to set the values of the dialog
controls and will not use the data attributes to set the controls.
But, since you never initialized the stem, there are no controls to
set.  This is why you see the text that you set with:

    prodNo = self~newEdit("IDC_PROD_NO")
    r = prodNo~settext("ABC123")

When you omit the argument, after initDialog() finishes, ooDialog sets
the edit control to the value of its data attribute, which is the
empty string.

This behavior is now documented in section "3.2.1 new (Class method)"
the new method of the dialog object.  If you read that and the
"Understanding data attributes" section, it should be perfectly clear.
 <grin>

This was a good topic, it is an area that can be very confusing.

--
Mark miesfeld

------------------------------------------------------------------------------
vRanger cuts backup time in half-while increasing security.
With the market-leading solution for virtual backup and recovery, 
you get blazing-fast, flexible, and affordable data protection.
Download your free trial now. 
http://p.sf.net/sfu/quest-d2dcopy1
_______________________________________________
Oorexx-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/oorexx-users

Reply via email to