]>
git.saurik.com Git - wxWidgets.git/blob - contrib/samples/foldbar/foldpanelbar/layouttest.cpp
1 /////////////////////////////////////////////////////////////////////////////
2 // Name: layouttest.cpp
4 // Author: Jorgen Bodde
8 // Copyright: (c) Jorgen Bodde
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
12 // For compilers that support precompilation, includes "wx/wx.h".
13 #include "wx/wxprec.h"
26 #include "layouttest.h"
32 * LayoutTest type definition
35 IMPLEMENT_CLASS( LayoutTest
, wxPanel
)
38 * LayoutTest event table definition
41 BEGIN_EVENT_TABLE( LayoutTest
, wxPanel
)
43 ////@begin LayoutTest event table entries
44 ////@end LayoutTest event table entries
49 * LayoutTest constructors
52 LayoutTest::LayoutTest( )
56 LayoutTest::LayoutTest( wxWindow
* parent
, wxWindowID id
, const wxString
& caption
, const wxPoint
& pos
, const wxSize
& size
, long style
)
58 Create(parent
, id
, caption
, pos
, size
, style
);
65 bool LayoutTest::Create( wxWindow
* parent
, wxWindowID id
, const wxString
& WXUNUSED(caption
), const wxPoint
& pos
, const wxSize
& size
, long style
)
67 ////@begin LayoutTest member initialisation
68 ////@end LayoutTest member initialisation
70 ////@begin LayoutTest creation
71 SetExtraStyle(GetExtraStyle()|wxWS_EX_BLOCK_EVENTS
);
72 wxPanel::Create( parent
, id
, pos
, size
, style
);
75 GetSizer()->Fit(this);
76 GetSizer()->SetSizeHints(this);
78 ////@end LayoutTest creation
83 * Control creation for LayoutTest
86 void LayoutTest::CreateControls()
88 ////@begin LayoutTest content construction
90 LayoutTest
* item1
= this;
92 wxBoxSizer
* item2
= new wxBoxSizer(wxVERTICAL
);
93 item1
->SetSizer(item2
);
94 item1
->SetAutoLayout(true);
95 wxStaticText
* item3
= new wxStaticText( item1
, wxID_STATIC
, _("lbaaaaaa"), wxDefaultPosition
, wxDefaultSize
, 0 );
96 item3
->SetBackgroundColour(wxColour(139, 139, 139));
97 item2
->Add(item3
, 0, wxGROW
|wxALL
|wxADJUST_MINSIZE
, 5);
98 wxPanel
* item4
= new wxPanel( item1
, ID_PANEL1
, wxDefaultPosition
, wxSize(100, 80), wxTAB_TRAVERSAL
);
99 item2
->Add(item4
, 0, wxGROW
, 5);
100 wxBoxSizer
* item5
= new wxBoxSizer(wxVERTICAL
);
101 item4
->SetSizer(item5
);
102 item4
->SetAutoLayout(true);
103 wxStaticText
* item6
= new wxStaticText( item4
, wxID_STATIC
, _("Static text"), wxDefaultPosition
, wxDefaultSize
, 0 );
104 item5
->Add(item6
, 0, wxALIGN_LEFT
|wxALL
|wxADJUST_MINSIZE
, 5);
105 wxButton
* item7
= new wxButton( item4
, ID_BUTTON
, _("Button"), wxDefaultPosition
, wxDefaultSize
, 0 );
106 item5
->Add(item7
, 0, wxALIGN_LEFT
|wxALL
, 5);
107 ////@end LayoutTest content construction
111 * Should we show tooltips?
114 bool LayoutTest::ShowToolTips()
120 * Get bitmap resources
123 wxBitmap
LayoutTest::GetBitmapResource( const wxString
& WXUNUSED(name
) )
126 ////@begin LayoutTest bitmap retrieval
128 ////@end LayoutTest bitmap retrieval
135 wxIcon
LayoutTest::GetIconResource( const wxString
& WXUNUSED(name
) )
138 ////@begin LayoutTest icon retrieval
140 ////@end LayoutTest icon retrieval