Go Back   Cockos Incorporated Forums > REAPER Forums > REAPER Feature Requests

Reply
 
Thread Tools Display Modes
Old 04-22-2021, 12:17 PM   #1
Buy One
Human being with feelings
 
Buy One's Avatar
 
Join Date: Sep 2019
Posts: 1,132
Default reaper.MB() and reaper.ShowMessageBox() customizable button captions

The default names don't fit all use cases. I believe it should not be difficult to add another argument to the function where button captions would be separated by a comma or a semicolon much like field names in reaper.GetUserInputs()
Buy One is online now   Reply With Quote
Old 04-22-2021, 12:26 PM   #2
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,621
Default

I'll quote a post from the Api-wishlist-thread about that:

https://forum.cockos.com/showpost.ph...&postcount=357

Quote:
Originally Posted by rstockm View Post
As of now, the MB() offers these button-choices for modal dialogs:

0, OK
1, OK CANCEL
2, ABORT RETRY IGNORE
3, YES NO CANCEL
4, YES NO
5, RETRY CANCEL

which is not so bad after all.
Nevertheless, best practice is to have the actual task/verb printed on the button instead of "OK" or "Yes".
Apple addressed this ages ago, this is from 1992 I guess:


To boost up the UX my suggestion would be to offer an "extended" MB() command, where I as the author of a script can define the text on the buttons to my liking. Bonus karma for giving us 3 or even 4 options if we wish.

Before:

"Do you want to save this file?"
[no] [yes]

after:
"Do you want to save this file?"
[cancel] [save as...] [save]

And an optional checkbox for stuff like "remember my choice for the future"
__________________
Use you/she/her.Ultraschall-Api Lua Api4Reaper - Donate, if you wish

On vacation for the time being...
Meo-Ada Mespotine is offline   Reply With Quote
Old 04-22-2021, 12:29 PM   #3
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,621
Default

Wouldn't use comma or semicolon separation, as this interferes with button-caption-texts that need a , displayed.
A common problem with GetUserInput.
__________________
Use you/she/her.Ultraschall-Api Lua Api4Reaper - Donate, if you wish

On vacation for the time being...
Meo-Ada Mespotine is offline   Reply With Quote
Old 04-22-2021, 01:40 PM   #4
Buy One
Human being with feelings
 
Buy One's Avatar
 
Join Date: Sep 2019
Posts: 1,132
Default

Quote:
Originally Posted by Meo-Ada Mespotine View Post
Wouldn't use comma or semicolon separation, as this interferes with button-caption-texts that need a , displayed.
A common problem with GetUserInput.
I don't mind any other delimiter, but i considered this case. I just think that there's simply not enough space in a button to insert captions which would require punctuation marks.
Buy One is online now   Reply With Quote
Old 04-22-2021, 02:27 PM   #5
Meo-Ada Mespotine
Human being with feelings
 
Meo-Ada Mespotine's Avatar
 
Join Date: May 2017
Location: Leipzig
Posts: 6,621
Default

Quote:
I don't mind any other delimiter, but i considered this case. I just think that there's simply not enough space in a button to insert captions which would require punctuation marks.
The punctuation could be the actual content. For instance a messagebox asking "Do you prefer ; or , or . ?"
Could lead to buttons like ";" "," "." as selection. The usecases are probably rare, but why risking loosing them in the first place.


I personally would prefer support for 5 buttons(more are too impractical) and a checkbox(for remember my selection stuff).

So you would have as parameters:
string Text
string Title
string Checkbox_caption("", for no checkbox)
integer Number_buttons(up to 5)
string Buttontext_1
string Buttontext_2
string Buttontext_3
string Buttontext_4
string Buttontext_5

And as retvals:
integer Pressed_button
boolean Checkbox_State

This would be the easiest to have and use and create no ambiguity.
__________________
Use you/she/her.Ultraschall-Api Lua Api4Reaper - Donate, if you wish

On vacation for the time being...

Last edited by Meo-Ada Mespotine; 04-22-2021 at 02:33 PM.
Meo-Ada Mespotine is offline   Reply With Quote
Old 04-22-2021, 02:50 PM   #6
Buy One
Human being with feelings
 
Buy One's Avatar
 
Join Date: Sep 2019
Posts: 1,132
Default

OK, that's a more advanced function. I was only thinking about the option to rename buttons currently available.

But if there's a separate argument for button names how could the text of the actual message spill over to it?
Buy One is online now   Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -7. The time now is 04:02 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.