Setting Default values for Ribbon UI dropDown and comboBox control

  • Thread starter Michael S. Scherotter
  • Start date
M

Michael S. Scherotter

Is it possible to set the default values for a Ribbon UI comboBox and
dropDown box?
For example, I want to specify "United States" for the default country and
"English" for the default language.

<comboBox id="Country" keytip="CN" onChange="CountryChanged"
label="Country"
screentip="Pick your country from the list or type it
in.">
<item id="France" label="France"/>
<item id="Germany" label="Germany"/>
<item id="Japan" label="Japan"/>
<item id="UK" label="United Kingdom"/>
<item id="US" label="United States"/>
</comboBox>
<dropDown label="Language" keytip="LN" id="Language"
onAction="LanguageChanged"
screentip="Pick your language.">
<item id="en" label="English"/>
<item id="fr" label="French"/>
<item id="de" label="German"/>
<item id="jp" label="Japanese"/>
</dropDown>
 
M

Michael S. Scherotter

Patrick,
Thanks. I figured it out for the comboBox, but the dropDown control does
not have a getText callback in the schema and if you add one, you get an
error on loading the document. Do you know if this is a bug or by-design?
By the way, my ribbon bar is in a customUi.xml section in the docm file and
the callbacks are all VBA macros. Do you know the VBA signature for the
getVisible callback. How often is it called. I would like to make a group
visible when a button is pressed.

Thanks,
--
Michael S. Scherotter
Solution Platform Product Manager
Mindjet Corporation


Patrick Schmid said:
You'll have to implement the getText callback for the comboBox for
example. See http://pschmid.net/blog/2006/07/02/27
For a VB.NET sample of a comboBox. It should be fairly straightforward
to convert that sample to VBA. For an explanation of the callbacks, see
the earlier post http://pschmid.net/blog/2006/06/14/21

Patrick Schmid
 
P

Patrick Schmid

Maybe getSelectedItemID for the dropdown? Take a look at the schema and
the MSDN RibbonX documentation (you can find links on my blog)
sub GetVisible(control as IRibbonControl, ByRef visible)
Part 2 of the MSDN documentation on RibbonX lists all callbacks.
Due to a bug in B2, getVisible is called several times a second. I don't
know how often it will be called in the final product.
I should caution you against making a group just visible. That is now
how the Ribbon UI works. I urge you to read my UI style guide and
rethink that decision: http://pschmid.net/blog/2006/06/09/20

Patrick Schmid
--------------
http://pschmid.net

"Michael S. Scherotter" <[email protected]>
wrote in message
Patrick,
Thanks. I figured it out for the comboBox, but the dropDown control does
not have a getText callback in the schema and if you add one, you get an
error on loading the document. Do you know if this is a bug or by-design?
By the way, my ribbon bar is in a customUi.xml section in the docm file and
the callbacks are all VBA macros. Do you know the VBA signature for the
getVisible callback. How often is it called. I would like to make a group
visible when a button is pressed.

Thanks,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top