Tab stop order for controls residing inside Tab control? - visual-c++

In my MFC application, which is a modeless dialog by itself, has a Tab control along with many other controls. And Tab control has two tabs, and dialogs are inserted into those.
This tab control is preceded and followed by other controls in the tabbing order. And when tab key gets to the tab control, It doesn't go into the dialogs inside tab, instead it moves to the next control in the application. I want that to go into the tab dialog and navigate through controls inside it.
At the moment, Tab key visits these dialogs inside tabs after visiting all controls in my application(modeless dialog).
How do I or where do I set tab order such that the tab key goes into the tab control dialogs ?

Research the WS_EX_CONTROLPARENT window style. MSDN:
"If this style is specified, the dialog manager recurses into children of this window when performing navigation operations such as handling the TAB key, an arrow key, or a keyboard mnemonic."

Related

Tab navigation in MFCProprtyGridCtrol

I am working in an MFC windows application. I am using Grid control with some icons and its properties are displaying with MFC Property Grid Control ( CMFCPropertyGridCtrl ). I need to implement tab navigation. I i am in some icon (let us assume "Star1") and when I press tab key it should go to its properties control ( MFC Property grid control) and focus on any field or group name.
I did try to capture keyboard events in PretranslateMessage(). but needs how to set focus on that specific field or group name?

dojo tabContainer - how to get tab id under right-mouse click popup menu for tab not in focus

I'm a dojo newbie and I'm modifying an existing application for my customer and adding an extra options to the popup menu....'Close all', and 'Close other tabs'. There already exists 'Close'.
Adding the extra menu items were fairly straightforward...'Close all' gets the tabContainer and iterates over the tabs removing them.
But for 'Close other tabs', i.e. close all other tabs except the one I right-clicked on, I can't figure out how to get the id of that tab, on which the right-mouse click was done.
The 'selectedChildWidget' is not the tab I want, it gives the tab which is currently selected...I right clicked on one of the other non selected tabs.
Any ideas? I have the mouse event but cannot find the path back to the tab it was triggered against, only the popup menu.
Many thanks, Andrew (going rapidly grey over this one)
Dijit Menus have a currentTarget property that indicates what node the menu is being displayed for. From a MenuItem's onClick handler, you can access the current target node with this.getParent().currentTarget:
closeMenu.addChild(new MenuItem({
label: 'Close all',
ownerDocument: document,
onClick: function (evt) {
// tab that was clicked
var tab = registry.byNode(this.getParent().currentTarget);
// tab's associated page is tab.page
}
}));

On Windows CE how do I prevent my menu from covering up my form

I am having a problem where on some of my forms my menu bar is covering up my controls
But there are also some instances where my controls automatically line up below my menu
What do I need to do in my forms so that my controls always line up below my menu?
I discovered that the ability of a control to adjust its location to below the menu requires the control to be dock to the form. If you are using non-docked controls you need to place them in side a panel and then dock that panel to the form.

Setting the Tag property of a VB6 menu object

I have an old VB6 application that uses the Tag property to Enable / Disable the Main Menu items in the (startup) mdiForm. I see where the program reads the Menu Tag Property and compares it to the User's security (a string). If the Tag matches the User's security string then the menu item is made Visible and Enabled.
No where in the VB6 code or in the VB6 Menu Editor do I see how to initially set the Tag property for a menu item. The call to enable the User's menu items is the 5th line of code in the MDIForm_Load() event code, so there is not much else that can run before this call.
Does anybody know how to initially set the Tag property for a main menu drop down items?
Try clicking to select the menu item you are interested in, then the Tag property will be available in the properties window. You can also highlight the form that contains the menus in the project explorer and select the menu from the controls drop down.

Keep taskbar icon, replace MFC dialog

I have a MFC dialog based application. User can change the language of the dialog, and I made this by closing existing dialog, and opening another with changed language. The problem is that the effect in the taskbar is that one icon is removed, and another identical is created in its place. If my application's icon is not the last icon in the task bar it will be perceived as it was moved to the end of taskbar icon set.
I want to retain icon's position in the taskbar, and rather to prevent icon flicker at all from happening. How do I do that?
The application must support OS'es from Windows XP to Windows 7.
EDIT: alternative question for which I would accept an answer is how to create an invisible window that is nevertheless shown in the taskbar, and how to forward relevant window messages from that window to my main window?
Make the dialog a child of another outer parent window. The parent can be a dialog or any other kind of window; all it will be providing is the title bar. If the user tries to resize it it will have to forward resizing commands to the dialog, but otherwise you shouldn't need to do much in the parent window.
Why not replace the dialog with a CFormView instead? That way there's a frame window that wraps around the dialog (which is embedded in a form view) and it's the frame window that owns the taskbar icon.
Create an SDI application that displays a CFormView. Display the dialog in the default language (or whatever langauge the user previously chose) on initialization. When the user chooses the 'change language' option, simply change the form view that's being displayed with a new one.
Bonus feature: with this design, the framework will take care of things like language-specific accelerators and menus for you with no effort on your part.
For more on how to do this, check out http://www.codeguru.com/cpp/w-d/doc_view/viewmanagement/article.php/c3341/Multiple-Views-Using-SDI.htm

Resources