Add Popuop menu tool in CAB Main Menu Extention site - infragistics

I am developing application using CAB and i am using Infragistics CAB Extensibility kit.
I am facing one problem. i am unable to create Popup menu tool in Main menu. It shows me only Popup menu tool text and image and does not show Child button tools. here is my code to register in Main Menu
PopupMenuTool zoomButton = new PopupMenuTool("Zoom");
zoomButton.SharedProps.AppearancesSmall.Appearance.Image = Properties.Resources.bmw_m32;
zoomButton.SharedProps.DisplayStyle = ToolDisplayStyle.ImageAndText;
zoomButton.SharedProps.Caption = "Zoom";
zoomButton.DropDownArrowStyle = DropDownArrowStyle.Segmented;
// Specifies the Popup Style as Menu
zoomButton.Settings.PopupStyle = PopupStyle.Menu;
var zoom1X = new ButtonTool("GZoom1");
zoom1X.SharedProps.DisplayStyle = ToolDisplayStyle.TextOnlyAlways;
zoom1X.SharedProps.Caption = "Lavel 1";
zoomButton.Tools.Add(zoom1X);
WorkItem.UIExtensionSites[Constants.UIExtensionSiteNames.MainMenu].Add(zoomButton)

I got the answer from BankTeller sample provided by infragistics.
First i have to Register PopupMenuTool.Tools collection to my UIExtentionSite and then have to add ButtonTools in this collection..
Code should be like this
PopupMenuTool zoomButton = new PopupMenuTool("Zoom");
zoomButton.SharedProps.AppearancesSmall.Appearance.Image = Properties.Resources.bmw_m32;
zoomButton.SharedProps.DisplayStyle = ToolDisplayStyle.ImageAndText;
// Specifies the Popup Style as Menu
zoomButton.Settings.PopupStyle = PopupStyle.Menu;
zoomButton.DropDownArrowStyle = DropDownArrowStyle.Segmented;
WorkItem.UIExtensionSites[Constants.UIExtensionSiteNames.MainToolbar].Add(zoomButton);
WorkItem.UIExtensionSites.RegisterSite("ZoomTools", zoomButton.Tools);
ButtonTool zoom1X = new ButtonTool("Zoom 1 X");
zoom1X.SharedProps.Caption = "Level 1";
WorkItem.UIExtensionSites["ZoomTools"].Add(zoom1X);

Related

New Buttons in Interactive Grid toolbar

I need to add a new button to existing IG toolbar, which will set a specific value in the table column and then save the record.
Is there any way to create new buttons/change the behavior of existing Interactive Grid toolbar buttons?
I see you are using APEX 5.1. Yes, you can customise toolbar buttons in an interactive grid. For example, you can modify the look and feel of the Save and Add Row buttons and also add a Delete button. Select your interactive grid region and in the property editor, enter a value for Advanced > Static ID. Select Attributes > Advanced > JavaScript Initialization Code and input the following:
function(config) {
let $ = apex.jQuery,
toolbarData = $.apex.interactiveGrid.copyDefaultToolbar(),
toolbarGroup = toolbarData.toolbarFind("actions3");
addrowAction = toolbarData.toolbarFind("selection-add-row"),
saveAction = toolbarData.toolbarFind("save"); // Save button
// adding a "Delete" button
toolbarGroup.controls.push({type: "BUTTON",
action: "selection-delete",
icon: "icon-ig-delete",
iconBeforeLabel: true,
hot: true
});
// Modifying the buttons
addrowAction.icon = "icon-ig-add-row";
addrowAction.iconBeforeLabel = true;
addrowAction.hot = true;
saveAction.iconBeforeLabel = true;
saveAction.icon ="icon-ig-save-as";
saveAction.hot = true;
//storing the config
config.toolbarData = toolbarData;
return config;
}
Now run the page to see the customisation.
Here's a nice video that shows how to customise IG toolbar.
https://www.youtube.com/watch?v=_PBdBAfPBfQ

VS 2017 Extension - Add custom Solution Menu item

I am trying to add a menu item in the solution context menu. So when I do right click on the solution node I want to add a menu item. When I am clicking on the menu item I want to parse all the projects and do some checks.
I am adding the menu but into the toolbar:
private SecondCommand(AsyncPackage package, OleMenuCommandService commandService)
{
this.package = package ?? throw new ArgumentNullException(nameof(package));
commandService = commandService ?? throw new ArgumentNullException(nameof(commandService));
var menuCommandID = new CommandID(CommandSet, CommandId);
var menuItem = new MenuCommand(this.MenuItemCallback, menuCommandID);
commandService.AddCommand(menuItem);
}
How can I access to the solution context menu? The comandService is the VS main toolbar.
See my CommandSolutionContextMenu sample

Incorrect displaying of menu items text in status bar - wxWidgets 3.0

I am writing simple GUI software using wxWidgets 3.0 in CodeBlocks 13.12, on Win 7 x64 machine.
I would like to create a menu for the frame, and each item in the frame should make a different text appear in the status bar when highlighted. Below is what I have done so far ( only the menu part of code ). Menu and status bar appear as planned. The problem is that every item ( in File and Data sub menus ) when highlighted displays "Save project" in the status bar - which is the very first item in the first sub menu. How to change this so that proper menu item names are displayed ?
CODE :
wxMenuBar* mbar = new wxMenuBar();
wxMenu* fileMenu = new wxMenu(_T(""));
//fileMenu->Append(, _("&"), _("")));
fileMenu->Append(SaveProject, _("&Save project"), _("Save project"));
fileMenu->Append(SaveProjectAs, _("&Save project as"), _("Save project as"));
fileMenu->Append(OpenNewProject, _("&Open new project"), _("Open new project"));
fileMenu->Append(OpenExistingProject, _("&Open existing project"), _("Open existing project"));
fileMenu->AppendSeparator();
fileMenu->Append(Quit, _("&Quit"), _("Quit"));
mbar->Append(fileMenu, _("&File"));
wxMenu* dataMenu = new wxMenu(_T(""));
//fileMenu->Append(, _("&"), _("")));
dataMenu->Append(ImportData, _("&Import data"), _("Import data"));
dataMenu->Append(ExportData, _("&Export data"), _("Export data"));
dataMenu->Append(SavaDataAs, _("&Save data as"), _("Save data as"));
mbar->Append(dataMenu, _("&Data"));
mainFrame->SetMenuBar(mbar);
I suspect the problem is due to your use of duplicate menu IDs (e.g. SaveProject is used twice). While it's not clear why should this result in the observed behaviour, it is pretty clear that you cannot reuse the menu IDs as you will have no way of distinguishing between the events generated by the two items with the same ID. So don't do this.

How to add a new template to Typo3 "Layouts" drop-down list

I have a Typo3 installation with 3 existing layout options. These are all declared in the page.ts file like so:
#normal layout:
[globalVar=TSFE:page|layout=0]
page.10.template.file = fileadmin/template/classic-page.html
page.includeCSS.screen = fileadmin/template/css/style.css
page.includeCSS.screen.media = screen
[global]
And they are all in this list further down the page.ts file, like so:
TCEFORM.pages {
layout.altLabels.0 = Normal
layout.altLabels.1 = Startpage
layout.altLabels.2 = Landing page
}
All of these layout options are displayed in the CMS on the "Edit Page (X)" > Appearance page, in a drop-down list of possible layout options. Handy!
Now I have a shiny new template that I want to add as an option. I can apply it to a specific page id (say, page id #563) by adding this code to the page.ts:
[globalVar = TSFE:id=563]
page.10.template.file = fileadmin/template/shinynewtemplate.html
[GLOBAL]
But I can't seem to add it as a new layout option in the drop-down menu. I have tried this:
#shiny new layout:
[globalVar=TSFE:page|layout=3]
page.10.template.file = fileadmin/template/shinynewtemplate.html
page.includeCSS.screen = fileadmin/template/css/style.css
page.includeCSS.screen.media = screen
[global]
TCEFORM.pages {
layout.altLabels.0 = Normal
layout.altLabels.1 = Startpage
layout.altLabels.2 = Landing page
layout.altLabels.3 = Shiny new page
}
But no banana. It doesn't show up in the Appearance layout list, so I can't apply it to a page.
What am I missing? Is there somewhere else that I need to declare this template file so that it will show up as an option in the drop-down list?
An alternative label does not help, if there is no item which will use your label.
You need to add the new item (Page TS Config!):
TCEFORM.pages {
layout.addItems.3 = Shiny new page
}
See TSconfig

CMFCPropertyGridProperty with multi line edit box

How to create a multi line property with edit box? I need one more property that will show text in multi line box.
CMFCPropertyGridProperty* pGroup1 = new CMFCPropertyGridProperty(_T("Appearance"));
pGroup1->AddSubItem(new CMFCPropertyGridProperty(_T("Name"), (_variant_t) _T(""), _T("Specifies the text that will be displayed in the property")));
pGroup1->AddSubItem(new CMFCPropertyGridProperty(_T("Comments"), (_variant_t) _T(""), _T("Specifies the text that will be associated with the property")));
m_wndPropList.AddProperty(pGroup1);
It seems that multi-line properties are not implemented in MFC Property Grid. You can create a custom property with a button and show your own dialog with multi-line edit control when user click this button.
You can do it like in old style editors (replacing "\n","\n" so user can divide lines by "\n"):
Initialization:
CString s = m_initial_params.m_info;
s.Replace("\n","\\n");
CMFCPropertyGridProperty* pProp = new
CMFCPropertyGridProperty(misc_get_str_my(IDS_INFO),
(_variant_t) s, misc_get_str_my(IDS_INFO));
pProp->SetData(E_PROPERTY_DATA::OBJ_INFO);
pPropCtrl->AddProperty(pProp);
Reading Value:
int nProperty = pProperty->GetData();
if(E_PROPERTY_DATA::OBJ_INFO == nProperty)
{
m_initial_params.m_info = pProperty->GetValue().bstrVal;
m_initial_params.m_info.Replace("\\n","\n");
}