How to Use bcgcontrolbar

Source: Internet
Author: User

How to Use bcgcontrolbar

Install the bcgcontrolbar library on your computer:

Decompress bcgcontrolbar.zip (for example, to the C:/BCG directory)
Add C:/BCG/bin to your path environment variable,
Operation
Line visual c ++ and open the tools | Options dialog box, switch to the directories page and
C:/BCG/bcgcontrolbar is added to the include directory, and C:/BCG/bin is added to the library and
Executable Directory;
Open the bcgcontrolbar and/or bcgcontrolbarstatic Project (Path: C:/BCG/bcgcontrolbar) and select the required option;
To install the bcgcontrolbar Application Wizard, you only need to open the bcgbappwizard project and compile the link. You will see a new entry in the project list.
You must compile and link the DLL files of all bcgcontrolbar libraries;

Open the bcgcontrolbar project and compile the link. The following is a list of the obtained DLLs and library files:

Bcgcb *** D. dll, bcgcb *** D. Lib DLL debug version
Bcgcb ***. dll, bcgcb ***. Lib DLL release version
Bcgcb *** Ud. dll, bcgcb *** Ud. Lib DLL debug version, Unicode
Bcgcb *** U. dll, bcgcb *** U. Lib DLL release version Unicode
Bcgcb *** staticd. Lib static library debug version
Bcgcb *** staticds. Lib static library debug version, MFC shared DLL *
Bcgcb *** static. Lib static library release version
Bcgcb *** statics. Lib static library release version, MFC shared DLL *
Bcgcb *** staticud. Lib static library debug version, Unicode
Bcgcb *** staticuds. Lib static library debug version, Unicode, MFC shared DLL *
Bcgcb *** U. Lib static library release version, Unicode
Bcgcb *** us. Lib static library release version, Unicode, MFC shared DLL *

* ** Indicates the version number. For example, if your library version is 5.00, the corresponding release version of the DLL is bcgcb500.dll.
* The static library version with MFC shared DLL is applicable to version 4.7 or later.

All these files will be located in your/bin directory. Remember to add these directories to your system directory (copy all the DLL files to system32 ).

Change your source code as follows:

Add the bcgcontrolbar path to the include path
Are you sure you have called afxoleinit () initinstance () in your application ()
Add the following statement to the stdafx. h file:
# Include "bcgcbproinc. H"

Add cbcgworkspace-derived to your application class:
Class cmyapp: Public cwinapp,
Public cbcgworkspace

First, you must define the location where your custom data is stored in the registry and what kind of customization you need (mouse, keyboard, context menu). To do this, in the cmyapp :: set the registry entry in initinstance and initialize the custom Manager:
Setregistrybase (_ T ("Settings "));

// Initialize the custom Manager:
Initmousemanager ();
Initcontextmenumanager ();
Initkeyboardmanager ();

If you have decided to use the mouse or Context Menu customization function, you must attach a View to the mouse custom manager or initialize the context menu. Overload cbcgworkspace: preloadstate behavior:
Class cmyapp ....
{
...
Virtual void preloadstate ();
...
};

Void cmyapp: preloadstate ()
{
// Connect the mouse label event to a specific view:
Getmousemanager ()-> addview (iidtestview, _ T ("test View"), idr_view );

// Initialize the context menu:
Getcontextmenumanager ()-> addmenu (_ T ("test menu"), idmenu );
}

At the same time, change cmdiframewnd to cbcgmdiframewnd in the mainfrm. h and mainfrm. cpp files (Change cframewnd to cbcgpframewnd in the case of SDI applications)
Change cmdichildwnd to cbcgmdichildwnd.
Change ctoolbar to cbcgptoolbar and add an embedded menu bar object to your cmainframe class:
Cbcgpmenubar m_wndmenubar; // new menu bar
Cbcgptoolbar m_wndtoolbar; // application Toolbar

Add the following rows to the cmainframe: oncreate () behavior to enable the menu bar function:
// Create a menu bar (replace the standard menu ):
If (! M_wndmenubar.create (this ))
{
Trace0 ("failed to create menubar/N ");
Return-1; // creation failed
}
M_wndmenubar.setbarstyle (m_wndmenubar.getbarstyle () |
Cbrs_tooltips | cbrs_flyby | cbrs_size_dynamic );

To enable the menu bar to dock, add the following code:
M_wndmenubar.enabledocking (cbrs_align_any );
Dockcontrolbar (& m_wndmenubar );

Important: You can use any number of cbcgtoolbar toolbar in your application. All toolbar images are merged into a bitmap file. In any case, only one cbcgmenubar object is used.

To enable custom toolbar/menu, make the following changes:

Add toolbar/menu custom commands (for example, View | customize ...)
Implements onviewmimize behavior. The code looks as follows:
Void cmainframe: onviewcustomize ()
{
// Create a custom Toolbar Dialog Box:
Cbcgtoolbarcustomize * pdlgcust = new cbcgtoolbarcustomize (this,
True/* Automatic menus scaning */);
// Add the predefined toolbar:
Pdlgcust-> addtoolbar ("Main", idr_mainframe );
....

// Add custom commands:
Pdlgcust-> addbutton ("user", cbcgtoolbarbutton (id_user_tool1, 1, "user tool 1", true ));
Pdlgcust-> addbutton ("user", cbcgtoolbarbutton (id_user_tool2, 2, "user tool 2", true ));
Pdlgcust-> addbutton ("user", cbcgtoolbarbutton (id_user_tool3, 3, "user tool 3", true ));
....

Pdlgcust-> setusercategory ("user ");

// Enable the user to customize the CREATE/delete toolbar:
Pdlgcust-> enableuserdefinedtoolbars ();

Pdlgcust-> Create ();
}

To enable Microsoft? Office 2000 menu:

Define your own basic command set (usually in cmainframe: oncreate ):
Clist lstbasiccoomads;

Lstbasiccoomads. addtail (id_file_new );
Lstbasiccoomads. addtail (id_file_open );
Lstbasiccoomads. addtail (id_file_save );

......
Lstbasiccoomads. addtail (id_app_about );

Cbcgtoolbar: setbasiccommands (lstbasiccoomads );

These commands are displayed in the drop-down menu:
To enable the menu shadow:

Cbcgmenubar: enablemenushadows (bool benable = true)

Note: If the content you view may change dynamically, do not use menu shadows (for example, displaying animations and HTML pages in views) in the pop-up menu. In this case, the menu shadow remembers the previous view image.

To change the menu font at runtime:

Cbcgmenubar: setmenufont (lplogfont, bool bhorz = true );

To enable the "page" (custom) button, you only need to call:

M_wndtoolbar.enablecustomizebutton (true, id_of_customize_command,
_ T ("customize ..."));

To enable image-covered text:

M_wndtoolbar.enabletextlabels (bool benable = true );

To enable custom tools:

Add a new menu entry: id_tools_entry. This entry is automatically replaced by the list of existing tools.
Add the following entries to the string resource:

Id_tool1 "activates User-Defined tool/nuser tool"
Id_tool2 "activates User-Defined tool/nuser tool"
....
Id_toolx "activates User-Defined tool/nuser tool"

In the initinstance () of the application, call:
Enableusertools (id_tools_entry, id_tool1, id_toolx );

A new "Tools" page will be added to the custom dialog box.
To enable dynamic cropping of menus:

Retain some entries in the string resource table. These identifiers are used as control bar identifiers.

Id_tear_off1 ""
Id_tear_off2 ""
.......
Id_tear_offx ""

For each cropping pop-up menu, change the "break" attribute to "bar" (mf_menubarbreak)
In the initinstance () of the application, call:
Enabletearoffmenus (_ T ("regbase", id_tear_off1, id_tear_offx );

To enable static cropping menus

Keep an entry in the string resource table. This identifier will be different from the dynamic cropping identifier (as described above ).

Id_tear_off_bar ""

In the onshowpopupmenu of the main framework, You can crop a specific menu button:
Pmenubutton-> settearoff (d_tear_off_bar );

Download the cracked version at the following address:
Http://www.skkk.net/Download.asp? Id = 22532 & url = http://http.skkk.net/061124/download/BCGControlBar.Professional.v7.31.Final.rar

Installation password team zwt

 

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.