-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAccountsFrame.h
41 lines (35 loc) · 1.06 KB
/
AccountsFrame.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
#include <wx/wx.h>
#include <wx/settings.h>
#include <wx/frame.h>
#pragma once
class AccountsFrame : public wxFrame
{
public:
AccountsFrame(const wxString& title);
// Static method to get instance
static AccountsFrame* GetInstance() { return instance; }
// Static method to destroy the window
static void DestroyWindow()
{
if (instance)
{
instance->Destroy(); // Call the wxWindow's Destroy method
instance = nullptr; // Reset the static pointer
}
}
// Override window destruction to handle the static pointer
virtual bool Destroy() override
{
instance = nullptr;
return wxFrame::Destroy();
}
private:
wxPanel* rightPanel;
void OnButtonClicked(wxCommandEvent& event);
void OnTextChanged(wxCommandEvent& event);
void LoadPageContent(std::string page);
void OnCloseWindow(wxCloseEvent& event);
//std::vector<std::string> split(const std::string& str, const std::string& delim);
void Logic(int id);
static AccountsFrame* instance;
};