How to setup a .HTM file for a custom command to allow entering a text value

Next
 From:  fcwilt
11712.1 
Hi,

I'm working on the UI portion for some of my custom commands.

Currently the values I wish to be able to specify in the UI generated from the .HTM file, are hard coded in the .JS file for testing.

I've gotten the .HTM file to display a drop down combo where one of a fixed number of options can be selected. It's working fine.

But I cannot figure how to display a simple text entry field with a prompt showing what is to be entered into the field.

None of the examples I've found include a simple text entry field.

Thanks in advance.

Frederick
  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
11712.2 In reply to 11712.1 
Hi Frederick, you would usually want to use an <input> control for single line text field.

Here's an example from EditNameDialog.htm which you can find in the UI folder in the install:

Name:  <input id="nameinput" style="width:100%">


The input control doesn't have a closing tag and it has a .value property with the text value that it contains.
https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/input

If you can post your current .htm I can try to make a demo using it.

- 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
Next
 From:  fcwilt
11712.3 In reply to 11712.2 
Hi Michael,

This is what I have so far.

It displays the drop-down combo and the done/cancel buttons - that much all works.

I now need a text input field and a check box.

I recall seeing a check box example in another bit of code.

Frederick
Attachments:

  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
11712.4 In reply to 11712.3 
Hi Frederick, for a checkbox see here:
https://moi3d.com/forum/index.php?webtag=MOI&msg=11689.20

I've attached a version with a text input added.

- Michael
Attachments:

  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:  fcwilt
11712.5 In reply to 11712.4 
Hi Michael,

I've got what I need, UI wise, for now.

A couple of quick questions.

1.

Is it possible to show/hide an element like the check button, based on the current value of the drop-down combo?

2.

It seems that MoI reads the custom commands on startup, as edits I make don't seem to take effect until I open/close Moi.

Is there a script or something that can be executed within Moi to force it to re-read the commands?

Thanks much.

Frederick
  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
11712.6 In reply to 11712.5 
Hi Frederick,

re:
> 1.
> Is it possible to show/hide an element like the check button, based on the current value of the drop-down combo?

Yes, I've attached an example that hides the text input table row when the drop-down has a value == 'export'.

It does this by adding an onchange="" event handler to the dropdown and also an Initialize() function.


> 2.
> It seems that MoI reads the custom commands on startup, as edits I make don't seem to take effect until I open/close Moi.

It doesn't read them on startup but when it loads it, it stores it in memory so the next run doesn't load it from disk again.

See here for a moi.ini setting which will disable the caching:
https://moi3d.com/forum/index.php?webtag=MOI&msg=6727.2

- Michael
Attachments:

  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:  fcwilt
11712.7 In reply to 11712.6 
Hi Michael,

With your help on HTML I am very please with how things are going.

I have "visible" sets working well, with the UI providing for multiple sets using the text entry field and the check button selecting an option to keep currently visible objects visible on set restore, regardless of their being a "member" of the set.

I am having a blast - things that in the the past have been tedious are getting so much easier.

Frederick
  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