WinBatch® Technical Support Forum

All Things WinBatch => WinBatch => Topic started by: stevengraff on January 13, 2014, 05:29:51 AM

Title: AskItemList change "OK" button text
Post by: stevengraff on January 13, 2014, 05:29:51 AM
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?
Title: Re: AskItemList change "OK" button text
Post by: snowsnowsnow on January 13, 2014, 07:43:22 AM
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.
Title: Re: AskItemList change "OK" button text
Post by: Deana on January 13, 2014, 08:42:42 AM
You have a number of possible options.




Title: Re: AskItemList change "OK" button text
Post by: stevengraff on January 13, 2014, 11:40:30 AM
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
Title: Re: AskItemList change "OK" button text
Post by: Deana on January 13, 2014, 12:01:02 PM
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 )
Title: Re: AskItemList change "OK" button text
Post by: 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)
Title: Re: AskItemList change "OK" button text
Post by: snowsnowsnow on January 14, 2014, 04:45:33 AM
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.

Title: Re: AskItemList change "OK" button text
Post by: stevengraff on January 14, 2014, 07:18:14 AM
Thanks Snow... much appreciated. :)