]>
git.saurik.com Git - wxWidgets.git/blob - contrib/samples/foldbar/foldpanelbar/foldtestpanel.cpp
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: foldtestpanel.cpp
4 // Author: Jorgen Bodde
8 // Copyright: (c) Jorgen Bodde
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 #if defined(__GNUG__) && !defined(__APPLE__)
13 #pragma implementation "foldtestpanel.h"
16 // For compilers that support precompilation, includes "wx/wx.h".
17 #include "wx/wxprec.h"
30 #include "foldtestpanel.h"
37 * FoldTestPanel type definition
40 IMPLEMENT_CLASS( FoldTestPanel
, wxPanel
)
43 * FoldTestPanel event table definition
45 BEGIN_EVENT_TABLE( FoldTestPanel
, wxPanel
)
47 ////@begin FoldTestPanel event table entries
48 ////@end FoldTestPanel event table entries
50 //EVT_CAPTIONBAR(wxID_ANY, FoldTestPanel::OnCaptionPanel)
51 EVT_CAPTIONBAR(wxID_ANY
, FoldTestPanel::OnCaptionPanel
)
57 * FoldTestPanel constructors
60 FoldTestPanel::FoldTestPanel( )
65 FoldTestPanel::FoldTestPanel( wxWindow
* parent
, wxWindowID id
, const wxString
& caption
, const wxPoint
& pos
, const wxSize
& size
, long style
)
67 Create(parent
, id
, caption
, pos
, size
, style
);
71 * FoldTestPanel creator
74 bool FoldTestPanel::Create( wxWindow
* parent
, wxWindowID id
, const wxString
& WXUNUSED(caption
), const wxPoint
& pos
, const wxSize
& size
, long style
)
76 ////@begin FoldTestPanel member initialisation
78 ////@end FoldTestPanel member initialisation
80 ////@begin FoldTestPanel creation
81 SetExtraStyle(GetExtraStyle()|wxWS_EX_BLOCK_EVENTS
);
82 wxPanel::Create( parent
, id
, pos
, size
, style
);
85 GetSizer()->Fit(this);
86 GetSizer()->SetSizeHints(this);
88 ////@end FoldTestPanel creation
93 * Control creation for FoldTestPanel
96 void FoldTestPanel::CreateControls()
99 ////@begin FoldTestPanel content construction
101 FoldTestPanel
* item1
= this;
103 wxBoxSizer
* item2
= new wxBoxSizer(wxVERTICAL
);
105 item1
->SetSizer(item2
);
106 item1
->SetAutoLayout(true);
107 /* wxPanel* item3 = new wxPanel( item1, ID_PANEL, wxDefaultPosition, wxDefaultSize, wxNO_BORDER|wxFULL_REPAINT_ON_RESIZE|wxTAB_TRAVERSAL ); */
108 wxPanel
* item3
= new wxPanel( item1
, ID_PANEL
, wxDefaultPosition
, wxDefaultSize
, wxNO_BORDER
|wxTAB_TRAVERSAL
);
109 item2
->Add(item3
, 1, wxGROW
|wxADJUST_MINSIZE
, 5);
110 wxBoxSizer
* item4
= new wxBoxSizer(wxVERTICAL
);
111 item3
->SetSizer(item4
);
112 item3
->SetAutoLayout(true);
113 wxString item5Strings
[] = {
118 wxChoice
* item5
= new wxChoice( item3
, ID_CHOICE
, wxDefaultPosition
, wxDefaultSize
, 3, item5Strings
, 0 );
119 item4
->Add(item5
, 0, wxGROW
|wxALL
, 5);
120 wxTextCtrl
* item6
= new wxTextCtrl( item3
, ID_TEXTCTRL
, _T(""), wxDefaultPosition
, wxDefaultSize
, wxTE_MULTILINE
);
121 item4
->Add(item6
, 1, wxGROW
|wxALL
, 5);
122 wxRadioButton
* item7
= new wxRadioButton( item3
, ID_RADIOBUTTON
, _("I like this"), wxDefaultPosition
, wxDefaultSize
, 0 );
123 item7
->SetValue(true);
124 item4
->Add(item7
, 0, wxALIGN_LEFT
|wxALL
, 5);
125 wxRadioButton
* item8
= new wxRadioButton( item3
, ID_RADIOBUTTON1
, _("I hate it"), wxDefaultPosition
, wxDefaultSize
, 0 );
126 item8
->SetValue(false);
127 item4
->Add(item8
, 0, wxALIGN_LEFT
|wxALL
, 5);
128 ////@end FoldTestPanel content construction
131 void FoldTestPanel::OnCaptionPanel(wxCaptionBarEvent
&WXUNUSED(event
))
137 * Should we show tooltips?
140 bool FoldTestPanel::ShowToolTips()
146 * Get bitmap resources
149 wxBitmap
FoldTestPanel::GetBitmapResource( const wxString
& WXUNUSED(name
) )
152 ////@begin FoldTestPanel bitmap retrieval
154 ////@end FoldTestPanel bitmap retrieval
161 wxIcon
FoldTestPanel::GetIconResource( const wxString
& WXUNUSED(name
) )
164 ////@begin FoldTestPanel icon retrieval
166 ////@end FoldTestPanel icon retrieval