Allow customizing wxBusyInfo appearance.
Allow customizing wxBusyInfo window by passing wxBusyInfoFlags containing information about the icon, title, colours and frame transparency to use. Update the sample to show such "rich" busy info. git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@78063 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -233,6 +233,7 @@ wxBEGIN_EVENT_TABLE(MyFrame, wxFrame)
|
||||
|
||||
#if wxUSE_BUSYINFO
|
||||
EVT_MENU(DIALOGS_BUSYINFO, MyFrame::ShowBusyInfo)
|
||||
EVT_MENU(DIALOGS_BUSYINFO_RICH, MyFrame::ShowRichBusyInfo)
|
||||
#endif // wxUSE_BUSYINFO
|
||||
|
||||
#if wxUSE_FINDREPLDLG
|
||||
@@ -474,6 +475,7 @@ bool MyApp::OnInit()
|
||||
|
||||
#if wxUSE_BUSYINFO
|
||||
info_menu->Append(DIALOGS_BUSYINFO, wxT("&Busy info dialog\tCtrl-B"));
|
||||
info_menu->Append(DIALOGS_BUSYINFO_RICH, wxT("&Rich busy info dialog\tShift-Ctrl-B"));
|
||||
#endif // wxUSE_BUSYINFO
|
||||
|
||||
#if wxUSE_LOG_DIALOG
|
||||
@@ -2422,7 +2424,28 @@ void MyFrame::ShowBusyInfo(wxCommandEvent& WXUNUSED(event))
|
||||
}
|
||||
|
||||
wxSleep(2);
|
||||
//wxWakeUpIdle();
|
||||
}
|
||||
|
||||
void MyFrame::ShowRichBusyInfo(wxCommandEvent& WXUNUSED(event))
|
||||
{
|
||||
wxWindowDisabler disableAll;
|
||||
|
||||
// This is just an example and not an encouragement for printing
|
||||
// synchronously from the main thread.
|
||||
wxBusyInfo info
|
||||
(
|
||||
wxBusyInfoFlags()
|
||||
.Parent(this)
|
||||
.Icon(wxArtProvider::GetIcon(wxART_PRINT,
|
||||
wxART_OTHER, wxSize(128, 128)))
|
||||
.Title("<b>Printing your document</b>")
|
||||
.Text("Please wait...")
|
||||
.Foreground(*wxWHITE)
|
||||
.Background(*wxBLACK)
|
||||
.Transparency(4*wxALPHA_OPAQUE/5)
|
||||
);
|
||||
|
||||
wxSleep(5);
|
||||
}
|
||||
|
||||
#endif // wxUSE_BUSYINFO
|
||||
|
Reference in New Issue
Block a user