I got a problem with creating a menu on a page contains tabs (tabgroups). When i insert the menu's code in a simple window, it works fine. But when i insert the same code on a tabgroup, no menu appears when running. I searched about this problem and it seems that the ancien version of SDK not supported menus on a tabgroups.
anyone can help me about this ?
this is my code:
<Alloy>
<TabGroup id="mainTabGroup">
<Tab id="tab3" onClick="getTodoList">
<Window id="readWin">
<Menu id="menu">
<MenuItem id="settingitem" onClick="doAction" title="Settings" showAsAction="Ti.Android.SHOW_AS_ACTION_ALWAYS">
<MenuItem id="calitem" onClick="doAction" title="Calendar" showAsAction="Ti.Android.SHOW_AS_ACTION_NEVER">
<MenuItem id="logitem" onClick="doAction" title="Logout" showAsAction="Ti.Android.SHOW_AS_ACTION_NEVER">
</Menu>
<TableView id="tableView" onClick="doSomething"/>
</Window>
</Tab>
</TabGroup>
</Alloy>
I think your showAsAction should be :
showAsAction="Ti.Android.SHOW_AS_ACTION_ALWAYS"
Related
I am creating a custom toolbar for Excel 2010 and I am running into an problem with 2 of the buttons I have placed in a box group. For some reason they are not generating callbacks from the "onAction" command like all my others are and I am not getting any coding errors. I have been going through the markup specifications but cannot find a command that might work. Anyone see what I am doing wrong? The box group I am referring to is at the bottom of the code below - buttons labeled "ConvertToValues" and "TrimSpaces". Thanks.
<customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui">
<ribbon startFromScratch="false">
<tabs>
<tab id="MyCustomTab" label="Reporting">
<group id="AvtGroup" label="Actual v Target">
<button id="AvTDataPrep"
label="Data Organization"
imageMso="CreateQueryInDesignView"
size="large"
onAction="PrepAvTData" />
<button id="ChannelExport"
label="Channel Analysis Export"
imageMso="TableExportTableToSharePointList"
size="large"
onAction="ExportChannelData" />
<button id="Top50Export"
label="Top 50 Export"
imageMso="TableExportTableToSharePointList"
size="large"
onAction="ExportTop50Data" />
<button id="Top50CopyPaste"
label="Top 50 Copy/Paste"
imageMso="ImportExcel"
size="large"
onAction="CopyandPasteTop50Data" />
</group>
<group id="RMbyLocGroup" label="Route Metrics by Location">
<button id="RMDataPrep"
label="Data Organization"
imageMso="CreateQueryInDesignView"
size="large"
onAction="PrepRMData" />
</group>
<group id="ServiceMetricsGroup1" label="Service Metrics Tools">
<button id="FrequencyUpdate"
label="Frequency Update (AvT File)"
imageMso="PivotTableFormulasMenu"
size="large"
onAction="UpdateFrequencies" />
<button id="ServiceMetrics"
label="Service Metrics (AvT File)"
imageMso="DatasheetNewField"
size="large"
onAction="AddServiceMetrics" />
</group>
<group id="FormattingGroup" label="Formatting Tools">
<box id="FormattingBox" boxStyle="vertical">
<button id="ConvertToValues"
label="Convert To Values"
imageMso="ConditionalFormattingBottomNItems"
onAction="ConvertToValues" />
<button id="TrimSpaces"
label="Trim Excess Spaces"
imageMso="FormControlEditBox"
onAction="TrimSpaces" />
</box>
</group>
</tab>
</tabs>
</ribbon>
</customUI>
The source code for the Custom UI editor is available on GitHub. You can get the latest version and run it under the debugger where you can find the answer why callbacks are not generated for controls grouped together under the box control.
As a workaround you may add ribbon callbacks manually.
There currently appears to be a bug in Pug/Jade, in which <menuitem> is treated as self-closing, when in reality, they need to be closed. I've submitted the issue to the GitHub repo, and am awaiting a response/fix, but in the meantime, is there a viable alternative?
This is my contextmenu.pug file:
menu#main(type="context", label="")
menu(label="Visit me on...")
menuitem(label="LinkedIn")
menuitem(label="Twitter")
menuitem(label="Github")
menuitem(label="Stack Overflow")
menuitem(label="Email")
menuitem(label="Go Home")
The HTML is rendered as:
<menu id="main" type="context" label="">
<menu label="Visit me on...">
<menuitem label="LinkedIn">
<menuitem label="Twitter">
<menuitem label="Github">
<menuitem label="Stack Overflow">
<menuitem label="Email">
</menu>
<menuitem label="Go Home">
</menu>
Whereas, I would like all the menuitem tags to close with a </menuitem>. Otherwise, this would cause LinkedIn to be the only option that appears under "Visit me on..." The closest example I could find to this was this StackOverflow question, which suggested using plain HTML, and while this works, I am wondering if there is a Pug-only alternative. Is there a setting somewhere that determines which tags are self-closing? Or has there been a better alternative to forcing a closing tag since that question?
In case it matters, I'm using the Express.js framework, and recently updated from Jade (The issue existed before the migration).
GitHub Issue
You can write the menuitems as plaintext:
menu#main(type="context", label="")
menu(label="Visit me on...").
<menuitem label="LinkedIn"></menuitem>
<menuitem label="Twitter"></menuitem>
<menuitem label="Github"></menuitem>
<menuitem label="Stack Overflow"></menuitem>
<menuitem label="Email"></menuitem>
<menuitem label="Go Home"></menuitem>
https://pugjs.org/language/plain-text.html
Im running 2016 Standalone Excel (32bit version). I've been building a custom ribbon and so far so good. The documentation is pretty fluid and well written. However, I cant find any way to include menu 'section titles' as seen below:
Specifically referencing section titles like in the picture (i.e., 'Cell size', 'Visibility' etc). I've seen other Add-Ins emulate this, unless they are COM Add-Ins. Here is the documentation I reference: https://msdn.microsoft.com/en-us/library/dd911038(v=office.12).aspx
Is it out of date? I've tried adding 'Menu with Title' to my project but that doesn't even work. I've also tried adding <labelControl /> , and the ribbon doesn't even load when the labelControl is within a Menu.
Additionally, my version of Excel won't even display a <dialogBoxLauncher> so I'm concerned some things just aren't compatabile with my Excel version to begin with. I'm following the documentation easily and everything else has worked just fine. I even have a editBox in the ribbon I use and don't run into any 91 errors with it. So I know it's not me.
Can anyone duplicate this with the provided API? My ribbon is structured with XML, so I've reduced as much error potential as possible, is that my problem? Should there be run-time code implemented specifically for section titles?
Short snippet of my setup
<customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui" onLoad="OnRibbonLoad">
<ribbon>
<tabs>
<tab idMso="TabHome">
<group id="GroupTextTools" insertAfterMso="GroupFont" label="Text Tools">
<gallery id="textcase_gallery" label="Case Select" columns="1" size="large" imageMso="WordArtInsertDialogClassic" onAction="TextCase_SwitchCase" >
<item id="textcase_CapsButton" imageMso="TextAllCaps" label="Uppercase" screentip="Changes selected cells to all uppercase" />
<item id="textcase_ProperButton" label="Propercase" imageMso="ChangeCaseDialogClassic" screentip="Changes selected cells to proper case" />
<item id="textcase_LowerButton" label="Lowercase" imageMso="FontSizeDecrease" screentip="Changes selected cells to all small case" />
</gallery>
</group>
</tab>
<tab id="CustomTab" label="*removed*" insertAfterMso= "TabDeveloper">
<!--
GROUP A
-->
<group id="GroupFileOptions" label="File Options">
<button id="fileoptions_CloseButton" label="Close && Reopen" onAction="RunMacro" imageMso="SourceControlCheckIn" size="large" screentip="Saves Document, Closes && Reopens immediately"/>
<menu id="exportingmenu" label="Exporting" imageMso="FileCheckOut" size="large" screentip="Exporting Options">
<menu id="exportmenu_AsRange" label="As Range"> <!-- This is where I would like section Titles to be instead of another menu -->
<button id="exportmenu_range_CSVCButton" label="To CSV w/commas"/>
<button id="exportmenu_range_CSVSButton" label="To CSV w/spaces"/>
<button id="exportmenu_range_PDF" label="To PDF"/>
</menu>
<menu id="exportmenu_AsSheet" label="As Sheet"> <!--Goal is for this to be a section title, where I tried putting a <labelControl> -->
</menu>
</menu>
</group>
<!-- .... -->
</tab>
</tabs>
</ribbon>
</customUI>
After some trial and error, and an involuntary push from David Zemens by troubleshooting my errors, I've found that by cross referencing all the things I've tried with their Parent Elements, the only one that makes logical compiling sense is a <menuSeparator>, which just so happens to have a 'title' attribute. So by setting that you get a beautiful section title as shown:
<menuSeparator id="someID" title="Test title"/>
I managed to put a menu title only on a dynamicMenu via the getContent callback, which means the xml is defined in VBA as a piece of xml string, not in the customUI xml.
Most comprehensive documentation that I found so far on customUI interfaces is on https://msdn.microsoft.com/en-us/library/dd911038(v=office.12).aspx, however the references are pointing only to 2007. This link contains a much more extensive list of controls and options with extra controls for Access as well http://www.accessribbon.de/en/?Access_-_Ribbons:Ribbon_XML___Controls
I am new to programming but I tried to experiment with Excel ribbons. I am using the Custom UI Editor. I wanted to use the insertBefore and insertAfter controls to rearrange my custom buttons. If I do not use a unique namespace and insertAfterQ/insertBeforeQ at button level the order of buttons does not change, however, if I use it I cannot see the related macro (probably due to my namespace), therefore onAction will not do anything after clicking the buttons. I tried various combinations of idQ but I cannot make it work. The below example correctly executes just button 2 which is not in the namespace I specified.
A simple example:
<customUI xmlns="http://schemas.microsoft.com/office/2006/01/customui" xmlns:x="MyNameSpace">
<ribbon>
<tabs>
<tab idQ="x:customTab" label="My Order Form" insertAfterMso="TabHome">
<group idQ="x:customGroup" label="My Order Form Tools">
<button idQ="x:customButton1" label="Clear" size="large" onAction="DeleteOrder" image="deleteorder" />
<button id="customButton2" label="Print" size="large" onAction="ResetOrder" image="resetorder" />
<button idQ="x:customButton3" label="Home" size="large" onAction="NewOrder" insertBeforeQ="x:customButton1" image="neworder" />
</group>
</tab>
</tabs>
</ribbon>
</customUI>
Is there any way to make onAction work within the namespace? Or is there any other way? Many thanks, TS
Do you really need the namespace?
If you want to rearrange your own controls, just switch places in the xml:
<customUI xmlns="http://schemas.microsoft.com/office/2009/07/customui">
<ribbon>
<tabs>
<tab id="customTab" label="My Order Form" insertAfterMso="TabHome">
<group id="customGroup" label="My Order Form Tools">
<button id="customButton3" label="Home" size="large" onAction="NewOrder" image="neworder" />
<button id="customButton1" label="Clear" size="large" onAction="DeleteOrder" image="deleteorder" />
<button id="customButton2" label="Print" size="large" onAction="ResetOrder" image="resetorder" />
</group>
</tab>
</tabs>
</ribbon>
</customUI>
If you want to place your controls relative to built-in controls, use insertBeforeMso or insertAfterMso, like in your "customTab". From what I can tell you only need to use the namespace and idQ-ids if you combine controls from customUI-xml in different files.
How can I add a menu and sub menu items when right click on a file item visual studio solution explorer?
I have one menu and three sub menu items which will be displayed when I right click on a file in solution explorer like the below picture.
I tried using .vsct buttons but it will display on context menu and Iam unable to add sub menus
Authoring VSCT files is somewhat tricky; what you´ll need is a combination of a menu and buttons. First of all you need to reference the IDM_VS_CTXT_ITEMNODE group in your VSCT file.
<Group guid="guidCmdSet" id="grpIdMenuProjectItem" priority="0x0800">
<Parent guid="guidSHLMainMenu" id="IDM_VS_CTXT_ITEMNODE" />
</Group>
Than you create a new menu and add it to that group...
<Menu guid="guidCmdSet" id="sampleMenu" type="Menu" priority="0x1000">
<Parent guid="guidCmdSet" id="grpIdMenuProjectItem" />
<CommandFlag>IconAndText</CommandFlag>
<Strings>
<ButtonText>Sample Menu</ButtonText>
<CommandName>Sample Menu</CommandName>
</Strings>
</Menu>
For the submenu items another group is required, which will be added to the menu...
<Group guid="guidCmdSet" id="sampleMenuGroup" priority="0x1000">
<Parent guid="guidCmdSet" id="sampleMenu"/>
</Group>
At least you define your submenu items using buttons and add them to the submenu group...
<Button guid="guidCmdSet" id="sampleMenuItem" priority="0x1000" type="Button">
<Parent guid="guidCmdSet" id="sampleMenuGroup"/>
<CommandFlag>TextOnly</CommandFlag>
<Strings>
<ButtonText>Sample Menu Item 1</ButtonText>
<CommandName>sampleMenuItem1</CommandName>
</Strings>
</Button>
Don´t forget to define all symbols, otherwise the resource won´t compile.
<IDSymbol name="grpIdMenuProjectItem" value="0x1020"/>
<IDSymbol name="sampleMenu" value="0x1021"/>
<IDSymbol name="sampleMenuGroup" value="0x1022"/>
<IDSymbol name="sampleMenuItem" value="0x1023"/>
And this is what you get...