+ // Update the associated resource
+ // We need to convert to dialog units if this is not a dialog or panel, but
+ // the parent resource specifies dialog units.
+ int resourceX = x1;
+ int resourceY = y1;
+ int resourceWidth = width1;
+ int resourceHeight = height1;
+
+ if (parentResource->GetResourceStyle() & wxRESOURCE_DIALOG_UNITS)
+ {
+ wxPoint pt = handlerControl->GetParent()->ConvertPixelsToDialog(wxPoint(x1, y1));
+ wxSize sz = handlerControl->GetParent()->ConvertPixelsToDialog(wxSize(width1, height1));
+
+ // Convert back so we've rounded down
+ sz = handlerControl->GetParent()->ConvertDialogToPixels(sz);
+ sz = handlerControl->GetParent()->ConvertPixelsToDialog(sz);
+ resourceWidth = sz.x; resourceHeight = sz.y;
+
+ sz = handlerControl->GetParent()->ConvertDialogToPixels(sz);
+ width1 = sz.x;
+ height1 = sz.y;
+
+ pt = handlerControl->GetParent()->ConvertDialogToPixels(pt);
+ pt = handlerControl->GetParent()->ConvertPixelsToDialog(pt);
+ resourceX = pt.x; resourceY = pt.y;
+
+ pt = handlerControl->GetParent()->ConvertDialogToPixels(pt);
+ x1 = pt.x;
+ y1 = pt.y;
+ }