File: time_control.h

package info (click to toggle)
plucker 1.8-34
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 21,340 kB
  • sloc: ansic: 47,691; cpp: 42,310; python: 17,043; makefile: 1,521; perl: 1,492; pascal: 1,123; sh: 474; sed: 64; java: 13; csh: 6
file content (110 lines) | stat: -rw-r--r-- 3,967 bytes parent folder | download | duplicates (4)
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
//----------------------------------------------------------------------------------------
/*!
    \file       time_control.h        
    \modified                            
    \copyright  (c) Robert O'Connor ( rob@medicalmnemonics.com )
    \licence    GPL
    \brief      Describes time_control class    
    \author     Robert O'Connor
    \date       2002/09/26
 */
// RCS-ID:      $Id: time_control.h,v 1.2 2003/03/17 17:43:20 robertoconnor Exp $
//----------------------------------------------------------------------------------------

//----------------------------------------------------------------------------------------
// Begin single inclusion of this .h file condition
//----------------------------------------------------------------------------------------

#ifndef _TIME_CONTROL_H_
#define _TIME_CONTROL_H_

//----------------------------------------------------------------------------------------
// GCC interface
//----------------------------------------------------------------------------------------

#if defined(__GNUG__) && ! defined(__APPLE__)
    #pragma interface "time_control.h"
#endif

//----------------------------------------------------------------------------------------
// Shared defines
//----------------------------------------------------------------------------------------

#include "plucker_defines.h"

//----------------------------------------------------------------------------------------
// Headers
//----------------------------------------------------------------------------------------

#include "wx/panel.h"
#include "wx/datetime.h"
#include "wx/spinbutt.h"

//----------------------------------------------------------------------------------------
// Class definition: time_control
//----------------------------------------------------------------------------------------

//! A control for entering a time: has spinners for hours and minutes.
class time_control : public wxPanel
{

public:

    DECLARE_DYNAMIC_CLASS( time_control )

public:

    //! Constructor.
    /*!
        \param parent The parent window.
        \param id The id of the progress_listbox. Will usually be -1 unless multiple
            of them on the same dialog.
        \param pos The pixel position of the listctrl on its parent window
        \param size The pixel size of the listctrl
        \param style Style of the listbox. See wxWindows wxListBox docs for details.
        \param name Windows name (rarely used).
     */
    time_control( wxWindow *parent,
                  wxWindowID id = -1,
                  const wxPoint &pos = wxDefaultPosition,
                  const wxSize &size = wxDefaultSize,
                  const wxString &name = "the_time_control" );

    // Unused constructor: solely for usage of RTTI (DYNAMIC_CLASS) macros.
    time_control() {};

    //! Destructor
    ~time_control();

    wxDateTime               get_time();
    wxDateTime::wxDateTime_t get_hour();
    wxDateTime::wxDateTime_t get_minute();

    void        set_time( const wxDateTime& input_time );
    void        set_hour( const wxDateTime::wxDateTime_t input_hour );
    void        set_minute( const wxDateTime::wxDateTime_t input_minute );

    void        enable ( bool do_enable );

private:

    void        on_hour_textctrl( wxCommandEvent& event );
    void        on_hour_spinbutton( wxSpinEvent& event );
    void        on_minute_textctrl( wxCommandEvent& event );
    void        on_minute_spinbutton( wxSpinEvent& event );

    wxTextCtrl*   m_hour_textctrl;
    wxSpinButton* m_hour_spinbutton;
    wxStaticText* m_colon_statictext;
    wxTextCtrl*   m_minute_textctrl;
    wxSpinButton* m_minute_spinbutton;

    DECLARE_EVENT_TABLE()

};

//----------------------------------------------------------------------------------------
// End single inclusion of this .h file condition
//----------------------------------------------------------------------------------------

#endif  //_TIME_CONTROL_H_