X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/341287bf49066e5dd84e971bd508ee3919ff4b46..518f33a4e50585cab19757375a2c348e61d2594f:/src/common/wincmn.cpp?ds=inline diff --git a/src/common/wincmn.cpp b/src/common/wincmn.cpp index 3486f2b6bd..4aebe4007e 100644 --- a/src/common/wincmn.cpp +++ b/src/common/wincmn.cpp @@ -64,3 +64,27 @@ void wxWindow::UpdateWindowUI() } } } + +// Dialog units translations. Implemented in wincmn.cpp. +wxPoint wxWindow::ConvertPixelsToDialog(const wxPoint& pt) +{ + int charWidth = GetCharWidth(); + int charHeight = GetCharHeight(); + wxPoint pt2; + pt2.x = (int) ((pt.x * 4) / charWidth) ; + pt2.y = (int) ((pt.y * 8) / charHeight) ; + + return pt2; +} + +wxPoint wxWindow::ConvertDialogToPixels(const wxPoint& pt) +{ + int charWidth = GetCharWidth(); + int charHeight = GetCharHeight(); + wxPoint pt2; + pt2.x = (int) ((pt.x * charWidth) / 4) ; + pt2.y = (int) ((pt.y * charHeight) / 8) ; + + return pt2; +} +