Roger Newson <roger.newson at kcl.ac.uk> asks:
> I have a query re -graph twoway- and dialog boxes under the latest
> version of Stata 8.2 for Windows (executable 10 Jan 2005, ado-files
> 24 Feb 2005). Have there been any unpublicised major overhauls of
> the Stata graphics dialog box system since November 2004?
>
> I ask because my package -eclplot- (downloadable from SSC and
> distributed 22 November 2004) suddenly seems no longer to work in
> dialog mode, as invoked by
>
> db eclplot
Roger also points us to a Statalist post:
> http://www.stata.com/statalist/archive/2004-08/msg00585.html
Apparently we made several mistakes, as well as fixing a bug and
Roger's dialog was the drive-by victim. What has happened is that on
many controls you are using our standard lists (and you should), but
using the standard lists to define both contents and values. Don't
put in a values list as a general rule -- but we made this mistake in
the previous Statalist post ourselves, and, in the old code, with the
bug, it worked just fine for us as well as for Roger.
When we define a list, such as colors, the first item in it is
"Default" for the default color. Then, when you use contents(colors)
the dialog system automatically associates you with an appropriate
values list of colors, where the first item is "" (the empty string),
which corresponds with "Default".
When we say contents(colors) values(colors), we override this
automatic value list and now the first list item for values is
"Default", and indeed, Default came out. This is the desired
behavior, because in some cases (e.g. list type yesno) it is required
that you override the standard output list to get the proper behavior
from a control.
In the case of yesno lists, you usually need to define your own values
list -- yes and no are not the things you want to see as output!
Here's what happened in Roger's code. The first combobox misbehaving
on Roger's estopts tab is:
COMBOBOX cb_mcolor boxxpos_1 @ colorboxwid ., label("Marker color")
dropdownlist option(mcolor) contents(colors) values(colors)
onselchangelist(estopts_cb_mcolor_oscl)
What will and should work is:
COMBOBOX cb_mcolor boxxpos_1 @ colorboxwid ., label("Marker color")
dropdownlist option(mcolor) contents(colors)
onselchangelist(estopts_cb_mcolor_oscl)
with no values(colors)
I fixed Roger's dialog in the course of investigating what was going
on here, and I'm sending it to him in a separate email.
--Jean Marie with help from --James Hassell
[email protected] [email protected]
*
* 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/