1 /////////////////////////////////////////////////////////////////////////////
3 // Purpose: provide new wxSizer class for layout
4 // Author: Robert Roebling and Robin Dunn
8 // Copyright: (c) Robin Dunn, Dirk Holtwick and Robert Roebling
9 // Licence: wxWindows licence
10 /////////////////////////////////////////////////////////////////////////////
13 #pragma implementation "sizer.h"
16 // For compilers that support precompilation, includes "wx.h".
17 #include "wx/wxprec.h"
25 #include "wx/statbox.h"
26 #include "wx/notebook.h"
28 //---------------------------------------------------------------------------
30 IMPLEMENT_ABSTRACT_CLASS(wxSizerItem
, wxObject
);
31 IMPLEMENT_ABSTRACT_CLASS(wxSizer
, wxObject
);
32 IMPLEMENT_ABSTRACT_CLASS(wxGridSizer
, wxSizer
);
33 IMPLEMENT_ABSTRACT_CLASS(wxFlexGridSizer
, wxGridSizer
);
34 IMPLEMENT_ABSTRACT_CLASS(wxBoxSizer
, wxSizer
);
35 IMPLEMENT_ABSTRACT_CLASS(wxStaticBoxSizer
, wxBoxSizer
);
37 IMPLEMENT_ABSTRACT_CLASS(wxNotebookSizer
, wxSizer
);
40 //---------------------------------------------------------------------------
42 //---------------------------------------------------------------------------
44 wxSizerItem::wxSizerItem( int width
, int height
, int option
, int flag
, int border
, wxObject
* userData
)
46 m_window
= (wxWindow
*) NULL
;
47 m_sizer
= (wxSizer
*) NULL
;
51 m_userData
= userData
;
53 // minimal size is the initial size
57 SetRatio(width
, height
);
59 // size is set directly
63 wxSizerItem::wxSizerItem( wxWindow
*window
, int option
, int flag
, int border
, wxObject
* userData
)
66 m_sizer
= (wxSizer
*) NULL
;
70 m_userData
= userData
;
72 // minimal size is the initial size
73 m_minSize
= window
->GetSize();
75 // aspect ratio calculated from initial size
78 // size is calculated later
82 wxSizerItem::wxSizerItem( wxSizer
*sizer
, int option
, int flag
, int border
, wxObject
* userData
)
84 m_window
= (wxWindow
*) NULL
;
89 m_userData
= userData
;
91 // minimal size is calculated later
95 // size is calculated later
99 wxSizerItem::~wxSizerItem()
108 wxSize
wxSizerItem::GetSize()
112 ret
= m_sizer
->GetSize();
115 ret
= m_window
->GetSize();
122 if (m_flag
& wxNORTH
)
124 if (m_flag
& wxSOUTH
)
130 wxSize
wxSizerItem::CalcMin()
135 ret
= m_sizer
->GetMinSize();
136 // if we have to preserve aspect ratio _AND_ this is
137 // the first-time calculation, consider ret to be initial size
138 if ((m_flag
& wxSHAPED
) && !m_ratio
) SetRatio(ret
);
142 The minimum size of a window should be the
143 initial size, as saved in m_minSize, not the
148 ret = m_window->GetSize();
150 else ret
= m_minSize
;
156 if (m_flag
& wxNORTH
)
158 if (m_flag
& wxSOUTH
)
164 void wxSizerItem::SetDimension( wxPoint pos
, wxSize size
)
166 if (m_flag
& wxSHAPED
)
168 // adjust aspect ratio
169 int rwidth
= (int) (size
.y
* m_ratio
);
173 int rheight
= (int) (size
.x
/ m_ratio
);
174 // add vertical space
175 if (m_flag
& wxALIGN_CENTER_VERTICAL
)
176 pos
.y
+= (size
.y
- rheight
) / 2;
177 else if (m_flag
& wxALIGN_BOTTOM
)
178 pos
.y
+= (size
.y
- rheight
);
179 // use reduced dimensions
182 else if (rwidth
< size
.x
)
184 // add horizontal space
185 if (m_flag
& wxALIGN_CENTER_HORIZONTAL
)
186 pos
.x
+= (size
.x
- rwidth
) / 2;
187 else if (m_flag
& wxALIGN_RIGHT
)
188 pos
.x
+= (size
.x
- rwidth
);
193 // This is what GetPosition() returns. Since we calculate
194 // borders afterwards, GetPosition() will be the left/top
195 // corner of the surrounding border.
207 if (m_flag
& wxNORTH
)
212 if (m_flag
& wxSOUTH
)
218 m_sizer
->SetDimension( pos
.x
, pos
.y
, size
.x
, size
.y
);
221 m_window
->SetSize( pos
.x
, pos
.y
, size
.x
, size
.y
, wxSIZE_ALLOW_MINUS_ONE
);
226 bool wxSizerItem::IsWindow()
228 return (m_window
!= NULL
);
231 bool wxSizerItem::IsSizer()
233 return (m_sizer
!= NULL
);
236 bool wxSizerItem::IsSpacer()
238 return (m_window
== NULL
) && (m_sizer
== NULL
);
241 //---------------------------------------------------------------------------
243 //---------------------------------------------------------------------------
247 m_children
.DeleteContents( TRUE
);
256 void wxSizer::Add( wxWindow
*window
, int option
, int flag
, int border
, wxObject
* userData
)
258 m_children
.Append( new wxSizerItem( window
, option
, flag
, border
, userData
) );
261 void wxSizer::Add( wxSizer
*sizer
, int option
, int flag
, int border
, wxObject
* userData
)
263 m_children
.Append( new wxSizerItem( sizer
, option
, flag
, border
, userData
) );
266 void wxSizer::Add( int width
, int height
, int option
, int flag
, int border
, wxObject
* userData
)
268 m_children
.Append( new wxSizerItem( width
, height
, option
, flag
, border
, userData
) );
271 void wxSizer::Prepend( wxWindow
*window
, int option
, int flag
, int border
, wxObject
* userData
)
273 m_children
.Insert( new wxSizerItem( window
, option
, flag
, border
, userData
) );
276 void wxSizer::Prepend( wxSizer
*sizer
, int option
, int flag
, int border
, wxObject
* userData
)
278 m_children
.Insert( new wxSizerItem( sizer
, option
, flag
, border
, userData
) );
281 void wxSizer::Prepend( int width
, int height
, int option
, int flag
, int border
, wxObject
* userData
)
283 m_children
.Insert( new wxSizerItem( width
, height
, option
, flag
, border
, userData
) );
286 void wxSizer::Insert( int before
, wxWindow
*window
, int option
, int flag
, int border
, wxObject
* userData
)
288 m_children
.Insert( before
, new wxSizerItem( window
, option
, flag
, border
, userData
) );
291 void wxSizer::Insert( int before
, wxSizer
*sizer
, int option
, int flag
, int border
, wxObject
* userData
)
293 m_children
.Insert( before
, new wxSizerItem( sizer
, option
, flag
, border
, userData
) );
296 void wxSizer::Insert( int before
, int width
, int height
, int option
, int flag
, int border
, wxObject
* userData
)
298 m_children
.Insert( before
, new wxSizerItem( width
, height
, option
, flag
, border
, userData
) );
301 bool wxSizer::Remove( wxWindow
*window
)
305 wxNode
*node
= m_children
.First();
308 wxSizerItem
*item
= (wxSizerItem
*)node
->Data();
309 if (item
->GetWindow() == window
)
311 m_children
.DeleteNode( node
);
320 bool wxSizer::Remove( wxSizer
*sizer
)
324 wxNode
*node
= m_children
.First();
327 wxSizerItem
*item
= (wxSizerItem
*)node
->Data();
328 if (item
->GetSizer() == sizer
)
330 m_children
.DeleteNode( node
);
339 bool wxSizer::Remove( int pos
)
341 wxNode
*node
= m_children
.Nth( pos
);
342 if (!node
) return FALSE
;
344 m_children
.DeleteNode( node
);
349 void wxSizer::Fit( wxWindow
*window
)
351 window
->SetSize( GetMinWindowSize( window
) );
354 void wxSizer::Layout()
360 void wxSizer::SetSizeHints( wxWindow
*window
)
362 wxSize
size( GetMinWindowSize( window
) );
363 window
->SetSizeHints( size
.x
, size
.y
);
366 wxSize
wxSizer::GetMinWindowSize( wxWindow
*window
)
368 wxSize
minSize( GetMinSize() );
369 wxSize
size( window
->GetSize() );
370 wxSize
client_size( window
->GetClientSize() );
371 return wxSize( minSize
.x
+size
.x
-client_size
.x
,
372 minSize
.y
+size
.y
-client_size
.y
);
375 void wxSizer::SetDimension( int x
, int y
, int width
, int height
)
385 wxSize
wxSizer::GetMinSize()
387 wxSize
ret( CalcMin() );
388 if (ret
.x
< m_minSize
.x
) ret
.x
= m_minSize
.x
;
389 if (ret
.y
< m_minSize
.y
) ret
.y
= m_minSize
.y
;
393 void wxSizer::DoSetMinSize( int width
, int height
)
396 m_minSize
.y
= height
;
399 bool wxSizer::DoSetItemMinSize( wxWindow
*window
, int width
, int height
)
403 wxNode
*node
= m_children
.First();
406 wxSizerItem
*item
= (wxSizerItem
*)node
->Data();
407 if (item
->GetWindow() == window
)
409 item
->SetInitSize( width
, height
);
415 node
= m_children
.First();
418 wxSizerItem
*item
= (wxSizerItem
*)node
->Data();
419 if (item
->GetSizer())
421 /* It's a sizer, so lets search recursively. */
422 if (item
->GetSizer()->DoSetItemMinSize( window
, width
, height
))
424 /* A child sizer found the requested windw, exit. */
434 bool wxSizer::DoSetItemMinSize( wxSizer
*sizer
, int width
, int height
)
438 wxNode
*node
= m_children
.First();
441 wxSizerItem
*item
= (wxSizerItem
*)node
->Data();
442 if (item
->GetSizer() == sizer
)
444 item
->GetSizer()->DoSetMinSize( width
, height
);
450 node
= m_children
.First();
453 wxSizerItem
*item
= (wxSizerItem
*)node
->Data();
454 if (item
->GetSizer())
456 /* It's a sizer, so lets search recursively. */
457 if (item
->GetSizer()->DoSetItemMinSize( sizer
, width
, height
))
459 /* A child sizer found the requested windw, exit. */
469 bool wxSizer::DoSetItemMinSize( int pos
, int width
, int height
)
471 wxNode
*node
= m_children
.Nth( pos
);
472 if (!node
) return FALSE
;
474 wxSizerItem
*item
= (wxSizerItem
*) node
->Data();
475 if (item
->GetSizer())
477 /* Sizers contains the minimal size in them, if not calculated ... */
478 item
->GetSizer()->DoSetMinSize( width
, height
);
482 /* ... whereas the minimal size of spacers and windows in stored
484 item
->SetInitSize( width
, height
);
490 //---------------------------------------------------------------------------
492 //---------------------------------------------------------------------------
494 wxGridSizer::wxGridSizer( int rows
, int cols
, int vgap
, int hgap
)
502 wxGridSizer::wxGridSizer( int cols
, int vgap
, int hgap
)
510 void wxGridSizer::RecalcSizes()
512 if (m_children
.GetCount() == 0)
515 int nitems
= m_children
.GetCount();
520 nrows
= (nitems
+ ncols
-1) / ncols
;
522 ncols
= (nitems
+ nrows
-1) / nrows
;
524 wxSize
sz( GetSize() );
525 wxPoint
pt( GetPosition() );
527 int w
= (sz
.x
- (ncols
- 1) * m_hgap
) / ncols
;
528 int h
= (sz
.y
- (nrows
- 1) * m_vgap
) / nrows
;
531 for (int c
= 0; c
< ncols
; c
++)
534 for (int r
= 0; r
< nrows
; r
++)
536 int i
= r
* ncols
+ c
;
539 wxNode
*node
= m_children
.Nth( i
);
542 SetItemBounds( (wxSizerItem
*) node
->Data(), x
, y
, w
, h
);
550 wxSize
wxGridSizer::CalcMin()
552 if (m_children
.GetCount() == 0)
553 return wxSize(10,10);
555 int nitems
= m_children
.GetCount();
560 nrows
= (nitems
+ ncols
-1) / ncols
;
562 ncols
= (nitems
+ nrows
-1) / nrows
;
564 /* Find the max width and height for any component */
568 wxNode
*node
= m_children
.First();
571 wxSizerItem
*item
= (wxSizerItem
*)node
->Data();
572 wxSize
sz( item
->CalcMin() );
573 w
= wxMax( w
, sz
.x
);
574 h
= wxMax( h
, sz
.y
);
579 return wxSize(ncols
* w
+ (ncols
-1) * m_hgap
,
580 nrows
* h
+ (nrows
-1) * m_vgap
);
583 void wxGridSizer::SetItemBounds( wxSizerItem
*item
, int x
, int y
, int w
, int h
)
586 wxSize
sz( item
->CalcMin() );
587 int flag
= item
->GetFlag();
589 if ((flag
& wxEXPAND
) || (flag
& wxSHAPED
))
595 if (flag
& wxALIGN_CENTER_HORIZONTAL
)
597 pt
.x
= x
+ (w
- sz
.x
) / 2;
599 else if (flag
& wxALIGN_RIGHT
)
601 pt
.x
= x
+ (w
- sz
.x
);
604 if (flag
& wxALIGN_CENTER_VERTICAL
)
606 pt
.y
= y
+ (h
- sz
.y
) / 2;
608 else if (flag
& wxALIGN_BOTTOM
)
610 pt
.y
= y
+ (h
- sz
.y
);
614 item
->SetDimension(pt
, sz
);
617 //---------------------------------------------------------------------------
619 //---------------------------------------------------------------------------
621 wxFlexGridSizer::wxFlexGridSizer( int rows
, int cols
, int vgap
, int hgap
)
622 : wxGridSizer( rows
, cols
, vgap
, hgap
)
624 m_rowHeights
= (int*) NULL
;
625 m_colWidths
= (int*) NULL
;
628 wxFlexGridSizer::wxFlexGridSizer( int cols
, int vgap
, int hgap
)
629 : wxGridSizer( cols
, vgap
, hgap
)
631 m_rowHeights
= (int*) NULL
;
632 m_colWidths
= (int*) NULL
;
635 wxFlexGridSizer::~wxFlexGridSizer()
638 delete[] m_rowHeights
;
640 delete[] m_colWidths
;
643 void wxFlexGridSizer::CreateArrays()
646 delete[] m_rowHeights
;
648 delete[] m_colWidths
;
650 if (m_children
.GetCount() == 0)
653 int nitems
= m_children
.GetCount();
658 nrows
= (nitems
+ ncols
-1) / ncols
;
660 ncols
= (nitems
+ nrows
-1) / nrows
;
662 m_rowHeights
= new int[nrows
];
663 m_colWidths
= new int[ncols
];
665 for (int col
= 0; col
< ncols
; col
++)
666 m_colWidths
[ col
] = 0;
667 for (int row
= 0; row
< nrows
; row
++)
668 m_rowHeights
[ row
] = 0;
671 void wxFlexGridSizer::RecalcSizes()
673 if (m_children
.GetCount() == 0)
676 int nitems
= m_children
.GetCount();
681 nrows
= (nitems
+ ncols
-1) / ncols
;
683 ncols
= (nitems
+ nrows
-1) / nrows
;
685 wxSize
sz( GetSize() );
686 wxSize
minsz( CalcMin() );
687 wxPoint
pt( GetPosition() );
691 if ((m_growableRows
.GetCount() > 0) && (sz
.y
> minsz
.y
))
693 delta
= (sz
.y
- minsz
.y
) / m_growableRows
.GetCount();
694 for (idx
= 0; idx
< m_growableRows
.GetCount(); idx
++)
695 m_rowHeights
[ m_growableRows
[idx
] ] += delta
;
698 if ((m_growableCols
.GetCount() > 0) && (sz
.x
> minsz
.x
))
700 delta
= (sz
.x
- minsz
.x
) / m_growableCols
.GetCount();
701 for (idx
= 0; idx
< m_growableCols
.GetCount(); idx
++)
702 m_colWidths
[ m_growableCols
[idx
] ] += delta
;
705 sz
= wxSize( pt
.x
+ sz
.x
, pt
.y
+ sz
.y
);
708 for (int c
= 0; c
< ncols
; c
++)
711 for (int r
= 0; r
< nrows
; r
++)
713 int i
= r
* ncols
+ c
;
716 wxNode
*node
= m_children
.Nth( i
);
719 int w
= wxMax( 0, wxMin( m_colWidths
[c
], sz
.x
- x
) );
720 int h
= wxMax( 0, wxMin( m_rowHeights
[r
], sz
.y
- y
) );
722 SetItemBounds( (wxSizerItem
*) node
->Data(), x
, y
, w
, h
);
724 y
= y
+ m_rowHeights
[r
] + m_vgap
;
726 x
= x
+ m_colWidths
[c
] + m_hgap
;
730 wxSize
wxFlexGridSizer::CalcMin()
732 if (m_children
.GetCount() == 0)
733 return wxSize(10,10);
735 int nitems
= m_children
.GetCount();
740 nrows
= (nitems
+ ncols
-1) / ncols
;
742 ncols
= (nitems
+ nrows
-1) / nrows
;
750 wxNode
*node
= m_children
.First();
753 wxSizerItem
*item
= (wxSizerItem
*)node
->Data();
754 wxSize
sz( item
->CalcMin() );
757 m_rowHeights
[ row
] = wxMax( sz
.y
, m_rowHeights
[ row
] );
758 m_colWidths
[ col
] = wxMax( sz
.x
, m_colWidths
[ col
] );
765 for (col
= 0; col
< ncols
; col
++)
766 width
+= m_colWidths
[ col
];
769 for (row
= 0; row
< nrows
; row
++)
770 height
+= m_rowHeights
[ row
];
772 return wxSize( width
+ (ncols
-1) * m_hgap
,
773 height
+ (nrows
-1) * m_vgap
);
776 void wxFlexGridSizer::AddGrowableRow( size_t idx
)
778 m_growableRows
.Add( idx
);
781 void wxFlexGridSizer::RemoveGrowableRow( size_t WXUNUSED(idx
) )
785 void wxFlexGridSizer::AddGrowableCol( size_t idx
)
787 m_growableCols
.Add( idx
);
790 void wxFlexGridSizer::RemoveGrowableCol( size_t WXUNUSED(idx
) )
794 //---------------------------------------------------------------------------
796 //---------------------------------------------------------------------------
798 wxBoxSizer::wxBoxSizer( int orient
)
803 void wxBoxSizer::RecalcSizes()
805 if (m_children
.GetCount() == 0)
812 if (m_orient
== wxHORIZONTAL
)
814 delta
= (m_size
.x
- m_fixedWidth
) / m_stretchable
;
815 extra
= (m_size
.x
- m_fixedWidth
) % m_stretchable
;
819 delta
= (m_size
.y
- m_fixedHeight
) / m_stretchable
;
820 extra
= (m_size
.y
- m_fixedHeight
) % m_stretchable
;
824 wxPoint
pt( m_position
);
826 wxNode
*node
= m_children
.GetFirst();
829 wxSizerItem
*item
= (wxSizerItem
*) node
->Data();
832 if (item
->GetOption())
833 weight
= item
->GetOption();
835 wxSize
size( item
->CalcMin() );
837 if (m_orient
== wxVERTICAL
)
839 wxCoord height
= size
.y
;
840 if (item
->GetOption())
842 height
= (delta
* weight
) + extra
;
843 extra
= 0; // only the first item will get the remainder as extra size
846 wxPoint
child_pos( pt
);
847 wxSize
child_size( wxSize( size
.x
, height
) );
849 if (item
->GetFlag() & (wxEXPAND
| wxSHAPED
))
850 child_size
.x
= m_size
.x
;
851 else if (item
->GetFlag() & wxALIGN_RIGHT
)
852 child_pos
.x
+= m_size
.x
- size
.x
;
853 else if (item
->GetFlag() & (wxCENTER
| wxALIGN_CENTER_HORIZONTAL
))
854 // XXX wxCENTER is added for backward compatibility;
855 // wxALIGN_CENTER should be used in new code
856 child_pos
.x
+= (m_size
.x
- size
.x
) / 2;
858 item
->SetDimension( child_pos
, child_size
);
864 wxCoord width
= size
.x
;
865 if (item
->GetOption())
867 width
= (delta
* weight
) + extra
;
868 extra
= 0; // only the first item will get the remainder as extra size
871 wxPoint
child_pos( pt
);
872 wxSize
child_size( wxSize(width
, size
.y
) );
874 if (item
->GetFlag() & (wxEXPAND
| wxSHAPED
))
875 child_size
.y
= m_size
.y
;
876 else if (item
->GetFlag() & wxALIGN_BOTTOM
)
877 child_pos
.y
+= m_size
.y
- size
.y
;
878 else if (item
->GetFlag() & (wxCENTER
| wxALIGN_CENTER_VERTICAL
))
879 // XXX wxCENTER is added for backward compatibility;
880 // wxALIGN_CENTER should be used in new code
881 child_pos
.y
+= (m_size
.y
- size
.y
) / 2;
883 item
->SetDimension( child_pos
, child_size
);
892 wxSize
wxBoxSizer::CalcMin()
894 if (m_children
.GetCount() == 0)
895 return wxSize(10,10);
903 wxNode
*node
= m_children
.GetFirst();
906 wxSizerItem
*item
= (wxSizerItem
*) node
->Data();
908 m_stretchable
+= item
->GetOption();
910 wxSize
size( item
->CalcMin() );
912 if (m_orient
== wxHORIZONTAL
)
914 m_minWidth
+= size
.x
;
915 m_minHeight
= wxMax( m_minHeight
, size
.y
);
919 m_minHeight
+= size
.y
;
920 m_minWidth
= wxMax( m_minWidth
, size
.x
);
923 if (item
->GetOption() == 0)
925 if (m_orient
== wxVERTICAL
)
927 m_fixedHeight
+= size
.y
;
928 m_fixedWidth
= wxMax( m_fixedWidth
, size
.x
);
932 m_fixedWidth
+= size
.x
;
933 m_fixedHeight
= wxMax( m_fixedHeight
, size
.y
);
940 return wxSize( m_minWidth
, m_minHeight
);
943 //---------------------------------------------------------------------------
945 //---------------------------------------------------------------------------
947 wxStaticBoxSizer::wxStaticBoxSizer( wxStaticBox
*box
, int orient
)
948 : wxBoxSizer( orient
)
950 wxASSERT_MSG( box
, wxT("wxStaticBoxSizer needs a static box") );
955 static void GetStaticBoxBorders(wxStaticBox
*box
,
956 int *borderTop
, int *borderOther
)
958 // this has to be done platform by platform as there is no way to
959 // guess the thickness of a wxStaticBox border
961 if ( box
->GetLabel().IsEmpty() )
970 void wxStaticBoxSizer::RecalcSizes()
972 int top_border
, other_border
;
973 GetStaticBoxBorders(m_staticBox
, &top_border
, &other_border
);
975 m_staticBox
->SetSize( m_position
.x
, m_position
.y
, m_size
.x
, m_size
.y
);
977 wxPoint
old_pos( m_position
);
978 m_position
.x
+= other_border
;
979 m_position
.y
+= top_border
;
980 wxSize
old_size( m_size
);
981 m_size
.x
-= 2*other_border
;
982 m_size
.y
-= top_border
+ other_border
;
984 wxBoxSizer::RecalcSizes();
986 m_position
= old_pos
;
990 wxSize
wxStaticBoxSizer::CalcMin()
992 int top_border
, other_border
;
993 GetStaticBoxBorders(m_staticBox
, &top_border
, &other_border
);
995 wxSize
ret( wxBoxSizer::CalcMin() );
996 ret
.x
+= 2*other_border
;
997 ret
.y
+= other_border
+ top_border
;
1002 //---------------------------------------------------------------------------
1004 //---------------------------------------------------------------------------
1008 wxNotebookSizer::wxNotebookSizer( wxNotebook
*nb
)
1010 wxASSERT_MSG( nb
, wxT("wxNotebookSizer needs a notebook") );
1015 void wxNotebookSizer::RecalcSizes()
1017 m_notebook
->SetSize( m_position
.x
, m_position
.y
, m_size
.x
, m_size
.y
);
1020 wxSize
wxNotebookSizer::CalcMin()
1022 // This will have to be done platform by platform
1023 // as there is no way to guess the thickness of
1024 // the wxNotebook tabs and border.
1028 if ((m_notebook
->HasFlag(wxNB_RIGHT
)) ||
1029 (m_notebook
->HasFlag(wxNB_LEFT
)))
1031 borderX
+= 90; // improvements later..
1035 borderY
+= 40; // improvements later..
1038 if (m_notebook
->GetChildren().GetCount() == 0)
1039 return wxSize(borderX
+ 10, borderY
+ 10);
1044 wxWindowList::Node
*node
= m_notebook
->GetChildren().GetFirst();
1047 wxWindow
*item
= node
->GetData();
1048 wxSizer
*itemsizer
= item
->GetSizer();
1052 wxSize
subsize( itemsizer
->CalcMin() );
1054 if (subsize
.x
> maxX
) maxX
= subsize
.x
;
1055 if (subsize
.y
> maxY
) maxY
= subsize
.y
;
1058 node
= node
->GetNext();
1061 return wxSize( borderX
+ maxX
, borderY
+ maxY
);
1064 #endif // wxUSE_NOTEBOOK