AHK version: 1.1.23.01
This class provides intuitive methods to work with Rebar controls created via Gui, Add, Custom, ClassReBarWindow32.
- DeleteBand(Band)
- GetBand(Band [, ID, Text, Size, Image, Background, Style, Child])
- GetBandCount()
- GetBarHeight()
- GetLayout()
- GetRowCount()
- GetRowHeight(Band)
- IDToIndex(ID)
- InsertBand(hChild [, Position, Options, ID, Text, Size, Image, Background, MinHeight, MinWidth, IdealSize])
- MaximizeBand(Band [, IdealWidth])
- MinimizeBand(Band)
- ModifyBand(Band, Property, Value [, SetStyle])
- MoveBand(Band, Target)
- OnNotify(Param [, MenuXPos, MenuYPos, ID)
- SetBandStyle(Band, Value)
- SetBandWidth(Band, Width)
- SetImageList(ImageList)
- SetMaxRows([Rows])
- SetLayout(Layout)
- ShowBand(Band [, Show])
- ToggleStyle(Style)
Styles can be applied to Gui command options, e.g.: Gui, Add, Custom, ClassReBarWindow32 0x0800 0x0100
- RBS_BANDBORDERS := 0x0400 - Add a separator border between bands in different rows.
- RBS_DBLCLKTOGGLE := 0x8000 - Toggle maximize/minimize with double-click instead of single.
- RBS_FIXEDORDER := 0x0800 - Always displays bands in the same order.
- RBS_VARHEIGHT := 0x0200 - Allow bands to have different heights.
- CCS_NODIVIDER := 0x0040 - Removes the separator line above the rebar.
- CCS_NOPARENTALIGN := 0x0008 - Allows positioning and moving rebars.
- CCS_NORESIZE := 0x0004 - Allows resizing rebars.
- CCS_VERT := 0x0080 - Creates a vertical rebar.
Deletes a band from a rebar control.
TRUE if successful, FALSE if there was a problem.
- Band - 1-based index of the band to be deleted.
Retrieves information from a rebar band.
TRUE if successful, FALSE if there was a problem.
- Band - 1-based index of the band.
- ID - OutputVar to store the band's ID.
- Text - OutputVar to store the band's text.
- Size - OutputVar to store the band's size.
- Image - OutputVar to store the band's image index.
- Background - OutputVar to store a handle to the band's background bitmap.
- Style - OutputVar to store the band's style numeric value.
- Child - OutputVar to store a handle to the band's child control.
Retrieves the count of bands currently in the rebar control.
The number of bands in the rebar control.
Retrieves the height of the rebar control.
The height of the rebar control in pixels.
Retrieves the current layout of bands in the rebar control.
A string containing information about the current bands. String format is: ID1,Size1,Style1|ID2,Size2,Style2|...
Retrieves the number of rows of bands in a rebar control.
The number of rows in the rebar control.
Retrieves the number of rows of bands in a rebar control.
The height of the row from the corresponding band in pixels.
- Band - 1-based index of a band to retrieve the height from.
Converts a band identifier to a band index in a rebar control.
The 1-based band index if successful, or 0 otherwise.
- ID - The application-defined identifier of the band in question.
Inserts a new band in a rebar control.
TRUE if successful, FALSE if there was a problem.
- hChild - Handle to the control contained in the band, if any.
- Position - 1-based index of the location where the band will be inserted. If you set this parameter to 0, the control will add the new band at the last location.
- Options - Enter zero or more words, separated by space or tab, from the following list to set the band's initial styles: Break, FixedBmp, FixedSize, Hidden, HideTitle, NoGripper, NoVert, TopAlign, VariableHeight. The following styles are applied by default** - ChildEdge, GripperAlways (can be disabled with NoGripper), UseChevron (only valid if IdealSize is set).
- ID - Integer value that the control uses to identify this band. This parameter is required to retrieve and set layouts.
- Text - The display text for the band.
- Size - Length of the band, in pixels.
- Image - 1-based index of any image that should be displayed in the band. SetImageList method must be called prior to this.
- Background - Path of a bitmap file that is used as the background for this band.
- MinHeight - Minimum height of the control, in pixels.
- MinWidth - Minimum width of the control, in pixels.
- IdealSize - Ideal width of the band, in pixels. If the band is maximized to the ideal width (see MaximizeBand method), the rebar control will attempt to make the band this width.
Resizes a band to either its ideal or largest size.
TRUE if successful, FALSE if there was a problem.
- Band - 1-based index of a band to be maximized.
- IdealWidth - If TRUE the ideal width of the band will be used to maximize
Resizes a band to its smallest size.
TRUE if successful, FALSE if there was a problem.
- Band - 1-based index of a band to be minimized.
Sets band parameters such as Text and Size.
TRUE if successful, FALSE if there was a problem.
- Band - 1-based index of a band to be modified.
- Property - Enter one word from the following list to select the Property to be set** - Style, ID, Text, Size, Image, Background, MinWidth, MinHeight, IdealSize, Child (handle of control).
- Value - The value to be set in the selected Property. If Property is Style you can enter named values as in the InsertBand options, or an integer value.
- SetStyle - Only valid if Property is Style. Determines whether to add or remove the styles.
Moves a band from one index to another.
TRUE if successful, FALSE if there was a problem.
- Band - 1-based index of a band to be moved.
- Target - 1-based index of a the new band position.
Handles rebar notifications. This method should be called from the rebar's G-Label. If A_GuiEvent is "N", pass it A_EventInfo as the Param. You can also call it from a function monitoring the WM_NOTIFY message, pass it lParam as the Param. Currently this method is used to retrieve the position for a menu when the Chevron button is pushed and prevent a number of rows higher then the one set by SetMaxRows method.
If the ChevronPushed notification is passed returns the index of the band it is from.
- Param - The lParam from WM_NOTIFY message.
- MenuXPos - OutputVar to store the horizontal position for a menu.
- MenuYPos - OutputVar to store the vertical position for a menu.
- ID - OutputVar to store the band's ID.
Sets the style of a band.
TRUE if successful, FALSE if there was a problem.
- Band - 1-based index of the band.
- Value - Named values as in the InsertBand options, or an integer value.
Sets the width for a docked band.
TRUE if successful, FALSE if there was a problem.
- Band - 1-based index of the band.
- Width - New width in pixels.
Sets an ImageList to the rebar control.
TRUE if successful, FALSE if there was a problem.
- ImageList - ImageList ID.
Sets a layout of bands in the rebar control.
TRUE if a valid layout was passed, or FALSE otherwise.
- Layout - A string containing information about the current bands. String format is** - ID1,Size1,Style1|ID2,Size2,Style2|...
Sets the maximum number of rows allowed in a rebar control. This method requires the OnNotify method to be implemented.
The number of rows previously allowed.
- Rows - Number of maximum rows allowed. Set it to 0 to disable limit.
Shows or hides a given band in a rebar control.
TRUE if successful, FALSE if there was a problem.
- Band - 1-based index of the band.
- Show - Set to TRUE to show the band or FALSE to hide it.
Toggles rebar's style.
TRUE if a valid style is passed, or FALSE otherwise.
- Style - Enter one or more words, separated by space or tab, from the following list to toggle toolbar's styles** - AutoSize, BandBorders, DblClkToggle, FixedOrder, RegisterDropdown, VarHeight, VerticalGripper. You may also enter an integer value to define the style.