- DECLARE_DYNAMIC_CLASS(wxSizer)
-
- private:
- protected:
- wxSizerBehaviour sizerBehaviour;
- int borderX;
- int borderY;
- int sizerWidth;
- int sizerHeight;
- int sizerX;
- int sizerY;
- public:
- wxSizer();
- wxSizer(wxWindow *parent, wxSizerBehaviour behav = wxSizerNone);
- ~wxSizer();
-
- bool Create(wxWindow *parent, wxSizerBehaviour behav = wxSizerNone);
- virtual void SetSize(int x, int y, int w, int h, int flags = wxSIZE_AUTO);
- // Avoid compiler warning
- void SetSize(int w, int h) { wxWindow::SetSize(w, h); }
- virtual void Move(int x, int y);
- virtual void GetSize(int *w, int *h) const;
- inline virtual void GetClientSize(int *w, int *h) const { GetSize(w, h); }
- virtual void GetPosition(int *x, int *y) const;
-
- inline void SizerSetSize(int x, int y, int w, int h)
- { SetSize(x, y, w, h); }
- inline void SizerMove(int x, int y)
- { Move(x, y); }
-
- virtual void SetBorder(int w, int h);
- inline int GetBorderX() { return borderX ; }
- inline int GetBorderY() { return borderY ; }
-
- virtual void AddSizerChild(wxWindow *child);
- virtual void RemoveSizerChild(wxWindow *child);
-
- inline virtual void SetBehaviour(wxSizerBehaviour b) { sizerBehaviour = b; }
- inline virtual wxSizerBehaviour GetBehaviour() { return sizerBehaviour; }
-
- virtual bool LayoutPhase1(int *);
- virtual bool LayoutPhase2(int *);
+public:
+ wxIndividualLayoutConstraint();
+
+ // note that default copy ctor and assignment operators are ok
+
+ virtual ~wxIndividualLayoutConstraint(){}
+
+ void Set(wxRelationship rel, wxWindowBase *otherW, wxEdge otherE, int val = 0, int marg = wxLAYOUT_DEFAULT_MARGIN);
+
+ //
+ // Sibling relationships
+ //
+ void LeftOf(wxWindowBase *sibling, int marg = wxLAYOUT_DEFAULT_MARGIN);
+ void RightOf(wxWindowBase *sibling, int marg = wxLAYOUT_DEFAULT_MARGIN);
+ void Above(wxWindowBase *sibling, int marg = wxLAYOUT_DEFAULT_MARGIN);
+ void Below(wxWindowBase *sibling, int marg = wxLAYOUT_DEFAULT_MARGIN);
+
+ //
+ // 'Same edge' alignment
+ //
+ void SameAs(wxWindowBase *otherW, wxEdge edge, int marg = wxLAYOUT_DEFAULT_MARGIN);
+
+ // The edge is a percentage of the other window's edge
+ void PercentOf(wxWindowBase *otherW, wxEdge wh, int per);
+
+ //
+ // Edge has absolute value
+ //
+ void Absolute(int val);
+
+ //
+ // Dimension is unconstrained
+ //
+ void Unconstrained() { relationship = wxUnconstrained; }
+
+ //
+ // Dimension is 'as is' (use current size settings)
+ //
+ void AsIs() { relationship = wxAsIs; }
+
+ //
+ // Accessors
+ //
+ wxWindowBase *GetOtherWindow() { return otherWin; }
+ wxEdge GetMyEdge() const { return myEdge; }
+ void SetEdge(wxEdge which) { myEdge = which; }
+ void SetValue(int v) { value = v; }
+ int GetMargin() { return margin; }
+ void SetMargin(int m) { margin = m; }
+ int GetValue() const { return value; }
+ int GetPercent() const { return percent; }
+ int GetOtherEdge() const { return otherEdge; }
+ bool GetDone() const { return done; }
+ void SetDone(bool d) { done = d; }
+ wxRelationship GetRelationship() { return relationship; }
+ void SetRelationship(wxRelationship r) { relationship = r; }
+
+ // Reset constraint if it mentions otherWin
+ bool ResetIfWin(wxWindowBase *otherW);
+
+ // Try to satisfy constraint
+ bool SatisfyConstraint(wxLayoutConstraints *constraints, wxWindowBase *win);
+
+ // 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)