Weather App
 
Loading...
Searching...
No Matches
PanelStart Class Reference

Represents the main panel displaying a list of measurement stations. More...

#include <PanelStart.h>

Inheritance diagram for PanelStart:
Collaboration diagram for PanelStart:

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

HttpFetcherhttpFetcher = 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.
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ PanelStart()

PanelStart::PanelStart ( )

Constructor for PanelStart. Initializes the UI components and starts fetching station data.

◆ ~PanelStart()

PanelStart::~PanelStart ( )

Destructor for PanelStart. Cleans up dynamically allocated resources and unbinds events.

Member Function Documentation

◆ ButtonAbout_OnButtonClick()

void PanelStart::ButtonAbout_OnButtonClick ( wxCommandEvent & event)

Handles click events on the "About" button.

Parameters
eventThe button click event.

◆ FetchList()

void PanelStart::FetchList ( )

Initiates fetching of the station list from the API.

If a fetch operation is already in progress, this function does nothing.

◆ ListStations_OnItemDoubleClicked()

void PanelStart::ListStations_OnItemDoubleClicked ( wxCommandEvent & event)

Handles double-click events on the station list. Opens a new panel for the selected station.

Parameters
eventThe list box double-click event.

◆ OnDataFetched()

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.

Parameters
eventThe event containing the fetched data.

◆ OnFullScreen()

void PanelStart::OnFullScreen ( wxFullScreenEvent & event)

Handles full-screen events.

Parameters
eventThe full-screen event.

◆ OnWindowMaximized()

void PanelStart::OnWindowMaximized ( wxMaximizeEvent & event)

Handles window maximization events.

Parameters
eventThe window maximize event.

◆ OnWindowResized()

void PanelStart::OnWindowResized ( wxSizeEvent & event)

Handles window resize events.

Parameters
eventThe window resize event.

◆ UpdateGUI()

void PanelStart::UpdateGUI ( )

Updates the graphical user interface. Resizes UI elements based on the current window size.

Member Data Documentation

◆ button_about

wxButton* PanelStart::button_about = nullptr

Button for displaying information about the application.

◆ data

nlohmann::json PanelStart::data

JSON object holding station data.

◆ httpFetcher

HttpFetcher* PanelStart::httpFetcher = nullptr

Pointer to an HTTP fetcher instance.

◆ listStations

wxListBox* PanelStart::listStations

List box displaying station names.

◆ styleObjectSpacingX

const int PanelStart::styleObjectSpacingX = 10

Horizontal spacing between UI elements.

◆ styleObjectSpacingY

const int PanelStart::styleObjectSpacingY = 10

Vertical spacing between UI elements.

◆ textTop

wxStaticText* PanelStart::textTop = nullptr

Static text displaying the title.


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