1 /////////////////////////////////////////////////////////////////////////////
2 // Program: wxWidgets Widgets Sample
3 // Name: samples/widgets/widgets.cpp
4 // Purpose: Sample showing most of the simple wxWidgets widgets
5 // Author: Vadim Zeitlin
8 // Copyright: (c) 2001 Vadim Zeitlin
9 // License: wxWindows license
10 /////////////////////////////////////////////////////////////////////////////
12 // ============================================================================
14 // ============================================================================
16 // ----------------------------------------------------------------------------
18 // ----------------------------------------------------------------------------
20 // for compilers that support precompilation, includes "wx/wx.h".
21 #include "wx/wxprec.h"
27 // for all others, include the necessary headers
34 #include "wx/button.h"
35 #include "wx/checkbox.h"
36 #include "wx/listbox.h"
37 #include "wx/statbox.h"
38 #include "wx/stattext.h"
39 #include "wx/textctrl.h"
40 #include "wx/msgdlg.h"
43 #include "wx/sysopt.h"
44 #include "wx/bookctrl.h"
45 #include "wx/treebook.h"
47 #include "wx/colordlg.h"
48 #include "wx/fontdlg.h"
49 #include "wx/textdlg.h"
50 #include "wx/imaglist.h"
51 #include "wx/wupdlock.h"
55 #include "../sample.xpm"
57 // ----------------------------------------------------------------------------
59 // ----------------------------------------------------------------------------
64 Widgets_ClearLog
= 100,
71 #endif // wxUSE_TOOLTIPS
83 Widgets_BorderDefault
,
86 Widgets_GoToPageLast
= Widgets_GoToPage
+ 100
89 const wxChar
*WidgetsCategories
[MAX_PAGES
] = {
90 #if defined(__WXUNIVERSAL__)
104 // ----------------------------------------------------------------------------
106 // ----------------------------------------------------------------------------
108 // Define a new application type, each program should derive a class from wxApp
109 class WidgetsApp
: public wxApp
112 // override base class virtuals
113 // ----------------------------
115 // this one is called on application startup and is a good place for the app
116 // initialization (doing it here and not in the ctor allows to have an error
117 // return: if OnInit() returns false, the application terminates)
118 virtual bool OnInit();
121 // Define a new frame type: this is going to be our main frame
122 class WidgetsFrame
: public wxFrame
126 WidgetsFrame(const wxString
& title
);
127 virtual ~WidgetsFrame();
132 void OnButtonClearLog(wxCommandEvent
& event
);
134 void OnExit(wxCommandEvent
& event
);
137 void OnPageChanged(WidgetsBookCtrlEvent
& event
);
138 void OnGoToPage(wxCommandEvent
& event
);
141 void OnSetTooltip(wxCommandEvent
& event
);
142 #endif // wxUSE_TOOLTIPS
143 void OnSetFgCol(wxCommandEvent
& event
);
144 void OnSetBgCol(wxCommandEvent
& event
);
145 void OnSetFont(wxCommandEvent
& event
);
146 void OnEnable(wxCommandEvent
& event
);
147 void OnSetBorder(wxCommandEvent
& event
);
148 #endif // wxUSE_MENUS
150 // initialize the book: add all pages to it
153 // finding current page assuming book inside book
154 WidgetsPage
*CurrentPage();
157 // the panel containing everything
161 // the listbox for logging messages
162 wxListBox
*m_lboxLog
;
164 // the log target we use to redirect messages to the listbox
168 // the book containing the test pages
169 WidgetsBookCtrl
*m_book
;
172 // last chosen fg/bg colours and font
176 #endif // wxUSE_MENUS
178 // any class wishing to process wxWidgets events must use this macro
179 DECLARE_EVENT_TABLE()
183 // A log target which just redirects the messages to a listbox
184 class LboxLogger
: public wxLog
187 LboxLogger(wxListBox
*lbox
, wxLog
*logOld
)
190 //m_lbox->Disable(); -- looks ugly under MSW
194 virtual ~LboxLogger()
196 wxLog::SetActiveTarget(m_logOld
);
200 // implement sink functions
201 virtual void DoLog(wxLogLevel level
, const wxChar
*szString
, time_t t
)
203 // don't put trace messages into listbox or we can get into infinite
205 if ( level
== wxLOG_Trace
)
209 // cast is needed to call protected method
210 ((LboxLogger
*)m_logOld
)->DoLog(level
, szString
, t
);
215 wxLog::DoLog(level
, szString
, t
);
219 virtual void DoLogString(const wxChar
*szString
, time_t WXUNUSED(t
))
225 #ifdef __WXUNIVERSAL__
226 m_lbox
->AppendAndEnsureVisible(msg
);
227 #else // other ports don't have this method yet
229 m_lbox
->SetFirstItem(m_lbox
->GetCount() - 1);
233 // the control we use
236 // the old log target
242 WX_DEFINE_ARRAY_PTR(WidgetsPage
*, ArrayWidgetsPage
);
244 // ----------------------------------------------------------------------------
246 // ----------------------------------------------------------------------------
248 IMPLEMENT_APP(WidgetsApp
)
250 // ----------------------------------------------------------------------------
252 // ----------------------------------------------------------------------------
254 BEGIN_EVENT_TABLE(WidgetsFrame
, wxFrame
)
256 EVT_BUTTON(Widgets_ClearLog
, WidgetsFrame::OnButtonClearLog
)
258 EVT_BUTTON(Widgets_Quit
, WidgetsFrame::OnExit
)
261 EVT_MENU(Widgets_SetTooltip
, WidgetsFrame::OnSetTooltip
)
262 #endif // wxUSE_TOOLTIPS
265 EVT_WIDGETS_PAGE_CHANGED(wxID_ANY
, WidgetsFrame::OnPageChanged
)
266 EVT_MENU_RANGE(Widgets_GoToPage
, Widgets_GoToPageLast
,
267 WidgetsFrame::OnGoToPage
)
269 EVT_MENU(Widgets_SetFgColour
, WidgetsFrame::OnSetFgCol
)
270 EVT_MENU(Widgets_SetBgColour
, WidgetsFrame::OnSetBgCol
)
271 EVT_MENU(Widgets_SetFont
, WidgetsFrame::OnSetFont
)
272 EVT_MENU(Widgets_Enable
, WidgetsFrame::OnEnable
)
274 EVT_MENU_RANGE(Widgets_BorderNone
, Widgets_BorderDefault
,
275 WidgetsFrame::OnSetBorder
)
277 EVT_MENU(wxID_EXIT
, WidgetsFrame::OnExit
)
278 #endif // wxUSE_MENUS
281 // ============================================================================
283 // ============================================================================
285 // ----------------------------------------------------------------------------
287 // ----------------------------------------------------------------------------
289 bool WidgetsApp::OnInit()
291 if ( !wxApp::OnInit() )
294 // the reason for having these ifdef's is that I often run two copies of
295 // this sample side by side and it is useful to see which one is which
297 #if defined(__WXUNIVERSAL__)
298 title
= _T("wxUniv/");
301 #if defined(__WXMSW__)
302 title
+= _T("wxMSW");
303 #elif defined(__WXGTK__)
304 title
+= _T("wxGTK");
305 #elif defined(__WXMAC__)
306 title
+= _T("wxMAC");
307 #elif defined(__WXMOTIF__)
308 title
+= _T("wxMOTIF");
310 title
+= _T("wxWidgets");
313 wxFrame
*frame
= new WidgetsFrame(title
+ _T(" widgets demo"));
316 //wxLog::AddTraceMask(_T("listbox"));
317 //wxLog::AddTraceMask(_T("scrollbar"));
318 //wxLog::AddTraceMask(_T("focus"));
323 // ----------------------------------------------------------------------------
324 // WidgetsFrame construction
325 // ----------------------------------------------------------------------------
327 WidgetsFrame::WidgetsFrame(const wxString
& title
)
328 : wxFrame(NULL
, wxID_ANY
, title
)
330 // set the frame icon
331 SetIcon(wxICON(sample
));
335 m_lboxLog
= (wxListBox
*)NULL
;
336 m_logTarget
= (wxLog
*)NULL
;
338 m_book
= (WidgetsBookCtrl
*)NULL
;
341 // create the menubar
342 wxMenuBar
*mbar
= new wxMenuBar
;
343 wxMenu
*menuWidget
= new wxMenu
;
345 menuWidget
->Append(Widgets_SetTooltip
, _T("Set &tooltip...\tCtrl-T"));
346 menuWidget
->AppendSeparator();
347 #endif // wxUSE_TOOLTIPS
348 menuWidget
->Append(Widgets_SetFgColour
, _T("Set &foreground...\tCtrl-F"));
349 menuWidget
->Append(Widgets_SetBgColour
, _T("Set &background...\tCtrl-B"));
350 menuWidget
->Append(Widgets_SetFont
, _T("Set f&ont...\tCtrl-O"));
351 menuWidget
->AppendCheckItem(Widgets_Enable
, _T("&Enable/disable\tCtrl-E"));
353 wxMenu
*menuBorders
= new wxMenu
;
354 menuBorders
->AppendRadioItem(Widgets_BorderDefault
, _T("De&fault\tCtrl-Shift-9"));
355 menuBorders
->AppendRadioItem(Widgets_BorderNone
, _T("&None\tCtrl-Shift-0"));
356 menuBorders
->AppendRadioItem(Widgets_BorderSimple
, _T("&Simple\tCtrl-Shift-1"));
357 menuBorders
->AppendRadioItem(Widgets_BorderDouble
, _T("&Double\tCtrl-Shift-2"));
358 menuBorders
->AppendRadioItem(Widgets_BorderStatic
, _T("Stati&c\tCtrl-Shift-3"));
359 menuBorders
->AppendRadioItem(Widgets_BorderRaised
, _T("&Raised\tCtrl-Shift-4"));
360 menuBorders
->AppendRadioItem(Widgets_BorderSunken
, _T("S&unken\tCtrl-Shift-5"));
361 menuWidget
->AppendSubMenu(menuBorders
, _T("Set &border"));
363 menuWidget
->AppendSeparator();
364 menuWidget
->Append(wxID_EXIT
, _T("&Quit\tCtrl-Q"));
365 mbar
->Append(menuWidget
, _T("&Widget"));
368 mbar
->Check(Widgets_Enable
, true);
369 #endif // wxUSE_MENUS
372 m_panel
= new wxPanel(this, wxID_ANY
);
374 wxSizer
*sizerTop
= new wxBoxSizer(wxVERTICAL
);
376 // we have 2 panes: book with pages demonstrating the controls in the
377 // upper one and the log window with some buttons in the lower
379 int style
= wxBK_DEFAULT
;
380 // Uncomment to suppress page theme (draw in solid colour)
381 //style |= wxNB_NOPAGETHEME;
383 m_book
= new WidgetsBookCtrl(m_panel
, Widgets_BookCtrl
, wxDefaultPosition
,
385 wxSize(500, wxDefaultCoord
), // under Motif, height is a function of the width...
392 #ifndef __WXHANDHELD__
393 // the lower one only has the log listbox and a button to clear it
395 wxSizer
*sizerDown
= new wxStaticBoxSizer(
396 new wxStaticBox( m_panel
, wxID_ANY
, _T("&Log window") ),
399 m_lboxLog
= new wxListBox(m_panel
, wxID_ANY
);
400 sizerDown
->Add(m_lboxLog
, 1, wxGROW
| wxALL
, 5);
401 sizerDown
->SetMinSize(100, 150);
403 wxSizer
*sizerDown
= new wxBoxSizer(wxVERTICAL
);
406 wxBoxSizer
*sizerBtns
= new wxBoxSizer(wxHORIZONTAL
);
409 btn
= new wxButton(m_panel
, Widgets_ClearLog
, _T("Clear &log"));
411 sizerBtns
->Add(10, 0); // spacer
413 btn
= new wxButton(m_panel
, Widgets_Quit
, _T("E&xit"));
415 sizerDown
->Add(sizerBtns
, 0, wxALL
| wxALIGN_RIGHT
, 5);
417 // put everything together
418 sizerTop
->Add(m_book
, 1, wxGROW
| (wxALL
& ~(wxTOP
| wxBOTTOM
)), 10);
419 sizerTop
->Add(0, 5, 0, wxGROW
); // spacer in between
420 sizerTop
->Add(sizerDown
, 0, wxGROW
| (wxALL
& ~wxTOP
), 10);
422 #else // !__WXHANDHELD__/__WXHANDHELD__
424 sizerTop
->Add(m_book
, 1, wxGROW
| wxALL
);
426 #endif // __WXHANDHELD__
428 m_panel
->SetSizer(sizerTop
);
431 sizerTop
->SetSizeHints(this);
433 #if USE_LOG && !defined(__WXCOCOA__)
434 // wxCocoa's listbox is too flakey to use for logging right now
435 // now that everything is created we can redirect the log messages to the
437 m_logTarget
= new LboxLogger(m_lboxLog
, wxLog::GetActiveTarget());
438 wxLog::SetActiveTarget(m_logTarget
);
442 void WidgetsFrame::InitBook()
444 #if USE_ICONS_IN_BOOK
445 wxImageList
*imageList
= new wxImageList(32, 32);
447 imageList
->Add(wxBitmap(sample_xpm
));
449 wxImageList
*imageList
= NULL
;
453 WidgetsBookCtrl
*books
[MAX_PAGES
];
456 ArrayWidgetsPage pages
[MAX_PAGES
];
457 wxArrayString labels
[MAX_PAGES
];
459 wxMenu
*menuPages
= new wxMenu
;
460 unsigned int nPage
= 0, nFKey
= 0;
461 int cat
, imageId
= 1;
463 // we need to first create all pages and only then add them to the book
464 // as we need the image list first
466 // we also construct the pages menu during this first iteration
467 for ( cat
= 0; cat
< MAX_PAGES
; cat
++ )
470 nPage
++; // increase for parent page
472 books
[cat
] = new WidgetsBookCtrl(m_book
,
479 for ( WidgetsPageInfo
*info
= WidgetsPage::ms_widgetPages
;
481 info
= info
->GetNext() )
483 if( (info
->GetCategories() & ( 1 << cat
)) == 0)
486 WidgetsPage
*page
= (*info
->GetCtor())(
493 pages
[cat
].Add(page
);
495 labels
[cat
].Add(info
->GetLabel());
496 if ( cat
== ALL_PAGE
)
498 wxString
radioLabel(info
->GetLabel());
502 radioLabel
<< wxT("\tF" ) << nFKey
;
505 menuPages
->AppendRadioItem(
506 Widgets_GoToPage
+ nPage
,
510 // consider only for book in book architecture
516 // consider only for treebook architecture (with subpages)
522 GetMenuBar()->Append(menuPages
, _T("&Page"));
524 #if USE_ICONS_IN_BOOK
525 m_book
->AssignImageList(imageList
);
528 for ( cat
= 0; cat
< MAX_PAGES
; cat
++ )
531 m_book
->AddPage(NULL
,WidgetsCategories
[cat
],false,0);
533 m_book
->AddPage(books
[cat
],WidgetsCategories
[cat
],false,0);
534 #if USE_ICONS_IN_BOOK
535 books
[cat
]->SetImageList(imageList
);
540 size_t count
= pages
[cat
].GetCount();
541 for ( size_t n
= 0; n
< count
; n
++ )
550 false, // don't select
557 // for treebook page #0 is empty parent page only
558 m_book
->SetSelection(1);
559 m_book
->SetSelection(0);
563 WidgetsPage
*WidgetsFrame::CurrentPage()
565 wxWindow
*page
= m_book
->GetCurrentPage();
566 if(!page
) return NULL
;
569 return wxStaticCast(page
, WidgetsPage
);
571 WidgetsBookCtrl
*subBook
= wxStaticCast(page
, WidgetsBookCtrl
);
572 if (!subBook
) return NULL
;
573 page
= subBook
->GetCurrentPage();
574 if(!page
) return NULL
;
575 return wxStaticCast(page
, WidgetsPage
);
579 WidgetsFrame::~WidgetsFrame()
586 // ----------------------------------------------------------------------------
587 // WidgetsFrame event handlers
588 // ----------------------------------------------------------------------------
590 void WidgetsFrame::OnExit(wxCommandEvent
& WXUNUSED(event
))
596 void WidgetsFrame::OnButtonClearLog(wxCommandEvent
& WXUNUSED(event
))
604 void WidgetsFrame::OnPageChanged(WidgetsBookCtrlEvent
& event
)
606 // adjust "Page" menu selection
607 wxMenuItem
*item
= GetMenuBar()->FindItem(Widgets_GoToPage
+ event
.GetSelection());
608 if (item
) item
->Check();
610 // lazy creation of the pages
611 WidgetsPage
* page
= CurrentPage();
612 if (page
&& (page
->GetChildren().GetCount()==0))
614 wxWindowUpdateLocker
noUpdates(page
);
615 page
->CreateContent();
616 WidgetsBookCtrl
*book
= wxStaticCast(page
->GetParent(), WidgetsBookCtrl
);
618 for ( size_t i
= 0; i
< book
->GetPageCount(); ++i
)
620 wxWindow
*page
= book
->GetPage(i
);
623 size
.IncTo(page
->GetSize());
632 void WidgetsFrame::OnGoToPage(wxCommandEvent
& event
)
635 m_book
->SetSelection(event
.GetId() - Widgets_GoToPage
);
637 m_book
->SetSelection(m_book
->GetPageCount()-1);
638 WidgetsBookCtrl
*book
= wxStaticCast(m_book
->GetCurrentPage(), WidgetsBookCtrl
);
639 book
->SetSelection(event
.GetId() - Widgets_GoToPage
);
645 void WidgetsFrame::OnSetTooltip(wxCommandEvent
& WXUNUSED(event
))
647 WidgetsPage
*page
= CurrentPage();
651 wxLogMessage(_T("Page not selected."));
655 static wxString s_tip
= _T("This is a tooltip");
657 wxTextEntryDialog dialog
660 _T("Tooltip text (may use \\n, leave empty to remove): "),
661 _T("Widgets sample"),
665 if ( dialog
.ShowModal() != wxID_OK
)
668 s_tip
= dialog
.GetValue();
669 s_tip
.Replace(_T("\\n"), _T("\n"));
671 page
->GetWidget()->SetToolTip(s_tip
);
673 wxControl
*ctrl2
= page
->GetWidget2();
675 ctrl2
->SetToolTip(s_tip
);
678 #endif // wxUSE_TOOLTIPS
680 void WidgetsFrame::OnSetFgCol(wxCommandEvent
& WXUNUSED(event
))
683 // allow for debugging the default colour the first time this is called
684 WidgetsPage
*page
= CurrentPage();
687 wxLogMessage(_T("Page not selected."));
692 m_colFg
= page
->GetForegroundColour();
694 wxColour col
= wxGetColourFromUser(this, m_colFg
);
700 page
->GetWidget()->SetForegroundColour(m_colFg
);
701 page
->GetWidget()->Refresh();
703 wxControl
*ctrl2
= page
->GetWidget2();
706 ctrl2
->SetForegroundColour(m_colFg
);
710 wxLogMessage(_T("Colour selection dialog not available in current build."));
714 void WidgetsFrame::OnSetBgCol(wxCommandEvent
& WXUNUSED(event
))
717 WidgetsPage
*page
= CurrentPage();
720 wxLogMessage(_T("Page not selected."));
725 m_colBg
= page
->GetBackgroundColour();
727 wxColour col
= wxGetColourFromUser(this, m_colBg
);
733 page
->GetWidget()->SetBackgroundColour(m_colBg
);
734 page
->GetWidget()->Refresh();
736 wxControl
*ctrl2
= page
->GetWidget2();
739 ctrl2
->SetBackgroundColour(m_colFg
);
743 wxLogMessage(_T("Colour selection dialog not available in current build."));
747 void WidgetsFrame::OnSetFont(wxCommandEvent
& WXUNUSED(event
))
750 WidgetsPage
*page
= CurrentPage();
753 wxLogMessage(_T("Page not selected."));
758 m_font
= page
->GetFont();
760 wxFont font
= wxGetFontFromUser(this, m_font
);
766 page
->GetWidget()->SetFont(m_font
);
767 page
->GetWidget()->Refresh();
769 wxControl
*ctrl2
= page
->GetWidget2();
772 ctrl2
->SetFont(m_font
);
776 wxLogMessage(_T("Font selection dialog not available in current build."));
780 void WidgetsFrame::OnEnable(wxCommandEvent
& event
)
782 WidgetsPage
*page
= CurrentPage();
785 wxLogMessage(_T("Page not selected."));
789 page
->GetWidget()->Enable(event
.IsChecked());
792 void WidgetsFrame::OnSetBorder(wxCommandEvent
& event
)
795 switch ( event
.GetId() )
797 case Widgets_BorderNone
: border
= wxBORDER_NONE
; break;
798 case Widgets_BorderStatic
: border
= wxBORDER_STATIC
; break;
799 case Widgets_BorderSimple
: border
= wxBORDER_SIMPLE
; break;
800 case Widgets_BorderRaised
: border
= wxBORDER_RAISED
; break;
801 case Widgets_BorderSunken
: border
= wxBORDER_SUNKEN
; break;
802 case Widgets_BorderDouble
: border
= wxBORDER_DOUBLE
; break;
805 wxFAIL_MSG( _T("unknown border style") );
808 case Widgets_BorderDefault
: border
= wxBORDER_DEFAULT
; break;
811 WidgetsPage::ms_defaultFlags
&= ~wxBORDER_MASK
;
812 WidgetsPage::ms_defaultFlags
|= border
;
814 WidgetsPage
*page
= CurrentPage();
818 wxLogMessage(_T("Page not selected."));
822 page
->RecreateWidget();
825 #endif // wxUSE_MENUS
827 // ----------------------------------------------------------------------------
829 // ----------------------------------------------------------------------------
831 WidgetsPageInfo::WidgetsPageInfo(Constructor ctor
, const wxChar
*label
, int categories
)
833 , m_categories(categories
)
839 // dummy sorting: add and immediately sort in the list according to label
840 if ( WidgetsPage::ms_widgetPages
)
842 WidgetsPageInfo
*node_prev
= WidgetsPage::ms_widgetPages
;
843 if ( wxStrcmp(label
, node_prev
->GetLabel().c_str()) < 0 )
847 WidgetsPage::ms_widgetPages
= this;
851 WidgetsPageInfo
*node_next
;
854 node_next
= node_prev
->GetNext();
857 // add if between two
858 if ( wxStrcmp(label
, node_next
->GetLabel().c_str()) < 0 )
860 node_prev
->SetNext(this);
862 // force to break loop
869 node_prev
->SetNext(this);
872 node_prev
= node_next
;
880 WidgetsPage::ms_widgetPages
= this;
884 // ----------------------------------------------------------------------------
886 // ----------------------------------------------------------------------------
888 int WidgetsPage::ms_defaultFlags
= wxBORDER_DEFAULT
;
889 WidgetsPageInfo
*WidgetsPage::ms_widgetPages
= NULL
;
891 WidgetsPage::WidgetsPage(WidgetsBookCtrl
*book
,
892 wxImageList
*imaglist
,
894 : wxPanel(book
, wxID_ANY
,
895 wxDefaultPosition
, wxDefaultSize
,
896 wxNO_FULL_REPAINT_ON_RESIZE
|
900 #if USE_ICONS_IN_BOOK
901 imaglist
->Add(wxBitmap(icon
));
903 wxUnusedVar(imaglist
);
908 wxSizer
*WidgetsPage::CreateSizerWithText(wxControl
*control
,
912 wxSizer
*sizerRow
= new wxBoxSizer(wxHORIZONTAL
);
913 wxTextCtrl
*text
= new wxTextCtrl(this, id
, wxEmptyString
,
914 wxDefaultPosition
, wxDefaultSize
, wxTE_PROCESS_ENTER
);
916 sizerRow
->Add(control
, 0, wxRIGHT
| wxALIGN_CENTRE_VERTICAL
, 5);
917 sizerRow
->Add(text
, 1, wxLEFT
| wxALIGN_CENTRE_VERTICAL
, 5);
925 // create a sizer containing a label and a text ctrl
926 wxSizer
*WidgetsPage::CreateSizerWithTextAndLabel(const wxString
& label
,
930 return CreateSizerWithText(new wxStaticText(this, wxID_ANY
, label
),
934 // create a sizer containing a button and a text ctrl
935 wxSizer
*WidgetsPage::CreateSizerWithTextAndButton(wxWindowID idBtn
,
936 const wxString
& label
,
940 return CreateSizerWithText(new wxButton(this, idBtn
, label
), id
, ppText
);
943 wxCheckBox
*WidgetsPage::CreateCheckBoxAndAddToSizer(wxSizer
*sizer
,
944 const wxString
& label
,
947 wxCheckBox
*checkbox
= new wxCheckBox(this, id
, label
);
948 sizer
->Add(checkbox
, 0, wxLEFT
| wxRIGHT
, 5);
949 sizer
->Add(0, 2, 0, wxGROW
); // spacer