More indepth documentation?

More details needed on Object.Command

I've read a few threads on here about documentation being light. I've read the new 3.1 doc and still it just doesn't go into much depth. Somewhere there must be something deeper.

Take for instance Object.Command ... here's what the latest doc says:
Object.Command and Object.CommandParameters
Gets/sets the object command and parameters for Shortcut and URL object types.

OK. That's nice. Now what? So I have the need, let's say, to set the folder property for an object that is a pop-up menu of a folder. Right now I set it in the object properties (in DX) to the Programs folder. Now I want my users of the widget to be able to set a preference to a different folder. From reading the doc you would assume somehow you would use the Object.Command to issue that command since that particular property isn't exposed through the public interface of the object (from what I can find).

So ... any help on more detailed doc or how to do things like this would be helpful. I've seen another poster trying to ask this same question (setting shortcut folder) and the response was to read the manual basically but the manual doesn't seem to go that deep.

for any help,

Vince
7,182 views 6 replies
Reply #1 Top
Oh and I did setup the preferences so they show up in the exported object's preference dialog (which is WAY cool BTW) and I know they are getting set correctly but how to apply them like you would Object.Text is the question.

Oh and does anyone know how to access those preferences when running under DX like it does on the exported widget?

Vince
Reply #2 Top
First, here's my favorite link to DX documentation. https://www.stardock.com/products/desktopxenterprise/resources.asp

If you've seen all that, sorry, but it sounded like you were only looking at the Developers Guide.

I'm a bit unclear on some of your other questions, but I think I can get one of them. When you've added a widget preference Widget.AddPreference("CustomPrefName") (Which, you are right, is very cool) you can use/manipulate the value of that preference with Widget.Preference("CustomPrefName").Value As in

Widget.Preference("Name").Value = "NewValue" to change it or,
"CertainVariable" = Widget.Preference("Name").Value to retrieve it.

Also, there is the Sub Widget_OnPreferencesChange which is called when someone changes a value in the Properties panel and clicks OK. You can use this to do things that need to be done when users adjust preferences. I have a size slider in one of my widgets. So in the Widget_OnPreferencesChange function I use Object.Width = Widget.Preference("CustomSize").Value and Object.Height = Widget.Preference("CustomSize").Value to make the changes.

hth, rr
Reply #3 Top
Thanks. Yeah I have all the code to handle preferences. I just can't figure out how to set the folder for my object's shortcut (it's a shortcut object that people can config with image and text and folder location). So I can get the pref back out just fine but the doc didn't help on then to take that and set the object's shortcut folder from that variable.

Thanks again,

Vince
Reply #4 Top
Oh, I see. Hmm. You're right, there doesn't seem to be an easy way to set the Location: field. You can try variations on

Set objShell = CreateObject("WScript.Shell")
mypath = "E:\Data"
torun = "explorer " & mypath
objShell.Run torun

But I'm not sure if that'd handle spaces well.
Reply #5 Top
Yeah that will launch the folder. I guess I'm stuck not doing it. What I want to do is control the folder that a DX object pops up as a pop-up menu. The only way would be accessing the object's internal stuff like shortcut folder and such. None of the doc has those internals (and they may not even be exposed in the public interface). Oh well. It was a fun idea.

Thanks for the help. It is appreciated.

Vince
Reply #6 Top
Oh and ... I guess I'll just have to write it in C++.

Vince