1998-07-23 10:39:46 -04:00
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
// Name: test.h
|
|
|
|
// Purpose: wxToolBar sample
|
|
|
|
// Author: Julian Smart
|
|
|
|
// Modified by:
|
|
|
|
// Created: 23/07/98
|
|
|
|
// RCS-ID: $Id$
|
|
|
|
// Copyright: (c) Julian Smart
|
|
|
|
// Licence: wxWindows licence
|
|
|
|
/////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
// Define a new application
|
|
|
|
class MyApp: public wxApp
|
1998-12-09 12:30:17 -05:00
|
|
|
{
|
|
|
|
public:
|
1999-09-15 12:15:50 -04:00
|
|
|
bool OnInit();
|
1999-10-04 07:28:23 -04:00
|
|
|
bool InitToolbar(wxToolBar* toolBar, bool smallicons = FALSE);
|
1998-12-09 12:30:17 -05:00
|
|
|
};
|
|
|
|
|
1998-07-23 10:39:46 -04:00
|
|
|
// Define a new frame
|
|
|
|
class MyFrame: public wxFrame
|
|
|
|
{
|
|
|
|
public:
|
1999-09-15 12:15:50 -04:00
|
|
|
MyFrame(wxFrame *parent,
|
|
|
|
wxWindowID id = -1,
|
|
|
|
const wxString& title = "wxToolBar Sample",
|
|
|
|
const wxPoint& pos = wxDefaultPosition,
|
|
|
|
const wxSize& size = wxDefaultSize,
|
|
|
|
long style = wxDEFAULT_FRAME_STYLE);
|
1998-07-23 10:39:46 -04:00
|
|
|
|
|
|
|
void OnQuit(wxCommandEvent& event);
|
|
|
|
void OnAbout(wxCommandEvent& event);
|
1999-09-15 12:15:50 -04:00
|
|
|
|
|
|
|
void OnToggleToolbar(wxCommandEvent& event);
|
|
|
|
void OnEnablePrint(wxCommandEvent& event) { DoEnablePrint(); }
|
|
|
|
void OnToggleHelp(wxCommandEvent& event) { DoToggleHelp(); }
|
|
|
|
|
1998-07-24 11:43:03 -04:00
|
|
|
void OnToolLeftClick(wxCommandEvent& event);
|
|
|
|
void OnToolEnter(wxCommandEvent& event);
|
1998-07-23 10:39:46 -04:00
|
|
|
|
|
|
|
private:
|
1999-09-15 12:15:50 -04:00
|
|
|
void DoEnablePrint();
|
|
|
|
void DoToggleHelp();
|
|
|
|
|
|
|
|
bool m_smallToolbar;
|
1998-07-23 10:39:46 -04:00
|
|
|
wxTextCtrl* m_textWindow;
|
|
|
|
|
1999-01-12 18:51:13 -05:00
|
|
|
DECLARE_EVENT_TABLE()
|
1998-07-23 10:39:46 -04:00
|
|
|
};
|
|
|
|
|
1999-09-15 12:15:50 -04:00
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
// constants
|
|
|
|
// ----------------------------------------------------------------------------
|
1998-07-27 05:47:57 -04:00
|
|
|
|
1999-09-15 12:15:50 -04:00
|
|
|
const int ID_TOOLBAR = 500;
|
|
|
|
|
|
|
|
enum
|
|
|
|
{
|
|
|
|
IDM_TOOLBAR_TOGGLETOOLBAR = 200,
|
|
|
|
IDM_TOOLBAR_ENABLEPRINT,
|
|
|
|
IDM_TOOLBAR_TOGGLEHELP
|
|
|
|
};
|