A windows progress bar control. Encapsulates an MFC CStatusBarCtrl
class. Derived from PyCControl.
-
Creates the window for a new progress bar object.
-
Retrieve the status bar control's current widths of the horizontal and vertical borders and of the space between rectangles.
-
Retrieve coordinates of the parts in a status bar control.
-
Retrieves the bounding rectangle of a part in a status bar control.
-
Retrieves the text of a part in a status bar control.
-
Retrieves the text attributes of a part in a status bar control.
-
Retrieves the length of the text in a part in a status bar control.
-
Set the minimum height of a status bar control's drawing area.
-
Sets the number of parts in a status bar control and the coordinate of the right edge of each part.
-
Set the text in the given part of a status bar control.
-
Sets the tooltip text for a pane in a status bar.
PyCStatusBarCtrl.CreateWindow
CreateWindow(style, rect, parent, id) Creates the actual control.
-
style : int
The style for the control.
-
rect : (left, top, right, bottom)
The size and position of the control.
-
parent : PyCWnd
The parent window of the control. Usually a PyCDialog.
-
id : int
The control's ID.
PyCStatusBarCtrl.GetBorders
(width, height, spacing) = GetBorders() Retrieve the status bar control's current widths of the horizontal and vertical borders and of the space between rectangles.
PyCStatusBarCtrl.GetParts
(int) = GetParts(nParts) Retrieve coordinates of the parts in a status bar control.
-
nParts : int
The number of coordinates to retrieve
This function, as designed in MFC, returns both the *number* of parts, and,
through an OUT parameter, an array of ints giving the coordinates of the
parts. There is also an IN parameter saying how many coordinates to give
back. Here, we're explicitly changing the semantics a bit.
GetParts() -> Tuple of all coordinates
GetParts(n) -> Tuple of the first n coordinates (or all coordinates, if
fewer than n)
So, in Python, you can't simultaneously find out how many coordinates there
are, and retrieve a subset of them. In a reasonable universe, there would
have been GetParts() -> int, and GetCoords() -> List. This means that I
need to call the MFC method twice; once to find out how many there are, and
another time to get them.
PyCStatusBarCtrl.GetRect
(left, top, right, bottom) = GetRect(nPane) Retrieves the bounding rectangle of a part in a status bar control.
-
nPane : int
Zero-based index of the part whose bounding rectangle is to be retrieved.
PyCStatusBarCtrl.GetText
text = GetText(nPane) Retrieve the text from the given part of a status bar control.
-
nPane : int
Zero-based index of the part whose text is to be retrieved.
PyCStatusBarCtrl.GetTextAttr
int = GetTextAttr(nPane) Retrieve the attributes of the text in the given part of a status bar control.
-
nPane : int
Zero-based index of the part whose text is to be retrieved.
PyCStatusBarCtrl.GetTextLength
int = GetTextLength(nPane) Retrieve the length the text in the given part of a status bar control.
-
nPane : int
Zero-based index of the part whose text is to be retrieved.
PyCStatusBarCtrl.SetMinHeight
SetMinHeight(nHeight) Set the minimum height of a status bar control's drawing area.
-
nHeight : int
Minimum height
PyCStatusBarCtrl.SetParts
SetParts(coord) Sets the number of parts in a status bar control and the coordinate of the right edge of each part.
-
coord : int...
Coordinates of each part
PyCStatusBarCtrl.SetSimple
SetSimple(bSimple) Specify whether a status bar control displays simple text or displays all control parts set by a previous call to SetParts.
-
bSimple : int
If non-zero, displays simple text.
PyCStatusBarCtrl.SetText
SetText(text, nPane, nType) Set the text in the given part of a status bar control.
-
text : string
The text to display
-
nPane : int
Zero-based index of the part to set.
-
nType : int
Type of drawing operation.
The drawing type can be set to one of:~
0 - The text is drawn with a border to appear lower than
the plane of the status bar.~
win32con.SBT_NOBORDERS - The text is drawn without borders.~
win32con.SBT_OWNERDRAW - The text is drawn by the parent window.~
win32con.SBT_POPOUT - The text is drawn with a border to appear
higher than the plane of the status bar.
PyCStatusBarCtrl.SetTipText
SetTipText(nPane, text) Sets the tooltip text for a pane in a status bar. The status bar must have been created with the afxres.SBT_TOOLTIPS control style to enable ToolTips.
-
nPane : int
The zero-based index of status bar pane to receive the tooltip text.
-
text : string
The string containing the tooltip text.
Pay attention, this tooltip text is ONLY displayed in two situations:
1. When the corresponding pane in the status bar contains only an icon.
2. When the corresponding pane in the status bar contains text that is truncated due to the size of the pane.
To make the tooltip appear even if the text is not truncated, you could add additional spaces to the end of the pane text.
- CStatusBarCtrl::SetTipText