GetSystemMetrics with const

10 views
Skip to first unread message

Manolo

unread,
Nov 9, 2012, 8:07:40 PM11/9/12
to wx-...@googlegroups.com
Hi
Can we change
 wxSystemSettingsNative::GetMetric(wxSystemMetric index, wxWindow * win = NULL)
to
GetMetric(wxSystemMetric index, const wxWindow * win = NULL)

or do I call directly ::GetSystemMetrics(SM_CXVSCROLL)
to avoid 'constness' in a const func?

TIA
Manolo

Vadim Zeitlin

unread,
Nov 11, 2012, 7:45:34 AM11/11/12
to wx-...@googlegroups.com
On Sat, 10 Nov 2012 02:07:40 +0100 Manolo wrote:

M> Can we change
M> wxSystemSettingsNative::GetMetric(wxSystemMetric index, wxWindow * win =
M> NULL)
M> to
M> GetMetric(wxSystemMetric index, const wxWindow * win = NULL)

I think it should be possible, yes. But all the ports would need to be
updated.

M> or do I call directly ::GetSystemMetrics(*SM_CXVSCROLL*)
M> to avoid 'constness' in a const func?

No, it's really not a good idea to redo what this class already does. In
the worst case just use const_cast<>.

Regards,
VZ
Reply all
Reply to author
Forward
0 new messages