~ubuntu-branches/ubuntu/utopic/pgadmin3/utopic-proposed

« back to all changes in this revision

Viewing changes to pgadmin/include/ctl/timespin.h

  • Committer: Bazaar Package Importer
  • Author(s): Gerfried Fuchs
  • Date: 2011-06-07 23:03:54 UTC
  • mfrom: (1.3.1 upstream) (13 sid)
  • mto: This revision was merged to the branch mainline in revision 14.
  • Revision ID: james.westby@ubuntu.com-20110607230354-3td4j9y71u4ahcvj
Tags: 1.14.0~beta1-1
* New upstream development release, adding Build-Depends on
  postgresql-server-dev-all >= 117~.
* Add Build-Depends on quilt, (un)patch to debian/rules and patch for fixing
  the include for kwlist.h in pgadmin/db/keywords.c.
* Add pg_config --includedir-server output to CPPFLAGS.
* Remove unrecognized configure options: --with-wx-config,
  --with-pgsql-include, --enable-gtk2, --enable-unicode.
* Clean up manually the files that are left behind after the broken
  distclean.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
//////////////////////////////////////////////////////////////////////////
2
2
//
3
3
// pgAdmin III - PostgreSQL Tools
4
 
// 
5
 
// Copyright (C) 2002 - 2010, The pgAdmin Development Team
 
4
//
 
5
// Copyright (C) 2002 - 2011, The pgAdmin Development Team
6
6
// This software is released under the PostgreSQL Licence
7
7
//
8
8
// timespin.h - timeSpan SpinCtrl
19
19
class wxTimeSpinCtrl : public wxControl
20
20
{
21
21
public:
22
 
    wxTimeSpinCtrl() { Init(); }
23
 
    wxTimeSpinCtrl(wxWindow *parent,
24
 
                   wxWindowID id,
25
 
                   const wxPoint& pos = wxDefaultPosition,
26
 
                   const wxSize& size = wxDefaultSize,
27
 
                   long style = wxWANTS_CHARS, const wxString& name=wxT("wxTimeSpinCtrl"));
28
 
 
29
 
    bool Create(wxWindow *parent,
30
 
                   wxWindowID id,
31
 
                   const wxPoint& pos = wxDefaultPosition,
32
 
                   const wxSize& size = wxDefaultSize,
33
 
                   long style = wxWANTS_CHARS, const wxString& name=wxT("wxTimeSpinCtrl"));
34
 
 
35
 
    bool Destroy();
36
 
    bool Enable(bool enable=true);
37
 
 
38
 
    void SetMax(long seconds, bool useDay=false);
39
 
    bool SetValue(const wxTimeSpan& span);
40
 
    bool SetTime(const wxDateTime& time);
41
 
    wxTimeSpan GetValue();
 
22
        wxTimeSpinCtrl()
 
23
        {
 
24
                Init();
 
25
        }
 
26
        wxTimeSpinCtrl(wxWindow *parent,
 
27
                       wxWindowID id,
 
28
                       const wxPoint &pos = wxDefaultPosition,
 
29
                       const wxSize &size = wxDefaultSize,
 
30
                       long style = wxWANTS_CHARS, const wxString &name = wxT("wxTimeSpinCtrl"));
 
31
 
 
32
        bool Create(wxWindow *parent,
 
33
                    wxWindowID id,
 
34
                    const wxPoint &pos = wxDefaultPosition,
 
35
                    const wxSize &size = wxDefaultSize,
 
36
                    long style = wxWANTS_CHARS, const wxString &name = wxT("wxTimeSpinCtrl"));
 
37
 
 
38
        bool Destroy();
 
39
        bool Enable(bool enable = true);
 
40
 
 
41
        void SetMax(long seconds, bool useDay = false);
 
42
        bool SetValue(const wxTimeSpan &span);
 
43
        bool SetTime(const wxDateTime &time);
 
44
        wxTimeSpan GetValue();
42
45
 
43
46
private:
44
 
    void Init();
45
 
 
46
 
    void OnSpinUp(wxSpinEvent &ev);
47
 
    void OnSpinDown(wxSpinEvent &ev);
48
 
    void OnText(wxCommandEvent &ev);
49
 
    void OnSetFocus(wxFocusEvent &ev);
50
 
    void OnKillFocus(wxFocusEvent &ev);
51
 
    void OnEditKey(wxKeyEvent &ev);
52
 
    void OnNavigate(wxNavigationKeyEvent &ev);
53
 
 
54
 
    long GetTextTime();
55
 
    int  GetTimePart();
56
 
    void DoSpin(int diff);
57
 
    void Highlight(int tp);
58
 
 
59
 
    wxTextCtrl *m_txt;
60
 
    wxSpinButton *m_spn;
61
 
    wxString m_format;
62
 
    long spinValue, maxSpinValue;
63
 
    bool canWrap, hasDay;
64
 
 
65
 
    wxSize DoGetBestSize() const;
66
 
    void OnSize(wxSizeEvent& event);
67
 
 
68
 
    DECLARE_DYNAMIC_CLASS(wxTimeSpinCtrl)
69
 
    DECLARE_EVENT_TABLE()
70
 
    DECLARE_NO_COPY_CLASS(wxTimeSpinCtrl)
 
47
        void Init();
 
48
 
 
49
        void OnSpinUp(wxSpinEvent &ev);
 
50
        void OnSpinDown(wxSpinEvent &ev);
 
51
        void OnText(wxCommandEvent &ev);
 
52
        void OnSetFocus(wxFocusEvent &ev);
 
53
        void OnKillFocus(wxFocusEvent &ev);
 
54
        void OnEditKey(wxKeyEvent &ev);
 
55
        void OnNavigate(wxNavigationKeyEvent &ev);
 
56
 
 
57
        long GetTextTime();
 
58
        int  GetTimePart();
 
59
        void DoSpin(int diff);
 
60
        void Highlight(int tp);
 
61
 
 
62
        wxTextCtrl *m_txt;
 
63
        wxSpinButton *m_spn;
 
64
        wxString m_format;
 
65
        long spinValue, maxSpinValue;
 
66
        bool canWrap, hasDay;
 
67
 
 
68
        wxSize DoGetBestSize() const;
 
69
        void OnSize(wxSizeEvent &event);
 
70
 
 
71
        DECLARE_DYNAMIC_CLASS(wxTimeSpinCtrl)
 
72
        DECLARE_EVENT_TABLE()
 
73
        DECLARE_NO_COPY_CLASS(wxTimeSpinCtrl)
71
74
};
72
75
 
73
76
 
75
78
class wxTimeSpinCtrl : public wxSpinCtrl //wxControl
76
79
{
77
80
public:
78
 
    wxTimeSpinCtrl() { }
79
 
    wxTimeSpinCtrl(wxWindow *parent,
80
 
                   wxWindowID id,
81
 
                   const wxDateTime& date = wxDefaultDateTime,
82
 
                   const wxPoint& pos = wxDefaultPosition,
83
 
                   const wxSize& size = wxDefaultSize,
84
 
                   long style = wxWANTS_CHARS, const wxString& name=wxT("wxTimeSpinCtrl"));
85
 
 
86
 
    bool Destroy();
87
 
 
88
 
 
89
 
    bool Create(wxWindow *parent,
90
 
                            wxWindowID id,
91
 
                            const wxDateTime& date,
92
 
                            const wxPoint& pos,
93
 
                            const wxSize& size,
94
 
                            long style,
95
 
                            const wxString& name);
96
 
 
97
 
    bool SetValue(const wxTimeSpan& span);
98
 
    wxTimeSpan GetValue();
99
 
 
100
 
    virtual bool Enable(bool enable = true);
101
 
    virtual bool Show(bool show = true);
102
 
    virtual void DoMoveWindow(int x, int y, int width, int height);
 
81
        wxTimeSpinCtrl() { }
 
82
        wxTimeSpinCtrl(wxWindow *parent,
 
83
                       wxWindowID id,
 
84
                       const wxDateTime &date = wxDefaultDateTime,
 
85
                       const wxPoint &pos = wxDefaultPosition,
 
86
                       const wxSize &size = wxDefaultSize,
 
87
                       long style = wxWANTS_CHARS, const wxString &name = wxT("wxTimeSpinCtrl"));
 
88
 
 
89
        bool Destroy();
 
90
 
 
91
 
 
92
        bool Create(wxWindow *parent,
 
93
                    wxWindowID id,
 
94
                    const wxDateTime &date,
 
95
                    const wxPoint &pos,
 
96
                    const wxSize &size,
 
97
                    long style,
 
98
                    const wxString &name);
 
99
 
 
100
        bool SetValue(const wxTimeSpan &span);
 
101
        wxTimeSpan GetValue();
 
102
 
 
103
        virtual bool Enable(bool enable = true);
 
104
        virtual bool Show(bool show = true);
 
105
        virtual void DoMoveWindow(int x, int y, int width, int height);
103
106
 
104
107
private:
105
 
    wxTextCtrl *m_txt;
106
 
    wxSpinCtrl *m_spn;
107
 
    wxButton *m_btn;
108
 
    wxString m_format;
109
 
 
110
 
    bool m_dropped, m_processing;
111
 
 
112
 
    void Init();
113
 
    void DropDown(bool down=true);
114
 
 
115
 
    void OnEditKey(wxKeyEvent & event);
116
 
    void OnCalKey(wxKeyEvent & event);
117
 
    void OnClick(wxMouseEvent &ev);
118
 
    void OnSelChange(wxCalendarEvent &ev);
119
 
    void OnActivate(wxActivateEvent &ev);
120
 
    void OnSetFocus(wxFocusEvent &ev);
121
 
    void OnKillFocus(wxFocusEvent &ev);
122
 
 
123
 
    DECLARE_DYNAMIC_CLASS(wxTimeSpinCtrl)
124
 
    DECLARE_EVENT_TABLE()
125
 
    DECLARE_NO_COPY_CLASS(wxTimeSpinCtrl)
 
108
        wxTextCtrl *m_txt;
 
109
        wxSpinCtrl *m_spn;
 
110
        wxButton *m_btn;
 
111
        wxString m_format;
 
112
 
 
113
        bool m_dropped, m_processing;
 
114
 
 
115
        void Init();
 
116
        void DropDown(bool down = true);
 
117
 
 
118
        void OnEditKey(wxKeyEvent &event);
 
119
        void OnCalKey(wxKeyEvent &event);
 
120
        void OnClick(wxMouseEvent &ev);
 
121
        void OnSelChange(wxCalendarEvent &ev);
 
122
        void OnActivate(wxActivateEvent &ev);
 
123
        void OnSetFocus(wxFocusEvent &ev);
 
124
        void OnKillFocus(wxFocusEvent &ev);
 
125
 
 
126
        DECLARE_DYNAMIC_CLASS(wxTimeSpinCtrl)
 
127
        DECLARE_EVENT_TABLE()
 
128
        DECLARE_NO_COPY_CLASS(wxTimeSpinCtrl)
126
129
};
127
130
#endif
128
131