- int xpos, ypos, width, height;
- handlerControl->GetPosition(&xpos, &ypos);
- handlerControl->GetSize(&width, &height);
-
- dc.BeginDrawing();
-
-// dc.DestroyClippingRegion();
-
- wxPanel *panel = (wxPanel *)handlerControl->GetParent();
-
- // Erase selection handles
-// DrawSelectionHandles(dc, TRUE);
-
- dc.SetOptimization(FALSE);
-
- dc.SetLogicalFunction(wxINVERT);
-
- wxPen pen(wxColour(0, 0, 0), 1, wxDOT);
- dc.SetPen(pen);
- dc.SetBrush(* wxTRANSPARENT_BRUSH);
-
- dc.SetOptimization(TRUE);
-
- if (selectionHandle > 0)
- {
- panel->Refresh();
-
- DrawBoundingBox(dc, xpos, ypos, width, height);
- }
- else
- {
- panel->Refresh();
-
- dragOffsetX = (x - xpos);
- dragOffsetY = (y - ypos);
-
- DrawBoundingBox(dc, xpos, ypos, width, height);
-
- // Also draw bounding boxes for other selected items
- wxNode *node = panel->GetChildren().First();
- while (node)
- {
- wxWindow *win = (wxWindow *)node->Data();
- if (win->IsKindOf(CLASSINFO(wxControl)))
- {
- wxControl *item = (wxControl *)win;
- wxResourceEditorControlHandler *handler = (wxResourceEditorControlHandler *)item->GetEventHandler();
- if ((item != handlerControl) && handler->IsSelected())
- {
- int x1, y1, w1, h1;
- item->GetPosition(&x1, &y1);
- item->GetSize(&w1, &h1);
- handler->DrawBoundingBox(dc, x1, y1, w1, h1);
- }
- }
- node = node->Next();
- }
- }
- dc.EndDrawing();
-}
-
-void wxResourceEditorControlHandler::OnDragContinue(bool WXUNUSED(paintIt), int x, int y, int WXUNUSED(keys), wxDC& dc, int selectionHandle)
-{
- wxPanel *panel = (wxPanel *)handlerControl->GetParent();
- int xpos, ypos, width, height;
- handlerControl->GetPosition(&xpos, &ypos);
- handlerControl->GetSize(&width, &height);
-
- if (selectionHandle > 0)
- {
-/*
- 8 1 2
-
- 7 3
-
- 6 5 4
-*/
-
- int x1, y1, width1, height1;
-
- switch (selectionHandle)
- {
- case 1:
- x1 = xpos;
- y1 = y;
- width1 = width;
- height1 = (ypos + height) - y;
- break;
- case 5:
- x1 = xpos;
- y1 = ypos;
- width1 = width;
- height1 = (y - ypos);
- break;
- case 3:
- x1 = xpos;
- y1 = ypos;
- width1 = (x - xpos);
- height1 = height;
- break;
- case 7:
- x1 = x;
- y1 = ypos;
- width1 = (xpos + width) - x;
- height1 = height;
- break;
- case 2:
- x1 = xpos;
- y1 = y;
- width1 = (x - xpos);
- height1 = (ypos + height) - y;
- break;
- case 4:
- x1 = xpos;
- y1 = ypos;
- width1 = (x - xpos);
- height1 = (y - ypos);
- break;
- case 6:
- x1 = x;
- y1 = ypos;
- width1 = (xpos + width) - x;
- height1 = y - ypos;
- break;
- case 8:
- x1 = x;
- y1 = y;
- width1 = (xpos + width) - x;
- height1 = (ypos + height) - y;
- break;
- }