File: busyinfo.h

package info (click to toggle)
wxpython3.0 3.0.2.0%2Bdfsg-4
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 482,760 kB
  • ctags: 518,293
  • sloc: cpp: 2,127,226; python: 294,045; makefile: 51,942; ansic: 19,033; sh: 3,013; xml: 1,629; perl: 17
file content (72 lines) | stat: -rw-r--r-- 2,052 bytes parent folder | download | duplicates (10)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
/////////////////////////////////////////////////////////////////////////////
// Name:        busyinfo.h
// Purpose:     interface of wxBusyInfo
// Author:      wxWidgets team
// Licence:     wxWindows licence
/////////////////////////////////////////////////////////////////////////////

/**
    @class wxBusyInfo

    This class makes it easy to tell your user that the program is temporarily busy.
    Just create a wxBusyInfo object on the stack, and within the current scope,
    a message window will be shown.

    For example:

    @code
        wxBusyInfo wait("Please wait, working...");

        for (int i = 0; i < 100000; i++)
        {
            DoACalculation();
        }
    @endcode

    It works by creating a window in the constructor, and deleting it
    in the destructor.

    You may also want to call wxTheApp->Yield() to refresh the window
    periodically (in case it had been obscured by other windows, for
    example) like this:

    @code
        wxWindowDisabler disableAll;
        wxBusyInfo wait("Please wait, working...");

        for (int i = 0; i < 100000; i++)
        {
            DoACalculation();

            if ( !(i % 1000) )
                wxTheApp->Yield();
        }
    @endcode

    but take care to not cause undesirable reentrancies when doing it (see
    wxApp::Yield for more details). The simplest way to do it is to use
    wxWindowDisabler class as illustrated in the above example.

    Note that a wxBusyInfo is always built with the @c wxSTAY_ON_TOP window style
    (see wxFrame window styles for more info).

    @library{wxcore}
    @category{cmndlg}
*/
class wxBusyInfo
{
public:
    /**
        Constructs a busy info window as child of @a parent and displays @e msg in it.

        @note If @a parent is not @NULL you must ensure that it is not
              closed while the busy info is shown.
    */
    wxBusyInfo(const wxString& msg, wxWindow* parent = NULL);

    /**
        Hides and closes the window containing the information text.
    */
    virtual ~wxBusyInfo();
};