Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

Re: st: Have dialogs and/or -twoway- been overhauled since November?


From   Roger Newson <[email protected]>
To   [email protected]
Subject   Re: st: Have dialogs and/or -twoway- been overhauled since November?
Date   Wed, 30 Mar 2005 22:08:57 +0100

Thanks to Jean-Marie Linhart and James Hassell for their prompt and helpful fix to my problem. After one minor additional modification by myself (adding a -values(al_styles)- to the COMBOBOX refopts.cb_xlextend), I find that their version of -eclplot.dlg- seems to be working like a dream, without any complaints so far. And thanks again for all their previous help with dialog programming.

Best wishes

Roger


At 20:25 30/03/2005, Jean-Marie Linhart wrote:

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/

--
Roger Newson
Lecturer in Medical Statistics
Department of Public Health Sciences
Division of Asthma, Allergy and Lung Biology
King's College London

5th Floor, Capital House
42 Weston Street
London SE1 3QD
United Kingdom

Tel: 020 7848 6648 International +44 20 7848 6648
Fax: 020 7848 6620 International +44 20 7848 6620
  or 020 7848 6605 International +44 20 7848 6605
Email: [email protected]
Website: http://phs.kcl.ac.uk/rogernewson/

Opinions expressed are those of the author, not the institution.

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