source: filezilla/trunk/fuentes/src/interface/window_state_manager.h @ 130

Last change on this file since 130 was 130, checked in by jrpelegrina, 3 years ago

First release to xenial

File size: 1.0 KB
Line 
1#ifndef __WINDOW_STATE_MANAGER_H__
2#define __WINDOW_STATE_MANAGER_H__
3
4// This class get used to remember toplevel window size and position across
5// sessions.
6
7class CWindowStateManager : public wxEvtHandler
8{
9public:
10        CWindowStateManager(wxTopLevelWindow* pWindow);
11        virtual ~CWindowStateManager();
12
13        bool Restore(const unsigned int optionId, const wxSize& default_size = wxSize(-1, -1));
14        void Remember(unsigned int optionId);
15
16        static wxRect GetScreenDimensions();
17
18#ifdef __WXGTK__
19        // Set nonzero if Restore maximized the window.
20        // Reason is that under wxGTK, maximization request may take some time.
21        // It is actually done asynchronously by the window manager.
22        unsigned int m_maximize_requested;
23#endif
24
25protected:
26        bool ReadDefaults(const unsigned int optionId, bool& maximized, wxPoint& position, wxSize& size);
27
28        wxTopLevelWindow* m_pWindow;
29
30        bool m_lastMaximized;
31        wxPoint m_lastWindowPosition;
32        wxSize m_lastWindowSize;
33
34        void OnSize(wxSizeEvent& event);
35        void OnMove(wxMoveEvent& event);
36};
37
38#endif //__WINDOW_STATE_MANAGER_H__
Note: See TracBrowser for help on using the repository browser.