Cextstatuscontrolbar-managing status bar's panes is getting easier

Source: Internet
Author: User
Is your email address OK?You are signed up for our newsletters but your email address is either unconfirmed, or has not been reconfirmed in a long time. please click here to have a confirmation email sent so we can confirm your email address and start sending you newsletters again.

  • Download source files-53.1 KB
  • Download Demo project-19.5 KB

Introduction

The article introduces an enhanced version of the Standard MFC status bar control. the new class shocould enable you to easily Add/Remove panes to/from the application's Status Bar, on-the-fly. the status bar's panes may contain in almost any control you need: buttons, edits, animations, progress bars, and etc.

The class is partially based on the status bar presented in the freeware version of the prof-UIS library available here.

How to use it

TheCExtStatusControlBarClass is simple to use. To add it to your project, please follow the steps below:

  1. Put its source files (Cextstatuscontrolbar. cppAndCextstatuscontrolbar. h) Into the proper folder and add their file names to your Visual Studio project.
  2. Include its header to the appropriate header file. If you plan to useCExtStatusControlBarIn several places of your application, it's reasonable to add it to yourStdafx. hFile. Collapse copy code
    #include "CExtStatusControlBar.h"
  3. If you usedCStatusBar, You shoshould replace itCExtStatusControlBarEverywhere in the project. Collapse copy code
    CExtStatusControlBar  m_wndStatusBar;
Sample

TheStatuspanesSample project shows how to use the class in practice (including how to place controls into the control bar's PANES ).

List of methods
  • BOOL AddPane(UINT nID, int nIndex)

    Inserts a new pane into the status bar.

    Parameters
    nID
    ID of the pane to be added.
    nIndex
    The index of the newly created pane.
    Return Value
    Nonzero if successful.
  • BOOL RemovePane(UINT nID)

    Deletes a pane from the status bar.

    Parameters
    nID
    ID of the pane to be deleted.
    Return Value
    Nonzero if successful.
  • BOOL AddPaneControl(CWnd* pWnd, UINT nID, BOOL bAutoDestroy)

    Inserts a control into a specified pane.

    Parameters
    pWnd
    Pointer to the control to be added.
    nID
    ID of the target pane.
    bAutoDestroy
    Specifies whether the control shoshould be destroyed when the pane is removed.
    Return Value
    Nonzero if successful; otherwise zero.
  • BOOL AddPaneControl(HWND hWnd, UINT nID, BOOL bAutoDestroy)

    Inserts a control into a specified pane.

    Parameters
    hWnd
    Handle to the control to be added.
    nID
    ID of the target pane.
    bAutoDestroy
    Specifies whether the control shoshould be destroyed when the pane is removed.
    Return Value
    Nonzero if successful.
  • void DisableControl( int nIndex, BOOL bDisable=TRUE)

    Disables the control at a specified pane.

    Parameters
    nIndex
    Index of the pane.
    bDisable
    Flag specifying that the control is enabled if it is set TRUE.
  • int GetPanesCount() const

    Retrieves the current number of panes in the status bar.

  • void SetPaneWidth(int nIndex, int nWidth)

    Sets a width in pixels for a specified pane.

    Parameters
    nIndex
    Index of the pane.
    nStyle
    Width to be set.

     

  • void SetPaneInfo(int nIndex, UINT nID, UINT nStyle, int cxWidth)

    Sets the specified pane to a new ID, style and width.

    Parameters
    nIndex
    Index of the pane whose style is to be set.
    nID
    New ID for the pane.
    nStyle
    New style for the pane.
    cxWidth
    New width for the pane.
  • void SetPaneStyle(int nIndex, UINT nStyle)

    Sets the style of a status bar's pane. A pane's style determines how the Pane appears.

    Parameters
    nIndex
    Index of the pane whose style is to be set.
    nStyle
    Style of the pane whose style is to be set.
Copyright

You can use these sources for absolutely free.

Reporting bugs

Your questions, suggestions and bug reports may be posted either to the forum below or to the Forum at the prof-UIS website.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.