Represents the main panel displaying a list of measurement stations. More...
#include <PanelStart.h>


Public Member Functions | |
| PanelStart () | |
| Constructor for PanelStart. Initializes the UI components and starts fetching station data. | |
| ~PanelStart () | |
| Destructor for PanelStart. Cleans up dynamically allocated resources and unbinds events. | |
UI Updates | |
| void | UpdateGUI () |
| Updates the graphical user interface. Resizes UI elements based on the current window size. | |
| void | OnWindowResized (wxSizeEvent &event) |
| Handles window resize events. | |
| void | OnWindowMaximized (wxMaximizeEvent &event) |
| Handles window maximization events. | |
| void | OnFullScreen (wxFullScreenEvent &event) |
| Handles full-screen events. | |
Public Member Functions inherited from Panel | |
| Panel (Panel *origin) | |
| Constructs a new Panel and hides the previous one if provided. | |
| ~Panel () | |
| Destructor that deletes the current panel and restores the previous one. | |
| void | SetTitle (std::string title) |
| Sets the title of the main window. | |
Public Attributes | |
UI Styling Configuration | |
| const int | styleObjectSpacingX = 10 |
| Horizontal spacing between UI elements. | |
| const int | styleObjectSpacingY = 10 |
| Vertical spacing between UI elements. | |
Public Attributes inherited from Panel | |
| wxPanel * | panel |
| Pointer to the wxPanel instance managed by this class. | |
Data Fetching | |
| HttpFetcher * | httpFetcher = nullptr |
| Pointer to an HTTP fetcher instance. | |
| void | FetchList () |
| Initiates fetching of the station list from the API. | |
| void | OnDataFetched (wxThreadEvent &event) |
| Event handler for processing fetched data. | |
UI Elements | |
| wxStaticText * | textTop = nullptr |
| Static text displaying the title. | |
| nlohmann::json | data |
| JSON object holding station data. | |
| wxListBox * | listStations |
| List box displaying station names. | |
| wxButton * | button_about = nullptr |
| Button for displaying information about the application. | |
| void | ListStations_OnItemDoubleClicked (wxCommandEvent &event) |
| Handles double-click events on the station list. Opens a new panel for the selected station. | |
| void | ButtonAbout_OnButtonClick (wxCommandEvent &event) |
| Handles click events on the "About" button. | |
Represents the main panel displaying a list of measurement stations.
This panel allows users to select a station from a list, fetches station data from an API, and updates the local database accordingly.
| PanelStart::PanelStart | ( | ) |
Constructor for PanelStart. Initializes the UI components and starts fetching station data.
| PanelStart::~PanelStart | ( | ) |
Destructor for PanelStart. Cleans up dynamically allocated resources and unbinds events.
| void PanelStart::ButtonAbout_OnButtonClick | ( | wxCommandEvent & | event | ) |
Handles click events on the "About" button.
| event | The button click event. |
| void PanelStart::FetchList | ( | ) |
Initiates fetching of the station list from the API.
If a fetch operation is already in progress, this function does nothing.
| void PanelStart::ListStations_OnItemDoubleClicked | ( | wxCommandEvent & | event | ) |
Handles double-click events on the station list. Opens a new panel for the selected station.
| event | The list box double-click event. |
| void PanelStart::OnDataFetched | ( | wxThreadEvent & | event | ) |
Event handler for processing fetched data.
This method is triggered when an HTTP fetch operation is completed. It updates the local database and refreshes the station list UI.
| event | The event containing the fetched data. |
| void PanelStart::OnFullScreen | ( | wxFullScreenEvent & | event | ) |
Handles full-screen events.
| event | The full-screen event. |
| void PanelStart::OnWindowMaximized | ( | wxMaximizeEvent & | event | ) |
Handles window maximization events.
| event | The window maximize event. |
| void PanelStart::OnWindowResized | ( | wxSizeEvent & | event | ) |
Handles window resize events.
| event | The window resize event. |
| void PanelStart::UpdateGUI | ( | ) |
Updates the graphical user interface. Resizes UI elements based on the current window size.
| wxButton* PanelStart::button_about = nullptr |
Button for displaying information about the application.
| nlohmann::json PanelStart::data |
JSON object holding station data.
| HttpFetcher* PanelStart::httpFetcher = nullptr |
Pointer to an HTTP fetcher instance.
| wxListBox* PanelStart::listStations |
List box displaying station names.
| const int PanelStart::styleObjectSpacingX = 10 |
Horizontal spacing between UI elements.
| const int PanelStart::styleObjectSpacingY = 10 |
Vertical spacing between UI elements.
| wxStaticText* PanelStart::textTop = nullptr |
Static text displaying the title.