I am working on some code about capturing mouse location. I have a frame created by using wxWidgets, and I am working on an issue which I need to get the title bar height. Is there a good way to get the size of title bar?
Here is a simple illustration of what I need: 
wxWidgets provides a mechanism for this (and much else beside) called wxSystemSettings::GetMetric.
static int wxSystemSettings::GetMetric(wxSystemMetric index, wxWindow* win = NULL);
You can retrieve 'global' values by leaving win as NULL or you can pass in a specific window.
https://docs.wxwidgets.org/trunk/classwx_system_settings.html#aa18e3b5794dc4193c4b0668d28d4933a
The metric you probably want is wxSYS_CAPTION_Y.
https://docs.wxwidgets.org/trunk/settings_8h.html#a0f2b19d7a3717cdbef5a04cb05ab8f26
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With