Premise [download] Module: UI Controls -> Superceded by ABControls module.

Motorola Premise
123, once again you really went out of your way to help someone new on Premise (me specifically). I very much appreciate it! This new control class you've made works great for me. Rest assured I'll be using this on my current Onkyo receiver driver and many other drivers to come...

File Name: Module: MultiValueComboBox - A new user-interface control.
File Submitter: 123
File Submitted: 10 May 2009
File Updated: 10 May 2009
File Category: Premise
Author: 123
Contact: PM me
Version: 1.0

This module adds a new user-interface (UI) control called MultiValueComboBox. Basically, it displays the current value of a MultiValue property and lets you select any value from its associated Enumeration. Unless you are creating custom screens in AutomationBrowser, you don't need this!

Before installing anything, backup your current Premise Server and export the AutomationBrowser and Plugins modules.

The attached zip archive contains two files.
  1. MultiValueComboBox_<datestamp>.xdo
    Import this module first; it will alter the AutomationBrowser module. It adds a MultiValueComboBox class and alters the existing AutomationBrowser/ControlPanelManager/Classes/CompositeControl class (i.e. it adds the MultiValueComboBox class as a new ObjectContainment).
  2. MultiValueComboBoxTester.xdo
    This module demonstrates the use of the MultiValueComboBox and should be imported last (or not at all). It serves as an example of how to use a MultiValueComboBox. It provides a new Home object called MVCBTester containing two MultiValue properties: Compass and Volume. In Builder, add a New > MCVBTester object somewhere in your Premise Home and then view it in Premise Browser.

Click here to download this file
 
I've renamed this Module to UIControls because it now contains two new UI controls:
  1. MultiValueComboBox
  2. CheckBox
The following two features make the CheckBox control touchscreen-friendly:
  1. You can adjust the size of the checkbox icon.
  2. You can touch/click the checkbox icon or the checkbox label.
 

Attachments

  • CheckBox_Control.png
    CheckBox_Control.png
    5.6 KB · Views: 27
Nice..I finally got around to this. Works well! What I would really like to do is to have a scroll box with the channels as listed in Television Provider - any thoughts? Or will I have to keywhack the channels? Or any ideas on a script?
 
... have a scroll box with the channels as listed in Television Provider - any thoughts?
Fortunately, the HTML SELECT tag has a "size" attribute that determines the number of displayed items. The current version of MultiValueComboBox has its "size" attributed hard-coded to "1". As a result, it appears as a traditional Combo Box control.

I've attached an XDO file containing an enhanced MultiValueComboBox. Import it and it will update the old MultiValueComboBox.

The revised version includes a "ListSize" property that permits you to specify the number of displayed items. If you set it to 2, or more, the UI control will appear as a List Box with a vertical scroll bar.

Example
Using the UICTester example, go to Plugins > ControlsLibrary > UICTester > UICCompass > CompassControl and change its ListSize property from 1 to 2. The attached image shows the control is now a List Box, with a scroll bar, displaying two (North and South) of the four available items (North, South, East, West). Naturally, all UI controls below it must be moved lower to avoid the overlapping seen in the image.
 

Attachments

  • Revised_MultiValueComboBox.zip
    Revised_MultiValueComboBox.zip
    1.7 KB · Views: 11
  • Revised_MultiValueComboBox.png
    Revised_MultiValueComboBox.png
    3.7 KB · Views: 1
  • MultiValueComboBox___ListSize.png
    MultiValueComboBox___ListSize.png
    15.9 KB · Views: 8
  • UICTester_with_ListBox.png
    UICTester_with_ListBox.png
    18.8 KB · Views: 8
123 - looks good, I'll give it a try. I should probably rephrase what I was hoping to achieve. For the Cablebox or PVR, I thought it would be great if there was a way to make the enums used for a combo box to equate to the channels as listed under the Television_Provider...that way, if the channels change, I'd only have to change once (in Content).

What I have done, is added the primary channels we watch onto the UI for the Cable Box/PVR; it eliminates the need to switch back and forth between media and some of the device controls...

Or maybe there's a better way to do the whole task of combining media selection within device control?
 
... make the enums used for a combo box to equate to the channels as listed under the Television_Provider ...
OK, I see what you want; a UI control that that lists Media objects (Channels of a Television_Provider) as opposed to the elements of an Enumeration.

The current implementation creates a UI control for a MultiValue property which draws its values from an Enumeration. A MultiValue property cannot be instructed to draw its values from a Television_Provider. However, an Object Reference property can point to any object within Premise including a Television_Provider.

Both File_Provider and Television_Provider inherit from Content_Provider. So the idea would be to create a UI control for an Object reference property and draw its values from its associated Content_Provider.

I'll look into this further when I have a chance.
 
123! Bingo! I did some investigation over the last few days...which is why I referred back to your combo-box to begin with...I did start going down the path of Radio_Provider and Presets. It seems fundamentally to be the same thing. I have yet to make the connection between 'Radio' and a comparable 'Television' class work. Still working on it, but most importantly, really looking forward to seeing what someone who knows what they are doing comes up with! ;)
 
I'm making progress.

Add an ObjectRef to the UIControlsTester module. Set its Filter to TV_Channel and its Location to Television_Provider (or whatever you've named it). See the first attached image for details.

Now go to the UIControlsTester in Home and click ObjectRef's chooser button. You'll get a popup form that lists all of the available TV-Channels in the Television_Provider (see the 2nd image). That's how an ObjectRef can be used to list TV_Channels (Radio Stations and other media types).

What I need to do is to enhance MultiValueComboBox's GetOptions method. It has to determine if its rendering a MultiValue property or an ObjectRef and handle it appropriately (MultiValues uses Enumerations whereas ObjectRefs can point to all sorts of things).
 

Attachments

  • UIControlsTester___ObjectRef.png
    UIControlsTester___ObjectRef.png
    18.5 KB · Views: 8
  • ObjectRef___TV_Channel.png
    ObjectRef___TV_Channel.png
    49 KB · Views: 11
I think you're on target...in my efforts, I tried to model the Radio_Provider->PresetComboBox. For whatever reason, they decided to handle the Television_Provider differently; in practice, a TV channel is a Preset. Why would one handle them differently?
So when I create a TV Preset control, I need to change the GetOption to handle TV differently. It appears that Radio Stations are children of Radio? Or am I not reading the code correctly?

Looking forward to seeing your results!
 

Similar threads

C
Replies
0
Views
914
chucklyons
C
C
Replies
0
Views
1K
chucklyons
C
C
Replies
2
Views
2K
chucklyons
C
Back
Top