wxWidgets/contrib/samples/foldbar/extended/extended.h
Vadim Zeitlin 957f5ab77a added foldbar contrib
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@28599 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
2004-08-03 11:18:36 +00:00

107 lines
2.7 KiB
C++

/////////////////////////////////////////////////////////////////////////////
// Name: extended.h
// Purpose: Layout/foldpanelbar sample
// Author: Jorgen Bodde
// Modified by:
// Created: 24/07/2004
// Copyright: Jorgen Bodde based upon FoldPanelBar sample (c) Julian Smart
// Licence: wxWindows license
/////////////////////////////////////////////////////////////////////////////
#include "wx/toolbar.h"
#include "foldpanelbar.h"
wxMenuBar *CreateMenuBar(bool with_window);
enum
{
ID_COLLAPSEME = 10000,
ID_APPLYTOALL,
ID_USE_HGRADIENT,
ID_USE_VGRADIENT,
ID_USE_SINGLE,
ID_USE_RECTANGLE,
ID_USE_FILLED_RECTANGLE
};
// Define a new application
class MyApp: public wxApp
{
public:
bool OnInit(void);
};
class MyCanvas: public wxScrolledWindow
{
public:
MyCanvas(wxWindow *parent, const wxPoint& pos, const wxSize& size);
virtual void OnDraw(wxDC& dc);
void OnEvent(wxMouseEvent& event);
DECLARE_EVENT_TABLE()
};
// Define a new frame
class MyFrame: public wxMDIParentFrame
{
public:
MyFrame(wxWindow *parent, const wxWindowID id, const wxString& title, const wxPoint& pos, const wxSize& size, const long style);
void OnSize(wxSizeEvent& event);
void OnAbout(wxCommandEvent& event);
void OnNewWindow(wxCommandEvent& event);
void OnQuit(wxCommandEvent& event);
void OnToggleWindow(wxCommandEvent& event);
void OnFoldPanelBarDrag(wxSashEvent& event);
void OnCreateBottomStyle(wxCommandEvent& event);
void OnCreateNormalStyle(wxCommandEvent& event);
void OnCollapseMe(wxCommandEvent &event);
void OnExpandMe(wxCommandEvent &event);
void OnSlideColour(wxScrollEvent &event);
void OnStyleChange(wxCommandEvent &event);
protected:
wxSashLayoutWindow* m_leftWindow1;
private:
void ReCreateFoldPanel(int fpb_flags);
wxFoldPanelBar *_pnl;
wxButton *_btn;
wxCheckBox *_single;
wxSlider *_rslider1, *_gslider1, *_bslider1, *_rslider2, *_gslider2, *_bslider2;
int _flags;
DECLARE_EVENT_TABLE()
};
class MyChild: public wxMDIChildFrame
{
public:
MyCanvas *canvas;
MyChild(wxMDIParentFrame *parent, const wxString& title, const wxPoint& pos, const wxSize& size, const long style);
~MyChild(void);
void OnActivate(wxActivateEvent& event);
void OnQuit(wxCommandEvent& event);
DECLARE_EVENT_TABLE()
};
#define FPBTEST_QUIT 1
#define FPBTEST_NEW_WINDOW 2
#define FPBTEST_REFRESH 3
#define FPBTEST_CHILD_QUIT 4
#define FPBTEST_ABOUT 5
#define FPBTEST_TOGGLE_WINDOW 6
#define FPB_BOTTOM_STICK 7
#define FPB_SINGLE_FOLD 8
#define ID_WINDOW_TOP 100
#define ID_WINDOW_LEFT1 101
#define ID_WINDOW_LEFT2 102
#define ID_WINDOW_BOTTOM 103