Click here to Skip to main content
Licence CPOL
First Posted 16 Mar 2003
Views 84,036
Downloads 132
Bookmarked 18 times

Multiple Toolbars in the PocketPC 2002

By | 16 Mar 2003 | Article
Handling multiple toolbars - Pocket Word-style.

Sample Image - CeMultiBar.jpg

Introduction

This article presents a solution on how to implement multiple toolbars in a PocketPC 2002 application. The idea came from an exchange in the Embedded/Mobile message board where this functionality was sought, especially the Pocket Word-like management of the toolbar ( http://www.codeproject.com/script/comments/forums.asp?forumid=13695#xx435722xx).

Implementation

The demonstration project (illustrated above) has two toolbars that are hidden or shown through commands in the main command bar. Note: the demo project is meant to illustrate the working of the toolbars, so no functionality has been implemented on them.

Both toolbars are created in CMainFrame::OnCreate without the WS_VISIBLE style. When the user issues a command to show a toolbar, the window is shown and RecalcLayout is used to reposition everything inside the frame.

void CMainFrame::OnToolbarFormat() 
{
    CToolBarCtrl& rToolBar = m_wndCommandBar.GetToolBarCtrl();

    m_bFormat = !m_bFormat;

    m_wndFormat.ShowWindow(m_bFormat ? SW_SHOW : SW_HIDE);
    RecalcLayout();

    rToolBar.CheckButton(ID_TOOLBAR2, m_bFormat);
}

Note that there are no ON_UPDATE_COMMAND_UI handlers in the demo. Checking and unchecking of the main command bar buttons is done explicitly in this message handler.

A final note on CToolBar: I found no proper way to have it draw the top border, so I derived the dummy class CCeToolBar with the single purpose of drawing the top border. If there is a better way to achieve this, please post it here.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

About the Author

Joao Paulo Figueira

Software Developer
Primeworks
Portugal Portugal

Member

João is a partner at Primeworks, a company that develops remote database access software for Windows Mobile. He also works for Frotcom, a company that develops web-based fleet management solutions.

Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
You must Sign In to use this message board. (secure sign-in)
 
Search this forum  
 FAQ
    Noise  Layout  Per page   
  Refresh
GeneralUsar com o eVB PinmemberJOSE ROBERTO SIQUEIRA2:35 17 Aug '04  
GeneralRe: Usar com o eVB PinmemberJoão Paulo Figueira3:09 17 Aug '04  
GeneralQuestion! Pinmemberkanglue2:41 19 Jul '04  
GeneralNice Work, Question about Keybord Menu PinmemberFad B5:17 17 Apr '04  
GeneralGreat article ! Pinmembercedric moonen21:23 3 Jul '03  
GeneralAn good article Pinmemberghmay17:51 2 Jun '03  
GeneralRe: An good article PinmemberJoão Paulo Figueira22:03 2 Jun '03  
GeneralRe: An good article Pinmemberghmay22:57 2 Jun '03  
QuestionWhat about vertical toolbars? Pinmemberaseiden20:22 27 May '03  
AnswerRe: What about vertical toolbars? PinmemberJoão Paulo Figueira10:48 2 Jun '03  
GeneralAll I can say is... PinmemberJohn Simmons / outlaw programmer23:59 17 Mar '03  
GeneralRe: All I can say is... PinmemberJoão Paulo Figueira0:02 18 Mar '03  
GeneralRe: All I can say is... PinmemberRoger Allen6:23 18 Mar '03  
GeneralGreat article, but one question ... PinmemberDaniel S.7:24 17 Mar '03  
GeneralRe: Great article, but one question ... PinmemberJoão Paulo Figueira7:39 17 Mar '03  
GeneralRe: Great article, but one question ... PinmemberDaniel S.7:49 17 Mar '03  
GeneralRe: Great article, but one question ... PinmemberChopper4:05 18 Mar '03  
GeneralRe: Great article, but one question ... PinmemberJoão Paulo Figueira4:09 18 Mar '03  
GeneralRe: Great article, but one question ... PinmemberChopper4:27 18 Mar '03  
GeneralRe: Great article, but one question ... PinmemberJoão Paulo Figueira4:31 18 Mar '03  
GeneralRe: Great article, but one question ... PinmemberChopper4:40 18 Mar '03  
GeneralRe: Great article, but one question ... PinmemberJoão Paulo Figueira4:45 18 Mar '03  

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Mobile
Web01 | 2.5.120528.1 | Last Updated 17 Mar 2003
Article Copyright 2003 by Joao Paulo Figueira
Everything else Copyright © CodeProject, 1999-2012
Terms of Use
Layout: fixed | fluid