projects
/
wxWidgets.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Set mouse cursor correctly over image map links in wxHTML.
[wxWidgets.git]
/
include
/
wx
/
sizer.h
diff --git
a/include/wx/sizer.h
b/include/wx/sizer.h
index 6d414fd09d20308b3cc8a22ee7d0a3e1d33fb5b0..e11720a4e04b389b57de4ad8dac73d909bb7d88e 100644
(file)
--- a/
include/wx/sizer.h
+++ b/
include/wx/sizer.h
@@
-125,6
+125,10
@@
public:
wxSizerFlags& Border(int direction, int borderInPixels)
{
wxSizerFlags& Border(int direction, int borderInPixels)
{
+ wxCHECK_MSG( !(direction & ~wxALL), *this,
+ wxS("direction must be a combination of wxDirection ")
+ wxS("enum values.") );
+
m_flags &= ~wxALL;
m_flags |= direction;
m_flags &= ~wxALL;
m_flags |= direction;
@@
-251,10
+255,10
@@
class WXDLLIMPEXP_CORE wxSizerItem : public wxObject
public:
// window
wxSizerItem( wxWindow *window,
public:
// window
wxSizerItem( wxWindow *window,
- int proportion,
- int flag,
- int border,
- wxObject* userData );
+ int proportion
=0
,
+ int flag
=0
,
+ int border
=0
,
+ wxObject* userData
=NULL
);
// window with flags
wxSizerItem(wxWindow *window, const wxSizerFlags& flags)
// window with flags
wxSizerItem(wxWindow *window, const wxSizerFlags& flags)
@@
-266,10
+270,10
@@
public:
// subsizer
wxSizerItem( wxSizer *sizer,
// subsizer
wxSizerItem( wxSizer *sizer,
- int proportion,
- int flag,
- int border,
- wxObject* userData );
+ int proportion
=0
,
+ int flag
=0
,
+ int border
=0
,
+ wxObject* userData
=NULL
);
// sizer with flags
wxSizerItem(wxSizer *sizer, const wxSizerFlags& flags)
// sizer with flags
wxSizerItem(wxSizer *sizer, const wxSizerFlags& flags)
@@
-282,10
+286,10
@@
public:
// spacer
wxSizerItem( int width,
int height,
// spacer
wxSizerItem( int width,
int height,
- int proportion,
- int flag,
- int border,
- wxObject* userData);
+ int proportion
=0
,
+ int flag
=0
,
+ int border
=0
,
+ wxObject* userData
=NULL
);
// spacer with flags
wxSizerItem(int width, int height, const wxSizerFlags& flags)
// spacer with flags
wxSizerItem(int width, int height, const wxSizerFlags& flags)
@@
-311,6
+315,10
@@
public:
{ return m_minSize; }
wxSize GetMinSizeWithBorder() const;
{ return m_minSize; }
wxSize GetMinSizeWithBorder() const;
+ wxSize GetMaxSize() const
+ { return IsWindow() ? m_window->GetMaxSize() : wxDefaultSize; }
+ wxSize GetMaxSizeWithBorder() const;
+
void SetMinSize(const wxSize& size)
{
if ( IsWindow() )
void SetMinSize(const wxSize& size)
{
if ( IsWindow() )
@@
-436,6
+444,10
@@
protected:
void DoSetSizer(wxSizer *sizer);
void DoSetSpacer(const wxSize& size);
void DoSetSizer(wxSizer *sizer);
void DoSetSpacer(const wxSize& size);
+ // Add the border specified for this item to the given size
+ // if it's != wxDefaultSize, just return wxDefaultSize otherwise.
+ wxSize AddBorderToSize(const wxSize& size) const;
+
// discriminated union: depending on m_kind one of the fields is valid
enum
{
// discriminated union: depending on m_kind one of the fields is valid
enum
{
@@
-601,7
+613,7
@@
public:
virtual void DeleteWindows();
// Inform sizer about the first direction that has been decided (by parent item)
virtual void DeleteWindows();
// Inform sizer about the first direction that has been decided (by parent item)
- // Returns true if it made use of the informtion (and recalculated min size)
+ // Returns true if it made use of the inform
a
tion (and recalculated min size)
virtual bool InformFirstDirection( int WXUNUSED(direction), int WXUNUSED(size), int WXUNUSED(availableOtherDir) )
{ return false; }
virtual bool InformFirstDirection( int WXUNUSED(direction), int WXUNUSED(size), int WXUNUSED(availableOtherDir) )
{ return false; }
@@
-665,6
+677,10
@@
public:
m_position = pos;
m_size = size;
Layout();
m_position = pos;
m_size = size;
Layout();
+
+ // This call is required for wxWrapSizer to be able to calculate its
+ // minimal size correctly.
+ InformFirstDirection(wxHORIZONTAL, size.x, size.y);
}
void SetDimension(int x, int y, int width, int height)
{ SetDimension(wxPoint(x, y), wxSize(width, height)); }
}
void SetDimension(int x, int y, int width, int height)
{ SetDimension(wxPoint(x, y), wxSize(width, height)); }
@@
-699,6
+715,10
@@
public:
void Show(bool show) { ShowItems(show); }
void Show(bool show) { ShowItems(show); }
+ // This is the ShowItems() counterpart and returns true if any of the sizer
+ // items are shown.
+ virtual bool AreAnyItemsShown() const;
+
protected:
wxSize m_size;
wxSize m_minSize;
protected:
wxSize m_size;
wxSize m_minSize;
@@
-794,7
+814,7
@@
protected:
"Can't calculate number of cols if number of rows is not specified"
);
"Can't calculate number of cols if number of rows is not specified"
);
- return (m_children.GetCount() + m_rows - 1) / m_rows;
+ return
int
(m_children.GetCount() + m_rows - 1) / m_rows;
}
int CalcRows() const
}
int CalcRows() const
@@
-805,7
+825,7
@@
protected:
"Can't calculate number of cols if number of rows is not specified"
);
"Can't calculate number of cols if number of rows is not specified"
);
- return (m_children.GetCount() + m_cols - 1) / m_cols;
+ return
int
(m_children.GetCount() + m_cols - 1) / m_cols;
}
private:
}
private:
@@
-1017,6
+1037,7
@@
public:
// override to hide/show the static box as well
virtual void ShowItems (bool show);
// override to hide/show the static box as well
virtual void ShowItems (bool show);
+ virtual bool AreAnyItemsShown() const;
virtual bool Detach( wxWindow *window );
virtual bool Detach( wxSizer *sizer ) { return wxBoxSizer::Detach(sizer); }
virtual bool Detach( wxWindow *window );
virtual bool Detach( wxSizer *sizer ) { return wxBoxSizer::Detach(sizer); }