Skip to content

Latest commit

 

History

History
306 lines (153 loc) · 6.16 KB

PyCToolBar.md

File metadata and controls

306 lines (153 loc) · 6.16 KB

PyCToolBar

PyCToolBar Object

A class which encapsulates an MFC CToolBar

. Derived from a PyCControlBar object.

Methods

PyCToolBar.GetButtonStyle

GetButtonStyle(index) Retrieves the style for a button.

Parameters

  • index : int

    Index of the item whose style is to be retrieved.

PyCToolBar.GetButtonText

string = GetButtonText(index) Gets the text for a button.

Parameters

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

Parameters

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

Parameters

  • id : PyResourceId

    Name or id of the resource that contains the bitmap.

Comments

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.

Parameters

Comments

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

Parameters

  • style : long

    The toolbar style to set.

PyCToolBar.SetBitmap

SetBitmap(hBitmap) Sets a bitmapped image.

Parameters

  • hBitmap : int

    The handle to a bitmap resource.

Comments

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.

Parameters

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

Parameters

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

Parameters

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

Parameters

  • buttons : tuple

    A tuple containing the ID's of the buttons.

Alternative Parameters

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

Parameters

  • height : int

    The height in pixels of the toolbar.

PyCToolBar.SetSizes

SetSizes(sizeButton, sizeButton) Sets the size of each button.

Parameters

  • sizeButton : (cx, cy)

    The size of each button.

  • sizeButton : (cx, cy)

    The size of each bitmap.

PyCToolBar.SetToolTips

SetToolTips(obTTC) Sets the tooltips control

Parameters