X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/92a19c2e7757ba742846f83e56356de0a607bdc2..9a90985d5f2d7e0cd0e458bb3efba709a6166cbb:/contrib/src/ogl/constrnt.cpp diff --git a/contrib/src/ogl/constrnt.cpp b/contrib/src/ogl/constrnt.cpp index c2addad443..98e9e6ffde 100644 --- a/contrib/src/ogl/constrnt.cpp +++ b/contrib/src/ogl/constrnt.cpp @@ -24,7 +24,7 @@ #include #endif -#include +#include #include #include @@ -58,51 +58,51 @@ void OGLInitializeConstraintTypes() wxOGLConstraintTypes = new wxList(wxKEY_INTEGER); wxOGLConstraintTypes->Append(gyCONSTRAINT_CENTRED_VERTICALLY, - new wxOGLConstraintType(gyCONSTRAINT_CENTRED_VERTICALLY, "Centre vertically", "centred vertically w.r.t.")); + new wxOGLConstraintType(gyCONSTRAINT_CENTRED_VERTICALLY, wxT("Centre vertically"), wxT("centred vertically w.r.t."))); wxOGLConstraintTypes->Append(gyCONSTRAINT_CENTRED_HORIZONTALLY, - new wxOGLConstraintType(gyCONSTRAINT_CENTRED_HORIZONTALLY, "Centre horizontally", "centred horizontally w.r.t.")); + new wxOGLConstraintType(gyCONSTRAINT_CENTRED_HORIZONTALLY, wxT("Centre horizontally"), wxT("centred horizontally w.r.t."))); wxOGLConstraintTypes->Append(gyCONSTRAINT_CENTRED_BOTH, - new wxOGLConstraintType(gyCONSTRAINT_CENTRED_BOTH, "Centre", "centred w.r.t.")); + new wxOGLConstraintType(gyCONSTRAINT_CENTRED_BOTH, wxT("Centre"), wxT("centred w.r.t."))); wxOGLConstraintTypes->Append(gyCONSTRAINT_LEFT_OF, - new wxOGLConstraintType(gyCONSTRAINT_LEFT_OF, "Left of", "left of")); + new wxOGLConstraintType(gyCONSTRAINT_LEFT_OF, wxT("Left of"), wxT("left of"))); wxOGLConstraintTypes->Append(gyCONSTRAINT_RIGHT_OF, - new wxOGLConstraintType(gyCONSTRAINT_RIGHT_OF, "Right of", "right of")); + new wxOGLConstraintType(gyCONSTRAINT_RIGHT_OF, wxT("Right of"), wxT("right of"))); wxOGLConstraintTypes->Append(gyCONSTRAINT_ABOVE, - new wxOGLConstraintType(gyCONSTRAINT_ABOVE, "Above", "above")); + new wxOGLConstraintType(gyCONSTRAINT_ABOVE, wxT("Above"), wxT("above"))); wxOGLConstraintTypes->Append(gyCONSTRAINT_BELOW, - new wxOGLConstraintType(gyCONSTRAINT_BELOW, "Below", "below")); + new wxOGLConstraintType(gyCONSTRAINT_BELOW, wxT("Below"), wxT("below"))); // Alignment wxOGLConstraintTypes->Append(gyCONSTRAINT_ALIGNED_TOP, - new wxOGLConstraintType(gyCONSTRAINT_ALIGNED_TOP, "Top-aligned", "aligned to the top of")); + new wxOGLConstraintType(gyCONSTRAINT_ALIGNED_TOP, wxT("Top-aligned"), wxT("aligned to the top of"))); wxOGLConstraintTypes->Append(gyCONSTRAINT_ALIGNED_BOTTOM, - new wxOGLConstraintType(gyCONSTRAINT_ALIGNED_BOTTOM, "Bottom-aligned", "aligned to the bottom of")); + new wxOGLConstraintType(gyCONSTRAINT_ALIGNED_BOTTOM, wxT("Bottom-aligned"), wxT("aligned to the bottom of"))); wxOGLConstraintTypes->Append(gyCONSTRAINT_ALIGNED_LEFT, - new wxOGLConstraintType(gyCONSTRAINT_ALIGNED_LEFT, "Left-aligned", "aligned to the left of")); + new wxOGLConstraintType(gyCONSTRAINT_ALIGNED_LEFT, wxT("Left-aligned"), wxT("aligned to the left of"))); wxOGLConstraintTypes->Append(gyCONSTRAINT_ALIGNED_RIGHT, - new wxOGLConstraintType(gyCONSTRAINT_ALIGNED_RIGHT, "Right-aligned", "aligned to the right of")); + new wxOGLConstraintType(gyCONSTRAINT_ALIGNED_RIGHT, wxT("Right-aligned"), wxT("aligned to the right of"))); // Mid-alignment wxOGLConstraintTypes->Append(gyCONSTRAINT_MIDALIGNED_TOP, - new wxOGLConstraintType(gyCONSTRAINT_MIDALIGNED_TOP, "Top-midaligned", "centred on the top of")); + new wxOGLConstraintType(gyCONSTRAINT_MIDALIGNED_TOP, wxT("Top-midaligned"), wxT("centred on the top of"))); wxOGLConstraintTypes->Append(gyCONSTRAINT_MIDALIGNED_BOTTOM, - new wxOGLConstraintType(gyCONSTRAINT_MIDALIGNED_BOTTOM, "Bottom-midaligned", "centred on the bottom of")); + new wxOGLConstraintType(gyCONSTRAINT_MIDALIGNED_BOTTOM, wxT("Bottom-midaligned"), wxT("centred on the bottom of"))); wxOGLConstraintTypes->Append(gyCONSTRAINT_MIDALIGNED_LEFT, - new wxOGLConstraintType(gyCONSTRAINT_MIDALIGNED_LEFT, "Left-midaligned", "centred on the left of")); + new wxOGLConstraintType(gyCONSTRAINT_MIDALIGNED_LEFT, wxT("Left-midaligned"), wxT("centred on the left of"))); wxOGLConstraintTypes->Append(gyCONSTRAINT_MIDALIGNED_RIGHT, - new wxOGLConstraintType(gyCONSTRAINT_MIDALIGNED_RIGHT, "Right-midaligned", "centred on the right of")); + new wxOGLConstraintType(gyCONSTRAINT_MIDALIGNED_RIGHT, wxT("Right-midaligned"), wxT("centred on the right of"))); } void OGLCleanUpConstraintTypes() @@ -110,12 +110,12 @@ void OGLCleanUpConstraintTypes() if (!wxOGLConstraintTypes) return; - wxNode* node = wxOGLConstraintTypes->First(); + wxNode* node = wxOGLConstraintTypes->GetFirst(); while (node) { - wxOGLConstraintType* ct = (wxOGLConstraintType*) node->Data(); + wxOGLConstraintType* ct = (wxOGLConstraintType*) node->GetData(); delete ct; - node = node->Next(); + node = node->GetNext(); } delete wxOGLConstraintTypes; wxOGLConstraintTypes = NULL; @@ -137,13 +137,13 @@ wxOGLConstraint::wxOGLConstraint(int type, wxShape *constraining, wxList& constr m_constrainingObject = constraining; m_constraintId = 0; - m_constraintName = "noname"; + m_constraintName = wxT("noname"); - wxNode *node = constrained.First(); + wxNode *node = constrained.GetFirst(); while (node) { - m_constrainedObjects.Append(node->Data()); - node = node->Next(); + m_constrainedObjects.Append(node->GetData()); + node = node->GetNext(); } } @@ -175,17 +175,17 @@ bool wxOGLConstraint::Evaluate() { case gyCONSTRAINT_CENTRED_VERTICALLY: { - int n = m_constrainedObjects.Number(); + int n = m_constrainedObjects.GetCount(); double totalObjectHeight = 0.0; - wxNode *node = m_constrainedObjects.First(); + wxNode *node = m_constrainedObjects.GetFirst(); while (node) { - wxShape *constrainedObject = (wxShape *)node->Data(); + wxShape *constrainedObject = (wxShape *)node->GetData(); double width2, height2; constrainedObject->GetBoundingBoxMax(&width2, &height2); totalObjectHeight += height2; - node = node->Next(); + node = node->GetNext(); } double startY; double spacingY; @@ -204,10 +204,10 @@ bool wxOGLConstraint::Evaluate() // Now position the objects bool changed = FALSE; - node = m_constrainedObjects.First(); + node = m_constrainedObjects.GetFirst(); while (node) { - wxShape *constrainedObject = (wxShape *)node->Data(); + wxShape *constrainedObject = (wxShape *)node->GetData(); double width2, height2; constrainedObject->GetBoundingBoxMax(&width2, &height2); startY += (double)(spacingY + (height2/2.0)); @@ -217,23 +217,23 @@ bool wxOGLConstraint::Evaluate() changed = TRUE; } startY += (double)(height2/2.0); - node = node->Next(); + node = node->GetNext(); } return changed; } case gyCONSTRAINT_CENTRED_HORIZONTALLY: { - int n = m_constrainedObjects.Number(); + int n = m_constrainedObjects.GetCount(); double totalObjectWidth = 0.0; - wxNode *node = m_constrainedObjects.First(); + wxNode *node = m_constrainedObjects.GetFirst(); while (node) { - wxShape *constrainedObject = (wxShape *)node->Data(); + wxShape *constrainedObject = (wxShape *)node->GetData(); double width2, height2; constrainedObject->GetBoundingBoxMax(&width2, &height2); totalObjectWidth += width2; - node = node->Next(); + node = node->GetNext(); } double startX; double spacingX; @@ -252,10 +252,10 @@ bool wxOGLConstraint::Evaluate() // Now position the objects bool changed = FALSE; - node = m_constrainedObjects.First(); + node = m_constrainedObjects.GetFirst(); while (node) { - wxShape *constrainedObject = (wxShape *)node->Data(); + wxShape *constrainedObject = (wxShape *)node->GetData(); double width2, height2; constrainedObject->GetBoundingBoxMax(&width2, &height2); startX += (double)(spacingX + (width2/2.0)); @@ -265,25 +265,25 @@ bool wxOGLConstraint::Evaluate() changed = TRUE; } startX += (double)(width2/2.0); - node = node->Next(); + node = node->GetNext(); } return changed; } case gyCONSTRAINT_CENTRED_BOTH: { - int n = m_constrainedObjects.Number(); + int n = m_constrainedObjects.GetCount(); double totalObjectWidth = 0.0; double totalObjectHeight = 0.0; - wxNode *node = m_constrainedObjects.First(); + wxNode *node = m_constrainedObjects.GetFirst(); while (node) { - wxShape *constrainedObject = (wxShape *)node->Data(); + wxShape *constrainedObject = (wxShape *)node->GetData(); double width2, height2; constrainedObject->GetBoundingBoxMax(&width2, &height2); totalObjectWidth += width2; totalObjectHeight += height2; - node = node->Next(); + node = node->GetNext(); } double startX; double spacingX; @@ -318,10 +318,10 @@ bool wxOGLConstraint::Evaluate() // Now position the objects bool changed = FALSE; - node = m_constrainedObjects.First(); + node = m_constrainedObjects.GetFirst(); while (node) { - wxShape *constrainedObject = (wxShape *)node->Data(); + wxShape *constrainedObject = (wxShape *)node->GetData(); double width2, height2; constrainedObject->GetBoundingBoxMax(&width2, &height2); startX += (double)(spacingX + (width2/2.0)); @@ -336,7 +336,7 @@ bool wxOGLConstraint::Evaluate() startX += (double)(width2/2.0); startY += (double)(height2/2.0); - node = node->Next(); + node = node->GetNext(); } return changed; } @@ -344,10 +344,10 @@ bool wxOGLConstraint::Evaluate() { bool changed = FALSE; - wxNode *node = m_constrainedObjects.First(); + wxNode *node = m_constrainedObjects.GetFirst(); while (node) { - wxShape *constrainedObject = (wxShape *)node->Data(); + wxShape *constrainedObject = (wxShape *)node->GetData(); double width2, height2; constrainedObject->GetBoundingBoxMax(&width2, &height2); @@ -359,7 +359,7 @@ bool wxOGLConstraint::Evaluate() constrainedObject->Move(dc, x3, constrainedObject->GetY(), FALSE); } - node = node->Next(); + node = node->GetNext(); } return changed; } @@ -367,10 +367,10 @@ bool wxOGLConstraint::Evaluate() { bool changed = FALSE; - wxNode *node = m_constrainedObjects.First(); + wxNode *node = m_constrainedObjects.GetFirst(); while (node) { - wxShape *constrainedObject = (wxShape *)node->Data(); + wxShape *constrainedObject = (wxShape *)node->GetData(); double width2, height2; constrainedObject->GetBoundingBoxMax(&width2, &height2); @@ -382,7 +382,7 @@ bool wxOGLConstraint::Evaluate() constrainedObject->Move(dc, x3, constrainedObject->GetY(), FALSE); } - node = node->Next(); + node = node->GetNext(); } return changed; @@ -392,10 +392,10 @@ bool wxOGLConstraint::Evaluate() { bool changed = FALSE; - wxNode *node = m_constrainedObjects.First(); + wxNode *node = m_constrainedObjects.GetFirst(); while (node) { - wxShape *constrainedObject = (wxShape *)node->Data(); + wxShape *constrainedObject = (wxShape *)node->GetData(); double width2, height2; constrainedObject->GetBoundingBoxMax(&width2, &height2); @@ -407,7 +407,7 @@ bool wxOGLConstraint::Evaluate() constrainedObject->Move(dc, constrainedObject->GetX(), y3, FALSE); } - node = node->Next(); + node = node->GetNext(); } return changed; } @@ -415,10 +415,10 @@ bool wxOGLConstraint::Evaluate() { bool changed = FALSE; - wxNode *node = m_constrainedObjects.First(); + wxNode *node = m_constrainedObjects.GetFirst(); while (node) { - wxShape *constrainedObject = (wxShape *)node->Data(); + wxShape *constrainedObject = (wxShape *)node->GetData(); double width2, height2; constrainedObject->GetBoundingBoxMax(&width2, &height2); @@ -430,7 +430,7 @@ bool wxOGLConstraint::Evaluate() constrainedObject->Move(dc, constrainedObject->GetX(), y3, FALSE); } - node = node->Next(); + node = node->GetNext(); } return changed; } @@ -438,10 +438,10 @@ bool wxOGLConstraint::Evaluate() { bool changed = FALSE; - wxNode *node = m_constrainedObjects.First(); + wxNode *node = m_constrainedObjects.GetFirst(); while (node) { - wxShape *constrainedObject = (wxShape *)node->Data(); + wxShape *constrainedObject = (wxShape *)node->GetData(); double width2, height2; constrainedObject->GetBoundingBoxMax(&width2, &height2); @@ -453,7 +453,7 @@ bool wxOGLConstraint::Evaluate() constrainedObject->Move(dc, x3, constrainedObject->GetY(), FALSE); } - node = node->Next(); + node = node->GetNext(); } return changed; } @@ -461,10 +461,10 @@ bool wxOGLConstraint::Evaluate() { bool changed = FALSE; - wxNode *node = m_constrainedObjects.First(); + wxNode *node = m_constrainedObjects.GetFirst(); while (node) { - wxShape *constrainedObject = (wxShape *)node->Data(); + wxShape *constrainedObject = (wxShape *)node->GetData(); double width2, height2; constrainedObject->GetBoundingBoxMax(&width2, &height2); @@ -476,7 +476,7 @@ bool wxOGLConstraint::Evaluate() constrainedObject->Move(dc, x3, constrainedObject->GetY(), FALSE); } - node = node->Next(); + node = node->GetNext(); } return changed; @@ -486,10 +486,10 @@ bool wxOGLConstraint::Evaluate() { bool changed = FALSE; - wxNode *node = m_constrainedObjects.First(); + wxNode *node = m_constrainedObjects.GetFirst(); while (node) { - wxShape *constrainedObject = (wxShape *)node->Data(); + wxShape *constrainedObject = (wxShape *)node->GetData(); double width2, height2; constrainedObject->GetBoundingBoxMax(&width2, &height2); @@ -501,7 +501,7 @@ bool wxOGLConstraint::Evaluate() constrainedObject->Move(dc, constrainedObject->GetX(), y3, FALSE); } - node = node->Next(); + node = node->GetNext(); } return changed; } @@ -509,10 +509,10 @@ bool wxOGLConstraint::Evaluate() { bool changed = FALSE; - wxNode *node = m_constrainedObjects.First(); + wxNode *node = m_constrainedObjects.GetFirst(); while (node) { - wxShape *constrainedObject = (wxShape *)node->Data(); + wxShape *constrainedObject = (wxShape *)node->GetData(); double width2, height2; constrainedObject->GetBoundingBoxMax(&width2, &height2); @@ -524,7 +524,7 @@ bool wxOGLConstraint::Evaluate() constrainedObject->Move(dc, constrainedObject->GetX(), y3, FALSE); } - node = node->Next(); + node = node->GetNext(); } return changed; } @@ -532,10 +532,10 @@ bool wxOGLConstraint::Evaluate() { bool changed = FALSE; - wxNode *node = m_constrainedObjects.First(); + wxNode *node = m_constrainedObjects.GetFirst(); while (node) { - wxShape *constrainedObject = (wxShape *)node->Data(); + wxShape *constrainedObject = (wxShape *)node->GetData(); double x3 = (double)(x - (minWidth/2.0)); if (!Equals(x3, constrainedObject->GetX())) @@ -544,7 +544,7 @@ bool wxOGLConstraint::Evaluate() constrainedObject->Move(dc, x3, constrainedObject->GetY(), FALSE); } - node = node->Next(); + node = node->GetNext(); } return changed; } @@ -552,10 +552,10 @@ bool wxOGLConstraint::Evaluate() { bool changed = FALSE; - wxNode *node = m_constrainedObjects.First(); + wxNode *node = m_constrainedObjects.GetFirst(); while (node) { - wxShape *constrainedObject = (wxShape *)node->Data(); + wxShape *constrainedObject = (wxShape *)node->GetData(); double x3 = (double)(x + (minWidth/2.0)); if (!Equals(x3, constrainedObject->GetX())) @@ -564,7 +564,7 @@ bool wxOGLConstraint::Evaluate() constrainedObject->Move(dc, x3, constrainedObject->GetY(), FALSE); } - node = node->Next(); + node = node->GetNext(); } return changed; @@ -574,10 +574,10 @@ bool wxOGLConstraint::Evaluate() { bool changed = FALSE; - wxNode *node = m_constrainedObjects.First(); + wxNode *node = m_constrainedObjects.GetFirst(); while (node) { - wxShape *constrainedObject = (wxShape *)node->Data(); + wxShape *constrainedObject = (wxShape *)node->GetData(); double y3 = (double)(y - (minHeight/2.0)); if (!Equals(y3, constrainedObject->GetY())) @@ -586,7 +586,7 @@ bool wxOGLConstraint::Evaluate() constrainedObject->Move(dc, constrainedObject->GetX(), y3, FALSE); } - node = node->Next(); + node = node->GetNext(); } return changed; } @@ -594,10 +594,10 @@ bool wxOGLConstraint::Evaluate() { bool changed = FALSE; - wxNode *node = m_constrainedObjects.First(); + wxNode *node = m_constrainedObjects.GetFirst(); while (node) { - wxShape *constrainedObject = (wxShape *)node->Data(); + wxShape *constrainedObject = (wxShape *)node->GetData(); double y3 = (double)(y + (minHeight/2.0)); if (!Equals(y3, constrainedObject->GetY())) @@ -606,7 +606,7 @@ bool wxOGLConstraint::Evaluate() constrainedObject->Move(dc, constrainedObject->GetX(), y3, FALSE); } - node = node->Next(); + node = node->GetNext(); } return changed; }