lecui 1.0.0-alpha.20
lecui C++ user interface library
|
Widget manager class. More...
#include <widget.h>
Public Member Functions | |
widget_manager (form &fm) | |
Widget manager constructor. More... | |
~widget_manager () | |
Widget manager destructor. | |
bool | enable (const std::string &path, std::string &error) |
Enable a widget. More... | |
bool | disable (const std::string &path, std::string &error) |
Disable a widget. More... | |
bool | show (const std::string &path, std::string &error) |
Show a widget. More... | |
bool | hide (const std::string &path, std::string &error) |
Hide a widget. More... | |
void | close (const std::string &path) |
Close a widget. More... | |
void | select (const std::string &path) |
Select a widget. More... | |
bool | refresh (const std::string &path, std::string &error) |
Refresh a widget. More... | |
Widget manager class.
liblec::lecui::widget_manager::widget_manager | ( | form & | fm | ) |
Widget manager constructor.
fm | The form whose widgets we would like to manage. |
void liblec::lecui::widget_manager::close | ( | const std::string & | path | ) |
Close a widget.
path | The full path to the widget, e.g. "home_page/username". |
Avoid closing a widget from within its own handler to avoid access violation errors. Also make sure to never keep 'dangling widget references' because attempting to use those references after this method is called will result in access violation errors as well. Make sure to employ proper logic. As a failsafe, the widget is not closed immediately when this method is called. Rather a special timer is scheduled internally to close the widget. After this, the widget is closed as soon as possible, typically soon after the current handler exits. Note that a call to form::update() is not necessary after this method is called because it sends this call internally. Note that a call to form::update() is not necessary after this method is called because it sends this call internally.
bool liblec::lecui::widget_manager::disable | ( | const std::string & | path, |
std::string & | error | ||
) |
Disable a widget.
path | The full path to the widget, e.g. "home_page/username". |
error | Error information. |
Note that a call to form::update() is not necessary after this method is called because it sends this call internally.
bool liblec::lecui::widget_manager::enable | ( | const std::string & | path, |
std::string & | error | ||
) |
Enable a widget.
path | The full path to the widget, e.g. "home_page/username". |
error | Error information. |
Note that a call to form::update() is not necessary after this method is called because it sends this call internally.
bool liblec::lecui::widget_manager::hide | ( | const std::string & | path, |
std::string & | error | ||
) |
Hide a widget.
path | The full path to the widget, e.g. "home_page/username". |
error | Error information. |
Note that a call to form::update() is not necessary after this method is called because it sends this call internally.
bool liblec::lecui::widget_manager::refresh | ( | const std::string & | path, |
std::string & | error | ||
) |
Refresh a widget.
path | The full path to the widget, e.g. "home_page/username". |
error | Error information. |
This method causes all the widget's graphic resources to be recreated. This is useful if you need a resource being used by the widget, e.g. a .png file being used by an image_view, freed immediately after the widget's properties are changed. A call to form::reload() would do this but it's a lot more expensive since it refreshes every widget in every page, and a call to form::update() would only free the resource after the next time a paint operation is done. Note that a call to form::update() is not necessary after this method is called because it sends this call internally.
void liblec::lecui::widget_manager::select | ( | const std::string & | path | ) |
Select a widget.
path | The full path to the widget, e.g. "home_page/username". |
Any previous selection within the page is removed. Note that a call to form::update() is not necessary after this method is called because it sends this call internally.
bool liblec::lecui::widget_manager::show | ( | const std::string & | path, |
std::string & | error | ||
) |
Show a widget.
path | The full path to the widget, e.g. "home_page/username". |
error | Error information. |
Note that a call to form::update() is not necessary after this method is called because it sends this call internally.