Table of Contents | ||||||||
|
||||||||
ChangeCaption | ||||||||
Purpose Changes the caption of a button or many buttons |
||||||||
Protoype void CButtonMngr::ChangeCaption (string str_caption, string str_button, exclude ex_list = exclude(), int i_flag = LIST_IN) |
||||||||
Parameters
|
||||||||
Description This function changes the caption of a button. If the button previously had no caption, then this will assign one to it. The parameter str_caption takes a CTextMngr object that will then be assigned and displayed on the button, but only if caption visibility is enabled. You must also pass in for str_id the ID of the button that this new caption will be assigned to. Changing Multiple Objects If you want to change more than one button object at once, then you can use the last two parameters of the function. First you must compile a list (an STL vector) of objects that you want to either exclude or include. If you want to change all button objects except certain ones, pass those in for ex_list along with the flag LIST_IN. If you want to change only a certain set of objects, pass those in for ex_list along with the flag LIST_OUT. You should also pass ALL_BUTTONS for str_button. |
||||||||
Use CButtonMngr button; // change one button object button.ChangeCaption("new_caption", "my_button"); // change ALL button objects except "my_button" exclude ex_list; ex_list.push_back("my_button"); button.ChangeCaption("my_caption", ALL_BUTTONS, ex_list, LIST_IN); // change ONLY these three button objects exclude ex_list; ex_list.push_back("my_button1"); ex_list.push_back("my_button2"); ex_list.push_back("my_button3"); button.ChangeCaption("my_caption", ALL_BUTTONS, ex_list, LIST_OUT); |
||||||||
|
||||||||
|