Click here to Skip to main content
Click here to Skip to main content

Multiple Toolbars in the PocketPC 2002

By , 16 Mar 2003
Rate this:
Please Sign up or sign in to vote.

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

João Paulo Figueira
Software Developer Frotcom International
Portugal Portugal
I work on R&D for Frotcom International, a company that develops web-based fleet management solutions.
Follow on   Twitter   LinkedIn

Comments and Discussions

 
GeneralUsar com o eVB PinmemberJOSE ROBERTO SIQUEIRA17-Aug-04 2:35 
GeneralRe: Usar com o eVB PinmemberJoão Paulo Figueira17-Aug-04 3:09 
GeneralQuestion! Pinmemberkanglue19-Jul-04 2:41 
GeneralNice Work, Question about Keybord Menu PinmemberFad B17-Apr-04 5:17 
GeneralGreat article ! Pinmembercedric moonen3-Jul-03 21:23 
GeneralAn good article Pinmemberghmay2-Jun-03 17:51 
GeneralRe: An good article PinmemberJoão Paulo Figueira2-Jun-03 22:03 
GeneralRe: An good article Pinmemberghmay2-Jun-03 22:57 
QuestionWhat about vertical toolbars? Pinmemberaseiden27-May-03 20:22 
AnswerRe: What about vertical toolbars? PinmemberJoão Paulo Figueira2-Jun-03 10:48 
GeneralAll I can say is... PinmemberJohn Simmons / outlaw programmer17-Mar-03 23:59 
Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You Thank You
 
Smile | :) Smile | :) Smile | :) Smile | :)
 
------- signature starts
 
"...the staggering layers of obscenity in your statement make it a work of art on so many levels." - Jason Jystad, 10/26/2001
 
Please review the Legal Disclaimer in my bio.
 
------- signature ends
GeneralRe: All I can say is... PinmemberJoão Paulo Figueira18-Mar-03 0:02 
GeneralRe: All I can say is... PinmemberRoger Allen18-Mar-03 6:23 
GeneralGreat article, but one question ... PinmemberDaniel S.17-Mar-03 7:24 
GeneralRe: Great article, but one question ... PinmemberJoão Paulo Figueira17-Mar-03 7:39 
GeneralRe: Great article, but one question ... PinmemberDaniel S.17-Mar-03 7:49 
GeneralRe: Great article, but one question ... PinmemberChopper18-Mar-03 4:05 
GeneralRe: Great article, but one question ... PinmemberJoão Paulo Figueira18-Mar-03 4:09 
GeneralRe: Great article, but one question ... PinmemberChopper18-Mar-03 4:27 
GeneralRe: Great article, but one question ... PinmemberJoão Paulo Figueira18-Mar-03 4:31 
GeneralRe: Great article, but one question ... PinmemberChopper18-Mar-03 4:40 
GeneralRe: Great article, but one question ... PinmemberJoão Paulo Figueira18-Mar-03 4:45 

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.

| Advertise | Privacy | Mobile
Web03 | 2.8.140415.2 | Last Updated 17 Mar 2003
Article Copyright 2003 by João Paulo Figueira
Everything else Copyright © CodeProject, 1999-2014
Terms of Use
Layout: fixed | fluid