Professional UI Solutions
Site Map   /  Register
 
 

Forum

Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Prof-UIS Tech Support » Toolbars docking problem Collapse All
Subject Author Date
Offer Har Jan 19, 2011 - 9:00 AM

Dear Support,


We have two toolbars. We want to dock one to the left side of the application and one on top.


We need the docked toolbar at the left side to reach all the way to the top-left corner of the application, but when we dock the top toolbar, the top toolbar pushes the toolbar docked on the left side under it:



+---------------------------------------+
|		    TOP TOOLBAR			    |
+---+-----------------------------------+
|   |								   |
| L |								   |
| E |								   |
| F |								   |
| T |								   |
|   |								   |
| T |								   |
| O |								   |
| O |								   |
| L |								   |
| B |								   |
| A |								   |
| R |								   |
+---+-----------------------------------+

What we need is this:



+---+-----------------------------------+
|   |	    TOP TOOLBAR			    |
|   +-----------------------------------+
|   |								   |
| L |								   |
| E |								   |
| F |								   |
| T |								   |
|   |								   |
| T |								   |
| O |								   |
| O |								   |
| L |								   |
| B |								   |
| A |								   |
| R |								   |
+---+-----------------------------------+

How do we do it? This is very important in our application.


Thanks,


Ron.


 

Technical Support Jan 20, 2011 - 2:27 AM

If both toolbars are non-redockable, you should create the left toolbar before the top toolbar.
If you are using re-dockable toolbars, you should place the mainframe’s child window with the AFX_IDW_DOCKBAR_LEFT identifier before the window with the AFX_IDW_DOCKBAR_TOP identifier.

Offer Har Jan 21, 2011 - 7:46 AM

Dear Support,


I read the article at http://www.prof-uis.com/prof-uis/tech-support/feature-articles/docking-mechanism-explained.aspx#@lt;/p>

As my bars are all fixed-size, they all go into "circle 0". In your schema of circle 0, it seems that the top and bottom the ones occupying the areas I want my left and right to occupy. (the red circle)


Please check if my request is possible, and if so, and example will be great. This is very important for us.


Thanks,


Ron.

Technical Support Jan 24, 2011 - 9:01 AM

Please find the first main frame’s child windows with the AFX_IDW_DOCKBAR_TOP, AFX_IDW_DOCKBAR_BOTTOM, AFX_IDW_DOCKBAR_LEFT and AFX_IDW_DOCKBAR_RIGHT dialog control identifiers using the GetDlgItem() API. Then reorder them like you need. Here is how to do this in the DRAWCLI sample application (put this code snippet to the end of CMainFrame::OnCreate() method):

CWnd * pDockBarT = GetDlgItem( AFX_IDW_DOCKBAR_TOP );
CWnd * pDockBarB = GetDlgItem( AFX_IDW_DOCKBAR_BOTTOM );
CWnd * pDockBarL = GetDlgItem( AFX_IDW_DOCKBAR_LEFT );
CWnd * pDockBarR = GetDlgItem( AFX_IDW_DOCKBAR_RIGHT );
    ASSERT_VALID( pDockBarT );
    ASSERT_VALID( pDockBarB );
    ASSERT_VALID( pDockBarL );
    ASSERT_VALID( pDockBarR );
    pDockBarB->SetWindowPos( pDockBarR, 0, 0, 0, 0, SWP_NOMOVE|SWP_NOSIZE|SWP_NOOWNERZORDER|SWP_NOREDRAW|SWP_NOSENDCHANGING );
    pDockBarT->SetWindowPos( pDockBarB, 0, 0, 0, 0, SWP_NOMOVE|SWP_NOSIZE|SWP_NOOWNERZORDER|SWP_NOREDRAW|SWP_NOSENDCHANGING );
    RecalcLayout();
    
    return 0;

Offer Har Jan 24, 2011 - 9:15 AM

Dear Support,


I still do not understand one thing - how will GetDlgItem return me the right bars - none of my bars use this IDs, they are toolbars with IDs I gave them that are meaningfull like ID_TOOLBAR_FILE, ID_TOOLBAR_VIEW etc.


Also, the two lines between the RecalcLayout, what do they do?


Thanks,


Ron.

Technical Support Jan 26, 2011 - 2:43 AM

GetDlgItem() returns CDockBar objects rather than your bars.
Those two lines change Z-orders of top and bottom CDockBar windows. Before these lines are invoked, the CDockBar windows have the following Z-order order: top, bottom, left, right. After these lines are invoked: left, right, top, bottom i.e. left and right CDockBar windows dock themselves before top and bottom. Or, in other words, left and right CDockBar windows now have a chance to take up the entire available height.

Offer Har Jan 20, 2011 - 6:29 AM

Dear Support,


I tried with no luck to do what you said, still, the minute I dock anithing at the top or bottom it bushes the toolbars. Can you explain whan you mean in this sentence:


you should place the mainframe’s child window with the AFX_IDW_DOCKBAR_LEFT identifier before the window with the AFX_IDW_DOCKBAR_TOP identifier.


What child you are talking about and what are these IDs? my toolbars don’t have these IDs.


Thanks,


Ron.