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

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

First release to xenial

File size: 2.2 KB
Line 
1#ifndef __VIEWHEADER_H__
2#define __VIEWHEADER_H__
3
4#include "state.h"
5
6class CComboBoxEx;
7class CViewHeader : public wxNavigationEnabled<wxWindow>
8{
9        friend class CComboBoxEx;
10public:
11        CViewHeader(wxWindow* pParent, const wxString& label);
12
13        // Reparents the control.
14        // Calls wxWindow::Reparent under WXMSW and WXGTK. On other systems,
15        // a new instance is created with the same content (but with different
16        // parent) and the provided pointer to pViewHeader will be modified.
17        static void Reparent(CViewHeader** pViewHeader, wxWindow* parent);
18
19        void SetLabel(const wxString& label);
20        wxString GetLabel() const;
21
22        virtual void SetFocus();
23
24protected:
25        CComboBoxEx* m_pComboBox{};
26        wxStaticText* m_pLabel{};
27        bool m_alreadyInPaint{};
28
29        DECLARE_EVENT_TABLE()
30        void OnSize(wxSizeEvent& event);
31
32        void OnPaint(wxPaintEvent& event);
33#ifdef __WXMSW__
34        void OnComboPaint(wxPaintEvent& event);
35        void OnComboMouseEvent(wxMouseEvent& event);
36        bool m_bLeftMousePressed{};
37#endif //__WXMSW__
38
39        void AddRecentDirectory(const wxString &directory);
40        std::deque<wxString> m_recentDirectories; // ordered by age
41        std::list<wxString> m_sortedRecentDirectories; // ordered by sort order
42
43        int m_cbOffset{};
44        int m_labelHeight{};
45};
46
47class CLocalViewHeader : public CViewHeader, CStateEventHandler
48{
49public:
50        CLocalViewHeader(wxWindow* pParent, CState* pState);
51
52protected:
53        virtual void OnStateChange(CState* pState, enum t_statechange_notifications notification, const wxString& data, const void* data2);
54
55        wxString m_oldValue;
56
57        DECLARE_EVENT_TABLE()
58        void OnTextChanged(wxCommandEvent& event);
59        void OnTextEnter(wxCommandEvent& event);
60        void OnSelectionChanged(wxCommandEvent& event);
61#ifdef __WXGTK__
62        void OnSelectTextEvent(wxCommandEvent& event);
63
64        wxString m_autoCompletionText;
65#endif
66};
67
68class CRemoteViewHeader : public CViewHeader, CStateEventHandler
69{
70public:
71        CRemoteViewHeader(wxWindow* pParent, CState* pState);
72
73protected:
74        virtual void OnStateChange(CState* pState, enum t_statechange_notifications notification, const wxString& data, const void* data2);
75
76        CServer m_lastServer;
77        CServerPath m_path;
78
79        DECLARE_EVENT_TABLE()
80        void OnTextChanged(wxCommandEvent& event);
81        void OnTextEnter(wxCommandEvent& event);
82        void OnSelectionChanged(wxCommandEvent& event);
83};
84
85#endif //__VIEWHEADER_H__
Note: See TracBrowser for help on using the repository browser.