/*
* Division control point
*/
-
+
class wxDivisionControlPoint: public wxControlPoint
{
DECLARE_DYNAMIC_CLASS(wxDivisionControlPoint)
wxClientDC dc(GetCanvas());
GetCanvas()->PrepareDC(dc);
- dc.SetLogicalFunction(wxXOR);
+ dc.SetLogicalFunction(OGLRBLF);
wxPen dottedPen(wxColour(0, 0, 0), 1, wxDOT);
dc.SetPen(dottedPen);
dc.SetBrush((* wxTRANSPARENT_BRUSH));
Erase(dc);
- dc.SetLogicalFunction(wxXOR);
+ dc.SetLogicalFunction(OGLRBLF);
wxPen dottedPen(wxColour(0, 0, 0), 1, wxDOT);
dc.SetPen(dottedPen);
double offsetY = yy - objectStartY;
Move(dc, GetX() + offsetX, GetY() + offsetY);
-
+
if (m_canvas && !m_canvas->GetQuickEditMode()) m_canvas->Redraw(dc);
}
object->Show(FALSE);
object->Move(dc, newX, newY);
object->Show(TRUE);
-
+
// Now set the scaled size
object->GetBoundingBoxMin(&xBound, &yBound);
object->SetSize(object->GetFixedWidth() ? xBound : xScale*xBound,
wxShape *newObject = object->CreateNewCopy(FALSE, FALSE);
if (newObject->GetId() == 0)
newObject->SetId(NewId());
-
+
newObject->SetParent(&compositeCopy);
compositeCopy.m_children.Append(newObject);
wxShape *constrainedObject = (wxShape *)node2->Data();
wxShape *newConstrained = (wxShape *)(oglObjectCopyMapping.Find((long)constrainedObject)->Data());
newConstrainedList.Append(newConstrained);
- node2 = node2->Next();
+ node2 = node2->Next();
}
wxOGLConstraint *newConstraint = new wxOGLConstraint(constraint->m_constraintType, newConstraining,
m_constrainingObject = (wxShape *)objExpr1->GetClientData();
else
wxFatalError("Couldn't find constraining image of composite.", "Object graphics error");
-
+
int i = 0;
wxExpr *currentIdExpr = constrainedExpr->Nth(i);
while (currentIdExpr)
}
return;
}
-
+
wxClientDC dc(GetCanvas());
GetCanvas()->PrepareDC(dc);
double newYPos2 = (double)(y1 + (3.0*GetHeight()/4.0));
wxDivisionShape *newDivision = compositeParent->OnCreateDivision();
newDivision->Show(TRUE);
-
+
Erase(dc);
// Anything adjoining the bottom of this division now adjoins the
// Division is now receiving mouse events _before_ the contained object,
// because it was added last (on top of all others)
- // Add after the image that visualizes the container
+ // Add after the image that visualizes the container
compositeParent->AddChild(newDivision, compositeParent->FindContainerImage());
m_handleSide = DIVISION_SIDE_BOTTOM;
double newYPos2 = GetY();
wxDivisionShape *newDivision = compositeParent->OnCreateDivision();
newDivision->Show(TRUE);
-
+
Erase(dc);
// Anything adjoining the left of this division now adjoins the
GetCanvas()->PrepareDC(dc);
Move(dc, newX, GetY());
-
+
return TRUE;
}
GetCanvas()->PrepareDC(dc);
Move(dc, GetX(), newY);
-
+
return TRUE;
}
GetCanvas()->PrepareDC(dc);
Move(dc, newX, GetY());
-
+
return TRUE;
}
GetCanvas()->PrepareDC(dc);
Move(dc, GetX(), newY);
-
+
return TRUE;
}
originalY = division->GetY();
originalW = division->GetWidth();
originalH = division->GetHeight();
-
+
wxControlPoint::OnBeginDragLeft(x, y, keys, attachment);
}
success = FALSE;
else
division->ResizeAdjoining(DIVISION_SIDE_LEFT, x, FALSE);
-
+
break;
}
case DIVISION_SIDE_TOP:
success = FALSE;
else
division->ResizeAdjoining(DIVISION_SIDE_TOP, y, FALSE);
-
+
break;
}
case DIVISION_SIDE_RIGHT:
success = FALSE;
else
division->ResizeAdjoining(DIVISION_SIDE_RIGHT, x, FALSE);
-
+
break;
}
case DIVISION_SIDE_BOTTOM:
success = FALSE;
else
division->ResizeAdjoining(DIVISION_SIDE_BOTTOM, y, FALSE);
-
+
break;
}
}
}
node = node->Next();
}
-
+
return TRUE;
}
* Popup menu for editing divisions
*
*/
-
+
void oglGraphicsDivisionMenuProc(wxMenu& menu, wxCommandEvent& event)
{
wxDivisionShape *division = (wxDivisionShape *)menu.GetClientData();
GraphicsForm *form = new GraphicsForm("Containers");
int lineWidth = currentPen->GetWidth();
-
+
form->Add(wxMakeFormShort("Width", &lineWidth, wxFORM_DEFAULT, NULL, NULL, wxVERTICAL,
150));
form->Add(wxMakeFormString("Colour", pColour, wxFORM_CHOICE,
else if (strcmp(*pStyle, "Dot Dash") == 0)
lineStyle = wxDOT_DASH;
}
-
+
wxPen *newPen = wxThePenList->FindOrCreatePen(*pColour, lineWidth, lineStyle);
if (!pen)
pen = wxBLACK_PEN;
oglPopupDivisionMenu->Enable(DIVISION_MENU_EDIT_TOP_EDGE, TRUE);
else
oglPopupDivisionMenu->Enable(DIVISION_MENU_EDIT_TOP_EDGE, FALSE);
-
+
int x1, y1;
m_canvas->ViewStart(&x1, &y1);