Table of Contents

 
Stick
 

Purpose

Sticks a button to a set state and the state does not change until it is un-stuck

 

Protoype

void CButtonMngr::Stick (string str_button, bool b_stick, bool b_handle_event = false)
 

Parameters

button the ID of the button to stick
stick whether to stick (TRUE) or un-stick (FALSE) the button
handle_event whether the button can still receive events in it's stuck state
 

Description

This function sets or unsets a buttons sticky state. When a button is in a stuck state its image remains constant until it is unstuck. If you want the button to still be able to recognize events like mouse-overs and mouse clicks, then you must pass in TRUE for b_handle_event. If you pass in FALSE instead, then the button can only be un-stuck by some outside force since no event will be generated for this button and thus it cannot un-stick itself.

 

Use

CButtonMngr button;
// stick a button with no event handling
button.Stick("my_button", true);
// un-stick the button
button.Stick("my_button", false);
 

Prev: ShowIcon