Re: st: Dialogs setvalue and tab switching

Dear James,
thank you very much for the answers. Now knowing how this feature is
called (withvalue) I did a search back and found that it was asked
about already in 2003 (Stata 8):
http://www.stata.com/statalist/archive/2003-03/msg00160.html. But it
was not straightforward to find without knowing the answer in the
first place.
Thanks for the advice regarding accessibility options. The focus is back.
Best regards,
Sergiy Radyakin
On 8/27/07, James Hassell, StataCorp <jhassell@stata.com> wrote:
> Sergiy Radyakin <serjradyakin@gmail.com> has asked several questions about
> dialog programing and various behavior of the dialog system. I will
> respond below. If Sergiy has more in-depth questions he would like to
> ask, I invite him to email me privately at jhassell@stata.com.
>
> > 1. I have a dialog with a combobox (COMBOBOX control) and a label
> > (TEXT control). I would like to set the label to be equal to some text
> > and the value of the combobox. To do this I handle onselchange()
> > event:
>
> > PROGRAM Combo_changed
> > BEGIN
> > put `".my_dlg.main.tx_key.setlabel "My string "' main.cb_box1 `"""'
> > stata hidden
> > END
>
> > I wonder if I can achieve the same result without having to call Stata
> > from my dialog.
> > If I write:
>
> > PROGRAM Combo_changed
> > BEGIN
> > call main.tx_key.setlabel main.cb_box1
> > END
> >
> > the label becomes "main.cb_box1" (e.g. it is not evaluated). However,
> > the same expression is evaluated in the -put- statement. I wonder if
> > it was possible to manipulate the values of controls in the dialogs
> > too.
>
> Sergiy can write a dialog PROGRAM to handle the task without calling the
> Stata ado engine.
>
> You can use an undocumented feature: withvalue.
>
> withvalue is used as a member program and takes the -value- of a dialog
> control and places it in a substitution character '@'. This method will
> work in both Stata 9 and Stata 10.
>
> SCRIPT Combo_changed
> BEGIN
> main.cb_box1.withvalue main.tx_key.setlabel "@"
> END
>
>
> > 2. Working on a computer without a mouse recently I noticed that
> > Ctrl+PgUp and Ctrl+PgDn combinations, which switch the tabs of a
> > dialog, do not work in Stata (versions 8, 9 and 10 for Windows). Can
> > this be fixed? Is there any other shortcut to switch tabs?
>
> We will work to get this added, but I can't give a time frame on when
> it will be done.
>
>
> > 3. Regarding tabs. There seems to be a differential behaviour between
> > the versions of Stata. At least in version 8 (Windows) focused
> > controls were highlighted (with a dotted line). Already in version 9
> > (Windows) it disappeared (though I guess it was retained in v9 some
> > time ago). Thus having 10 checkboxes on a form makes it difficult to
> > realize which one is active (again, no mouse). Can this highlighting
> > feature be controlled somehow? E.g. version control/dialog
> > directive/scheme, etc. Does XP Scheme has anything to do with it?
>
> The Windows DLL (uxtheme.dll) which controls the appearance of themes
> seems to be preventing the focus rings from appearing. We have been
> unable to find a workaround we can implement in the code. However,
> end users can work around this by enabling "Show extra keyboard help
> in programs" under the "Accessibility Options" in Windows XP, and
> keyboard focus rings should return.
>
>
> > And how is tab-ordering of controls organized? (e.g. in the same
> > sequence the controls are defined in the file, or top-to-bottom/ then
> > left-to-right, or something else?)
>
> This is normally the order in which the controls are created. However,
> the behavior is operating system and window manager dependent.
>
> *
> * For searches and help try:
> * http://www.stata.com/support/faqs/res/findit.html
> * http://www.stata.com/support/statalist/faq
> * http://www.ats.ucla.edu/stat/stata/
>
*
* For searches and help try:
* http://www.stata.com/support/faqs/res/findit.html
* http://www.stata.com/support/statalist/faq
* http://www.ats.ucla.edu/stat/stata/