Editable combobox for Widget.Preferences- Help?

Monday, October 16, 2006 by sViz | Discussion: DesktopX

I need a little help figuring out how to use this property. Specifically when you change the text of the preset entries, how do you make the change permanent?

Widget.AddPreference "box1"
Widget.Preference("box1").Type = "ComboEdit"
Widget.Preference("box1").Caption = "BoxName"
Widget.Preference("box1").AddValue "item1"
Widget.Preference("box1").AddValue "item2"
Widget.Preference("box1").AddValue "item3"


I can edit the names of any one of those entries in widget mode but the changes don’t take effect. I don’t see any further elaboration on this in the DG. Can anyone who has had any experience with this help me out here? Thanks.
sViz
Reply #1 Wednesday, October 18, 2006 12:48 AM
Furthermore, when using a regular combobox I can use Sub Control_OnSelect to trigger an action as soon as I select something from the drop down. I can't do that with a widget.preference combobox. Can I?
Vad_M
Reply #2 Friday, October 20, 2006 11:57 PM
There are many ways to use this. Please look below...

Sub MyBox
On Error Resume Next
Set objBOX = nothing
Set objBOX = DesktopX.CreateForm
With objBOX
.caption = " DesktopX Form Name... "
.addpreference("box1")
.preference("box1").Type = "comboedit"
.preference("box1").caption = "BoxName"
.preference("box1").addvalue "item1"
.preference("box1").addvalue "item2"
.preference("box1").addvalue "item3"
.preference("box1").defaultvalue = "item1"
If .prompt Then
desktopx.object("My Object").text = .preference("box1").value
End If
End With
Set objBOX = nothing
End Sub

This code will work as a regular combobox.
Best Regards.
sViz
Reply #3 Saturday, October 21, 2006 2:57 AM
EDIT: Thanks, Vad_M. While I found this script to be extremely useful I still can't get the action to fire as soon as I select something from the drop down. I'd have to click 'ok' before the changes take effect. Here's my goal really:



I'd select something from the "Select Group" drop down at the top and the information in the fields below would change according to what group I selected.
Group 1 would display:
Group Name: "News"
Browser 1: cnn.com
Browser 2: cspan.com
etc.

Group 2 would display:
Group Name: "OS Customization"
Browser1: wincustomize.com
Browser2: stardock.com
etc.


Essentially I'm making changes within the form or properties box before I click ok and apply them to the widget. If I could simply edit the items in the "Select Group" box I wouldn't need the 2nd box, Group Name. I hope I've explained this well.

Please login to comment and/or vote for this skin.

Welcome Guest! Please take the time to register with us.
There are many great features available to you once you register, including:

  • Richer content, access to many features that are disabled for guests like commenting on the forums and downloading skins.
  • Access to a great community, with a massive database of many, many areas of interest.
  • Access to contests & subscription offers like exclusive emails.
  • It's simple, and FREE!



web-wc01