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.

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

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

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

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:

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.

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.

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.

Frame window

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").

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:

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.

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).

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().

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.

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.

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:

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:

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

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.

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():

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.

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():

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().

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.

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.

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.

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:

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.

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.

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

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.

The newest version of Prof UIS contains a ribbon control but I cant find a sample in the freeware version.
I also can't find any ribbon classes (CExtRibbonBar,...) in the sourcecode. Does the freeware package include the ribbon?

I working on 32-bit Vista. I have MSVC 2008. My project uses MCBS (debug) Prof-UIS libraries.
I had several problems when compiling and linking Prof-UIS libraries. I have Prof-UIS freeware v. 2.84.

1. I had to add
#define CX_BORDER 1
#define CY_BORDER 1
in ExtSplitterWnd.cpp otherwise it wouldn't compile.
2. I had to add ExtControlsCommon.h and .cpp in ProfUISLIB-project, otherwise almost non of the samples or other projects wouldn't link.
3. I had to add __EXT_MFC_NO_CUSTOMIZE to Preprocessor definitions on my own project properties because there is not all headers in freeware version and it wouldn't compile.

Hello sir,
I want to insert slider control in toolbar.If it is placed horizontally it takes lot of space in toolbar.Can it be placed vertically in toolbar.or otherwise is it possible to place it in Drop-down popup menu of toolbar.Waiting for your early reply.

Dockable toolbars and menu bar can be created in the frame windows only. If you still want to use dockable menu bar in dialog you can try to create CFrameWnd inside the dialog and then menu bar inside this frame window.

I recommend you to download the latest library version from www.prof-uis.com first. That version is compiled without any problems under any Visual Studio version.
If you still have some compile problems please give me the build log so I can say what's wrong.

The library setting for compilations are all with the 'static' prefix.
All of samples need the library to be compiled without the static prefix , for example profuis283nd.lib, i couldn't find a way to compile the library with this specifications.
Does anyone know how to solve this problem ?
Thanks

The ProfUIS264nd.lib file corresponds to the Win32 ANSI Debug configuration of Prof-UIS. So please open the ProfUISDLL project and compile the "Win32 ANSI Debug" configuration. After that, you can use the compiled library files in your project. Please also make sure that the folder with binary files is added to the Library Files folders section of the directories list (Tools->Options>Directories).

The problem is that only static ansi debug appears in the configurations list.
Every option is peceded with the 'static' word before the full text
Thanks for answering, but i have decided to drop the idea to integrate prof uis.

I am using the library in my MDI program, it works fine but have a problem.

At first, all the button works OK, but if I insert a new button between them, the button beside the new button won't be responded to any clicking. If I delete the program registry key at current user in Registry, it works again. But I didn't load or save the settings of buttons in Registry.

Did you mean the toolbar buttons? If yes, please try to invoke the CExtToolControlBar::_RecalcLayoutImpl() method after inserting the new button. Would you also clerify what did you mean by "button won't be responded to any clicking"? How does it look? Is the button appeared disabled? Some screenshots would be useful. You can sent their to the Prof-UIS Support Team (support@prof-uis.com). If you can prepare the test project which shows the problem please send it also.

Yes, the button appeared disabled. I didn't save anything into registry for Pro-UIS. Another scenario is that if you click the button to do something and save into registry, then the operation finished, the button may be disabled right away. I cannot duplicate on my computer, but it happened once on my friend's computer, I delete the whole registry settings in the current user of the program, then it worked well on his computer. I just would like to know what causes the problem.