Click here to Skip to main content
65,938 articles
CodeProject is changing. Read more.
Articles
(untagged)

Professional User Interface Suite

13 Jan 2004 26  
MFC extension library enabling software to be provided with a professional UI

Contents

Introduction

Prof-UIS is an easy-to-use MFC extension library that enables you to deliver Windows applications with a professional and user-friendly interface. Prof-UIS is specially designed to help Visual C++ developers implement advanced UI facilities in the most effective and easy way: In most cases, to replace the proper MFC class name with that of Prof-UIS in your code is enough to take full advantage of Prof-UIS functionality, i.e. CComboBox -> CExtComboBox. That, combined with an impressive list of key features, makes Prof-UIS an invaluable tool for GUI development.

Prof-UIS is designed to help Visual C++ programmers save hundreds of hours in implementing today's most demanded GUI facilities in their applications. This makes Prof-UIS an invaluable tool for GUI development.

Prof-UIS Features

  • On-the-fly changeable Microsoft Office 2000, XP and 2003 themes
  • Visual Studio .NET-like resizable control bar, which optionally shows its contents while dragging/resizing. Such bars can be placed in all sorts of combinations relatively to each other both in the main frame window and in the smart floating containers
  • Powerful set of tools for color management: color popup menu with shadow (color picker menu), color picker button, color palette control, color picker control, and color selection dialog
  • Pop-up menu with shadows, animation, frequently/rarely used commands and Windows 2000-like tooltip window
  • Menu bar with automatic support for lists of MRU files and MDI windows, the system menu for the MDI/SDI main frame and MDI child frame, and the context menu for application's toolbars and resizable control bars
  • Enhanced resizable dialog, resizable property sheet and resizable property page
  • Fixed-size panel control bar
  • Enhanced standard controls with flat/semi-flat style: combo box with optional auto-complete, edit, button with icon, check box, and radio button
  • Built-in toolbar buttons with divided drop-down areas
  • Toolbar's chevron button support
  • Powerful "persistent affixment algorithm" which makes Prof-UIS control bars extremely user-friendly � they can restore their exact positions and sizes after redocking the bars or resizing the frame
  • Generalized template window classes for various common tasks like injecting non-client area borders into any window, providing flicker-free repainting and anchoring child windows to the borders of their parent window
  • Multi profile UI persistence and archive-based serialization of UI state, which supports the command usage statistics. These features are based on the Command Manager serializable component
  • Alpha icons for disabled menu and toolbar items used when both the Microsoft Office 2003 style and high/true color monitor modes are on
  • Multi-monitor support
  • Visual Studio 6.0/7.0/7.1 compatibility
  • ANSI, MBCS, Unicode, and native Unicode support
  • German, Polish, Swedish and Russian localizations

Pop-up Menus

How to use pop-up menus in your application

The CExtPopupMenuWnd class implements a popup menu. To use it is no more difficult than the standard CMenu class.

1. Create the CExtPopupMenuWnd object dynamically:

CExtPopupMenuWnd *pPopupWnd = new CExtPopupMenuWnd;

2. Initialize menu items by either loading the menu resource

    VERIFY(
        pPopupWnd->LoadMenu(
            hWnd,
            IDR_TEST_POPUP_MENU
        )
    );

or performing a set of calls to CExtPopupMenuWnd::ItemInsert()

3. Let us now look at how a new popup submenu can be inserted.

First, create and initialize it by going through Step 1 and Step 2. Then, call ItemInsertSpecPopup() for inserting a new popup at the specified position in the existing CExtPopupMenuWnd object. The code below inserts a color picker menu to the existing menu:

    pPopupWnd->ItemInsertSpecPopup(
        new CExtPopupColorMenuWnd,
        -1,
        _T( "test color menu" )
    );

4. Track the created and initialized popup menu:

    VERIFY( pPopupWnd->TrackPopupMenu( 0, x, y ) );

Please note that the popup menu's tracking position is set in screen coordinates.

The CExtPopupMenuWnd objects are auto-destroyed, so do not call the delete operator for these objects.

How to set popup menu visualization options?

Popup menu class CExtPopupMenuWnd has the following properties:

Property Default Value Meaning
static bool g_bMenuWithShadows; true Allow displaying shadows
static bool g_bMenuExpanding; true Allow hiding rarely used menu items in initial state
static bool g_bMenuHighlightRarely; true Display rarely used menu items in a different style
static bool g_bMenuShowCoolTips; true Allow displaying cool tooltips
static bool g_bMenuExpandAnimation; true Turn on animation when expanding rarely used menu items
static bool g_bUseDesktopWorkArea; true If true, align to desktop work area, otherwise - to screen area
static e_animation_type_t g_DefAnimationType; __AT_FADE Default animation during menu activation. Acceptable values are:
__AT_NONE
__AT_RANDOM
__AT_ROLL
__AT_SLIDE
__AT_FADE
__AT_ROLL_AND_SREETCH
__AT_SLIDE_AND_SREETCH
__AT_NOISE
__AT_BOXES
__AT_CIRCLES
__AT_HOLES

How to set the commands that are always displayed as frequently used to menu?

The frequently used or basic commands are those that do not depend on usage statistics or a number of clicks. All application commands are registered in the command manager (CExtCmdManager), whose members and methods can be accessed via the global smart pointer variable g_CmdManager with operator ->. The SetBasicCommands() method allows you to replenish the basic commands list. The system commands (from the window's system menu), OLE commands and the commands relating to MRU files and to MDI windows are automatically considered to be basic.

What is the usefulness of the SetBasicCommands method?

In the DRAWCLI sample expandable menus are used. When you open any drop down menu from the menu bar, the items corresponding to basic commands are only visible at first. Other items appear only when you click on the Expand button at the bottom of the menu or when you press CTLT+DOWN_ARROW.

How to disable the most recently used menu items?

There are two ways to do this:

  • add the following lines to your initialization code
    CExtPopupColorMenuWnd::g_bMenuExpanding = false;
    CExtPopupColorMenuWnd::g_bMenuHighlightRarely = false;
  • use g_CmdManager->SetBasicCommands(...) to make all your commands basic i.e. initially visible in your menus.
The first way is preferable.

Docking Mechanism Explained

This part of the article describes how Prof-UIS implements the mechanism responsible for docking its control bars. It also explains the most important operations on the dockable control bar including how its position is set in a frame window.

Important terms

There are several terms that may have different meanings to different people. Brief descriptions of some important terms are given below.

Frame window

An overlapped/popup window with one child window in the center area and a set of child windows (control bars) that can be fixed to its borders.

Docking site

A popup frame window that contains a set of control bars in its either docked or floating state.

Floating container (floating palette, floating frame, mini frame)

A special kind of the frame window that encloses only one child docking bar window with the AFX_IDW_DOCKBAR_FLOAT dialog control identifier. The docking bar window encloses one or more control bars. Floating containers are created and destroyed automatically with the control bar�s drag-and-drop algorithm.

Control bar

The generalized MFC implementation of the window that can be either fixed to any of the borders of its parent frame window or floated in the floating container.

Fixed-size control bar

A fixed-size control bar (e.g. toolbars or menu bars). The size of the fixed bar in its docked state could not be changed by dragging its borders.

Resizable control bar *

A control bar that can be resized by dragging its borders and docked in the dynamic control bar containers.

Docking bar

A kind of an MFC control bar which is used as a parent window for all the control bars with the re-docking feature turned on (CControlBar::EnableDocking() is used for this). Basically MFC provides two types of docking bars, which are implemented as the internal class (CDockBar): floating bar (with the dialog control identifier set to AFX_IDW_DOCKBAR_FLOAT) and docking bar fixed to the sides of the docking site (with the dialog control identifiers set to AFX_IDW_DOCKBAR_LEFT, AFX_IDW_DOCKBAR_RIGHT, AFX_IDW_DOCKBAR_TOP, or AFX_IDW_DOCKBAR_BOTTOM). MFC supports only four docking bars for one docking site at the time (these bars are marked with red in the below). In Prof-UIS these bars are called "circle 0" or "outer docking bar circle". Both fixed and resizable bars can be docked into "circle 0", but the drag-and-drop algorithm for resizable bars docks them only into the Prof-UIS-specific inner docking bar "circles" with numbers starting from 1. In the figure below, "circle 1" is marked with blue, "circle 2" - with green. Inner circles are created and destroyed dynamically with the drag-and-drop algorithm for the resizable bar. These inner circles "allow" resizable bars to be docked to each other in a nested way. The fixed-size control bars could be docked only into "circle 0" marked with red.

Docking site�s client area

The area that is free of any bars. It is marked with yellow in the figure and used by MDI client windows in MDI applications and the view window in SDI applications.

Dynamic control bar container *

A special kind of the resizable control bar, which is created dynamically and used for docking other resizable bars to horizontal rows inside vertical rows and vice versa. The dynamic control bar container like any resizable control bar can take up part of the docking site or part of the floating container.

Status bar

The MFC implementation of the status line. The status bar cannot be re-docked by dragging any its area. It takes up part of the docking site under the lowest docking bar (i.e. under the red "circle 0").

* Prof-UIS - specific term

How to dock fixed-size control bars relatively each other?

To set a certain fixed docking bar location, just call your CMainFrame::DockControlBar() method with the appropriate parameter values. The following example arranges two toolbars into one horizontal image at the bottom of a frame window:

    DockControlBar(
        &m_wndToolBar1,
        AFX_IDW_DOCKBAR_BOTTOM
    );
    CRect wrAlreadyDockedToolBar;
    m_wndToolBar1.GetWindowRect( &wrAlreadyDockedToolBar );
    wrAlreadyDockedToolBar.OffsetRect( 0, 1 );
    DockControlBar(
        &m_wndToolBar2,
        AFX_IDW_DOCKBAR_BOTTOM,
        &wrAlreadyDockedToolBar
    );

How to dock resizable bars relatively each other?

Use the CExtControlBar::DockControlBar() methods (two overloaded functions) to set the relative positions of the control bars. In the sample below, the first method docks the m_wndResourceViewBar resizable bar to the newly created row in the left part of "docking circle 1". The second one is applied to the already docked m_wndResourceViewBar bar, with its parameters specifying the position of the m_wndServerExplorerBar bar relatively to the m_wndResourceViewBar one.

    m_wndResourceViewBar.DockControlBar(
        AFX_IDW_DOCKBAR_LEFT,
        1,
        this,
        false
    );
    m_wndResourceViewBar.DockControlBar(
        &m_wndServerExplorerBar,
        true,
        true,
        this,
        false
    );

How to show or hide docked or floating control bars?

To make both fixed-size bars and resizable bars visible/invisible, the CFrameWnd::ShowControlBar() method should be used. The CControlBar::ShowWindow() cannot be used here, because it does not affect the positions of other bars in the same frame window (i.e. the method does not perform the frame layout recalculation).

How to float fixed-size bar?

For this purpose, use either CExtControlBar::FloatControlBar(), or CFrameWnd::FloatControlBar(). Both methods produce the same results.

How to float resizable bar?

The CExtControlBar::FloatControlBar() method should be used. The CFrameWnd::FloatControlBar() method is not allowed.

How to enable control bars in the docking site to be re-dockable?

Usually all the control bars (but the status bar) in any docking site are enabled to be re-dockable. This feature is turned on by performing the following two steps. First, call the static CExtControlBar::FrameEnableDocking( pDockSite ) method. Second, invoke the CExtControlBar::EnableDocking() method of the bar.

If a bar is not re-dockable, its parent window is the docking site. In case of a dockable bar, the parent window is always a docking bar window (even for a floating palette).

IMPORTANT: CExtControlBar::FrameEnableDocking( pDockSite ) should be used instead of CFrameWnd::EnableDocking().

How to activate resizable bar that is not visible?

The call of the static CExtControlBar::DoFrameBarCheckCmd( pDockSite, nReisizableBarDlgCtrlID, false ) method activates the resizable bar being in any state.

How to set initial size for resizable control bar?

Use the three methods below to initialize the desired size of a bar that is either in the docked state (vertical/horizontal) or in the floating state:

  • SetInitDesiredSizeVertical( CSize )
  • SetInitDesiredSizeHorizontal( CSize )
  • SetInitDesiredSizeFloating( CSize )

The real sizes of docked bars are adjusted proportionally between all the resizable bars in one row.

Please note that the bar can be in the floating state only when it itself is the single bar in its floating container. In any other case, the bar is in the docked state.

How to detect whether bar is in floating container or in docking site?

Call the CExtControlBar::GetParentFrame() method to get the pointer to the parent CFrameWnd-based window. If this returned object is kind of CMiniFrameWnd, the bar is docked inside a floating container. Otherwise the bar is docked in the docking site.

How to detect whether bar is visible or not?

Retrieve the bar window style flags by calling the GetStyle() method. The bar window is visible if its window style flags have the WS_VISIBLE flag. The CControlBar::IsVisible() method can additionally detect whether the bar is temporarily invisible.

How to handle control bar's show/hide commands and update their associated command states in docking site?

These commands make each control bar visible/invisible. They are usually marked with check marks, which indicates visibility of the bars. Every docking bar has its own unique dialog control identifier and the corresponding menu command in the docking site. In this case, the context menu with the list of all the docking bars can be activated on every frame point. So, to set the correct check mark for the "Show/Hide" command of the bar, you should add the following two lines to the frame�s message map:

    ON_COMMAND_EX( ID_BAR_... , OnBarCheck )
    ON_UPDATE_COMMAND_UI( ID_BAR_... , OnUpdateControlBarMenu )

How to handle control bar's show/hide commands and update their associated command states in docking site like in Visual Studio .NET?

First, see the previous answer. The difference is in the command handling/updating for the resizable bars. These commands have no check marks and are only used to activate resizable control bars. They never hide bars. Implement the new OnBarCheck() and OnUpdateControlBarMenu() methods in the docking site:

    BOOL CMainFrame::OnBarCheck( UINT nID )
    {
        return CExtControlBar::DoFrameBarCheckCmd(
            this,
            nID,
            false
            );
    }
    void CMainFrame::OnUpdateControlBarMenu( CCmdUI * pCmdUI )
    {
        CExtControlBar::DoFrameBarCheckUpdate(
            this,
            pCmdUI,
            false
        );
    }

How to load/save state of docking bars?

The state persistence is usually implemented in your CMainFrame's OnCreate() and DestroyWindow() methods.

To load bars' state:

    CExtControlBar::ProfileBarStateLoad(
        this, // some kind of CFrameWnd

        pApp->m_pszRegistryKey, 
           // application registry key (usually company name)

        pApp->m_pszProfileName, 
           // application profile name (usually product name)

        pApp->m_pszProfileName  // Prof-UIS profile name

    );

To save bars' state:

    CExtControlBar::ProfileBarStateSave(
        this, // some kind of CFrameWnd

        pApp->m_pszRegistryKey, 
            // application registry key (usually company name)

        pApp->m_pszProfileName, 
            // application profile name (usually product name)

        pApp->m_pszProfileName  // Prof-UIS profile name

    );

How to add Visual Studio .NET like resizable control bar to frame window?

You should add the CExtControlBar member in the frame window class declaration. Creating a resizable control bar is similar to that of toolbar.

How to insert window into resizable control bar?

When creating such a child window, pass a pointer to CExtControlBar instance in the "parent window" parameter to the child window Create() method. After that, the control bar will automatically adjust the child window to its client area. So far, the resizable control bar allows only one child window

How to add docking menu bar to frame window?

The docking menu bar is implemented just as an ordinary toolbar. Any needed initialization should be performed in your CMainFrame's OnCreate() handler. Moreover, you need to add a frame window class member of CExtMenuControlBar class.

    ...
    if( !m_wndMenuBar.Create(
            _T( "Menubar name" ),
            this,
            ID_VIEW_MENUBAR) ||
        !m_wndMenuBar.LoadMenuBar( IDR_MAINFRAME ))
    {
        TRACE0( _T( "Failed to create menubar\n" ) );
        return -1;
    }
    ...
    m_wndMenuBar.EnableDocking( CBRS_ALIGN_ANY );
    ...
    CExtControlBar::FrameEnableDocking( this );
    ...
    DockControlBar( &m_wndMenuBar );
    ...

By default, CExtMenuControlBar does not activate menu on pressing the ALT key. To enable this, you should override the PreTranslateMessage() virtual function in a frame window class and add the following lines before the parent PreTranslateMessage():

    if( m_wndMenuBar.TranslateMainFrameMessage( pMsg ) )
        return TRUE;

In case of MDI, repeat the same in the child frame window class.

Is there a way to change the appearance of the gripper for the control bars?

Painting of all the Prof-UIS windows is performed with the global paint manager (the g_PaintManager variable). It is a smart container for the CExtPaintManager-like object. You can install your own paint manager classes derived from CExtPaintManager or CExtPaintManagerXP/CExtPaintManagerOffice2003 to re-paint anything you wish. So, create your own class derived from CExtPaintManager. Then override the PaintGripper() method. Please consult the code of CExtPaintManager::PaintGripper() for details. If m_bSideBar is true, we are painting the gripper of the resizable bar, which is a caption. If m_bFloating is true, we are painting the caption of any floating mini-frame window.

How to remove the close button from CExtControlBar?

You should use your own class derived from CExtControlBar (or CExtToolControlBar, or CExtMenuControlBar) and override the OnNcAreaButtonsReinitialize() virtual method. This is the source code of CExtControlBar::OnNcAreaButtonsReinitialize():

    void CExtControlBar::OnNcAreaButtonsReinitialize()
    {
        INT nCountOfNcButtons = NcButtons_GetCount();
        if( nCountOfNcButtons > 0 )
            return;
        NcButtons_Add( new CExtBarNcAreaButtonClose(this) );
    #if (!defined __EXT_MFC_NO_TAB_CONTROLBARS)
        NcButtons_Add( new CExtBarNcAreaButtonAutoHide(this) );
    #endif // (!defined __EXT_MFC_NO_TAB_CONTROLBARS)

        NcButtons_Add( new CExtBarNcAreaButtonMenu(this) );
    }
If you remove this line NcButtons_Add( new CExtBarNcAreaButtonClose(this) ); the "X" button will disappear. When the control bar window is in the floating state, it is inside a miniframe window which is created and destroyed automatically by Prof-UIS. The "X" on this frame just hides the window. All the non-client area buttons are instances of the classes which are derived from CExtBarNcAreaButton. You can write your own buttons and initialize them in OnNcAreaButtonsReinitialize().

Prof-UIS Usage Tips

I am a novice in MFC programming. How to set up paths for Prof-UIS files?

All the Prof-UIS LIB and DLL files can be found in ...\Prof-UIS\Bin6 or ...\Prof-UIS\Bin7 folder (for VC++ 6 or 7). You should add the ...\Prof-UIS\Include folder into the "Include folders list" in your VC++ environment settings. Also, you should add the ...\Prof-UIS\Bin6 or ...\Prof-UIS\Bin7 folder into the "Library folders list". In your projects precompiled header file (usually named StdAfx.h) you should add this line:

  #include <Prof-UIS.h>

Now your program will be linked together with appropriate Prof-UIS library (depending on your project settings). To allow your program run, you may need copy required Prof-UIS DLL (if any required) into the same folder with your program EXE file.

How to use Prof-UIS controls(CExtComboBox, CExtButton, etc.)?

Just replace the standard MFC classes in your code with the corresponding ones of Prof-UIS. Do not forget to include the appropriate header files.

How to load/save application commands usage statistics?

Command Manager solves this problem with the g_CmdManager->SerializeState() method.

How to replace standard MFC toolbar with that of Prof-UIS in frame window?

First, include ExtToolControlBar.h in the header file a frame window. Second, replace CToolBar class name with CExtToolBar. Finally, modify the frame window handler code in OnCreate():

    if( !m_wndToolBar.Create(
            _T( "Toolbar name" ),
            this,
            AFX_IDW_TOOLBAR)
        || !m_wndToolBar.LoadToolBar( IDR_MAINFRAME ))
    {
        TRACE0( "Failed to create toolbar" );
        return -1;
    }

How to set /change text for a button on toolbar and for menu item in menu?

You should get the command specifier from the command manager and, then, set the text attributes m_sToolbarText and m_sMenuText. If you have to set/change the text after the frame window has been created, call the RecalcLayout() method of the frame.

    CExtCmdManager::cmd_t * p_cmd;
    p_cmd = g_CmdManager->CmdGetPtr( ID_... );
    ASSERT( p_cmd != NULL );
    p_cmd->m_sMenuText = _T( "Menu text" );
    p_cmd->m_sToolbarText = _T( "Toolbar text" );

How to insert controls into toolbar?

Create a control with Dialog Control ID value equal to the ID of an existing button on the toolbar. Then, set then control to the button by calling CExtToolControlBar::SetButtonCtrl() method.

If there is no command with such ID in the application menu, then it is recommended to set a menu text for this command. That allows the button/control to be displayed correctly in case there is no space in the toolbar for it.

    if( !m_wndComboFindText.Create(
            WS_CHILD|WS_VISIBLE|CBS_HASSTRINGS|CBS_DROPDOWN,
            CRect(0,0,180,200),
            &m_wndToolBarStandard,
            ID_HELP_SEARCH_COMBO))
    {
        TRACE0( _T( "Failed to create ID_HELP_SEARCH_COMBO\n" ) );
        return -1;      // fail to create

    }
    m_wndToolBarStandard.SetButtonCtrl( 
        m_wndToolBarStandard.CommandToIndex(ID_EDIT_FIND),
        &m_wndComboFindText
    );
    m_wndComboFindText.SetFont(  
        CFont::FromHandle((HFONT)::GetStockObject(DEFAULT_GUI_FONT)) );
    m_wndComboFindText.SetItemHeight(
        -1, m_wndComboFindText.GetItemHeight(-1) - 1 );
    g_CmdManager->CmdGetPtr( m_wndComboFindText.GetDlgCtrlID() )->
        m_sMenuText = _T( "Search help system" ); 
  
    CZoomBarSliderButton *pZoomSliderTBB = new CZoomBarSliderButton(
            &m_wndToolBarZoom,
            ID_MYEXTBTN_SLIDER,
            0,
            11, 4, 0,  // scroll total/pos/page

            0, 0,  
          // button extent horz(left/right)/vert(up/down) in pixels

          // (if zeros - use slider-like layout instead of scrollbar-like)

            100, 100  // total slider control extent horz/vert in pixels

        );
    VERIFY(m_wndToolBarZoom.InsertSpecButton(-1,pZoomSliderTBB,FALSE));
  
    CSeekBarSliderButton *pSeekScrollerTBB = new CSeekBarSliderButton(
       &m_wndToolBarSeek,
       ID_MYEXTBTN_SCROLLER,
       0,
       0, 0, 0,  // scroll total/pos/page

       10, 10,  // button extent horz(left/right)/vert(up/down) in pixels

       // (if zeros - use slider-like layout instead of scrollbar-like)

       300, 300  // total slider control extent horz/vert in pixels

      );
    VERIFY(m_wndToolBarSeek.InsertSpecButton(-1,pSeekScrollerTBB,FALSE));

How to add/remove UI state profile from/to command manager?

Prof-UIS supports multi profile UI state persistence. Each profile has unique name and a set of window handles.

    g_CmdManager->ProfileSetup( _T( "ProfileSectionName" ), hWnd );

How to set menu for a toolbar button?

The CExtToolControlBar class stores the HMENU attribute for every button. You can set it by activating CExtToolControlBar::SetButtonMenu().

    CExtCmdManager::cmd_t * p_cmd;
    CMenu _menu;
    p_cmd = g_CmdManager->CmdGetPtr( ID_CMD_... );
    ASSERT( p_cmd != NULL );
    VERIFY( _menu.LoadMenu( ID_MENU_... ) );
    VERIFY(
        m_wndToolBarMain.SetButtonMenu(
            m_wndToolBarMain.CommandToIndex( ID_CMD_... ),
            _menu.Detach(),
            TRUE
        )
    );

How to display Prof-UIS advanced Color Dialog?

Prof-UIS provides an advanced color selection dialog with a set of color navigation modes. Just declare the CExtColorDlg object and call DoModal(). Use m_strCaption member to set a custom dialog caption. To set initial colors, use m_clrInit and m_clrNew members. Some modes are demonstrated below:

How to change User Interface Manager?

User interface Manager is an instance of CExtPaintManager or the one derived from it and is stored in a global smart pointer variable g_PaintManager. CExtPaintManager methods are used for drawing all supported interface components as provided by the Office 98/2K/2003 appearance. Prof-UIS also includes CExtPaintManagerXP and CExtPaintManagerOffice2003 classes used for drawing in the Office XP and Office 2003 styles. The following lines describe how to set the Office 98/2K/2003 interface style.

    VERIFY(
        g_PaintManager.InstallPaintManager( new CExtPaintManager )
    );

    VERIFY(
        g_PaintManager.InstallPaintManager( new CExtPaintManagerXP )
    );

    VERIFY(
        g_PaintManager.InstallPaintManager( 
            new CExtPaintManagerOffice2003 )
    );

Samples

DRAWCLI

This sample application based on the Microsoft's sample with OLE Server-Container technology support illustrates the use of OLE-verb menus, OLE Client-Server compatible control bars, color picker menus both in menu bar and in toolbar, toolbar buttons with dynamically generated icons, owner-draw menu, and more.

GLViews

Demonstrates how to output rendered images (OpenGL animation) both to the main view and to the dockable views resided in resizable control bars. This multithreaded application allows you to select an active camera in each view, set up its parameters and perform 6 DOF simulation of camera maneuvers. GLViews also illustrates playing an AVI file on a 3D surface, OpenGL stencil buffer-based reflection, and frame image rendering during animation.

Avi Frames

Shows how to work with the slider button built into the Prof-UIS toolbar. The slider features optional scroll arrow buttons like those in the standard scroll bar. The Zoom and Seek slider buttons represented in the sample demonstrate how to control the playing of AVI files.

Status Bar Panes

Demonstrates the features of the Prof-UIS status bar. This control, which is an enhanced version of the standard MFC status bar, enables you to easily add or remove panes on-the-fly. Its panes may contain almost any control you need: buttons, edits, animations, progress bars, and etc.

Funny Bars

Shows how to use icons of different sizes and different color depths in toolbars. It also demonstrates how, for the toolbar buttons, to change the font, font size and font style of the caption as well as the button image on-the-fly.

ProfUIS_Controls

Illustrates the primary controls including toolbar and menu bar in dialog window, user-defined toolbar buttons and labels, pop-up menu with owner-draw items and left area, pop-up menu in system tray, menu animation effects, powerful color picker menu and dialog, and more.

ResizablePropertySheet

A simple resizable property sheet based application. Illustrates the usage of the resizable property sheet window as an application's main window.

ResizableChildSheet

Demonstrates how to use CExtResizablePropertySheet as a child window of the resizable control bar and MDI child frame.

StateInFile

A simple single document interface application without DOC/VIEW architecture support demonstrates how to save the current state of control bars in a file.

MDI_InnerOuterBars

A simple multiply document interface application without DOC/VIEW architecture support demonstrates how to use control bars both in the MDI frame window and in the MDI child window.

FullScreenState

Illustrates full state persistence of control bars when switching between windowed and full screen modes.

FixedSizePanels

Demonstrates how to implement different kinds of bars with fixed size including dialog bars, palette bars, custom-drawn panels.

MthOutput

Shows multithreaded output to rich edit controls placed in resizable control bars and MDI child frames.

Version History

Version 2.23

Released on January 15, 2004.

New features

  • Improved Office 2003� style
  • Alpha icons for disabled menu and toolbar items used when both the Microsoft
  • Experimental subsystem of the native Unicode character support
  • German, Polish, Swedish and Russian localizations

Bug fixes

  • Fixed bug that caused crash of complex floating palettes containing more than one resizable bar
  • Corrected a style of toolbar chevron button when the Microsoft Office� XP/2003 UI style is on

Version 2.22

Released on September 25, 2003.

New features

  • MS Office� 2003 theme based both on classic GDI API and native Windows XP�s theme API
  • Multi-monitor support
  • Visual Studio� NET 2003 compatibility
  • Improved docking algorithm for toolbars
  • Enhanced algorithm dealt with the message loop now makes resizing windows smoother

Bug fixes

  • Fixed a bug with an incorrect initial position of the system menu when clicking the right mouse button on the dialog�s caption
  • Fixed an XP style bug with too dark shadow under the system menu�s items

Version 2.21

Released on July 8, 2003.

New features

  • Fixed-size control bars (an enhanced toolbar and a completely new panel bar) with a new powerful "persistent affixment algorithm" which makes them extremely user-friendly. The control bars can restore their exact positions and sizes after redocking the bars or resizing the frame.
  • Built-in toolbar buttons with divided drop-down areas.
  • CExtButton button control can now support divided drop-down areas.
  • All the context menus over different frame areas (including control bars, docking bars, and floating palettes) and the toolbar�s contents button menu can be constructed on-the-fly.
  • Menu item with a submenu can combine its area with the area of the currently opened submenu.

Bug fixes

  • Fixed a bug dealing with the locked loop when resizing the floating toolbars with icons of size greater than 16x16.

Version 2.20

Released on September 15, 2002.

New features

  • Completely new docking mechanism for resizable control bars
  • Visual Studio .NET like resizable control bar, which optionally shows its content while dragging/resizing as the Task Area bar does in Office 2000 and Office XP
  • Resizable dialog and resizable property sheet with styled push buttons, which both have the new system menu, and resizable property page (these windows also support the MFC automatic tooltip feature for their child toolbar windows)
  • Generalized template window classes for various common tasks like injecting non-client area borders into any window, providing flicker-free repainting, anchoring child windows to the borders of their parent window

Bug fixes

  • Fixed incorrect vertical text painting under Windows NT 4
  • Fixed a bug with crashing the program after clicking the mouse on the "Show/Hide bars" menu item in the expanded button of the toolbar/menu bar

Version 2.15

Released on July 8, 2002.

New features

  • Completely new dragging algorithm for toolbars and resizable control bars
  • Streamlined resizing algorithm for floating control bars
  • Owner-drawn popup menu with the left image area
  • Smoother menu animation effects
  • Support for standard Windows sounds in menu
  • Updated Hue/Saturation/Luminance roller mode in CExtColorCtrl
  • Enhanced 256 color painting
  • Source Code compiled at warning level 4
  • ANSI/MBCS/Unicode support
  • Fully compatible with Visual Studio .NET

Bug fixes

  • Unwanted frame repainting when dragging control bars
  • Bug dealing with painting the owner-drawn CExtComboBox in toolbars
  • Bug arising when auto-completing the user input in the CExtComboBox editor popup menu

Version 2.1

Released on April 13, 2002. First public release.

Copyright

The Prof-UIS library presented in this article is freeware software.

Credits

Thanks to all those whose names appear in the library source code, and to anybody who have been forgotten to mention. Many thanks to people who submitted bug information.

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.

Additional Information

Any additional information on Prof-UIS as well as its latest versions can be obtained at http://www.prof-uis.com/.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here