Code: Select all
diff --git a/samples/display/display.cpp b/samples/display/display.cpp
index 58f18de..a981120 100644
--- a/samples/display/display.cpp
+++ b/samples/display/display.cpp
@@ -356,6 +356,8 @@ void MyFrame::PopuplateWithDisplayInfo()
sizer->Add(new wxStaticText(page, wxID_ANY, "Current: "));
sizer->Add(new wxStaticText(page, Display_CurrentMode, currentMode));
+ sizer->Add(new wxButton(page, wxID_ANY, _T("Hello World"), wxDefaultPosition, wxWindow::FromDIP(wxSize(250,50), 0)));
+
sizerTop->Add(new wxButton(page, Display_ResetMode, "&Reset mode"),
wxSizerFlags().Centre().Border());
#endif // wxUSE_DISPLAY
Finally, I just click the "Reset mode" button of the program, and the whole window becomes below, the button size is return back to 250*50. See image below:
Here is my question.
1, I'm not sure how the "Reset mode" button does, I see it just call the
Code: Select all
void MyFrame::OnResetMode(wxCommandEvent& WXUNUSED(event))
{
wxDisplay dpy(m_book->GetSelection());
dpy.ResetMode();
}
2, Why in the second screen shot, I have a 375*75 size button? From my understanding, the third screen shot is correct, while the second screen shot with 375*75 button is wrong.
I mean when I use such code:
Code: Select all
sizer->Add(new wxButton(page, wxID_ANY, _T("Hello World"), wxDefaultPosition, wxWindow::FromDIP(wxSize(250,50), 0)));
The whole testing code was in: https://github.com/asmwarrior/cb_projec ... isplay.cpp, while the resource file is in its root folder.
Any help and suggestion are welcome, thanks!