lecui 1.0.0-alpha.20
lecui C++ user interface library
Public Attributes | List of all members
liblec::lecui::form::form_events Struct Reference

Form events. More...

#include <form.h>

Public Attributes

std::function< void(const lecui::size &)> size = nullptr
 Size event. Happens when the form's size changes. More...
 
std::function< void(const std::string &)> drop_files = nullptr
 Drop files event. Happens when files are dropped on the form. More...
 
std::function< void(const std::string &)> receive_data = nullptr
 Receive data event. Happens when data is received from another instance. More...
 
std::function< void()> caption
 Caption event. Happens when the form's caption is clicked. More...
 
std::function< bool(std::string &)> initialize
 Initialize event. Happens when the app is being initialized. All all initialization code in this handler, e.g., reading registry settings. More...
 
std::function< bool(std::string &)> layout
 Layout event. Happens when the form's layout is being made. All primary layout should be done here. More...
 
std::function< void()> start
 Start event. Happens after the form_events::layout event but just before the form is displayed. This is a good place to close the splash screen. The splash screen itself is best created in the form_events::initialize event.
 
std::function< void()> close
 Shutdown event. Happens when either the close button on the top right is clicked, or when Alt+F4 is pressed on the keyboard. This is a good place to ask the user if they really wish to close the form, and then call form::close if they confirm. More...
 
std::function< void()> shutdown
 Shutdown event. Happens after closing is confirmed but before the form's destructor is called. This is a good place to save user settings. More...
 

Detailed Description

Form events.

Member Data Documentation

◆ caption

std::function<void()> liblec::lecui::form::form_events::caption

Caption event. Happens when the form's caption is clicked.

This handler needs to be set before the form is created. It is recommended that it be set in the initialize event.

◆ close

std::function<void()> liblec::lecui::form::form_events::close

Shutdown event. Happens when either the close button on the top right is clicked, or when Alt+F4 is pressed on the keyboard. This is a good place to ask the user if they really wish to close the form, and then call form::close if they confirm.

The form::close method is called internally if this handler isn't set.

◆ drop_files

std::function<void(const std::string&)> liblec::lecui::form::form_events::drop_files = nullptr

Drop files event. Happens when files are dropped on the form.

The parameter contains the full path to the dropped file, including the file's extension. This handler needs to be set before the form is created. It is recommended that it be set in the initialize event.

◆ initialize

std::function<bool(std::string&)> liblec::lecui::form::form_events::initialize

Initialize event. Happens when the app is being initialized. All all initialization code in this handler, e.g., reading registry settings.

The handler should return false if an error occurs that makes it necessary to abort the application. In such a case, error information should be written to the parameter (note that it's a reference). When false is returned application initialization is aborted and the layout event is never called.

◆ layout

std::function<bool(std::string&)> liblec::lecui::form::form_events::layout

Layout event. Happens when the form's layout is being made. All primary layout should be done here.

If there's an error in the layout's implementation write the error information to the parameter (note that it's a reference), and return false. This information will be internally passed to the blocking create method. It is recommended to add at least one page container to the form in this method and show it before returning from this method. This becomes the home page. All the form's pages can be made in this method but this is not recommended. It is recommended to create other pages in the handlers that attempt to open them so that they are created dynamically at runtime so that the app uses the least amount of resources at any given time.

◆ receive_data

std::function<void(const std::string&)> liblec::lecui::form::form_events::receive_data = nullptr

Receive data event. Happens when data is received from another instance.

The parameter will contain the received data.

◆ shutdown

std::function<void()> liblec::lecui::form::form_events::shutdown

Shutdown event. Happens after closing is confirmed but before the form's destructor is called. This is a good place to save user settings.

Avoid such logic errors as attempting to create widgets here.

◆ size

std::function<void(const lecui::size&)> liblec::lecui::form::form_events::size = nullptr

Size event. Happens when the form's size changes.

The parameter contains the new size of the form. This should be interpreted in reference to the form's design size (its size at creation). More details about the form's design size can be found in the dimensions class under the controls.h header.


The documentation for this struct was generated from the following file: