Help button for add on scripts?
All  1-4  5-6

Previous
Next
 From:  bemfarmer
10768.5 In reply to 10768.3 
The first method to have a help "button" is OK.
The hbox and flex method is very nice.

Is there a text editor to create messages in an alert box?
In the past I have had to use /n for newline and + and '

Well, just using text, not variables, would not be too hard...

Sample code:
code:
moi.ui.alert( 'x1 = ' + x1 + ' cm' + '\n' + 'dValue = ' + dValue + ' cm' + '\n' + 'x0 = ' + x0 + ' cm' );


- Brian
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged

Previous
 From:  Michael Gibson
10768.6 In reply to 10768.5 
Hi Brian,

re:
> Is there a text editor to create messages in an alert box?
> In the past I have had to use /n for newline and + and '

That's the main way to do it. Sometimes it can be good to build it up in smaller chunks like

str += '...';
str += '...';

But there is also a string formatter you can use like this:
code:
var x1 = 5, dValue = 3, x0 = 8;
var msg = moi.ui.formatString( 'x1 = %1% cm\ndValue = %2% cm\nx0 = %3% cm', x1, dValue, x0 );
moi.ui.alert( msg );

So for that way you have one "template string" that contains placeholders %1% , %2%, etc.. which are replaced by the values passed after the format string.

That method reduces the amount of little fragments that the regular way uses.

- Michael
  Reply Reply More Options
Post Options
Reply as PM Reply as PM
Print Print
Mark as unread Mark as unread
Relationship Relationship
IP Logged
 

Reply to All Reply to All

 

 
 
Show messages: All  1-4  5-6