OSDN Git Service

Handling key and mouse events in listctrl is improved
[molby/Molby.git] / wxSources / modalwindow.h
1 /**********************************************************************************************
2  *
3  * Filename  : modalwindow.h
4  * Purpose   : Allow a modalwindow like wxDialog but allowing menus and such.
5  * Author    : John A. Mason
6  * Created   : 8/27/2008 07:54:12 AM
7  * Copyright : Released under wxWidgets original license.
8  * **********************************************************************************************/
9
10 #ifndef __wx_ModalWindow_h__
11 #define __wx_ModalWindow_h__
12
13 #include <wx/wxprec.h>
14
15 #ifdef __BORLANDC__
16     #pragma hdrstop
17 #endif
18
19 #include <wx/frame.h>
20
21 #ifndef WX_PRECOMP
22     #include <wx/utils.h>
23     #include <wx/app.h>
24 #endif
25
26 #include <wx/evtloop.h>
27
28 class wxModalWindow : public wxFrame {
29    private:
30          // while we are showing a modal window we disable the other windows using
31          // this object
32          wxWindowDisabler *m_windowDisabler;
33
34          // modal window runs its own event loop
35                 wxEventLoop *m_eventLoop;
36         
37          // is modal right now?
38          bool m_isShowingModal;
39
40          //The return code of a modal window
41          int m_returnCode;
42    public:
43          wxModalWindow();
44          wxModalWindow(wxWindow* parent, wxWindowID id, const wxString& title, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = wxDEFAULT_FRAME_STYLE, const wxString& name = "modalwindow");
45          virtual ~wxModalWindow();
46
47
48          void Init();
49          bool Show(bool show);
50          bool IsModal() const;
51          int ShowModal();
52
53          void EndModal(int retCode);
54          void SetReturnCode(int retCode);
55          int GetReturnCode() const;
56         private:
57             //  20140920 Toshi Nagata
58                 DECLARE_DYNAMIC_CLASS(wxModalWindow)
59 };
60
61 #endif