Dialog unit mods; wxProp tidying
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@816 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user