XWidgetSoft Forum
https://www.bbs.xwidget.com/

Code to SetPath & SetIcon with auto binding current object
https://www.bbs.xwidget.com/viewtopic.php?f=8&t=2512
Page 1 of 1

Author:  meme [ January 11th, 2013, 5:55 pm ]
Post subject:  Code to SetPath & SetIcon with auto binding current object

I have several shotcutcores in a widget a wish to change the settings of the shortcuts via code, can anyone assist with the syntax.
I can add "Menu items" that use !SetPath= & !SetIcon= with the Binding core-auto binding current object core, selected.
This works, so you can right click on any shortcut and then it will set a path or icon, but I wish to do it from code.

How can do a similar thing in code? Something like...
ShortCutCore.shortcutcore1.DisplayName="hello";
shortcutcore1.icon=icons\blank.png
or can I use !SetPath= & !SetIcon=
But I can not get it to work...
How can I achieve the same as the "auto binding current object core" ? so the code runs on the currently selected object core.

Thany you for any assistance :D

Author:  Tony [ January 11th, 2013, 6:41 pm ]
Post subject:  Re: Code to SetPath & SetIcon with auto binding current obje

you can uses code :

Code:
  shortcutcore1.cmd(null, "!SetIcon=icon.png" );

Author:  meme [ January 11th, 2013, 8:10 pm ]
Post subject:  Re: Code to SetPath & SetIcon with auto binding current obje

Thank you Tony that works fine to change the settings for Path and Icon but what about DisplayName ?
Is there a !DisplayName= that can be used to edit the display name ?

Also how can I achieve the same as the "auto binding current object core" ? so the code runs on the currently selected object core?
I can get the name of the object requesting the code with
function OnMouseDown(Sender)
sender.name
But how to I find the shortcutcore? for that object ?

Your assistance is greatly appreciated :)

Author:  Tony [ January 16th, 2013, 12:06 am ]
Post subject:  Re: Code to SetPath & SetIcon with auto binding current obje

The DisplayName will auto set by "!SetPath="

Page 1 of 1 All times are UTC - 8 hours
Powered by phpBB® Forum Software © phpBB Group
http://www.phpbb.com/