On Thu, Aug 11, 2011 at 9:48 AM, Oliver Sims <
oliver.s...@simsassociates.co.uk> wrote:

> **
>  >  Is this a bug?  Not really, it's our old friend autodetection.
>
> Ah-ha! I should have thought of that. Many thanks, Mark.
>
> Do you know when you might implement .Application~autoDetection(.false or
> .true)?
>


Well, I was trying to not work any more on the ooDialog code, and just work
on finishing the documentation.  But, I might slip this in to the next beta
drop.

--
Mark Miesfeld





>  Oliver
>
>  ------------------------------
> *From:* Mark Miesfeld [mailto:miesf...@gmail.com]
> *Sent:* 11 August 2011 14:44
> *To:* Open Object Rexx Users
> *Subject:* Re: [Oorexx-users] ooDialog - createStaticText() bug?
>
>   On Thu, Aug 11, 2011 at 7:59 AM, Oliver Sims <
> oliver.s...@simsassociates.co.uk> wrote:
>
>> **
>> In the defineDialog method of a UserDialog program (listed below), I have
>> the following statement:
>>
>>   self~createStaticText(902, 40, 40, 200, 40, , "ABC")
>>
>> But the text "ABC" does not appear. Is this a bug?
>>
>
> I'm going to kind of hedge on my answer.  Is this a bug?  Not really, it's
> our old friend autodetection.
>
> Add:
>
>
> ::method initAutoDetection
>   self~noAutoDetection
>
>
>>  If I now change the createStaticText() statement to:
>>
>>    self~createStaticText(, 40, 40, 200, 40, , "ABC")
>>
>> then the text "ABC" does appear, but of course the program breaks at the
>> ~newStatic(902) statement.
>>
>> Btw, this program used to work fine a couple of months ago.
>>
>
>
> I made a change a little while ago, to fix another bug I think.
>
> Static controls were ignored in the original auto detection code.  But,
> they should only be ignored if they have a resource ID of -1.  If they are
> assigned an ID, then they should be treated by the auto detection code the
> same way as an edit control.  For backwards compatibility, I probably need
> to revisit why I made the change and the implementation of the change.
>
> So, in your code, when you assign an ID, auto detection sets the text to ""
> since you did not set the attribute.  When you don't assign an ID, then auto
> detection ignores the control.
>
> You could also add this code:
>
> dlg = .MyDialog2~new
> dlg~data902 = 'ABC'
> dlg~execute("SHOWTOP", IDI_DLG_OOREXX)
> and skip the initAutoDetection() override and it will work.
>
> All in all, I think the confusion auto detection causes negates the idea
> that it makes things simplier for the Rexx program.
>
> Here's a small program that shows why a static text control should be
> treated the same as an edit control.  If the programmer *wants* to use auto
> detection, then it should behave consistently in all cases:
>
> say 'Please enter your name:'
> parse pull name
>
> dlg = .MyDialog2~new
> dlg~data902 = 'Hello' name
> dlg~execute("SHOWTOP", IDI_DLG_OOREXX)
>
> ::requires "ooDialog.cls"
>
> ::CLASS 'MyDialog2' SUBCLASS UserDialog
>
> ::METHOD init
>   forward class (super) continue
>   self~create(30, 30, 257, 123, "Test Dialog", "CENTER")
>
> ::METHOD defineDialog
>   self~createPushButton(901, 142, 99, 50, 14, "DEFAULT", "PushMe",
> PushMeClicked)
>   self~createStaticText(902, 40, 40, 200, 40, , "ABC")
>
> ::METHOD PushMeClicked
>   newText = self~newStatic(902)
>   say "Change your name to:"
>   parse pull name
>   newText~setText("Hello" name)
>
> --
> Mark Miesfeld
>
>
> ------------------------------------------------------------------------------
> Get a FREE DOWNLOAD! and learn more about uberSVN rich system,
> user administration capabilities and model configuration. Take
> the hassle out of deploying and managing Subversion and the
> tools developers use with it.
> http://p.sf.net/sfu/wandisco-dev2dev
> _______________________________________________
> Oorexx-users mailing list
> Oorexx-users@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/oorexx-users
>
>
------------------------------------------------------------------------------
Get a FREE DOWNLOAD! and learn more about uberSVN rich system, 
user administration capabilities and model configuration. Take 
the hassle out of deploying and managing Subversion and the 
tools developers use with it. 
http://p.sf.net/sfu/wandisco-dev2dev
_______________________________________________
Oorexx-users mailing list
Oorexx-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/oorexx-users

Reply via email to