X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/3417c2cd3d5cb05451270b5a09fe2355406158a3..8f5a042b12a084755eace706529f0e4f9774cc0c:/include/wx/layout.h diff --git a/include/wx/layout.h b/include/wx/layout.h index e3e5353ce7..c46241c1d8 100644 --- a/include/wx/layout.h +++ b/include/wx/layout.h @@ -6,7 +6,7 @@ // Created: 29/01/98 // RCS-ID: $Id$ // Copyright: (c) 1998 Julian Smart -// Licence: wxWindows license +// Licence: wxWindows licence ///////////////////////////////////////////////////////////////////////////// #ifndef _WX_LAYOUTH__ @@ -16,11 +16,11 @@ // headers // ---------------------------------------------------------------------------- -#ifdef __GNUG__ +#if defined(__GNUG__) && !defined(__APPLE__) #pragma interface "layout.h" #endif -#include "wx/defs.h" +#include "wx/object.h" // X stupidly defines these in X.h #ifdef Above @@ -68,25 +68,11 @@ enum wxRelationship class WXDLLEXPORT wxIndividualLayoutConstraint : public wxObject { - DECLARE_DYNAMIC_CLASS(wxIndividualLayoutConstraint) - -protected: - // To be allowed to modify the internal variables - friend class wxIndividualLayoutConstraint_Serialize; - - // 'This' window is the parent or sibling of otherWin - wxWindowBase *otherWin; - - wxEdge myEdge; - wxRelationship relationship; - int margin; - int value; - int percent; - wxEdge otherEdge; - bool done; - public: wxIndividualLayoutConstraint(); + + // note that default copy ctor and assignment operators are ok + ~wxIndividualLayoutConstraint(); void Set(wxRelationship rel, wxWindowBase *otherW, wxEdge otherE, int val = 0, int marg = wxLAYOUT_DEFAULT_MARGIN); @@ -148,6 +134,23 @@ public: // Get the value of this edge or dimension, or if this // is not determinable, -1. int GetEdge(wxEdge which, wxWindowBase *thisWin, wxWindowBase *other) const; + +protected: + // To be allowed to modify the internal variables + friend class wxIndividualLayoutConstraint_Serialize; + + // 'This' window is the parent or sibling of otherWin + wxWindowBase *otherWin; + + wxEdge myEdge; + wxRelationship relationship; + int margin; + int value; + int percent; + wxEdge otherEdge; + bool done; + + DECLARE_DYNAMIC_CLASS(wxIndividualLayoutConstraint) }; // ---------------------------------------------------------------------------- @@ -156,8 +159,6 @@ public: class WXDLLEXPORT wxLayoutConstraints : public wxObject { - DECLARE_DYNAMIC_CLASS(wxLayoutConstraints) - public: // Edge constraints wxIndividualLayoutConstraint left; @@ -172,14 +173,19 @@ public: wxIndividualLayoutConstraint centreY; wxLayoutConstraints(); + + // note that default copy ctor and assignment operators are ok + ~wxLayoutConstraints(); bool SatisfyConstraints(wxWindowBase *win, int *noChanges); bool AreSatisfied() const { - return left.GetDone() && top.GetDone() && right.GetDone() && - bottom.GetDone() && centreX.GetDone() && centreY.GetDone(); + return left.GetDone() && top.GetDone() && + width.GetDone() && height.GetDone(); } + + DECLARE_DYNAMIC_CLASS(wxLayoutConstraints) }; #endif