NCBI C++ ToolKit
flexibledate_panel.hpp
Go to the documentation of this file.

Go to the SVN repository for this file.

1 #ifndef GUI_WIDGETS_EDIT___FLEXIBLEDATE_PANEL__HPP
2 #define GUI_WIDGETS_EDIT___FLEXIBLEDATE_PANEL__HPP
3 
4 /* $Id: flexibledate_panel.hpp 43219 2019-05-29 19:39:12Z filippov $
5  * ===========================================================================
6  *
7  * PUBLIC DOMAIN NOTICE
8  * National Center for Biotechnology Information
9  *
10  * This software/database is a "United States Government Work" under the
11  * terms of the United States Copyright Act. It was written as part of
12  * the author's official duties as a United States Government employee and
13  * thus cannot be copyrighted. This software/database is freely available
14  * to the public for use. The National Library of Medicine and the U.S.
15  * Government have not placed any restriction on its use or reproduction.
16  *
17  * Although all reasonable efforts have been taken to ensure the accuracy
18  * and reliability of the software and data, the NLM and the U.S.
19  * Government do not and cannot warrant the performance or results that
20  * may be obtained by using this software or data. The NLM and the U.S.
21  * Government disclaim all warranties, express or implied, including
22  * warranties of performance, merchantability or fitness for any particular
23  * purpose.
24  *
25  * Please cite the author in any work or product based on this material.
26  *
27  * ===========================================================================
28  *
29  * Authors: Colleen Bollin
30  */
31 
32 #include <corelib/ncbistd.hpp>
33 #include <objects/general/Date.hpp>
34 #include <gui/gui_export.h>
35 
36 #include <wx/panel.h>
37 #include <wx/choice.h>
38 #include <wx/textctrl.h>
39 
40 /*!
41  * Includes
42  */
43 
44 ////@begin includes
45 ////@end includes
46 
48 
49 /*!
50  * Forward declarations
51  */
52 
53 ////@begin forward declarations
54 ////@end forward declarations
55 
56 
57 /*!
58  * Control identifiers
59  */
60 
61 
62 ////@begin control identifiers
63 #define ID_FLEXIBLEDATE 10042
64 #define ID_FLEXIBLEDATE_YEAR 10041
65 #define ID_FLEXIBLEDATE_MONTH 10039
66 #define ID_FLEXIBLEDATE_DAY 10040
67 #define SYMBOL_CFLEXIBLEDATEPANEL_STYLE wxTAB_TRAVERSAL
68 #define SYMBOL_CFLEXIBLEDATEPANEL_TITLE _("FlexibleDate")
69 #define SYMBOL_CFLEXIBLEDATEPANEL_IDNAME ID_FLEXIBLEDATE
70 #define SYMBOL_CFLEXIBLEDATEPANEL_SIZE wxSize(400, 300)
71 #define SYMBOL_CFLEXIBLEDATEPANEL_POSITION wxDefaultPosition
72 ////@end control identifiers
73 
74 
75 /*!
76  * CFlexibleDatePanel class declaration
77  */
78 
80 {
81  DECLARE_DYNAMIC_CLASS( CFlexibleDatePanel )
82  DECLARE_EVENT_TABLE()
83 
84 public:
85  /// Constructors
87  CFlexibleDatePanel( wxWindow* parent, CRef<objects::CDate> the_date, long min_year = 1900, long range = 200, wxWindowID id = SYMBOL_CFLEXIBLEDATEPANEL_IDNAME, const wxPoint& pos = SYMBOL_CFLEXIBLEDATEPANEL_POSITION, const wxSize& size = SYMBOL_CFLEXIBLEDATEPANEL_SIZE, long style = SYMBOL_CFLEXIBLEDATEPANEL_STYLE );
88 
89  /// Creation
90  bool Create( wxWindow* parent, wxWindowID id = SYMBOL_CFLEXIBLEDATEPANEL_IDNAME, const wxPoint& pos = SYMBOL_CFLEXIBLEDATEPANEL_POSITION, const wxSize& size = SYMBOL_CFLEXIBLEDATEPANEL_SIZE, long style = SYMBOL_CFLEXIBLEDATEPANEL_STYLE );
91 
92  /// Destructor
94 
95  /// Initialises member variables
96  void Init();
97 
98  /// Creates the controls and sizers
99  void CreateControls();
100 
101  bool TransferDataToWindow();
102  bool TransferDataFromWindow();
103 
104  CRef<objects::CDate> GetDate() const;
105  void SetDate(const objects::CDate& a_date );
106  void SetDate(const string &date);
107  void Clear();
108 
109  void SetToolTip(const wxString &tipString);
110 
111 ////@begin CFlexibleDatePanel event handler declarations
112 
113 ////@end CFlexibleDatePanel event handler declarations
114 
115 ////@begin CFlexibleDatePanel member function declarations
116 
117  /// Retrieves bitmap resources
118  wxBitmap GetBitmapResource( const wxString& name );
119 
120  /// Retrieves icon resources
121  wxIcon GetIconResource( const wxString& name );
122 ////@end CFlexibleDatePanel member function declarations
123 
124  /// Should we show tooltips?
125  static bool ShowToolTips();
126 
127  string GetYear() const {return m_YearCtrl->GetValue().ToStdString();}
128  string GetMonth() const {return m_MonthCtrl->GetStringSelection().ToStdString();}
129  string GetDay() const {return m_DayCtrl->GetValue().ToStdString();}
130 
131 ////@begin CFlexibleDatePanel member variables
132  wxTextCtrl* m_YearCtrl;
133  wxChoice* m_MonthCtrl;
134  wxTextCtrl* m_DayCtrl;
135 ////@end CFlexibleDatePanel member variables
136 private:
138  long m_Year;
139  long m_Day;
140  int m_Month;
141  long m_MinYear;
143 };
144 
146 
147 #endif // GUI_WIDGETS_EDIT___FLEXIBLEDATE_PANEL__HPP
CFlexibleDatePanel(wxWindow *parent, CRef< objects::CDate > the_date, long min_year=1900, long range=200, wxWindowID id=10042, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(400, 300), long style=wxTAB_TRAVERSAL)
void SetDate(const objects::CDate &a_date)
CRef< objects::CDate > m_Date
Include a standard set of the NCBI C++ Toolkit most basic headers.
#define SYMBOL_CFLEXIBLEDATEPANEL_IDNAME
#define SYMBOL_CFLEXIBLEDATEPANEL_STYLE
#define SYMBOL_CFLEXIBLEDATEPANEL_POSITION
#define SYMBOL_CFLEXIBLEDATEPANEL_SIZE
static void Init(void)
Definition: cursor6.c:76
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:100
#define NCBI_GUIWIDGETS_EDIT_EXPORT
Definition: gui_export.h:526
Defines to provide correct exporting from DLLs in Windows.
range(_Ty, _Ty) -> range< _Ty >
const struct ncbi::grid::netcache::search::fields::SIZE size
Modified on Sun Jul 21 04:21:57 2024 by modify_doxy.py rev. 669887