diff options
Diffstat (limited to 'Tox_GUI/gui')
-rw-r--r-- | Tox_GUI/gui/Main.cpp | 33 | ||||
-rw-r--r-- | Tox_GUI/gui/home/Home.cpp | 28 | ||||
-rw-r--r-- | Tox_GUI/gui/home/Home.h | 13 |
3 files changed, 74 insertions, 0 deletions
diff --git a/Tox_GUI/gui/Main.cpp b/Tox_GUI/gui/Main.cpp new file mode 100644 index 00000000..42feecfa --- /dev/null +++ b/Tox_GUI/gui/Main.cpp | |||
@@ -0,0 +1,33 @@ | |||
1 | #include <wx\wx.h> | ||
2 | #include "home\Home.h" | ||
3 | |||
4 | class Tox : public wxApp | ||
5 | { | ||
6 | public: | ||
7 | virtual bool OnInit(); | ||
8 | }; | ||
9 | |||
10 | |||
11 | |||
12 | bool Tox::OnInit() | ||
13 | { | ||
14 | Home *home = new Home(wxT("Tox")); | ||
15 | home->Show(true); | ||
16 | |||
17 | return true; | ||
18 | } | ||
19 | |||
20 | int WINAPI wWinMain(HINSTANCE hInstance, HINSTANCE prevInstance, LPWSTR lpCmdLine, int nShowCmd) | ||
21 | { | ||
22 | char *buf; | ||
23 | |||
24 | buf = new char[wcslen(lpCmdLine) + 1]; | ||
25 | |||
26 | wcstombs(buf, lpCmdLine, wcslen(lpCmdLine) +1); | ||
27 | |||
28 | wxApp::SetInstance( new Tox()); | ||
29 | |||
30 | wxEntry(hInstance, prevInstance, buf, nShowCmd); | ||
31 | |||
32 | wxEntryCleanup(); | ||
33 | } \ No newline at end of file | ||
diff --git a/Tox_GUI/gui/home/Home.cpp b/Tox_GUI/gui/home/Home.cpp new file mode 100644 index 00000000..f30f8af3 --- /dev/null +++ b/Tox_GUI/gui/home/Home.cpp | |||
@@ -0,0 +1,28 @@ | |||
1 | #include <wx\textdlg.h> | ||
2 | #include "Home.h" | ||
3 | |||
4 | Home::Home(const wxString& title) | ||
5 | : wxFrame(NULL, wxID_ANY, title, wxDefaultPosition, wxSize(750, 450)) | ||
6 | { | ||
7 | wxPanel * panel = new wxPanel(this, -1); | ||
8 | |||
9 | wxBoxSizer *hbox = new wxBoxSizer(wxHORIZONTAL); | ||
10 | |||
11 | netlogList = new wxListBox(panel, ID_LISTBOX, | ||
12 | wxPoint(-1, -1), wxSize(-1, -1)); | ||
13 | |||
14 | hbox->Add(netlogList, 3, wxEXPAND | wxALL, 20); | ||
15 | |||
16 | panel->SetSizer(hbox); | ||
17 | |||
18 | Centre(); | ||
19 | |||
20 | netlogList->Append("Testing..."); | ||
21 | } | ||
22 | |||
23 | void Home::AddNew(wxCommandEvent& event) | ||
24 | { | ||
25 | wxString str = wxGetTextFromUser(wxT("Add new item")); | ||
26 | if (str.Len() > 0) | ||
27 | netlogList->Append(str); | ||
28 | } \ No newline at end of file | ||
diff --git a/Tox_GUI/gui/home/Home.h b/Tox_GUI/gui/home/Home.h new file mode 100644 index 00000000..a3832136 --- /dev/null +++ b/Tox_GUI/gui/home/Home.h | |||
@@ -0,0 +1,13 @@ | |||
1 | #include <wx\wx.h> | ||
2 | |||
3 | class Home : public wxFrame | ||
4 | { | ||
5 | public: | ||
6 | Home(const wxString& title); | ||
7 | |||
8 | void AddNew(wxCommandEvent& event); | ||
9 | |||
10 | wxListBox *netlogList; | ||
11 | }; | ||
12 | |||
13 | const int ID_LISTBOX = 1; \ No newline at end of file | ||