How to change the sequence in the MDI Tab document menu? - mfc

In the tabbed document view of the MFC feature pack the user can re-order the tabs by dragging and dropping and when there is a larger number of tabs in use you have a drop down list at the end.
The problem is that the menu item for windows with the drop list of the first 9 sessions and more windows, plus the drop down list at the end of the tabbed bar are in document load order.
Does anyone know of a example on how to change the Document order in the CDocManager class in order to stay in sync?

The relevant code can be found in CMFCTabCtrl::OnShowTabDocumentsMenu.
So reorder the internal array and you have what you need.
You have the source code so it shouldn't be a real big thing.

You can use following code for it:
CMFCTabCtrl &t = ((CMainFrame*)m_pMainWnd)->GetMDITabs();
t.MoveTab(<your tab number>, t.GetTabsNum()-1);

Related

Alternative to legacy tabs parent set in current navigation menu in oracle apex?

Just like we could make parent tab set and combine all tabs in it.
Is it possible to do the same with navigation menus?
Basically, how can we convert set of tabs to navigation menus explicitly?
or create a parent list that would contain all the other lists.
Ex: Manager list, employee list all could get combined to one parent list,
Is this possible?
In shot, how can we convert the standard tab set in navigation menu format?
Vini,
Within Lists you can develop structures as many levels deep as you like. To do so just specify the parent list entry.
One customer that comes to mind has a single Navigation Menu list with several hundred entries, numerous levels deep.
With APEX 20.1 you now have the choice of displaying the Navigation Menu on the side, on the top or as a Mega Menu.
Regards,
David

Desktop Navigation Menu, How to fix the problem when you click?

help please, I can not understand what the problem is. When you click on the drop-down menu, opens a completely different tab, which is located above.
The page itself opens correct.
But the menu unfolds is not correct.
What i want to see
Any thoughts? Maybe this is done in the settings?
To edit the Menu you go into Shared Components-Navigation Menu.
Not sure what your problem is, but it could be something to do with how those are sorted.
What you need is for all the top layer tobs(the ones you have w/o names) to have no parent, and each have its contained tabs marked with it as parent.
And maybe try changing their sequence so that all the second layer tabs are in sequence between the top layer tabs(say your first top layer tab is sequence 1000, and your second top layer tab is 2000, make sure all the second layer tabs belonging to the first top layer tab are marked with the correct parent entry, and are numbered between 1000 and 2000).
I hope this resolves whatever bug you have.

Transfer form elements between tabs on scope change in Qt

My problem is quite simple: I need to transfer form elements from one tab to another.
Say I've ten tabs and each tab has it's own set of text edits.
Is it possible to create just one set of text edits and transfer it from one tab to another,changing functionality behind it, but without changing the forms layout?
Currently I've "solved" that problem just by populating copy of text edit's for each tab but common sense tells me that there's a simpler way to achieve that in Qt.
I'm using Qt 5.7.
Yes, it's possible using a single QTabBar. A QTabBar, as its name suggests, only displays a narrow bar with multiple tabs within.
You can put a frame below that tab bar and listen for tab change signal which is emitted by the QTabBar. In this way, the frame below is the same for all tabs, so you can change underlying logic for each tab.

Two column TPopupMenu to list shortcuts right aligned

Using Borland/CodeGear/Ebarcadero C++ Builder 2009. Is it possible to show shortcuts (or other text), right aligned in a second column in a TPopupMenu ?
For instance:
[image] Open File ctrl-O
[image] Close File ctrl-W
[image] BlahBlah ctrl-B
etc.
If so, how ?
I checked the break property on an item, but the results is not exactly what I want, since items are selectable on their own, instead of the complete line. Also it's not drawn that nicely.
Your feedback appreciated.
A menu item can have an image (see the TMenuItem.ImageIndex property), and can have a shortcut assigned (see the TMenuItem.ShortCut property). The VCL will automatically draw those elements for you, exactly as you have shown.
By default, they are a little squished together. You can use the TMenuItem.OnMeasureItem event to extend the Width:
If you still do not like the way the default drawing looks, or you want different text than the ShortCut to appear on the right side, you will have to owner-draw the menu items yourself (see the TMenuItem.OnDrawItem and TMenuItem.OnAdvancedDrawItem events), then you can make the menu items appear however you want.

Hide a tab previously added to Qt TabWidget

I've a dialog which contains a Qt TabWidget with a number of tabs added.
I'd like to hide one of the tabs.
_mytab->hide()
doesn't work. I don't want to just delete the tab and all its widgets from the .ui file because other code relies on the widgets within the tab. However, it would be fine to generate the tab code but somehow not ::insertTab in the generated uic_mydialog.cpp. Setting the hidden property in the ui file does not work either.
I'm using Qt 3.3
I had encountered the same problem. I am using the following approach.
Now here is the data.
genTab is the name of my QTabWidget
tabX is the name of the tab that i want to remove.
(Note that this is the second tab in the Tab Widget. Hence, i will be using "1" as the index to refer to this tab)
The code to remove and add is as below.
ui.genTab->removeTab(1); // removes the tab at the index 1 which is the second tab from left
ui.genTab->insertTab(1, ui.tabX, "<Name of TabX>"); // The tab is added back.
Here, note that it is easy to do this if you have the tab added statically in the design time. Because we will have an object name associated with the tab and hence we can refer to it using, ui.tabX. From what you say, in your case the tab is indeed added statically in the design time.
However, if you are adding the tabs dynamically, then probably you will have to maintain the tabs in a list and then have another list for deletedTabs.
But the first solution will most likely work for you.
Hope this helps.
-Arjun
I would use QTabDialog::removePage(QWidget* pTabPage) which does not delete pTabPage, which is what you want.
_myTabDlg->removePage(_mytab);
I'm using it and it works fine !