I have a pane in an C++ MFC app that I want to dock bottom right as shown in orange in this image. Currently it is going right across the bottom (red).
see http://screencast.com/t/kSpPhvZkgBGj
This is how the user can do it in VS2008.
http://screencast.com/t/kSpPhvZkgBGj
What position is this called? How can I get the same effect?
It depends on the order the panes are created. I developed a software that even has two interface versions, with completely different layouts.
Outlook Layout:
Ribbon Layout
As you can see in the Outlook layout the 3 panes at top got at the left in the Ribbon layout; and the information bar moved from the top to the bottom.
This got some annoying work to be done. I used CDockablePane entities. Are you using them?
Related
I'm porting a MFC application to use the Ribbon UI and MFC feature pack and would like to have a docked horizontal pane that does not include a caption. I'd hope that something like
MyPane.ModifyStyle(WS_CAPTION, 0);
m_pParentFrame->RecalcLayout();
would work, but no joy. FWIW, the docking pane is hosting a wide horizontal dialog docked under the main view and the caption wastes more desktop real estate than I'd like to give away.
Edit: Further googling found a possible solution here: http://www.sibisa.com/remove-hide-title-bar-board-cdockablepane-window/
Edit2: EnableGripper(FALSE) was what was needed, see https://msdn.microsoft.com/en-us/library/bb984118.aspx
Calling EnableGripper(FALSE) removes the caption.
I'm interested in making my own small gui designer for learning purposes in Qt. Just basic drag and drop from left panel which would have controls, to right panel on which they could be selected, moved, resized and have their properties changed (name and such) and eventually (if selected) be lined up.
I would use QGraphicsScene as the right panel cause it already has selecting and moving implemented. But how would I implement resizing? And then how would I generate a QWidget class with controls at same positions? Or is there an easier way?
What would be the best way to implement all of this? All suggestions are welcome and keep in mind that it won't be complex as Qt designer.
You need to define some widgets, which are going to be dragged from the left panel -maybe a tree view with icons- and dropped to the scene.
These widgets should inherit from QGraphicsWidget. You can also inherit QWidget and put the widgets into scene via QGraphicsProxyWidget. They can be resized by highlighting corners and overloading the mouse events. Please check out corner grabbers and sizable box examples. Also check out QSizeGrip. It is the resizing grip of any QStatusBar.
Property panel is the easiest, you should list the properties of the clicked item. To line up, you can reinvent the wheel and write a layout maker class, or simply use QGraphicsLayout and highlight the layout on your interface. Ctrl+left click should select multiple widgets, a layout button should layout them programmatically, and a bounding rectangle item should be drawn.
I am working on a project that totally does not want to use the built-in window/dock state and position saving of MFC. This means that in my main frame, I set EnableLoadDockState(FALSE). As much as I love to change it back to TRUE, I can't.
I plan on getting the position where a CDockablePane was docked through onAfterDock() of my CDockablePane. My problem is I have no idea on how to get whether it was placed on the side, top or bottom, on another CDockablePane.
Is there a way to get this information?
Thanks!
I think there is a way to get it, but it's not going to be easy or pretty.
A you're trapping the OnAfterDock, I guess you're not interested in floating panes. So, for docked panes, you can use CDockablePane::GetDefaultPaneDivider (MSDN here), which returns - as MSDN says:
A valid CPaneDivider object if the dockable pane is docked to the main frame window, or NULL if the dockable pane is not docked or if it is floating.
The CPaneDivider object (MSDN here)
...divides two panes, divides two groups of panes, or separates a group of panes from the client area of the main frame window
The following partial screenshot says more:
So, for a regular pane divider, you can use the methods available on CPaneDivider to find the other pane, or another embedded CPaneDivider (so recursive interrogation necessary here) and check if the divider is horizontal or vertical etc.
For the other case described above, look at the CPaneContainerManager class, which (again as MSDN says)
...manages the storage and display of the current docking layout
From here, you can again drill down through the whole docking hierarchy that starts from your original docked pane.
If I were you, I would really really look again at using EnableLoadDockState or at least browse the MFC source code to see if there are any internal helper classes/functions that you can reuse.
I've just solved this issue. I can check CDockablePane's dwStyle (GetPaneStyle()) for CBRS_ALIGN_LEFT, CBRS_ALIGN_RIGHT, etc. No complex methods. Simple.
My application uses stacked dialogs to select between options in several places. For example, the dialog box below uses two stacked dialogs:
To choose between "shooting methods", the user selects from the drop-down list in the bottom right. This changes a child dialog box above it.
The "advanced options" box (located in the child dialog box) selects between a simplified interface and a more complete one.
In each case, the stacked dialog box is implemented using a picture object as a placeholder in the parent dialog. When a page is selected, SetWindowPos is called to move/resize the child dialog (pNewPage) to fit the placeholder.
// Show the newly selected page
pNewPage->ShowWindow (SW_SHOW) ;
pNewPage->SetFocus () ;
// Position the newly selected page
CRect rcDlgArea ;
GetDlgItem (IDC_DLG_AREA)->GetWindowRect (&rcDlgArea) ;
ScreenToClient (&rcDlgArea) ;
pNewPage->SetWindowPos (this,
rcDlgArea.left, rcDlgArea.top, rcDlgArea.Width (), rcDlgArea.Height (),
SWP_NOACTIVATE) ;
This has worked very well up until now, but one of my users in Germany is having a problem I can't explain. When he opens the tool, the stacked page comes up looking like this:
Note that the child dialogs are stretched so that the text in the child dialog appears larger than the text in the parent.
Other than the visual layout issues, the child dialog also seems to "cover" the selection drop-down in the bottom right (located in the parent dialog). Although the drop-down is still visible, CBN_SELCHANGE messages are not received when the drop-down list is clicked.
I am at a loss to explain why the child dialog boxes are being rescaled. As you can see above, I've tried to be very explicit about the resizing of the dialog box, but this doesn't seem to work.
Can anyone think of a reason why the child dialog might be rescaled on some systems but not on others? Any help would be greatly appreciated.
Thank you,
Michael
Seems like this user has larger fonts selected than what is used in the first screenshot. Note that dialog sizes are specified in DLU's, which scale with the size the user has selected for the font. You can either scale your dialog explicitly, in pixels (bad solution, this will make your app look even worse on some configurations), or do your calculations in DLU's everywhere. Your second screenshot also seems to show that the child dialogs use a different font than those of the wizard. I'm not sure why that is, I guess it's something in the window styles you pass to the wizard when you create it.
I have created a MDI project with CView's using VS2008Pro.
I want to have some sort of bar at the bottom of every CView where i
can put controls on, like buttons. I dont know how this bar is called
and how to create one for every CView.
I have a picture of it here to explain what i want.
http://www.4shared.com/dir/32975742/b4bac91c/CView_Bar.html
Could someone please tell me what kind of bar this would be and how to
create it for CViews?
Thanks.
I think, what you want is basically a Toolbar (to answer your question how it is called) in an MDIChildWindow (similar like the toolbar in the main frame window of your application which is created usually by the MFC application wizard automatically). The way to add a toolbar in a child frame window is very analogous to what the wizard has added to the main frame window. You can decide in code where the toolbar shall be located (top, bottom, left, ...)
You can find a brief "How to..." here: http://support.microsoft.com/kb/155141
Also try to google by "Toolbar in MDIChildWindow" or similar. You'll find many resources, I believe.