Toolbar joins the name of the text

xiaoxiao2021-03-06  46

Main function

1.ctoolbar :: Setsizes (Size SizeImage)

Used to set the size of the tool button and the size of the bitmap above. This function has two parameters, where sizebutton is used to specify the size of the button, and the sizeImage is used to specify the size of the bitmap. It should be noted that the CX domains and CX domains of these two parameters must be greater than zero, and the width (CX) of SizeButton is at least 7, and the height (CY) is at least 6.

2.ctoolbar :: setButtonText (int Nindex, LPCTSTSTR LPSTTEXT)

This function is used to set the text displayed on the tool button, NINDEX is used to specify the set tool button (including the split) based on 0 index (including the split), ie the NINDEX 1 tool button will be set, LPstText That is to specify the words you want to display.

3.ctoolbar :: EnableTooltips (Bool Benable)

This function is used to set the tooltips feature for setting / canceling the tool button.

4.cmaInframe :: ShowControlbar (Ccontrolbar * Pbar, Bool Bshow, Bool BDELAY)

This function is used to set the display or not of the toolbar or status bar.

PBAR: Pointer to the Toolbar or Status Bar Object

Bshow: For True, the toolbar or status bar is displayed.

BDELAY: True, delay the display time, otherwise display the toolbar or status bar immediately

achieve

Add variables

Size type member variable m_sizemax, maximum size for storage buttons

2. In the CMAINFRAME class, the beginning of the document begins with a static array, which is used to store the text tag, as follows:

#ifdef _Debug

#define new debug_new

#undef this_file

Static char this_file [] = __file__;

#ENDIF

Static tchar * texttips [] = {"New", "Open", "Save", "" Cut "," Copy "," Paste "," Print "," "," About ", "}; // This sentence is added

3. Add a member function to CMAINFRAME: Void CMAINFRAME :: UpdateToolbar (); Used to Update Toolbar

Void CMAINFRAME :: UpdateToolbar ()

{

CRECT RECT;

Size SizeButton, SizeImage

m_sizemax.cx = 0;

M_SIZEMAX.CY = 0;

/ / Maximum size

For (int i = 0; i

{

M_WndToolBar.SetButtontext (i, Texttips

转载请注明原文地址:https://www.9cbs.com/read-75208.html

New Post(0)