+
+
+void wxResourceEditorDialogHandler::DrawBoundingBox(wxDC& dc, int x, int y, int w, int h)
+{
+ dc.DrawRectangle(x, y, w, h);
+}
+
+
+void wxResourceEditorDialogHandler::OnDragBegin(int x, int y, int WXUNUSED(keys), wxDC& dc, int selectionHandle)
+{
+/*
+ dc.BeginDrawing();
+
+ dc.SetOptimization(FALSE);
+
+ dc.SetLogicalFunction(wxINVERT);
+
+ wxPen pen(wxColour(0, 0, 0), 1, wxDOT);
+ dc.SetPen(pen);
+ dc.SetBrush(* wxTRANSPARENT_BRUSH);
+
+ dc.SetOptimization(TRUE);
+
+// Refresh();
+// DrawBoundingBox(dc, xpos, ypos, width, height);
+
+ dc.EndDrawing();
+*/
+} //wxResourceEditorDialogHandler::OnDragBegin()
+
+
+void wxResourceEditorDialogHandler::OnDragContinue(bool WXUNUSED(paintIt), int x, int y, int WXUNUSED(keys), wxDC& dc, int selectionHandle)
+{
+ int upperLeftX = (x < firstDragX) ? x : firstDragX;
+ int upperLeftY = (y < firstDragY) ? y : firstDragY;
+ int lowerRightX = (x > firstDragX) ? x : firstDragX;
+ int lowerRightY = (y > firstDragY) ? y : firstDragY;
+
+ dc.BeginDrawing();
+ dc.SetLogicalFunction(wxINVERT);
+ wxPen pen(wxColour(0, 0, 0), 1, wxDOT);
+ dc.SetPen(pen);
+ dc.SetBrush(* wxTRANSPARENT_BRUSH);
+
+ DrawBoundingBox(dc, (int)upperLeftX, upperLeftY,
+ lowerRightX-upperLeftX, lowerRightY-upperLeftY);
+
+ dc.EndDrawing();
+
+} // wxResourceEditorDialogHandler::OnDragContinue()
+
+
+void wxResourceEditorDialogHandler::OnDragEnd(int x, int y, int WXUNUSED(keys), wxDC& dc, int selectionHandle)
+{
+/*
+ dc.BeginDrawing();
+
+ dc.SetOptimization(FALSE);
+
+ dc.SetLogicalFunction(wxCOPY);
+ dc.SetPen(* wxBLACK_PEN);
+ dc.SetBrush(* wxBLACK_BRUSH);
+
+ dc.SetOptimization(TRUE);
+
+ dc.EndDrawing();
+*/
+
+} // wxResourceEditorDialogHandler::OnDragEnd()
+
+void wxResourceEditorDialogHandler::OnObjectEdit(wxCommandEvent& event)
+{
+ wxMenu* menu = (wxMenu*) event.GetEventObject();
+
+ wxWindow *data = (wxWindow *)menu->GetClientData();
+ if (!data)
+ return;
+
+ wxResourceManager::GetCurrentResourceManager()->EditWindow(data);
+}
+
+void wxResourceEditorDialogHandler::OnObjectDelete(wxCommandEvent& event)
+{
+ wxMenu* menu = (wxMenu*) event.GetEventObject();
+
+ wxWindow *data = (wxWindow *)menu->GetClientData();
+ if (!data)
+ return;
+
+ // Before deleting a dialog, give the user a last chance
+ // change their mind, in case they accidentally right
+ // clicked the dialog rather than the widget they were
+ // aiming for.
+ if (data->IsKindOf(CLASSINFO(wxPanel)))
+ {
+ wxString str(wxT("Deleting dialog : "));
+ str += data->GetName();
+ if (wxMessageBox(wxT("Are you sure?"), str, wxYES_NO | wxCENTRE) == wxNO)
+ return;
+ }
+
+ wxResourceManager::GetCurrentResourceManager()->DeselectItemIfNecessary(data);
+
+ wxResourceManager::GetCurrentResourceManager()->SaveInfoAndDeleteHandler(data);
+ wxResourceManager::GetCurrentResourceManager()->DeleteResource(data);
+ wxResourceManager::GetCurrentResourceManager()->DeleteWindow(data);
+}
+
+
+