]>
git.saurik.com Git - wxWidgets.git/blob - contrib/samples/foldbar/foldpanelbar/foldtestpanel.cpp
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: foldtestpanel.cpp
4 // Author: Jorgen Bodde
5 // Modified by: ABX - 19/12/2004 : possibility of horizontal orientation
6 // : wxWidgets coding standards
9 // Copyright: (c) Jorgen Bodde
10 // Licence: wxWindows licence
11 /////////////////////////////////////////////////////////////////////////////
13 #if defined(__GNUG__) && !defined(__APPLE__)
14 #pragma implementation "foldtestpanel.h"
17 // For compilers that support precompilation, includes "wx/wx.h".
18 #include "wx/wxprec.h"
31 #include "foldtestpanel.h"
38 * FoldTestPanel type definition
41 IMPLEMENT_CLASS( FoldTestPanel
, wxPanel
)
44 * FoldTestPanel event table definition
46 BEGIN_EVENT_TABLE( FoldTestPanel
, wxPanel
)
48 ////@begin FoldTestPanel event table entries
49 ////@end FoldTestPanel event table entries
51 //EVT_CAPTIONBAR(wxID_ANY, FoldTestPanel::OnCaptionPanel)
52 EVT_CAPTIONBAR(wxID_ANY
, FoldTestPanel::OnCaptionPanel
)
58 * FoldTestPanel constructors
61 FoldTestPanel::FoldTestPanel( )
66 FoldTestPanel::FoldTestPanel( wxWindow
* parent
, wxWindowID id
, const wxString
& caption
, const wxPoint
& pos
, const wxSize
& size
, long style
)
68 Create(parent
, id
, caption
, pos
, size
, style
);
72 * FoldTestPanel creator
75 bool FoldTestPanel::Create( wxWindow
* parent
, wxWindowID id
, const wxString
& WXUNUSED(caption
), const wxPoint
& pos
, const wxSize
& size
, long style
)
77 ////@begin FoldTestPanel member initialisation
79 ////@end FoldTestPanel member initialisation
81 ////@begin FoldTestPanel creation
82 SetExtraStyle(GetExtraStyle()|wxWS_EX_BLOCK_EVENTS
);
83 wxPanel::Create( parent
, id
, pos
, size
, style
);
86 GetSizer()->Fit(this);
87 GetSizer()->SetSizeHints(this);
89 ////@end FoldTestPanel creation
94 * Control creation for FoldTestPanel
97 void FoldTestPanel::CreateControls()
100 ////@begin FoldTestPanel content construction
102 FoldTestPanel
* item1
= this;
104 wxBoxSizer
* item2
= new wxBoxSizer(wxVERTICAL
);
106 item1
->SetSizer(item2
);
107 item1
->SetAutoLayout(true);
108 /* wxPanel* item3 = new wxPanel( item1, ID_PANEL, wxDefaultPosition, wxDefaultSize, wxNO_BORDER|wxFULL_REPAINT_ON_RESIZE|wxTAB_TRAVERSAL ); */
109 wxPanel
* item3
= new wxPanel( item1
, ID_PANEL
, wxDefaultPosition
, wxDefaultSize
, wxNO_BORDER
|wxTAB_TRAVERSAL
);
110 item2
->Add(item3
, 1, wxGROW
|wxADJUST_MINSIZE
, 5);
111 wxBoxSizer
* item4
= new wxBoxSizer(wxVERTICAL
);
112 item3
->SetSizer(item4
);
113 item3
->SetAutoLayout(true);
114 wxString item5Strings
[] = {
119 wxChoice
* item5
= new wxChoice( item3
, ID_CHOICE
, wxDefaultPosition
, wxDefaultSize
, 3, item5Strings
, 0 );
120 item4
->Add(item5
, 0, wxGROW
|wxALL
, 5);
121 wxTextCtrl
* item6
= new wxTextCtrl( item3
, ID_TEXTCTRL
, _T(""), wxDefaultPosition
, wxDefaultSize
, wxTE_MULTILINE
);
122 item4
->Add(item6
, 1, wxGROW
|wxALL
, 5);
123 wxRadioButton
* item7
= new wxRadioButton( item3
, ID_RADIOBUTTON
, _("I like this"), wxDefaultPosition
, wxDefaultSize
, 0 );
124 item7
->SetValue(true);
125 item4
->Add(item7
, 0, wxALIGN_LEFT
|wxALL
, 5);
126 wxRadioButton
* item8
= new wxRadioButton( item3
, ID_RADIOBUTTON1
, _("I hate it"), wxDefaultPosition
, wxDefaultSize
, 0 );
127 item8
->SetValue(false);
128 item4
->Add(item8
, 0, wxALIGN_LEFT
|wxALL
, 5);
129 ////@end FoldTestPanel content construction
132 void FoldTestPanel::OnCaptionPanel(wxCaptionBarEvent
&WXUNUSED(event
))
138 * Should we show tooltips?
141 bool FoldTestPanel::ShowToolTips()
147 * Get bitmap resources
150 wxBitmap
FoldTestPanel::GetBitmapResource( const wxString
& WXUNUSED(name
) )
153 ////@begin FoldTestPanel bitmap retrieval
155 ////@end FoldTestPanel bitmap retrieval
162 wxIcon
FoldTestPanel::GetIconResource( const wxString
& WXUNUSED(name
) )
165 ////@begin FoldTestPanel icon retrieval
167 ////@end FoldTestPanel icon retrieval