What is the correct way to response to the wxEVT_DPI_CHANGED event?

AsmWarrior <[email protected]>
Newsgroups gmane.comp.lib.wxwindows.general
Message-ID <[email protected]>
Hi, when the application receive a wxEVT_DPI_CHANGED event, how can it 
response to the event?

I looked at the wxWidgets' sample code "display", it looks like it does 
nothing, but just show some text in the status bar:

void MyFrame::OnDPIChanged(wxDPIChangedEvent& event)
{
    wxLogStatus(this, "DPI changed: was %d*%d, now %d*%d",
                event.GetOldDPI().x, event.GetOldDPI().y,
                event.GetNewDPI().x, event.GetNewDPI().y);

    event.Skip();
}

But if we need to layout the UIs, do we need to call the ResetMode() 
function of the wxDisplay class?

I just search for the "ResetMode" in wxWidgets' github site, I don't see 
much usage of this function.

In the "display" sample code, this function is called when a wxButton get 
clicked.

I even did some test about the DPI changing, and I think if ResetMode() is 
not called, the layout is wrong, you can see the discussion and image shots 
here in the:

How does the FromDIP function work under different DPI scaling? — 
https://forums.wxwidgets.org/viewtopic.php?p=218156#p218156

Any suggestions? Thanks!

Asmwarrior

-- 
Please read https://www.wxwidgets.org/support/mlhowto.htm before posting.
--- 
You received this message because you are subscribed to the Google Groups "wx-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/wx-users/af6073ad-2ba0-43f8-94d2-d2c156fa6bcfn%40googlegroups.com.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.