1998-10-26 13:32:07 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
2000-03-14 14:24:14 -05:00
|
|
|
// Name: notebook.h
|
1998-10-26 13:32:07 -05:00
|
|
|
// Purpose: wxNotebook demo
|
|
|
|
// Author: Julian Smart
|
|
|
|
// Modified by:
|
|
|
|
// Created: 25/10/98
|
|
|
|
// RCS-ID: $Id$
|
|
|
|
// Copyright: (c)
|
1999-08-02 17:31:09 -04:00
|
|
|
// Licence: wxWindows licence
|
1998-10-26 13:32:07 -05:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
2000-03-14 14:24:14 -05:00
|
|
|
#include "wx/notebook.h"
|
1998-10-26 13:32:07 -05:00
|
|
|
|
|
|
|
// Define a new application
|
|
|
|
class MyApp: public wxApp
|
|
|
|
{
|
|
|
|
public:
|
2000-02-28 20:49:05 -05:00
|
|
|
bool OnInit();
|
2001-12-05 16:05:23 -05:00
|
|
|
void InitTabView(wxNotebook* notebook, wxWindow* window);
|
1998-10-26 13:32:07 -05:00
|
|
|
|
|
|
|
wxButton* m_okButton;
|
|
|
|
wxButton* m_cancelButton;
|
2000-02-28 20:49:05 -05:00
|
|
|
wxButton* m_addPageButton, *m_insertPageButton;
|
2000-02-22 10:29:59 -05:00
|
|
|
wxButton* m_nextPageButton;
|
1998-10-26 13:32:07 -05:00
|
|
|
};
|
|
|
|
|
|
|
|
DECLARE_APP(MyApp)
|
|
|
|
|
1999-08-02 17:31:09 -04:00
|
|
|
#if USE_TABBED_DIALOG
|
|
|
|
|
1998-10-26 13:32:07 -05:00
|
|
|
class MyDialog: public wxDialog
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
MyDialog(wxWindow* parent, const wxWindowID id, const wxString& title,
|
|
|
|
const wxPoint& pos, const wxSize& size, const long windowStyle = wxDEFAULT_DIALOG_STYLE);
|
|
|
|
|
|
|
|
void OnOK(wxCommandEvent& event);
|
|
|
|
void OnCloseWindow(wxCloseEvent& event);
|
2000-02-28 20:49:05 -05:00
|
|
|
void Init();
|
1998-10-26 13:32:07 -05:00
|
|
|
|
|
|
|
protected:
|
|
|
|
wxNotebook* m_notebook;
|
|
|
|
|
1999-08-02 17:31:09 -04:00
|
|
|
DECLARE_EVENT_TABLE()
|
1998-10-26 13:32:07 -05:00
|
|
|
};
|
|
|
|
|
1999-08-02 17:31:09 -04:00
|
|
|
#else // USE_TABBED_DIALOG
|
|
|
|
|
1998-10-26 13:32:07 -05:00
|
|
|
class MyFrame: public wxFrame
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
MyFrame(wxFrame* parent, const wxWindowID id, const wxString& title,
|
|
|
|
const wxPoint& pos, const wxSize& size, const long windowStyle = wxDEFAULT_FRAME_STYLE);
|
|
|
|
|
|
|
|
void OnOK(wxCommandEvent& event);
|
|
|
|
void OnCloseWindow(wxCloseEvent& event);
|
1999-05-20 10:32:04 -04:00
|
|
|
void OnAddPage(wxCommandEvent& event);
|
2000-02-28 20:49:05 -05:00
|
|
|
void OnInsertPage(wxCommandEvent& event);
|
2000-02-22 10:29:59 -05:00
|
|
|
void OnNextPage(wxCommandEvent& event);
|
1999-05-25 06:40:07 -04:00
|
|
|
void OnDeletePage(wxCommandEvent& event);
|
1999-06-24 17:27:52 -04:00
|
|
|
void OnIdle(wxIdleEvent& event);
|
|
|
|
|
|
|
|
void Init();
|
|
|
|
|
1998-10-26 13:32:07 -05:00
|
|
|
protected:
|
|
|
|
wxNotebook* m_notebook;
|
|
|
|
wxPanel* m_panel; // Panel containing notebook and OK/Cancel/Help
|
|
|
|
|
1999-08-02 17:31:09 -04:00
|
|
|
DECLARE_EVENT_TABLE()
|
1998-10-26 13:32:07 -05:00
|
|
|
};
|
|
|
|
|
1999-08-02 17:31:09 -04:00
|
|
|
#endif // USE_TABBED_DIALOG
|
|
|
|
|
1998-10-26 13:32:07 -05:00
|
|
|
// File ids
|
|
|
|
#define TEST_ABOUT 2
|
|
|
|
|
|
|
|
// Tab ids
|
|
|
|
#define TEST_TAB_DOG 1
|
|
|
|
#define TEST_TAB_CAT 2
|
|
|
|
#define TEST_TAB_GOAT 3
|
|
|
|
#define TEST_TAB_GUINEAPIG 4
|
|
|
|
#define TEST_TAB_ANTEATER 5
|
|
|
|
#define TEST_TAB_HUMMINGBIRD 6
|
|
|
|
#define TEST_TAB_SHEEP 7
|
|
|
|
#define TEST_TAB_COW 8
|
|
|
|
#define TEST_TAB_HORSE 9
|
|
|
|
#define TEST_TAB_PIG 10
|
|
|
|
#define TEST_TAB_OSTRICH 11
|
|
|
|
#define TEST_TAB_AARDVARK 12
|
|
|
|
|
|
|
|
#define ID_NOTEBOOK 1000
|
1999-05-20 10:32:04 -04:00
|
|
|
#define ID_ADD_PAGE 1200
|
1999-05-25 06:40:07 -04:00
|
|
|
#define ID_DELETE_PAGE 1201
|
2000-02-22 10:29:59 -05:00
|
|
|
#define ID_NEXT_PAGE 1202
|
2000-02-28 20:49:05 -05:00
|
|
|
#define ID_INSERT_PAGE 1203
|
1998-10-26 13:32:07 -05:00
|
|
|
|