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

Go to the SVN repository for this file.

1 #ifndef GUI_WIDGETS_EDIT___SINGLEAUTHOR_PANEL__HPP
2 #define GUI_WIDGETS_EDIT___SINGLEAUTHOR_PANEL__HPP
3 
4 /* $Id: singleauthor_panel.hpp 43131 2019-05-20 16:34:35Z bollin $
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 
34 #include <objmgr/scope.hpp>
35 #include <gui/gui_export.h>
36 // This header must (at least indirectly) precede any wxWidgets headers.
40 
41 #include <wx/panel.h>
42 #include <wx/textctrl.h>
43 #include <wx/hyperlink.h>
44 
45 class wxChoice;
46 
47 ////@begin forward declarations
48 ////@end forward declarations
49 
52  class CAuthor;
53  class CName_std;
55 
56 /*!
57  * Control identifiers
58  */
59 
60 
61 ////@begin control identifiers
62 #define ID_SINGLEAUTHOR 10025
63 #define ID_AUTH_FIRST 10026
64 #define ID_AUTH_MI 10027
65 #define ID_AUTH_LAST 10028
66 #define ID_AUTH_SUFFIX 10029
67 #define ID_AUTH_SWAP_NAME 10030
68 #define SYMBOL_CSINGLEAUTHORPANEL_STYLE wxTAB_TRAVERSAL
69 #define SYMBOL_CSINGLEAUTHORPANEL_TITLE _("SingleAuthor")
70 #define SYMBOL_CSINGLEAUTHORPANEL_IDNAME ID_SINGLEAUTHOR
71 #define SYMBOL_CSINGLEAUTHORPANEL_SIZE wxSize(400, 300)
72 #define SYMBOL_CSINGLEAUTHORPANEL_POSITION wxDefaultPosition
73 ////@end control identifiers
74 
75 
76 /*!
77  * CSingleAuthorPanel class declaration
78  */
79 
81 {
82  DECLARE_DYNAMIC_CLASS( CSingleAuthorPanel )
83  DECLARE_EVENT_TABLE()
84 
85 public:
86  /// Constructors
88  CSingleAuthorPanel( wxWindow* parent, objects::CAuthor& author,
89  wxWindowID id = SYMBOL_CSINGLEAUTHORPANEL_IDNAME,
90  const wxPoint& pos = SYMBOL_CSINGLEAUTHORPANEL_POSITION,
91  const wxSize& size = SYMBOL_CSINGLEAUTHORPANEL_SIZE,
92  long style = SYMBOL_CSINGLEAUTHORPANEL_STYLE );
93 
94  /// Creation
95  bool Create( wxWindow* parent,
96  wxWindowID id = SYMBOL_CSINGLEAUTHORPANEL_IDNAME,
97  const wxPoint& pos = SYMBOL_CSINGLEAUTHORPANEL_POSITION,
98  const wxSize& size = SYMBOL_CSINGLEAUTHORPANEL_SIZE,
99  long style = SYMBOL_CSINGLEAUTHORPANEL_STYLE );
100 
101  /// Destructor
103 
104  /// Initialises member variables
105  void Init();
106 
107  /// Creates the controls and sizers
108  void CreateControls();
109 
110  virtual bool TransferDataFromWindow();
111  virtual bool TransferDataToWindow();
112 
113  CRef<objects::CAuthor> GetAuthor() const;
114  void SetAuthor(const objects::CAuthor &author);
115 
116 ////@begin CSingleAuthorPanel event handler declarations
117 
118  void OnFirstNameKillFocus(wxFocusEvent& event);
119 
120 ////@end CSingleAuthorPanel event handler declarations
121 
122 ////@begin CSingleAuthorPanel member function declarations
123 
124  /// Retrieves bitmap resources
125  wxBitmap GetBitmapResource( const wxString& name );
126 
127  /// Retrieves icon resources
128  wxIcon GetIconResource( const wxString& name );
129 ////@end CSingleAuthorPanel member function declarations
130 
131  /// Should we show tooltips?
132  static bool ShowToolTips();
133 
134 ////@begin CSingleAuthorPanel member variables
135  wxTextCtrl* m_FirstNameCtrl;
136  wxTextCtrl* m_MiddleInitial;
137  wxTextCtrl* m_LastNameCtrl;
138  wxChoice* m_Suffix;
139 ////@end CSingleAuthorPanel member variables
140 
141  void OnMoveAuthorUpdated ( wxCommandEvent& evt );
142  void OnSwapName( wxCommandEvent& evt );
143  void HideNonTextCtrls();
144 
145  static string s_ParseInitialsFromName(const objects::CName_std& name);
146  static bool IsPlaceholder(const objects::CAuthor& author);
147 
148 private:
149  string x_ParseInitialsFromAuthor();
150 
152  wxString m_FirstName;
153  wxString m_LastName;
157  wxArrayString m_SuffixStrings;
158 };
159 
161 
162 #endif // GUI_WIDGETS_EDIT___SINGLEAUTHOR_PANEL__HPP
CAuthor –.
Definition: Author.hpp:59
@Name_std.hpp User-defined methods of the data storage class.
Definition: Name_std.hpp:56
wxArrayString m_SuffixStrings
CSingleAuthorPanel(wxWindow *parent, objects::CAuthor &author, wxWindowID id=10025, const wxPoint &pos=wxDefaultPosition, const wxSize &size=wxSize(400, 300), long style=wxTAB_TRAVERSAL)
CNoTabBitmapButton * m_SwapButton
CLargeNoTabSpinControl * m_MoveSpinCtrl
CLargeNoTabSpinControl * m_InsertSpinCtrl
CRef< objects::CAuthor > m_Author
Include a standard set of the NCBI C++ Toolkit most basic headers.
Workaround for wxWidgets header errors in certain configurations; MUST be included (at least indirect...
static void Init(void)
Definition: cursor6.c:76
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
#define END_SCOPE(ns)
End the previously defined scope.
Definition: ncbistl.hpp:75
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:100
#define BEGIN_SCOPE(ns)
Define a new scope.
Definition: ncbistl.hpp:72
#define NCBI_GUIWIDGETS_EDIT_EXPORT
Definition: gui_export.h:526
Defines to provide correct exporting from DLLs in Windows.
const struct ncbi::grid::netcache::search::fields::SIZE size
#define SYMBOL_CSINGLEAUTHORPANEL_SIZE
#define SYMBOL_CSINGLEAUTHORPANEL_POSITION
#define SYMBOL_CSINGLEAUTHORPANEL_STYLE
#define SYMBOL_CSINGLEAUTHORPANEL_IDNAME
Modified on Wed Jun 19 17:07:08 2024 by modify_doxy.py rev. 669887