\helpref{wxWindow::GetForegroundColour}{wxwindowgetforegroundcolour}
+\membersection{wxWindow::GetBestFittingSize}\label{wxwindowgetbestfittingsize}
+
+\constfunc{wxSize}{GetBestFittingSize}{\void}
+
+Merges the window's best size into the min size and returns the result.
+
+\wxheading{See also}
+
+\helpref{wxWindow::GetBestSize}{wxwindowgetbestsize},\rtfsp
+\helpref{wxWindow::SetBestFittingSize}{wxwindowsetbestfittingsize},\rtfsp
+\helpref{wxWindow::SetSizeHints}{wxwindowsetsizehints}
+
+
\membersection{wxWindow::GetBestSize}\label{wxwindowgetbestsize}
\constfunc{wxSize}{GetBestSize}{\void}
\helpref{wxWindow::Refresh}{wxwindowrefresh},\rtfsp
\helpref{wxEraseEvent}{wxeraseevent}
+
\membersection{wxWindow::SetBestFittingSize}\label{wxwindowsetbestfittingsize}
\func{void}{SetBestFittingSize}{\param{const wxSize& }{size = wxDefaultSize}}
A {\it smart} SetSize that will fill in default size components with the
-window's {\it best} size values. Also set's the minsize for use with
-sizers.
+window's {\it best} size values. Also sets the window's minsize to
+the value passed in for use with sizers. This means that if a full or
+partial size is passed to this function then the sizers will use that
+size instead of the results of GetBestSize to determine the minimum
+needs of the window for layout.
\wxheading{See also}
-\helpref{wxWindow::SetSize}{wxwindowsetsize}
-\helpref{wxWindow::GetBestSize}{wxwindowgetbestsize}
+\helpref{wxWindow::SetSize}{wxwindowsetsize},\rtfsp
+\helpref{wxWindow::GetBestSize}{wxwindowgetbestsize},\rtfsp
+\helpref{wxWindow::GetBestFittingSize}{wxwindowgetbestfittingsize},\rtfsp
\helpref{wxWindow::SetSizeHints}{wxwindowsetsizehints}
protected:
// function called when any of the bitmaps changes
- virtual void OnSetBitmap() { }
+ virtual void OnSetBitmap() { InvalidateBestSize(); }
// the bitmaps for various states
wxBitmap m_bmpNormal,
// if the button was clicked)
virtual void Command(wxCommandEvent &event);
+ virtual void SetLabel( const wxString &label );
+ virtual bool SetFont(const wxFont& font);
+
protected:
// creates the control (calls wxWindowBase::CreateBase inside) and adds it
// to the list of parents children
void Move(const wxPoint& pt, int flags = wxSIZE_USE_EXISTING)
{ Move(pt.x, pt.y, flags); }
- // A 'Smart' SetSize that will fill in default size values with 'best' size
- void SetBestFittingSize(const wxSize& size=wxDefaultSize);
-
// Z-order
virtual void Raise() = 0;
virtual void Lower() = 0;
}
// get the size best suited for the window (in fact, minimal
- // acceptable size using which it will still look "nice")
- wxSize GetBestSize() const { return DoGetBestSize(); }
+ // acceptable size using which it will still look "nice" in
+ // most situations)
+ wxSize GetBestSize() const
+ {
+ if (m_bestSizeCache.IsFullySpecified())
+ return m_bestSizeCache;
+ return DoGetBestSize();
+ }
void GetBestSize(int *w, int *h) const
{
- wxSize s = DoGetBestSize();
+ wxSize s = GetBestSize();
if ( w )
*w = s.x;
if ( h )
*h = s.y;
}
+ // reset the cached best size value so it will be recalculated the
+ // next time it is needed.
+ void InvalidateBestSize() { m_bestSizeCache = wxDefaultSize; }
+ void CacheBestSize(const wxSize& size) const
+ { wxConstCast(this, wxWindowBase)->m_bestSizeCache = size; }
+
// There are times (and windows) where 'Best' size and 'Min' size
// are vastly out of sync. This should be remedied somehow, but in
// the meantime, this method will return the larger of BestSize
// MinSize hint.
wxSize GetAdjustedBestSize() const
{
- wxSize s( DoGetBestSize() );
+ wxSize s( GetBestSize() );
return wxSize( wxMax( s.x, GetMinWidth() ), wxMax( s.y, GetMinHeight() ) );
}
+ // This function will merge the window's best size into the window's
+ // minimum size, giving priority to the min size components, and
+ // returns the results.
+ wxSize GetBestFittingSize() const;
+
+ // A 'Smart' SetSize that will fill in default size values with 'best'
+ // size. Sets the minsize to what was passed in.
+ void SetBestFittingSize(const wxSize& size=wxDefaultSize);
+
// the generic centre function - centers the window on parent by`
// default or on screen if it doesn't have parent or
// wxCENTER_ON_SCREEN flag is given
static int WidthDefault(int w) { return w == -1 ? 20 : w; }
static int HeightDefault(int h) { return h == -1 ? 20 : h; }
+
+ // Used to save the results of DoGetBestSize so it doesn't need to be
+ // recalculated each time the value is needed.
+ wxSize m_bestSizeCache;
+
// keep the old name for compatibility, at least until all the internal
// usages of it are changed to SetBestFittingSize
void SetBestSize(const wxSize& size) { SetBestFittingSize(size); }
-
// set the initial window size if none is given (i.e. at least one of the
// components of the size passed to ctor/Create() is -1)
//
// can be accurately calculated
virtual void SetInitialBestSize(const wxSize& WXUNUSED(size)) {}
+
// more pure virtual functions
// ---------------------------
// convert display area to window area, adding the size neccessary for the
// tabs
- return CalcSizeFromPage(bestSize);
+ wxSize best = CalcSizeFromPage(bestSize);
+ CacheBestSize(best);
+ return best;
}
// ----------------------------------------------------------------------------
}
}
+
+void wxControlBase::SetLabel( const wxString &label )
+{
+ InvalidateBestSize();
+ wxWindow::SetLabel(label);
+}
+
+bool wxControlBase::SetFont(const wxFont& font)
+{
+ InvalidateBestSize();
+ return wxWindow::SetFont(font);
+}
+
// ----------------------------------------------------------------------------
// wxStaticBitmap
// ----------------------------------------------------------------------------
wxSize wxStaticBitmapBase::DoGetBestSize() const
{
+ wxSize best;
wxBitmap bmp = GetBitmap();
if ( bmp.Ok() )
- return wxSize(bmp.GetWidth(), bmp.GetHeight());
-
- // this is completely arbitrary
- return wxSize(16, 16);
+ best = wxSize(bmp.GetWidth(), bmp.GetHeight());
+ else
+ // this is completely arbitrary
+ best = wxSize(16, 16);
+ CacheBestSize(best);
+ return best;
}
#endif // wxUSE_STATBMP
if ( IsWindow() && !(m_flag & wxFIXED_MINSIZE) )
{
// Since the size of the window may change during runtime, we
- // should use the current minimal size. If there is a MinSize,
- // use it, otherwise use the BestSize.
- wxSize min = m_window->GetMinSize();
- if (min.x == -1 || min.y == -1)
- {
- wxSize best = m_window->GetBestSize();
- if (min.x == -1) min.x = best.x;
- if (min.y == -1) min.y = best.y;
- }
- m_minSize = min;
+ // should use the current minimal/best size.
+ m_minSize = m_window->GetBestFittingSize();
}
-
ret = m_minSize;
}
wxCoord WXUNUSED(xPos),
wxCoord WXUNUSED(yPos))
{
+ InvalidateBestSize();
return InsertTool(GetToolsCount(), id, label, bitmap, bmpDisabled,
kind, shortHelp, longHelp, clientData);
}
m_minHeight =
m_maxHeight = wxDefaultSize.y;
+ // invalidiated cache value
+ m_bestSizeCache = wxDefaultSize;
+
// window are created enabled and visible by default
m_isShown =
m_isEnabled = true;
{
if ( GetChildren().GetCount() > 0 )
{
- SetClientSize(DoGetBestSize());
+ SetClientSize(GetBestSize());
}
//else: do nothing if we have no children
}
}
}
-void wxWindowBase::SetBestFittingSize(const wxSize& size)
+
+wxSize wxWindowBase::GetBestFittingSize() const
{
- // If the given size is incomplete then merge with the best size.
- wxSize sizeBest;
- if ( size.x == wxDefaultSize.x || size.y == wxDefaultSize.y )
+ // merge the best size with the min size, giving priority to the min size
+ wxSize min = GetMinSize();
+ if (min.x == wxDefaultCoord || min.y == wxDefaultCoord)
{
- sizeBest = DoGetBestSize();
- if ( size.x != wxDefaultSize.x )
- sizeBest.x = size.x;
- if ( size.y != wxDefaultSize.y )
- sizeBest.y = size.y;
- }
- else // have complete explicit size
- {
- sizeBest = size;
+ wxSize best = GetBestSize();
+ if (min.x == wxDefaultCoord) min.x = best.x;
+ if (min.y == wxDefaultCoord) min.y = best.y;
}
+ return min;
+}
- // Change the size if needed
- if (GetSize() != sizeBest)
- SetSize(sizeBest);
- // don't shrink the control below its best size
- m_minWidth = sizeBest.x;
- m_minHeight = sizeBest.y;
+void wxWindowBase::SetBestFittingSize(const wxSize& size)
+{
+ // Set the min size to the size passed in. This will usually either be
+ // wxDefaultSize or the size passed to this window's ctor/Create function.
+ SetMinSize(size);
+
+ // Merge the size with the best size if needed
+ wxSize best = GetBestFittingSize();
+
+ // If the current size doesn't match then change it
+ if (GetSize() != best)
+ SetSize(best);
}
+
// by default the origin is not shifted
wxPoint wxWindowBase::GetClientAreaOrigin() const
{
{
wxCHECK_RET( m_widget != NULL, wxT("invalid bitmap button") );
+ InvalidateBestSize();
+
wxBitmap the_one;
if (!m_isEnabled)
the_one = m_bmpDisabled;
best.x = m_bmpNormal.GetWidth()+border;
best.y = m_bmpNormal.GetHeight()+border;
}
+ CacheBestSize(best);
return best;
}
if (ret.x < 80) ret.x = 80;
}
+ CacheBestSize(ret);
return ret;
}
if (ret.y <= 18)
ret.y = 8 + GetCharHeight();
+ CacheBestSize(ret);
return ret;
}
// empty combobox should have some reasonable default size too
if ( ret.x < 100 )
ret.x = 100;
+
+ CacheBestSize(ret);
return ret;
}
}
m_label << *pc;
}
+ InvalidateBestSize();
}
wxString wxControl::GetLabel() const
(* GTK_WIDGET_CLASS( GTK_OBJECT_GET_CLASS(m_widget) )->size_request )
(m_widget, &req );
- return wxSize(req.width, req.height);
+ wxSize best(req.width, req.height);
+ CacheBestSize(best);
+ return best;
}
wxSize wxGauge::DoGetBestSize() const
{
+ wxSize best;
if (HasFlag(wxGA_VERTICAL))
- return wxSize(28, 100);
+ best = wxSize(28, 100);
else
- return wxSize(100, 28);
+ best = wxSize(100, 28);
+ CacheBestSize(best);
+ return best;
}
void wxGauge::SetRange( int range )
wxASSERT_MSG( m_clientList.GetCount() == (size_t)GetCount(),
wxT("bug in client data management") );
+ InvalidateBestSize();
+
GList *children = m_list->children;
int length = g_list_length(children);
int wxListBox::DoAppend( const wxString& item )
{
+ InvalidateBestSize();
+
if (m_strings)
{
// need to determine the index
// make it too small neither
lbHeight = (cy+4) * wxMin(wxMax(GetCount(), 3), 10);
- return wxSize(lbWidth, lbHeight);
+ wxSize best(lbWidth, lbHeight);
+ CacheBestSize(best);
+ return best;
}
void wxListBox::FixUpMouseEvent(GtkWidget *widget, wxCoord& x, wxCoord& y)
if (req.width > size.x)
size.x = req.width;
+ CacheBestSize(size);
return size;
}
wxSize wxSpinButton::DoGetBestSize() const
{
- return wxSize(15, 26); // FIXME
+ wxSize best(15, 26); // FIXME
+ CacheBestSize(best);
+ return best;
}
// static
wxSize wxSpinCtrl::DoGetBestSize() const
{
wxSize ret( wxControl::DoGetBestSize() );
- return wxSize(95, ret.y);
+ wxSize best(95, ret.y);
+ CacheBestSize(best);
+ return best;
}
// static
gtk_pixmap_set( GTK_PIXMAP(m_widget), m_bitmap.GetPixmap(), mask );
}
- SetBestSize(wxSize(bitmap.GetWidth(), bitmap.GetHeight()));
+ InvalidateBestSize();
+ SetSize(GetBestSize());
}
}
// adjust the label size to the new label unless disabled
if (!HasFlag(wxST_NO_AUTORESIZE))
{
+ InvalidateBestSize();
SetSize( GetBestSize() );
- SetSizeHints(GetSize());
}
}
// adjust the label size to the new label unless disabled
if (!HasFlag(wxST_NO_AUTORESIZE))
{
+ InvalidateBestSize();
SetSize( GetBestSize() );
- SetSizeHints(GetSize());
}
return ret;
}
(* GTK_WIDGET_CLASS( GTK_OBJECT_GET_CLASS(m_widget) )->size_request )
(m_widget, &req );
- return wxSize(req.width, req.height);
+ wxSize best(req.width, req.height);
+ CacheBestSize(best);
+ return best;
}
bool wxStaticText::SetForegroundColour(const wxColour& colour)
(m_widget, &req );
m_width = req.width + m_xMargin;
m_height = req.height + 2*m_yMargin;
+ InvalidateBestSize();
return TRUE;
}
//case wxTOOL_STYLE_SEPARATOR: -- nothing to do
}
+ InvalidateBestSize();
return TRUE;
}
{
// FIXME should be different for multi-line controls...
wxSize ret( wxControl::DoGetBestSize() );
- return wxSize(80, ret.y);
+ wxSize best(80, ret.y);
+ CacheBestSize(best);
+ return best;
}
// ----------------------------------------------------------------------------
wxCHECK_RET(m_widget != NULL, wxT("invalid toggle button"));
m_bitmap = label;
+ InvalidateBestSize();
OnSetBitmap();
}
UpdateWindowUI(wxUPDATE_UI_FROMIDLE);
}
-// wxSize DoGetBestSize() const
+
// Get the "best" size for this control.
wxSize wxToggleBitmapButton::DoGetBestSize() const
{
best.x = m_bitmap.GetWidth()+border;
best.y = m_bitmap.GetHeight()+border;
}
+ CacheBestSize(best);
return best;
}
UpdateWindowUI(wxUPDATE_UI_FROMIDLE);
}
-// wxSize DoGetBestSize() const
+
// Get the "best" size for this control.
wxSize wxToggleButton::DoGetBestSize() const
{
if (ret.x < 80) ret.x = 80;
}
-
- return ret;
+ CacheBestSize(ret);
+ return ret;
}
// static
{
wxCHECK_RET( m_widget != NULL, wxT("invalid bitmap button") );
+ InvalidateBestSize();
+
wxBitmap the_one;
if (!m_isEnabled)
the_one = m_bmpDisabled;
best.x = m_bmpNormal.GetWidth()+border;
best.y = m_bmpNormal.GetHeight()+border;
}
+ CacheBestSize(best);
return best;
}
if (ret.x < 80) ret.x = 80;
}
+ CacheBestSize(ret);
return ret;
}
if (ret.y <= 18)
ret.y = 8 + GetCharHeight();
+ CacheBestSize(ret);
return ret;
}
// empty combobox should have some reasonable default size too
if ( ret.x < 100 )
ret.x = 100;
+
+ CacheBestSize(ret);
return ret;
}
}
m_label << *pc;
}
+ InvalidateBestSize();
}
wxString wxControl::GetLabel() const
(* GTK_WIDGET_CLASS( GTK_OBJECT_GET_CLASS(m_widget) )->size_request )
(m_widget, &req );
- return wxSize(req.width, req.height);
+ wxSize best(req.width, req.height);
+ CacheBestSize(best);
+ return best;
}
wxSize wxGauge::DoGetBestSize() const
{
+ wxSize best;
if (HasFlag(wxGA_VERTICAL))
- return wxSize(28, 100);
+ best = wxSize(28, 100);
else
- return wxSize(100, 28);
+ best = wxSize(100, 28);
+ CacheBestSize(best);
+ return best;
}
void wxGauge::SetRange( int range )
wxASSERT_MSG( m_clientList.GetCount() == (size_t)GetCount(),
wxT("bug in client data management") );
+ InvalidateBestSize();
+
GList *children = m_list->children;
int length = g_list_length(children);
int wxListBox::DoAppend( const wxString& item )
{
+ InvalidateBestSize();
+
if (m_strings)
{
// need to determine the index
// make it too small neither
lbHeight = (cy+4) * wxMin(wxMax(GetCount(), 3), 10);
- return wxSize(lbWidth, lbHeight);
+ wxSize best(lbWidth, lbHeight);
+ CacheBestSize(best);
+ return best;
}
void wxListBox::FixUpMouseEvent(GtkWidget *widget, wxCoord& x, wxCoord& y)
if (req.width > size.x)
size.x = req.width;
+ CacheBestSize(size);
return size;
}
wxSize wxSpinButton::DoGetBestSize() const
{
- return wxSize(15, 26); // FIXME
+ wxSize best(15, 26); // FIXME
+ CacheBestSize(best);
+ return best;
}
// static
wxSize wxSpinCtrl::DoGetBestSize() const
{
wxSize ret( wxControl::DoGetBestSize() );
- return wxSize(95, ret.y);
+ wxSize best(95, ret.y);
+ CacheBestSize(best);
+ return best;
}
// static
gtk_pixmap_set( GTK_PIXMAP(m_widget), m_bitmap.GetPixmap(), mask );
}
- SetBestSize(wxSize(bitmap.GetWidth(), bitmap.GetHeight()));
+ InvalidateBestSize();
+ SetSize(GetBestSize());
}
}
// adjust the label size to the new label unless disabled
if (!HasFlag(wxST_NO_AUTORESIZE))
{
+ InvalidateBestSize();
SetSize( GetBestSize() );
- SetSizeHints(GetSize());
}
}
// adjust the label size to the new label unless disabled
if (!HasFlag(wxST_NO_AUTORESIZE))
{
+ InvalidateBestSize();
SetSize( GetBestSize() );
- SetSizeHints(GetSize());
}
return ret;
}
(* GTK_WIDGET_CLASS( GTK_OBJECT_GET_CLASS(m_widget) )->size_request )
(m_widget, &req );
- return wxSize(req.width, req.height);
+ wxSize best(req.width, req.height);
+ CacheBestSize(best);
+ return best;
}
bool wxStaticText::SetForegroundColour(const wxColour& colour)
(m_widget, &req );
m_width = req.width + m_xMargin;
m_height = req.height + 2*m_yMargin;
+ InvalidateBestSize();
return TRUE;
}
//case wxTOOL_STYLE_SEPARATOR: -- nothing to do
}
+ InvalidateBestSize();
return TRUE;
}
{
// FIXME should be different for multi-line controls...
wxSize ret( wxControl::DoGetBestSize() );
- return wxSize(80, ret.y);
+ wxSize best(80, ret.y);
+ CacheBestSize(best);
+ return best;
}
// ----------------------------------------------------------------------------
wxCHECK_RET(m_widget != NULL, wxT("invalid toggle button"));
m_bitmap = label;
+ InvalidateBestSize();
OnSetBitmap();
}
UpdateWindowUI(wxUPDATE_UI_FROMIDLE);
}
-// wxSize DoGetBestSize() const
+
// Get the "best" size for this control.
wxSize wxToggleBitmapButton::DoGetBestSize() const
{
best.x = m_bitmap.GetWidth()+border;
best.y = m_bitmap.GetHeight()+border;
}
+ CacheBestSize(best);
return best;
}
UpdateWindowUI(wxUPDATE_UI_FROMIDLE);
}
-// wxSize DoGetBestSize() const
+
// Get the "best" size for this control.
wxSize wxToggleButton::DoGetBestSize() const
{
if (ret.x < 80) ret.x = 80;
}
-
- return ret;
+ CacheBestSize(ret);
+ return ret;
}
// static
void wxBitmapButton::SetBitmapLabel(const wxBitmap& bitmap)
{
m_bmpNormal = bitmap;
+ InvalidateBestSize();
ControlButtonContentInfo info ;
wxMacCreateBitmapButton( &info , m_bmpNormal ) ;
int wxListBox::DoAppend(const wxString& item)
{
+ InvalidateBestSize();
+
int index = m_noItems ;
m_stringArray.Add( item ) ;
m_dataArray.Add( NULL );
wxCHECK_RET( pos >= 0 && pos <= m_noItems,
wxT("invalid index in wxListBox::InsertItems") );
+ InvalidateBestSize();
+
int nItems = items.GetCount();
for ( int i = 0 ; i < nItems ; i++ )
void wxStaticBitmap::SetBitmap(const wxBitmap& bitmap)
{
m_bitmap = bitmap;
+ InvalidateBestSize();
SetSize(GetBestSize());
Refresh() ;
}
if ( !(GetWindowStyle() & wxST_NO_AUTORESIZE) )
{
+ InvalidateBestSize();
SetSize( GetBestSize() ) ;
- SetSizeHints(GetSize());
}
Update() ;
{
if ( !(GetWindowStyle() & wxST_NO_AUTORESIZE) )
{
+ InvalidateBestSize();
SetSize( GetBestSize() );
- SetSizeHints(GetSize());
}
}
}
SetSize( maxWidth, maxHeight );
+ InvalidateBestSize();
return TRUE;
}
{
// nothing special to do here - we relayout in Realize() later
tool->Attach(this);
+ InvalidateBestSize();
return TRUE;
}
tool2->SetPosition( pt ) ;
}
+ InvalidateBestSize();
return TRUE ;
}
void wxBitmapButton::SetBitmapLabel(const wxBitmap& bitmap)
{
m_bmpNormal = bitmap;
+ InvalidateBestSize();
ControlButtonContentInfo info ;
wxMacCreateBitmapButton( &info , m_bmpNormal ) ;
int wxListBox::DoAppend(const wxString& item)
{
+ InvalidateBestSize();
+
int index = m_noItems ;
m_stringArray.Add( item ) ;
m_dataArray.Add( NULL );
wxCHECK_RET( pos >= 0 && pos <= m_noItems,
wxT("invalid index in wxListBox::InsertItems") );
+ InvalidateBestSize();
+
int nItems = items.GetCount();
for ( int i = 0 ; i < nItems ; i++ )
void wxStaticBitmap::SetBitmap(const wxBitmap& bitmap)
{
m_bitmap = bitmap;
+ InvalidateBestSize();
SetSize(wxSize(bitmap.GetWidth(), bitmap.GetHeight()));
Refresh() ;
}
{
// temporary fix until layout measurement and drawing are in synch again
Refresh() ;
+ InvalidateBestSize();
SetSize( GetBestSize() ) ;
}
Refresh() ;
if ( !(GetWindowStyle() & wxST_NO_AUTORESIZE) )
{
// temporary fix until layout measurement and drawing are in synch again
- Refresh() ;
+ Refresh() ;
+ InvalidateBestSize();
SetSize( GetBestSize() );
}
}
}
SetSize(maxWidth, maxHeight);
+ InvalidateBestSize();
return TRUE;
}
{
// nothing special to do here - we relayout in Realize() later
tool->Attach(this);
+ InvalidateBestSize();
return TRUE;
}
tool2->SetPosition( pt ) ;
}
+ InvalidateBestSize();
return TRUE ;
}
m_marginY = wxDEFAULT_BUTTON_MARGIN;
}
- int x = pos.x;
- int y = pos.y;
- int width = size.x;
- int height = size.y;
-
if (id == -1)
m_windowId = NewControlId();
else
m_windowId = id;
- if ( bitmap.Ok() )
- {
- wxSize newSize = DoGetBestSize();
- if ( width == -1 )
- width = newSize.x;
- if ( height == -1 )
- height = newSize.y;
- }
-
long msStyle = WS_VISIBLE | WS_TABSTOP | WS_CHILD | BS_OWNERDRAW ;
if ( m_windowStyle & wxCLIP_SIBLINGS )
// Subclass again for purposes of dialog editing mode
SubclassWin(m_hWnd);
- SetFont(parent->GetFont());
-
- SetSize(x, y, width, height);
+ SetPosition(pos);
+ SetBestSize(size);
return true;
}
int wxListBox::DoAppend(const wxString& item)
{
+ InvalidateBestSize();
+
int index = ListBox_AddString(GetHwnd(), item);
m_noItems++;
wxCHECK_RET( pos >= 0 && pos <= m_noItems,
wxT("invalid index in wxListBox::InsertItems") );
+ InvalidateBestSize();
+
int nItems = items.GetCount();
for ( int i = 0; i < nItems; i++ )
{
{
wxGDIImage* convertedImage = ConvertImage( *image );
SetImageNoCopy( convertedImage );
+ InvalidateBestSize();
}
void wxStaticBitmap::SetImageNoCopy( wxGDIImage* image)
// disabled
if ( !(GetWindowStyle() & wxST_NO_AUTORESIZE) )
{
+ InvalidateBestSize();
DoSetSize(-1, -1, -1, -1, wxSIZE_AUTO_WIDTH | wxSIZE_AUTO_HEIGHT);
- SetSizeHints(GetSize());
}
}
// disabled
if ( !(GetWindowStyle() & wxST_NO_AUTORESIZE) )
{
+ InvalidateBestSize();
DoSetSize(-1, -1, -1, -1, wxSIZE_AUTO_WIDTH | wxSIZE_AUTO_HEIGHT);
- SetSizeHints(GetSize());
}
return ret;
// Realize() later
tool->Attach(this);
+ InvalidateBestSize();
return TRUE;
}
}
}
+ InvalidateBestSize();
return TRUE;
}
}
}
+ InvalidateBestSize();
return TRUE;
}
GetBestSizeTuple);
+ DocDeclStr(
+ void , InvalidateBestSize(),
+ "Reset the cached best size value so it will be recalculated the next
+time it is needed.", "");
+
+
+
+ DocDeclStr(
+ wxSize , GetBestFittingSize() const,
+ "This function will merge the window's best size into the window's
+minimum size, giving priority to the min size components, and returns
+the results.
+", "");
+
+
DocDeclStr(
wxSize , GetAdjustedBestSize() const,
"This method is similar to GetBestSize, except in one
be reset back to default.", "");
DocDeclStr(
- wxCursor& , GetCursor(),
+ wxCursor , GetCursor(),
"Return the cursor associated with this window.", "");
DocDeclStr(
- wxFont& , GetFont(),
+ wxFont , GetFont(),
"Returns the default font used for this window.", "");