Thanks Aaron.
That was quick and helpful. I just have a small wish more, for an
improvement to the ListBox property.
For an example, let me just do this:
You let a routine in your app populate the listbox with files in a folder.
Then, you let the user choose a file, from the ListBox. Let's say, he
chooses file 3, and the listbox has ten entries. Your app further let the
user hit a Delete key, and the file will be deleted. What then happens?
Well, the way things stand to day, you now will populate the listbox once
again, and the result will be a list of nine files. And, you are placed on
the first of the entries.
My wish would have been, that there had been some kind of an Index property
of the ListBox routine. How about something like:
Set s =
SharedObjects("com.gwmicro.gwtoolkit.simpledialogs").listboxdialog
s.additem "red", "red"
s.additem "green", "green"
s.additem "blue", "blue"
s.sort = true
s.defaultbutton = "&Select"
s.cancelbutton = "Close"
s.DefaultSelect = 2
print s.ChooseItem("Select a color")
X = S.CurrentIndex
Then, when you call the listbox routine next time, you could do:
S.DefaultSelection = X
, And the user would be directly on the spot where he left off. That is, in
my example, since he deleted file 3, he now will be placed on the 'new' file
3... Hope that example made sense. Smile. Bit late here, but still hope you
get the meaning of the thing.
could such a small thing easily be implemented? My above example of a list
of files, would only be one case where the CurrentIndex variable could be
useful. Same goes with a listbox wthat was related to an array, or any other
listbox that might be updated somehow down the road. If your list only does
contain ten entries, it is only anoying that you will be taken back to a
start point (first entry, or whatever is hard coded in the
DefaultSelection). But what if your list is populated by 100 entries, you
are at 77, and the list gets updated, and DefaultSelection has been
hardcoded to 1? Smile.
From: "Aaron Smith" <[email protected]>
Cc: <[email protected]>
Sent: Wednesday, November 30, 2011 9:10 PM
Subject: Re: SimpleDialogs Update
OOps. Make that DefaultSelection.
Thanks,
Aaron
On 11/30/2011 1:28 PM, Aaron Smith wrote:
Greetings,
The latest version of the GW Toolki (8.4.4) has support for the
DefaultSelect property in the SimpleDialogs object:
Set s =
SharedObjects("com.gwmicro.gwtoolkit.simpledialogs").listboxdialog
s.additem "red", "red"
s.additem "green", "green"
s.additem "blue", "blue"
s.sort = true
s.defaultbutton = "&Select"
s.cancelbutton = "Close"
s.DefaultSelect = 2
print s.ChooseItem("Select a color")
That would result in a dialog with the green list box item automatically
selected.
Aaron
--
Aaron Smith
Web Development * App Development * Product Support Specialist
GW Micro, Inc. * 725 Airport North Office Park, Fort Wayne, IN 46825
260-489-3671 * gwmicro.com
To insure that you receive proper support, please include all past
correspondence (where applicable), and any relevant information
pertinent to your situation when submitting a problem report to the GW
Micro Technical Support Team.