A class which encapsulates an MFC CToolBar
. Derived from a PyCControlBar object.
-
Retrieves the style for a button.
-
Gets the text for a button.
-
Returns the command ID of a button or separator at the given index.
-
Gets the associated tooltip control
-
Returns the tool bar control object associated with the tool bar
-
Loads the bitmap containing bitmap-button images.
-
Loads a toolbar from a Toolbar resource.
-
Sets toolbar's (CBRS_xxx) part of style
-
Sets a bitmapped image.
-
Sets the button's command ID, style, and image number.
-
Sets button styles and an index of button images within the bitmap.
-
Sets the style for a button
-
Sets the height of the toolbar.
-
Sets the sizes for the toolbar items.
-
Sets the tooltips control
PyCToolBar.GetButtonStyle
GetButtonStyle(index) Retrieves the style for a button.
-
index : int
Index of the item whose style is to be retrieved.
PyCToolBar.GetButtonText
string = GetButtonText(index) Gets the text for a button.
-
index : int
Index of the item whose text is to be retrieved.
PyCToolBar.GetItemID
GetItemID(index) Returns the command ID of a button or separator at the given index.
-
index : int
Index of the item whose ID is to be retrieved.
PyCToolBar.GetToolBarCtrl
PyCToolBarCtrl = GetToolBarCtrl() Gets the toolbar control object for the toolbar
PyCToolBar.GetToolTips
GetToolTips() Returns the associated tooltips control
PyCToolBar.LoadBitmap
LoadBitmap(id) Loads the bitmap containing bitmap-button images.
-
id : PyResourceId
Name or id of the resource that contains the bitmap.
The bitmap should contain one image for each toolbar button. If the
images are not of the standard size (16 pixels wide and 15 pixels high),
call PyCToolBar::SetSizes to set the button sizes and their images.
PyCToolBar.LoadToolBar
LoadToolBar(id) Loads a toolbar from a toolbar resource.
-
id : PyResourceId
Name or resource id of the resource
The bitmap should contain one image for each toolbar button. If the
images are not of the standard size (16 pixels wide and 15 pixels high),
call PyCToolBar::SetSizes to set the button sizes and their images.
PyCToolBar.SetBarStyle
SetBarStyle(style) Sets the toolbar part of style
-
style : long
The toolbar style to set.
PyCToolBar.SetBitmap
SetBitmap(hBitmap) Sets a bitmapped image.
-
hBitmap : int
The handle to a bitmap resource.
Call this method to set the bitmap image for the toolbar. For example,
call SetBitmap to change the bitmapped image after the user takes an action on
a document that changes the action of a button.
PyCToolBar.SetButtonInfo
SetButtonInfo(index, ID, style, imageIx) Sets the button's command ID, style, and image number.
-
index : int
Index of the button or separator whose information is to be set.
-
ID : int
The value to which the button's command ID is set.
-
style : int
The new button style
-
imageIx : int
New index for the button's image within the bitmap
PyCToolBar.SetButtonStyle
SetButtonStyle(index, style) Sets the style for a button.
-
index : int
Index of the item whose style is to be set
-
style : int
The new style
PyCToolBar.SetButtonText
SetButtonText(index, text) Sets the text for a button.
-
index : int
Index of the item whose style is to be set
-
text : string
The new text
PyCToolBar.SetButtons
SetButtons(buttons) Sets button styles and an index of button images within the bitmap.
-
buttons : tuple
A tuple containing the ID's of the buttons.
-
numButtons
The number of buttons to pre-allocate. If this option is used, then PyCToolBar::PySetButtonInfo
must be used.
PyCToolBar.SetHeight
SetHeight(height) Sets the height of the toolbar.
-
height : int
The height in pixels of the toolbar.
PyCToolBar.SetSizes
SetSizes(sizeButton, sizeButton) Sets the size of each button.
-
sizeButton : (cx, cy)
The size of each button.
-
sizeButton : (cx, cy)
The size of each bitmap.
PyCToolBar.SetToolTips
SetToolTips(obTTC) Sets the tooltips control
-
obTTC : PyCToolTipCtrl
The ToolTipCtrl ctrl to be set.