X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/a3622daa901777a33969d8bc04e2d62dee14d164..6b769f3d1f81ffebba557208083a1fc161dfbe23:/src/common/layout.cpp diff --git a/src/common/layout.cpp b/src/common/layout.cpp index 3ac377c21b..e8f22391a6 100644 --- a/src/common/layout.cpp +++ b/src/common/layout.cpp @@ -22,13 +22,12 @@ #include "wx/defs.h" -#if USE_CONSTRAINTS - #ifndef WX_PRECOMP #include "wx/window.h" #include "wx/utils.h" #include "wx/dialog.h" #include "wx/msgdlg.h" +#include #endif #include "wx/layout.h" @@ -91,7 +90,7 @@ int wxSizerMarginY(wxWindow *win) wxIndividualLayoutConstraint::wxIndividualLayoutConstraint() { myEdge = wxTop; relationship = wxUnconstrained; margin = 0; value = 0; percent = 0; otherEdge = wxTop; - done = FALSE; otherWin = NULL; + done = FALSE; otherWin = (wxWindow *) NULL; } wxIndividualLayoutConstraint::~wxIndividualLayoutConstraint() @@ -139,7 +138,7 @@ bool wxIndividualLayoutConstraint::ResetIfWin(wxWindow *otherW) if (otherW == otherWin) { myEdge = wxTop; relationship = wxAsIs; margin = 0; value = 0; percent = 0; otherEdge = wxTop; - otherWin = NULL; + otherWin = (wxWindow *) NULL; return TRUE; } else @@ -730,7 +729,7 @@ int wxIndividualLayoutConstraint::GetEdge(wxEdge which, // know the dimension is obtainable immediately. // E.g. a wxExpandSizer may contain a button (but the button's // true parent is a panel, not the sizer) - if (other->GetChildren()->Member(thisWin)) + if (other->GetChildren().Member(thisWin)) { switch (which) { @@ -1053,7 +1052,7 @@ bool wxOldDoLayout(wxWindow *win) doneSoFar.Append(win); - wxNode *node = win->GetChildren()->First(); + wxNode *node = win->GetChildren().First(); while (node) { wxWindow *child = (wxWindow *)node->Data(); @@ -1078,7 +1077,7 @@ bool wxOldDoLayout(wxWindow *win) while ((noChanges > 0) && (noIterations < maxIterations)) { noChanges = 0; - wxNode *node = win->GetChildren()->First(); + wxNode *node = win->GetChildren().First(); while (node) { wxWindow *child = (wxWindow *)node->Data(); @@ -1098,12 +1097,12 @@ bool wxOldDoLayout(wxWindow *win) // failed, so we can print a specific diagnostic message. if (noFailures > 0) { - wxDebugMsg("wxWindow::Layout() failed.\n"); + wxDebugMsg(_("wxWindow::Layout() failed.\n")); } */ // Now set the sizes and positions of the children, and // recursively call Layout(). - node = win->GetChildren()->First(); + node = win->GetChildren().First(); while (node) { wxWindow *child = (wxWindow *)node->Data(); @@ -1202,7 +1201,7 @@ wxSizer::~wxSizer() { // Remove all children without deleting them, // or ~wxbWindow will delete proper windows _twice_ - wxNode *node = GetChildren()->First(); + wxNode *node = GetChildren().First(); while (node) { wxNode *next = node->Next(); @@ -1210,7 +1209,7 @@ wxSizer::~wxSizer() if (!win->IsKindOf(CLASSINFO(wxSizer))) { delete node; - win->SetSizerParent(NULL); + win->SetSizerParent((wxWindow *) NULL); } else { @@ -1222,8 +1221,8 @@ wxSizer::~wxSizer() if (m_sizerParent) // && !m_sizerParent->IsKindOf(CLASSINFO(wxSizer))) { - m_sizerParent->SetSizer(NULL); - m_sizerParent = NULL; + m_sizerParent->SetSizer((wxSizer *) NULL); + m_sizerParent = (wxWindow *) NULL; } } @@ -1248,7 +1247,7 @@ void wxSizer::SetBorder(int x, int y) void wxSizer::AddSizerChild(wxWindow *child) { child->SetSizerParent(this); - GetChildren()->Append(child); + GetChildren().Append(child); // Add some constraints for the purpose of storing // the relative position of the window/sizer @@ -1271,10 +1270,10 @@ void wxSizer::AddSizerChild(wxWindow *child) void wxSizer::RemoveSizerChild(wxWindow *child) { - GetChildren()->DeleteObject(child); + GetChildren().DeleteObject(child); } -void wxSizer::SetSize(int x, int y, int w, int h, int WXUNUSED(flags)) +void wxSizer::DoSetSize(int x, int y, int w, int h, int WXUNUSED(flags)) { wxLayoutConstraints *constr = GetConstraints(); if (x != -1) @@ -1303,23 +1302,6 @@ void wxSizer::SetSize(int x, int y, int w, int h, int WXUNUSED(flags)) } } -void wxSizer::Move(int x, int y) -{ - wxLayoutConstraints *constr = GetConstraints(); - if (x != -1) - { - sizerX = x; - if (constr) - constr->left.SetValue(x); - } - if (y != -1) - { - sizerY = y; - if (constr) - constr->top.SetValue(y); - } -} - void wxSizer::GetSize(int *w, int *h) const { *w = sizerWidth; @@ -1341,7 +1323,7 @@ bool wxSizer::LayoutPhase1(int *noChanges) { if (!m_sizerParent) { - wxMessageBox("wxExpandSizer has no parent!", "Sizer error", wxOK); + wxMessageBox(_("wxExpandSizer has no parent!"), _("Sizer error"), wxOK); return TRUE; } @@ -1381,7 +1363,7 @@ bool wxSizer::LayoutPhase1(int *noChanges) // Find the bounding box and set own size int maxX = 0; int maxY = 0; - wxNode *node = GetChildren()->First(); + wxNode *node = GetChildren().First(); while (node) { int x, y, width, height; @@ -1518,11 +1500,6 @@ wxRowColSizer::~wxRowColSizer() { } -void wxRowColSizer::SetSize(int x, int y, int w, int h, int flags) -{ - wxSizer::SetSize(x, y, w, h, flags); -} - bool wxRowColSizer::LayoutPhase1(int *noChanges) { *noChanges = 0; @@ -1579,7 +1556,7 @@ bool wxRowColSizer::LayoutPhase1(int *noChanges) int maxX = currentX; int maxY = currentY; - wxNode *node = GetChildren()->First(); + wxNode *node = GetChildren().First(); while (node) { wxWindow *win = (wxWindow *)node->Data(); @@ -1743,6 +1720,3 @@ wxSpacingSizer::~wxSpacingSizer() { } - - -#endif