Improvement requests :  K-Meleon Web Browser Forum
Use this forum to talk about a feature you're missing. 
Picklist for the macro language
Posted by: JamesD
Date: January 01, 2016 02:08AM

There are times when the confirm() statement cannot adequately handle a choice between items by the user. It can return a choice from a maximum of three items and do that by assigning the items to YESNOCANCEL. Using yes, no, and cancel is confusing to the user when the choices are of equal weight and there is no cancel if one of the choices is assigned to cancel.

Yes, prompt() can accept a number as a choice, but only confirm() has a message area longer than one line. Also prompt() does not restrict the user's input. The results from prompt() might require a revisit to the prompt if they don't fit the macro's requirements.

I would like to propose this:
    $RESULT = picklist( MESSAGE , PICKS [, TITLE  [, ICON]] );

Shows a messagebox and asks for a choice (numeric 1-9 w/zero for cancel).
The messagebox is where the choices are enumerated.

PICKS   =  NUMBER OF BUTTONS WITH NUMBERS TO BE SHOWN PLUS CANCEL 
ICON    =  EXCLAIM | INFO | STOP | QUESTION 
RESULT  =  1 | 2 | ... | 9 | 0

It is likely too much to hope that the Microsoft Foundation Class provides for this, but I just had to ask.

Options: ReplyQuote
Re: Picklist for the macro language
Posted by: siria
Date: January 01, 2016 02:48AM

Yes the "prompt" is so heavily restricted on info-space it's often an impossible struggle! But recently have read somewhere that javascript-prompts can actually show multiple lines?? If true, that might be the easiest solution.

And at the moment I'd use as a workaround for a picklist a little popupmenu. First the user info via info-alert (if needed), and upon clicking "OK" the menu with the fix options pops up...
The catch with that construction is, in that moment the calling macro ends, and the new menu must call everything that follows. It could inherit a variable with an "$_action" instruction or such. And if the user cancels the popmenu by clicking sideways, macros will not know this.

As example, my PermDefs macro uses such little multiple-choice menus (e.g. Toggle script files: allow all / no 3rd party / block all)
Post #2:
http://kmeleonbrowser.org/forum/read.php?9,134990

Options: ReplyQuote
Re: Picklist for the macro language
Posted by: JamesD
Date: January 01, 2016 03:20PM

I have an extension called "KMListBox" that works. The problem with it has always been the length of the string passed with the exec() statement.

Now that KM can write a data file, perhaps it is time to revisit that project and see if it can handle items where an item might need more than one line. If I can find the time and energy.

Options: ReplyQuote
Re: Picklist for the macro language
Posted by: JamesD
Date: January 25, 2016 03:01PM

Quote
JamesD
I have an extension called "KMListBox" that works. The problem with it has always been the length of the string passed with the exec() statement.

Now that KM can write a data file, perhaps it is time to revisit that project and see if it can handle items where an item might need more than one line. If I can find the time and energy.

I have almost completed the update for KMListBox. I need to know if an average user can copy files within the root directory. I have not had a 'normal' setup on my computer for years. I have write authority everywhere.

Specifically can the user run a macro which uses deletefile() and copyfile() statements where the target path is root\tools\KMListBox. If they cannot then the KMListBox folder must be in their profile.

The KMListBox.exe can handle individual items up to 64 characters and I still have to check the maximum number of items that can be displayed. I will soon test whether items can be multi line.

Options: ReplyQuote


K-Meleon forum is powered by Phorum.