-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.cpp
More file actions
103 lines (81 loc) · 2.43 KB
/
main.cpp
File metadata and controls
103 lines (81 loc) · 2.43 KB
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
// Author: Erkhembileg Ariunbold
// Project: ArchiveManager
// Date: 2025.06.06
#include <wx/wx.h>
#include <wx/notebook.h>
#include "EnhancedZipPanel.h"
#include "EnhancedUnZipPanel.h"
class ArchiveApp : public wxApp
{
public:
virtual bool OnInit();
};
class MainFrame : public wxFrame
{
public:
MainFrame();
~MainFrame(); // Added destructor
private:
void OnExit(wxCommandEvent& event);
void OnAbout(wxCommandEvent& event);
wxNotebook* m_notebook;
EnhancedZipPanel* m_zipPanel;
EnhancedUnZipPanel* m_unzipPanel;
DECLARE_EVENT_TABLE()
};
wxBEGIN_EVENT_TABLE(MainFrame, wxFrame)
EVT_MENU(wxID_ABOUT, MainFrame::OnAbout)
EVT_MENU(wxID_EXIT, MainFrame::OnExit)
wxEND_EVENT_TABLE()
wxIMPLEMENT_APP(ArchiveApp);
bool ArchiveApp::OnInit()
{
MainFrame* frame = new MainFrame();
frame->Show(true);
return true;
}
MainFrame::MainFrame()
: wxFrame(NULL, wxID_ANY, "Enhanced Archive Manager",
wxDefaultPosition, wxSize(800, 600))
{
// Create menu bar
wxMenu* menuFile = new wxMenu;
menuFile->Append(wxID_EXIT, "E&xit\tAlt-X", "Quit the application");
wxMenu* menuHelp = new wxMenu;
menuHelp->Append(wxID_ABOUT, "&About\tF1", "Show about dialog");
wxMenuBar* menuBar = new wxMenuBar;
menuBar->Append(menuFile, "&File");
menuBar->Append(menuHelp, "&Help");
SetMenuBar(menuBar);
CreateStatusBar();
SetStatusText("Ready");
// Create notebook for tabs
m_notebook = new wxNotebook(this, wxID_ANY);
// Create zip panel
m_zipPanel = new EnhancedZipPanel(m_notebook);
m_notebook->AddPage(m_zipPanel, "Create Archive", true);
// Create unzip panel
m_unzipPanel = new EnhancedUnZipPanel(m_notebook);
m_notebook->AddPage(m_unzipPanel, "Extract Archive", false);
// Layout
wxBoxSizer* mainSizer = new wxBoxSizer(wxVERTICAL);
mainSizer->Add(m_notebook, 1, wxEXPAND | wxALL, 5);
SetSizer(mainSizer);
Centre();
}
MainFrame::~MainFrame()
{
// wxWidgets will handle cleanup of child windows
}
void MainFrame::OnExit(wxCommandEvent& event)
{
Close(true);
}
void MainFrame::OnAbout(wxCommandEvent& event)
{
wxMessageBox("Enhanced Archive Manager v1.0\n\n"
"A powerful file archiving application with optimized performance.\n"
"Features ZIP/UNZIP operations with path optimization.",
"About Enhanced Archive Manager",
wxOK | wxICON_INFORMATION);
}