A quick (and dirty) Script Palette script
 1-16  17-36  37-44

Previous
Next
 From:  Michael Gibson
5993.17 In reply to 5993.9 
Hi Pilou,

> What file must have to edit for have French "Fermer" against
> the English "Close" button?

Just make sure you have your Language set to French (Options > General > Language), then the dialog should show this (screenshot from my system with MoI language set to French):



This was with the current v3 version, are you maybe using an older version Pilou?

- 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:  Michael Gibson
5993.18 In reply to 5993.16 
Hi Burr,

> I don't know why it is not translating with the French strings. It could be the way the filesystem
> is called in the script? I think Michael will have to look at this.

It's working fine for me over here - when I set Options > General > Language to French, I get a French language close button, as shown above.

You can even have the dialog open when you change the language and it updates dynamically as the current language is switched...

Do you see something different than that over there?

I was testing using the current v3 beta - Pilou are you using an old version maybe?

- 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:  Michael Gibson
5993.19 In reply to 5993.15 
Hi dinos,

> The close button is just the standard moi:DialogClose tag. I'm not sure if this localized
> along with the rest of Moi3D if you are using a different language.

Yup, it is localized and the localization seems to be working fine for me over here...


> I remember looking for a way to close the Dialog window after a command is selected, but
> i couldn't find one. That would eliminate the close button altogether and improve the
> operation of the script.

Buttons or menu items on a flyout will automatically dismiss the flyout when pushed, but that built in default auto closing won't happen if they are on a dialog instead of a flyout menu.

You can add an onclick="" handler to make the dialog close though, you'd want to do the same thing as the button inside of the DialogClose.htm template, which is: onclick="moiWindow.endDialog(0);"

So modifying line #26 of ScriptPalette.htm to be this should do it:

code:
				html += '<moi:MenuItem onclick="moiWindow.endDialog(0);" command="' + cmd + '">' + title + '</moi:MenuItem>';



For some people it might be good to have a separate close button if they are using it repeatedly though...

- 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:  BurrMan
5993.20 In reply to 5993.18 
No. I just did a test by changing the English strings text and didn't switch my system to French.

I just assumed Frenchy new this and it wasn't working for him, and wanted to point him at the area that controlled that dialogue text.
  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:  dinos
5993.21 In reply to 5993.19 
Hi Michael.

Thanks for your help. I've updated the first post to include 2 versions of the script: one with a close button and one without.

Personally i prefer the version without the close button as it feels more natural: Shortcut for the popup to appear, command or escape to dismiss.
But i'm sure there are cases where it might be more useful to have a close button.

Dinos

EDITED: 6 Feb 2014 by DINOS

  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:  Frenchy Pilou (PILOU)
5993.22 
Perfect : I had not enabled the French Language! :)
So when I enable it magically "Fermer" appears as aspected!
Sorry for the little disturb!

Of course I had also the red x button! ;)

EDITED: 6 Feb 2014 by PILOU

  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
5993.23 In reply to 5993.22 
Hi Pilou,

> Perfect : I had not enable the French Language! :)

Mystery solved! :)

- 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:  Andrei Samardac
5993.24 
Why I can not to have this script correctly shown in window?

script: /*! Show all except curves, points and Hidden style*/ var obj = moi.geometryDatabase.getObjects().getBReps(), st = moi.geometryDatabase.findstyle("Hidden",0), sti; if (st) {sti = st.index;} else { sti = "nf";} for ( var o = 0; o < obj.length; ++o ) { if ( obj.item(o).hidden && obj.item(o).styleIndex !== sti) { obj.item(o).hidden = false; obj.item(o).selected = false; }};


In script window it looks like this:

< obj.length; ++o ) { if ( obj.item(o).hidden && obj.item(o).styleIndex !== sti) { obj.item(o).hidden = false; obj.item(o).selected = false; }};"> Show all except curves, points and Hidden style

Looks like it becouse <.
  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:  Andrei Samardac
5993.25 In reply to 5993.1 
Is it any way to make some categories in this script window, to store scripts more logically?
  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:  dinos
5993.26 In reply to 5993.24 
Hi Andrei,
The problem is caused by the double quotes around "Hidden" and "nf" in the script.


If you replace the double quotes with single quotes it should work fine:

script: /*! Show all except curves, points and Hidden style*/ var obj = moi.geometryDatabase.getObjects().getBReps(), st = moi.geometryDatabase.findstyle('Hidden',0), sti; if (st) {sti = st.index;} else { sti = 'nf';} for ( var o = 0; o < obj.length; ++o ) { if ( obj.item(o).hidden && obj.item(o).styleIndex !== sti) { obj.item(o).hidden = false; obj.item(o).selected = false; }};


This is a limitation of the way the script palette works.

Dinos
  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:  Andrei Samardac
5993.27 In reply to 5993.26 
dinos, thank you.

____________________________________________________________________
My Portfolio: www.samardac.tumblr.com
A lot of my Tutorials!
Subscribe to my youtube channel: http://www.youtube.com/samardac
Russian community of MOI 3D: www.vk.com/moi3d
  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:  Frenchy Pilou (PILOU)
5993.28 
Works fine for the "one line" but for the "commands" I see well the name of the Line of the Command but

A little problem!



Of course the command works when I make : Press TAB ...and type _vClone !

Idem if I take a direct native command like Blend!

EDITED: 14 Feb 2014 by PILOU

  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:  dinos
5993.29 In reply to 5993.28 
Hi Frenhcy,
you have to leave a space between the command and the comment:
Blend /*!Blendo*/
Otherwise my script and/or Moi get confused.

Dinos
  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:  Frenchy Pilou (PILOU)
5993.30 In reply to 5993.29 
aaaaaaaaaaaaaaaaaaaaaaaaaaaaah!!!!!!!!!!!!!!

All is fine now! Bravo!
---
Pilou
Is beautiful that please without concept!
My Gallery
  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:  Hans
5993.31 
Hi dino!

You use this sign "!" to pick the commands for your palette. In your script I have seen some of this sign.
Can i change this signs for example in to "?" or other?
Then copy and rename your script "Script Palette 2" to make different category of caommands.

I am not a programmer. May be this is a way.

Thanks for your work!!

Hopefully, Hans
  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:  dinos
5993.32 In reply to 5993.31 
Hi Hans!

I havent tried it, but yes it should work as you describe.

Just change the ! at line 22 in the second copy of the script to something else:
code:
title = line.match(/\/\*\!(.+)\*\//);

Its escaped so you should be fine with most symbols.

I wrote this script primarily for me, and released it in case someone else needed a relatively simple way to keep their scripts in a palette. The Shortcut Keys panel inside Options is hardcoded and cannot be altered so i used the ! sign to emulate a check box next to each command. In my mind the ! sign is actually a check box saying "include in the palette" ;-)

I could replace the ! with !1, !2 etc for multiple categories, but there a few issues that i'll have to think about such as naming the categories, passing parameters to the script etc.
If i can find some free time i might give it a shot.
In the meantime what you are describing is the best way to do it.


Dinos
  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:  Frenchy Pilou (PILOU)
5993.33 
Cool trick!

Excellent!

EDITED: 14 Feb 2014 by PILOU

  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:  Frenchy Pilou (PILOU)
5993.34 
Nothing but as you can see above the button is not centered ! ;)
So does exist some code for resolve this very very very little disturb ? :)
  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
5993.35 In reply to 5993.34 
Hi Pilou,

> Nothing but as you can see above the button is not centered ! ;)

That's normal that buttons on dialogs in MoI are not centered, that's because it looks weird on larger dialogs. See for example the Close button on Options dialog. This dialog is just using the same thing.

- 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:  Frenchy Pilou (PILOU)
5993.36 In reply to 5993.35 
Thx for the info!
---
Pilou
Is beautiful that please without concept!
My Gallery
  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:  1-16  17-36  37-44