How to useing javascript do a command ?

Next
 From:  Kondou
10474.1 
i hope click the
  • can do polyline command, How do?
  • polyline
  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
Next
 From:  Michael Gibson
10474.2 In reply to 10474.1 
Hi Kondou, I'm sorry I don't understand your message, some pieces seem to be missing.

You want to click on what to launch the polyline command?

The script code to start a command goes like this though:

moi.command.execCommand( 'polyline' );

For a keyboard shortcut though you can just put in the name of the command ('Polyline') and for a <moi:CommandButton> UI element you can put in an attribute of command="Polyline". You can find the regular button for launching polyline in the file Lines.htm which is inside the commands folder in the install, it looks like this:
<moi:CommandButton icon="moi://ui/icons/PolylineIcon.png" command="polyline"><moi:Text textid="Polyline"></moi:CommandButton>

If you wanted to make some other element other than a <moi:CommandButton> to launch the polyline command then you would use the script code above to do it, for example a push button that launches the polyline command would go like this:

<moi:PushButton onclick="moi.command.execCommand( 'polyline' );">Polyline button</moi:PushButton>

- 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

Previous
 From:  Kondou
10474.3 In reply to 10474.2 
dear Michael Gibson:

<moi:PushButton onclick="moi.command.execCommand( 'polyline' );">Polyline button</moi:PushButton>

is working!

thanks you!
  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