Status Bar – Giavapps Windows API

 

 

api_statusbar_create(ParentHandle, Flags, ExFlags, Text) This function creates a status bar.

ParentHandle: parent handle.
Flags: Flags of the control. Flags must be separated with the symbol "|".
ExFlags: extended flags of the control. Flags must be separated with the symbol "|".
Text: text of the status bar.

 

Flags

 

This control supports the Window Styles and you can specify any of the styles listed below:

 

SBARS_SIZEGRIP The status bar control will include a sizing grip at the right end of the status bar. A sizing grip is similar to a sizing border; it is a rectangular area that the user can click and drag to resize the parent window.

SBT_TOOLTIPS Use this style to enable tooltips.

 

Extended Flags

 

This control supports the Extended Window Styles.

 

Return Value

 

If the function succeeds, the return value is a handle to the new status bar.

If the function fails, the return value is false.

To get extended error information, call api_control_get_last_error().

 

Control Functions

 

api_statusbar_set_automatic_update(ParentHandle, StatusBarHandle, AutoUpdate) This function enables or disables the automatic update feature for the given status bar. Giavapps Windows API makes your life a lot easier: by default status bars do not update their position and size when you resize the parent window. You can’t update status bars properly from GameMaker: Studio since GameMaker will freeze the application when you move or resize windows. When you enable this feature Giavapps Windows API will automatically update the specified status bar for you. This extension handles the automatic update task pretty well but if you use only windows with a static size (windows without the WS_SIZEBOX style), you shouldn’t use this feature since this adds processing and you don’t need it.

ParentHandle: parent window of the status bar.
StatusBarHandle: it must be a StatusBarHandle.
AutoUpdate: enables (true) or disables (false) the automatic update feature.

 

api_statusbar_get_automatic_update(StatusBarHandle) This function returns true when the automatic update feature is enabled for the specified status bar or false otherwise.

StatusBarHandle: it must be a StatusBarHandle.

 

api_statusbar_update(StatusBarHandle) This function updates the size and position of the specified status bar relative to its parent window. You should use api_statusbar_set_automatic_update() instead, since this function is less effective and this couldn’t be able to update instantly the status bars due to the fact that GameMaker freezes the application when you move or resize windows. This feature has been included just in case you would like to have a sort of custom behaviour for your status bars.

StatusBarHandle: it must be a StatusBarHandle.

 

api_statusbar_set_parts(StatusBarHandle, Parts) Sets the number of parts for the specified status bar . The function returns true if successful, or false otherwise. This feature automatically sets (or resets) the width of the parts.

StatusBarHandle: it must be a StatusBarHandle.
Parts: number of parts to set (value between 1 and 256).

 

api_statusbar_get_parts(StatusBarHandle) Returns the number of parts in a status bar control.

StatusBarHandle: it must be a StatusBarHandle.

 

api_statusbar_set_part_width(StatusBarHandle, Index, Width) Sets the width of the given part in a status bar control. The function returns true if successful, or false otherwise.

StatusBarHandle: it must be a StatusBarHandle.
Index: the zero-based index of the part.
Width: the width of the part.

 

api_statusbar_get_part_width(StatusBarHandle, Index) Returns the width of the given part.

StatusBarHandle: it must be a StatusBarHandle.
Index: the zero-based index of the part.

 

api_statusbar_set_part_text(StatusBarHandle,Index, Text) Sets the text of the part in a status bar control. The function returns true if successful, or false otherwise.

StatusBarHandle: it must be a StatusBarHandle.
Index: the zero-based index of the part.
Text: the text of the part.

 

api_statusbar_get_part_text(StatusBarHandle, Index) Returns the text of the given part in a status bar control.

StatusBarHandle: it must be a StatusBarHandle.
Index: the zero-based index of the part.

 

api_statusbar_set_part_icon(StatusBarHandle, Index, IconHandle) Sets the icon for a part in a status bar. Returns true if successful, or false otherwise.

StatusBarHandle: it must be a StatusBarHandle.
Index: the zero-based index of the part.
IconHandle: Handle to the icon to be set. If this value is false, the icon is removed from the part.

 

api_statusbar_get_part_icon(StatusBarHandle, Index) Returns the IconHandle of the given part in a status bar.

StatusBarHandle: it must be a StatusBarHandle.
Index: the zero-based index of the part.

 

api_statusbar_get_clicked(StatusBarHandle, MouseButton) The function returns true when the user clicks with the mouse on the given status bar or false otherwise.

StatusBarHandle: it must be a StatusBarHandle.
MouseButton: this argument can be mb_left, mb_right, or mb_any.

 

api_statusbar_get_doubleclicked(StatusBarHandle, MouseButton) The function returns true when the user double clicks with the mouse on the given status bar or false otherwise.

StatusBarHandle: it must be a StatusBarHandle.
MouseButton: this argument can be mb_left, mb_right, or mb_any.

 

Code Examples

 

Creating a Status Bar

 

statusbar = api_statusbar_create(window,WS_VISIBLE | WS_CHILD | WS_BORDER | SBARS_SIZEGRIP,0,"This is a Status Bar!");

 

Setting Automatic Update

 

api_statusbar_set_automatic_update(window,statusbar,1);

 

Setting Multiple Parts and Text

 

api_statusbar_set_parts(statusbar,3);
api_statusbar_set_part_text(statusbar,0,"Part 1");
api_statusbar_set_part_text(statusbar,1,"Part 2");
api_statusbar_set_part_text(statusbar,2,"Part 3");

 

I am Luigi Piscopo, also known as DJ GiDeejay / Producer / Remixer in the music world. I am a Producer with a lot of experience in photo editing, video editing, audio editing, graphic design, web design, programming and promotion.

Leave a Reply

Il tuo indirizzo email non sarà pubblicato. I campi obbligatori sono contrassegnati *

*