Statalist


[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: Dialogs setvalue and tab switching


From   [email protected] (James Hassell, StataCorp)
To   [email protected]
Subject   Re: st: Dialogs setvalue and tab switching
Date   Mon, 27 Aug 2007 12:11:08 -0500

Sergiy Radyakin <[email protected]> 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 [email protected].

> 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/



© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index