// Created: 12/07/98
// RCS-ID: $Id$
// Copyright: (c) Julian Smart
-// Licence: wxWindows licence
+// Licence: wxWindows licence
/////////////////////////////////////////////////////////////////////////////
-#ifdef __GNUG__
-#pragma implementation "constrnt.h"
-#endif
-
// For compilers that support precompilation, includes "wx.h".
#include "wx/wxprec.h"
#endif
#ifndef WX_PRECOMP
-#include <wx/wx.h>
+#include "wx/wx.h"
#endif
#if wxUSE_PROLOGIO
-#include <wx/deprecated/wxexpr.h>
+#include "wx/deprecated/wxexpr.h"
#endif
#include "wx/ogl/ogl.h"
return eq;
}
-// Return TRUE if anything changed
+// Return true if anything changed
bool wxOGLConstraint::Evaluate()
{
double maxWidth, maxHeight, minWidth, minHeight, x, y;
}
// Now position the objects
- bool changed = FALSE;
+ bool changed = false;
node = m_constrainedObjects.GetFirst();
while (node)
{
startY += (double)(spacingY + (height2/2.0));
if (!Equals(startY, constrainedObject->GetY()))
{
- constrainedObject->Move(dc, constrainedObject->GetX(), startY, FALSE);
- changed = TRUE;
+ constrainedObject->Move(dc, constrainedObject->GetX(), startY, false);
+ changed = true;
}
startY += (double)(height2/2.0);
node = node->GetNext();
}
// Now position the objects
- bool changed = FALSE;
+ bool changed = false;
node = m_constrainedObjects.GetFirst();
while (node)
{
startX += (double)(spacingX + (width2/2.0));
if (!Equals(startX, constrainedObject->GetX()))
{
- constrainedObject->Move(dc, startX, constrainedObject->GetY(), FALSE);
- changed = TRUE;
+ constrainedObject->Move(dc, startX, constrainedObject->GetY(), false);
+ changed = true;
}
startX += (double)(width2/2.0);
node = node->GetNext();
}
// Now position the objects
- bool changed = FALSE;
+ bool changed = false;
node = m_constrainedObjects.GetFirst();
while (node)
{
startY += (double)(spacingY + (height2/2.0));
if ((!Equals(startX, constrainedObject->GetX())) || (!Equals(startY, constrainedObject->GetY())))
- {
- constrainedObject->Move(dc, startX, startY, FALSE);
- changed = TRUE;
- }
+ {
+ constrainedObject->Move(dc, startX, startY, false);
+ changed = true;
+ }
startX += (double)(width2/2.0);
startY += (double)(height2/2.0);
}
case gyCONSTRAINT_LEFT_OF:
{
- bool changed = FALSE;
+ bool changed = false;
wxNode *node = m_constrainedObjects.GetFirst();
while (node)
double x3 = (double)(x - (minWidth/2.0) - (width2/2.0) - m_xSpacing);
if (!Equals(x3, constrainedObject->GetX()))
- {
- changed = TRUE;
- constrainedObject->Move(dc, x3, constrainedObject->GetY(), FALSE);
- }
+ {
+ changed = true;
+ constrainedObject->Move(dc, x3, constrainedObject->GetY(), false);
+ }
node = node->GetNext();
}
}
case gyCONSTRAINT_RIGHT_OF:
{
- bool changed = FALSE;
+ bool changed = false;
wxNode *node = m_constrainedObjects.GetFirst();
while (node)
double x3 = (double)(x + (minWidth/2.0) + (width2/2.0) + m_xSpacing);
if (!Equals(x3, constrainedObject->GetX()))
- {
- changed = TRUE;
- constrainedObject->Move(dc, x3, constrainedObject->GetY(), FALSE);
- }
+ {
+ changed = true;
+ constrainedObject->Move(dc, x3, constrainedObject->GetY(), false);
+ }
node = node->GetNext();
}
return changed;
-
- return FALSE;
}
case gyCONSTRAINT_ABOVE:
{
- bool changed = FALSE;
+ bool changed = false;
wxNode *node = m_constrainedObjects.GetFirst();
while (node)
double y3 = (double)(y - (minHeight/2.0) - (height2/2.0) - m_ySpacing);
if (!Equals(y3, constrainedObject->GetY()))
- {
- changed = TRUE;
- constrainedObject->Move(dc, constrainedObject->GetX(), y3, FALSE);
- }
+ {
+ changed = true;
+ constrainedObject->Move(dc, constrainedObject->GetX(), y3, false);
+ }
node = node->GetNext();
}
}
case gyCONSTRAINT_BELOW:
{
- bool changed = FALSE;
+ bool changed = false;
wxNode *node = m_constrainedObjects.GetFirst();
while (node)
double y3 = (double)(y + (minHeight/2.0) + (height2/2.0) + m_ySpacing);
if (!Equals(y3, constrainedObject->GetY()))
- {
- changed = TRUE;
- constrainedObject->Move(dc, constrainedObject->GetX(), y3, FALSE);
- }
+ {
+ changed = true;
+ constrainedObject->Move(dc, constrainedObject->GetX(), y3, false);
+ }
node = node->GetNext();
}
}
case gyCONSTRAINT_ALIGNED_LEFT:
{
- bool changed = FALSE;
+ bool changed = false;
wxNode *node = m_constrainedObjects.GetFirst();
while (node)
double x3 = (double)(x - (minWidth/2.0) + (width2/2.0) + m_xSpacing);
if (!Equals(x3, constrainedObject->GetX()))
- {
- changed = TRUE;
- constrainedObject->Move(dc, x3, constrainedObject->GetY(), FALSE);
- }
+ {
+ changed = true;
+ constrainedObject->Move(dc, x3, constrainedObject->GetY(), false);
+ }
node = node->GetNext();
}
}
case gyCONSTRAINT_ALIGNED_RIGHT:
{
- bool changed = FALSE;
+ bool changed = false;
wxNode *node = m_constrainedObjects.GetFirst();
while (node)
double x3 = (double)(x + (minWidth/2.0) - (width2/2.0) - m_xSpacing);
if (!Equals(x3, constrainedObject->GetX()))
- {
- changed = TRUE;
- constrainedObject->Move(dc, x3, constrainedObject->GetY(), FALSE);
- }
+ {
+ changed = true;
+ constrainedObject->Move(dc, x3, constrainedObject->GetY(), false);
+ }
node = node->GetNext();
}
return changed;
-
- return FALSE;
+ #if 0
+ // two returned values ?
+ return false;
+ #endif
}
case gyCONSTRAINT_ALIGNED_TOP:
{
- bool changed = FALSE;
+ bool changed = false;
wxNode *node = m_constrainedObjects.GetFirst();
while (node)
double y3 = (double)(y - (minHeight/2.0) + (height2/2.0) + m_ySpacing);
if (!Equals(y3, constrainedObject->GetY()))
- {
- changed = TRUE;
- constrainedObject->Move(dc, constrainedObject->GetX(), y3, FALSE);
- }
+ {
+ changed = true;
+ constrainedObject->Move(dc, constrainedObject->GetX(), y3, false);
+ }
node = node->GetNext();
}
}
case gyCONSTRAINT_ALIGNED_BOTTOM:
{
- bool changed = FALSE;
+ bool changed = false;
wxNode *node = m_constrainedObjects.GetFirst();
while (node)
double y3 = (double)(y + (minHeight/2.0) - (height2/2.0) - m_ySpacing);
if (!Equals(y3, constrainedObject->GetY()))
- {
- changed = TRUE;
- constrainedObject->Move(dc, constrainedObject->GetX(), y3, FALSE);
- }
+ {
+ changed = true;
+ constrainedObject->Move(dc, constrainedObject->GetX(), y3, false);
+ }
node = node->GetNext();
}
}
case gyCONSTRAINT_MIDALIGNED_LEFT:
{
- bool changed = FALSE;
+ bool changed = false;
wxNode *node = m_constrainedObjects.GetFirst();
while (node)
double x3 = (double)(x - (minWidth/2.0));
if (!Equals(x3, constrainedObject->GetX()))
- {
- changed = TRUE;
- constrainedObject->Move(dc, x3, constrainedObject->GetY(), FALSE);
- }
+ {
+ changed = true;
+ constrainedObject->Move(dc, x3, constrainedObject->GetY(), false);
+ }
node = node->GetNext();
}
}
case gyCONSTRAINT_MIDALIGNED_RIGHT:
{
- bool changed = FALSE;
+ bool changed = false;
wxNode *node = m_constrainedObjects.GetFirst();
while (node)
double x3 = (double)(x + (minWidth/2.0));
if (!Equals(x3, constrainedObject->GetX()))
- {
- changed = TRUE;
- constrainedObject->Move(dc, x3, constrainedObject->GetY(), FALSE);
- }
+ {
+ changed = true;
+ constrainedObject->Move(dc, x3, constrainedObject->GetY(), false);
+ }
node = node->GetNext();
}
return changed;
-
- return FALSE;
+ #if 0
+ // two returned values ?
+ return false;
+ #endif
}
case gyCONSTRAINT_MIDALIGNED_TOP:
{
- bool changed = FALSE;
+ bool changed = false;
wxNode *node = m_constrainedObjects.GetFirst();
while (node)
double y3 = (double)(y - (minHeight/2.0));
if (!Equals(y3, constrainedObject->GetY()))
- {
- changed = TRUE;
- constrainedObject->Move(dc, constrainedObject->GetX(), y3, FALSE);
- }
+ {
+ changed = true;
+ constrainedObject->Move(dc, constrainedObject->GetX(), y3, false);
+ }
node = node->GetNext();
}
}
case gyCONSTRAINT_MIDALIGNED_BOTTOM:
{
- bool changed = FALSE;
+ bool changed = false;
wxNode *node = m_constrainedObjects.GetFirst();
while (node)
double y3 = (double)(y + (minHeight/2.0));
if (!Equals(y3, constrainedObject->GetY()))
- {
- changed = TRUE;
- constrainedObject->Move(dc, constrainedObject->GetX(), y3, FALSE);
- }
+ {
+ changed = true;
+ constrainedObject->Move(dc, constrainedObject->GetX(), y3, false);
+ }
node = node->GetNext();
}
return changed;
}
-
+ #if 0
+ // default value handled in main function body
default:
- return FALSE;
+ return false;
+ #endif
}
- return FALSE;
+ return false;
}