AskItemList change "OK" button text

Started by stevengraff, January 13, 2014, 05:29:51 AM

Previous topic - Next topic

stevengraff

I'd like to put different text on the OK button, i.e. "Go to" or something like that. Couldn't see how to do that. Is it possible?

snowsnowsnow

There's no "straight" way to do this, and the rest of the forum folks will tell you that you need to write a (custom) dialog script to setup your own dialog.  This means, essentially, that you will be re-inventing the wheel from first principles.

However, there is a way to do it - that allows you to re-use the system-provided dialogs.  It's a little involved, but I do it all the time.  It involves launching a secondary script to change the text of the buttons of your main script.

If you are interested, post back here, and I'll see if I can dig up some code.

Deana

Deana F.
Technical Support
Wilson WindowWare Inc.

stevengraff

Thanks; I'll have to put this off for a while. It just depends on how badly my end-users hate OK and want it to say "Go To." Maybe they won't care.  :D

Deana

I believe I misread the original post. I was thinking you wanted to change the name of a button on a MESSAGE box. However, now that I have had more than one cup of coffee I see you wanted to change the button name on a AskItemList.
Simply use the ButtonNames function. It changes the names of the buttons which appear in some WIL dialogs. Such as AskItemList.


Code (winbatch) Select
ButtonNames("Title1", "Title2")
AskItemList("", FileItemize(Dirscript():"*.*"), @tab, @sorted, @single )
Deana F.
Technical Support
Wilson WindowWare Inc.

stevengraff

Wow!

ButtonNames("Title1", "Title2") totally did the trick, thanks! (In the simple kind of way I always expect from WinBatch, and rarely get disappointed)

snowsnowsnow

Quote from: stevengraff on January 13, 2014, 07:18:10 PM
Wow!

ButtonNames("Title1", "Title2") totally did the trick, thanks! (In the simple kind of way I always expect from WinBatch, and rarely get disappointed)

I'm very glad that worked for you.

The problem is that ButtonNames() only works on a small subset of the WB "built-in" dialogs, and it always seemed that when I needed it, the dialog that I'm working with was not in the list.

FWIW, the list is: AskLine, AskFileText, AskItemList, AskPassword

Anyway, again, FWIW, the method that I use to change the title of any dialog button (using the Control Manager in a secondary script) is Really Cool.


stevengraff