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

Go to the SVN repository for this file.

1 #ifndef GUI_WIDGETS_FEEDBACK___FEEDBACK_WIZARD__HPP
2 #define GUI_WIDGETS_FEEDBACK___FEEDBACK_WIZARD__HPP
3 
4 /* $Id: feedback_wizard.hpp 39434 2017-09-22 15:41:37Z katargir $
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: Roman Katargin
30  */
31 
32 #include <corelib/ncbiobj.hpp>
33 
34 #include <gui/gui_export.h>
35 
36 /*!
37  * Includes
38  */
39 
40 ////@begin includes
41 #include "wx/wizard.h"
42 #include "wx/valgen.h"
43 #include "wx/valtext.h"
44 ////@end includes
45 
46 class wxCheckBox;
47 class wxTextCtrl;
48 
50 
51 /*!
52  * Forward declarations
53  */
54 
55 ////@begin forward declarations
56 class WizardPage;
57 class WizardPage1;
58 class WizardPage2;
59 class WizardPage3;
60 class WizardPage4;
61 ////@end forward declarations
62 
63 ///////////////////////////////////////////////////////////////////////////////
64 /// class CFeedbackReport serves as a data model for all pages and coordinates
65 /// the submission of a report
67 {
68 public:
69  void SetEmailAddr(const string& str) { m_EmailAddr = str; }
70  const string& GetEmailAddr() const { return m_EmailAddr; }
71 
72  void SetDescr(const string& str) { m_Descr = str; }
73  const string& GetDescr() const { return m_Descr; }
74 
75  void SetSysInfo(const string& str) { m_SysInfo = str; }
76  const string& GetSysInfo() const { return m_SysInfo; }
77 
78  void SetIncludeLog(bool b) { m_IncludeLog = b; }
79  bool GetIncludeLog() const { return m_IncludeLog; }
80 
81  void SetSubscribe(bool b) { m_Subscribe = b; }
82  bool GetSubscribe() const { return m_Subscribe; }
83 
84  void SendFeedback();
85 
86  void Format(CNcbiOstream& ostr) const;
87 
88 private:
89  string m_EmailAddr;
90  string m_Descr;
91  string m_SysInfo;
94 };
95 
96 /*!
97  * Control identifiers
98  */
99 
100 ////@begin control identifiers
101 #define SYMBOL_CFEEDBACKWIZARD_IDNAME ID_CFEEDBACKWIZARD
102 ////@end control identifiers
103 
104 /*!
105  * CFeedbackWizard class declaration
106  */
107 
109 {
110  DECLARE_DYNAMIC_CLASS( CFeedbackWizard )
111  DECLARE_EVENT_TABLE()
112 
113 public:
114  /// Constructors
115  CFeedbackWizard();
116  CFeedbackWizard( wxWindow* parent, bool opt_out );
117 
118  /// Creation
119  bool Create( wxWindow* parent, wxWindowID id = SYMBOL_CFEEDBACKWIZARD_IDNAME, const wxPoint& pos = wxDefaultPosition );
120 
121  /// Destructor
122  ~CFeedbackWizard();
123 
124  /// Initialises member variables
125  void Init();
126 
127  /// Creates the controls and sizers
128  void CreateControls();
129 
130 ////@begin CFeedbackWizard event handler declarations
131 
132 ////@end CFeedbackWizard event handler declarations
133 
134 ////@begin CFeedbackWizard member function declarations
135 
136  /// Runs the wizard
137  bool Run();
138 
139  /// Retrieves bitmap resources
140  wxBitmap GetBitmapResource( const wxString& name );
141 
142  /// Retrieves icon resources
143  wxIcon GetIconResource( const wxString& name );
144 ////@end CFeedbackWizard member function declarations
145 
146  /// Should we show tooltips?
147  static bool ShowToolTips();
148 
149 ////@begin CFeedbackWizard member variables
150  /// Control identifiers
151  enum {
152  ID_CFEEDBACKWIZARD = 10000
153  };
154 ////@end CFeedbackWizard member variables
155 
156 public:
157  CFeedbackReport GetReport() const;
158 
159  bool GetOptOut() const { return m_OptOut; }
160 
161  void SetProblemDescription(const char* description);
162 
163 private:
164  bool m_OptOut;
165 };
166 
167 /*!
168  * WizardPage class declaration
169  */
170 
171 class NCBI_GUIWIDGETS_FEEDBACK_EXPORT WizardPage: public wxWizardPageSimple
172 {
173  DECLARE_DYNAMIC_CLASS( WizardPage )
174  DECLARE_EVENT_TABLE()
175 
176 public:
177  /// Constructors
178  WizardPage();
179 
180  WizardPage( wxWizard* parent );
181 
182  /// Creation
183  bool Create( wxWizard* parent );
184 
185  /// Destructor
186  ~WizardPage();
187 
188  /// Initialises member variables
189  void Init();
190 
191  /// Creates the controls and sizers
192  void CreateControls();
193 
194 ////@begin WizardPage event handler declarations
195 
196  /// wxEVT_COMMAND_CHECKBOX_CLICKED event handler for ID_CHECKBOX4
197  void OnOptOutClick( wxCommandEvent& event );
198 
199 ////@end WizardPage event handler declarations
200 
201 ////@begin WizardPage member function declarations
202 
203  bool GetOptOut() const { return m_OptOut ; }
204  void SetOptOut(bool value) { m_OptOut = value ; }
205 
206  /// Retrieves bitmap resources
207  wxBitmap GetBitmapResource( const wxString& name );
208 
209  /// Retrieves icon resources
210  wxIcon GetIconResource( const wxString& name );
211 ////@end WizardPage member function declarations
212 
213  /// Should we show tooltips?
214  static bool ShowToolTips();
215 
216 ////@begin WizardPage member variables
217 private:
218  bool m_OptOut;
219  /// Control identifiers
220  enum {
221  ID_WIZARDPAGE1 = 10001,
222  ID_CHECKBOX4 = 10014
223  };
224 ////@end WizardPage member variables
225 };
226 
227 /*!
228  * WizardPage1 class declaration
229  */
230 
231 class NCBI_GUIWIDGETS_FEEDBACK_EXPORT WizardPage1: public wxWizardPageSimple
232 {
233  DECLARE_DYNAMIC_CLASS( WizardPage1 )
234  DECLARE_EVENT_TABLE()
235 
236 public:
237  /// Constructors
238  WizardPage1();
239 
240  WizardPage1( wxWizard* parent );
241 
242  /// Creation
243  bool Create( wxWizard* parent );
244 
245  /// Destructor
246  ~WizardPage1();
247 
248  /// Initialises member variables
249  void Init();
250 
251  /// Creates the controls and sizers
252  void CreateControls();
253 
254 ////@begin WizardPage1 event handler declarations
255 
256  /// wxEVT_WIZARD_PAGE_CHANGING event handler for ID_WIZARDPAGE2
257  void OnWizardpagePolicyChanging( wxWizardEvent& event );
258 
259  /// wxEVT_COMMAND_CHECKBOX_CLICKED event handler for ID_ACKNOWLEDGE
260  void OnAcknowledgePolicy( wxCommandEvent& event );
261 
262 ////@end WizardPage1 event handler declarations
263 
264 ////@begin WizardPage1 member function declarations
265 
266  /// Retrieves bitmap resources
267  wxBitmap GetBitmapResource( const wxString& name );
268 
269  /// Retrieves icon resources
270  wxIcon GetIconResource( const wxString& name );
271 ////@end WizardPage1 member function declarations
272 
273  /// Should we show tooltips?
274  static bool ShowToolTips();
275 
276 ////@begin WizardPage1 member variables
277  wxCheckBox* m_AcceptPolicy;
278  /// Control identifiers
279  enum {
280  ID_WIZARDPAGE2 = 10002,
281  ID_TEXTCTRL1 = 10003,
282  ID_ACKNOWLEDGE = 10004
283  };
284 ////@end WizardPage1 member variables
285 };
286 
287 /*!
288  * WizardPage2 class declaration
289  */
290 
291 class NCBI_GUIWIDGETS_FEEDBACK_EXPORT WizardPage2: public wxWizardPageSimple
292 {
293  DECLARE_DYNAMIC_CLASS( WizardPage2 )
294  DECLARE_EVENT_TABLE()
295 
296 public:
297  /// Constructors
298  WizardPage2();
299 
300  WizardPage2( wxWizard* parent );
301 
302  /// Creation
303  bool Create( wxWizard* parent );
304 
305  /// Destructor
306  ~WizardPage2();
307 
308  /// Initialises member variables
309  void Init();
310 
311  /// Creates the controls and sizers
312  void CreateControls();
313 
314 ////@begin WizardPage2 event handler declarations
315 
316  /// wxEVT_WIZARD_PAGE_CHANGING event handler for ID_WIZARDPAGE3
317  void OnProblemPageChanging( wxWizardEvent& event );
318 
319  /// wxEVT_COMMAND_TEXT_UPDATED event handler for ID_EMAILCTRL
320  void OnEmailCtrlTextUpdated( wxCommandEvent& event );
321 
322  /// wxEVT_COMMAND_CHECKBOX_CLICKED event handler for ID_CHECKBOX
323  void OnSendAnonymously( wxCommandEvent& event );
324 
325 ////@end WizardPage2 event handler declarations
326 
327 ////@begin WizardPage2 member function declarations
328 
329  wxString GetEMail() const { return m_EMail ; }
330  void SetEMail(wxString value) { m_EMail = value ; }
331 
332  bool GetIncludeLog() const { return m_IncludeLog ; }
333  void SetIncludeLog(bool value) { m_IncludeLog = value ; }
334 
335  wxString GetProblemDescr() const { return m_ProblemDescr ; }
336  void SetProblemDescr(wxString value) { m_ProblemDescr = value ; }
337 
338  bool GetSendAnonymously() const { return m_SendAnonymously ; }
339  void SetSendAnonymously(bool value) { m_SendAnonymously = value ; }
340 
341  bool GetSubscribe() const { return m_Subscribe ; }
342  void SetSubscribe(bool value) { m_Subscribe = value ; }
343 
344  /// Retrieves bitmap resources
345  wxBitmap GetBitmapResource( const wxString& name );
346 
347  /// Retrieves icon resources
348  wxIcon GetIconResource( const wxString& name );
349 ////@end WizardPage2 member function declarations
350 
351  /// Should we show tooltips?
352  static bool ShowToolTips();
353 
354 ////@begin WizardPage2 member variables
355  wxTextCtrl* m_EMailCtrl;
357  wxCheckBox* m_SubChbx;
358 private:
359  wxString m_EMail;
361  wxString m_ProblemDescr;
364  /// Control identifiers
365  enum {
366  ID_WIZARDPAGE3 = 10005,
367  ID_EMAILCTRL = 10006,
368  ID_CHECKBOX = 10027,
369  ID_DESCRCTRL = 10007,
370  ID_CHECK_SENDLOG = 10008,
371  ID_CHECK_SUBSCRIBE = 10019
372  };
373 ////@end WizardPage2 member variables
374 };
375 
376 /*!
377  * WizardPage3 class declaration
378  */
379 
380 class NCBI_GUIWIDGETS_FEEDBACK_EXPORT WizardPage3: public wxWizardPageSimple
381 {
382  DECLARE_DYNAMIC_CLASS( WizardPage3 )
383  DECLARE_EVENT_TABLE()
384 
385 public:
386  /// Constructors
387  WizardPage3();
388 
389  WizardPage3( wxWizard* parent );
390 
391  /// Creation
392  bool Create( wxWizard* parent );
393 
394  /// Destructor
395  ~WizardPage3();
396 
397  /// Initialises member variables
398  void Init();
399 
400  /// Creates the controls and sizers
401  void CreateControls();
402 
403  void OnShow(wxShowEvent& event);
404 
405 ////@begin WizardPage3 event handler declarations
406 
407 ////@end WizardPage3 event handler declarations
408 
409 ////@begin WizardPage3 member function declarations
410 
411  bool GetIncludeSysInfo() const { return m_IncludeSysInfo ; }
412  void SetIncludeSysInfo(bool value) { m_IncludeSysInfo = value ; }
413 
414  wxString GetSysInfo() const { return m_SysInfo ; }
415  void SetSysInfo(wxString value) { m_SysInfo = value ; }
416 
417  /// Retrieves bitmap resources
418  wxBitmap GetBitmapResource( const wxString& name );
419 
420  /// Retrieves icon resources
421  wxIcon GetIconResource( const wxString& name );
422 ////@end WizardPage3 member function declarations
423 
424  /// Should we show tooltips?
425  static bool ShowToolTips();
426 
427 ////@begin WizardPage3 member variables
428 private:
430  wxString m_SysInfo;
431  /// Control identifiers
432  enum {
433  ID_WIZARDPAGE4 = 10009,
434  ID_CHECKBOX3 = 10010,
435  ID_TEXTCTRL4 = 10011
436  };
437 ////@end WizardPage3 member variables
438 };
439 
440 /*!
441  * WizardPage4 class declaration
442  */
443 
444 class NCBI_GUIWIDGETS_FEEDBACK_EXPORT WizardPage4: public wxWizardPageSimple
445 {
446  DECLARE_DYNAMIC_CLASS( WizardPage4 )
447  DECLARE_EVENT_TABLE()
448 
449 public:
450  /// Constructors
451  WizardPage4();
452 
453  WizardPage4( wxWizard* parent );
454 
455  /// Creation
456  bool Create( wxWizard* parent );
457 
458  /// Destructor
459  ~WizardPage4();
460 
461  /// Initialises member variables
462  void Init();
463 
464  /// Creates the controls and sizers
465  void CreateControls();
466 
467 ////@begin WizardPage4 event handler declarations
468 
469  /// wxEVT_WIZARD_PAGE_CHANGED event handler for ID_WIZARDPAGE5
470  void OnWizardpageSubmitChanged( wxWizardEvent& event );
471 
472 ////@end WizardPage4 event handler declarations
473 
474 ////@begin WizardPage4 member function declarations
475 
476  /// Retrieves bitmap resources
477  wxBitmap GetBitmapResource( const wxString& name );
478 
479  /// Retrieves icon resources
480  wxIcon GetIconResource( const wxString& name );
481 ////@end WizardPage4 member function declarations
482 
483  /// Should we show tooltips?
484  static bool ShowToolTips();
485 
486 ////@begin WizardPage4 member variables
487  /// Control identifiers
488  enum {
489  ID_WIZARDPAGE5 = 10012,
490  ID_TEXTCTRL5 = 10013
491  };
492 ////@end WizardPage4 member variables
493 };
494 
496 
497 #endif // GUI_WIDGETS_FEEDBACK___FEEDBACK_WIZARD__HPP
#define ID_CHECKBOX3
#define ID_CHECKBOX4
class CFeedbackReport serves as a data model for all pages and coordinates the submission of a report
void SetDescr(const string &str)
void SetEmailAddr(const string &str)
const string & GetDescr() const
const string & GetSysInfo() const
void SetSubscribe(bool b)
const string & GetEmailAddr() const
void SetSysInfo(const string &str)
bool GetIncludeLog() const
void SetIncludeLog(bool b)
bool GetSubscribe() const
bool GetOptOut() const
CObject –.
Definition: ncbiobj.hpp:180
wxCheckBox * m_AcceptPolicy
void SetEMail(wxString value)
wxString GetEMail() const
bool GetSendAnonymously() const
bool GetIncludeLog() const
wxCheckBox * m_SendAnonymouslyCtrl
void SetIncludeLog(bool value)
wxCheckBox * m_SubChbx
wxString GetProblemDescr() const
wxTextCtrl * m_EMailCtrl
void SetProblemDescr(wxString value)
void SetSubscribe(bool value)
void SetSendAnonymously(bool value)
wxString m_ProblemDescr
bool GetSubscribe() const
void SetIncludeSysInfo(bool value)
wxString GetSysInfo() const
bool GetIncludeSysInfo() const
wxString m_SysInfo
void SetSysInfo(wxString value)
void SetOptOut(bool value)
bool GetOptOut() const
#define SYMBOL_CFEEDBACKWIZARD_IDNAME
static void Init(void)
Definition: cursor6.c:76
static const char * str(char *buf, int n)
Definition: stats.c:84
#define END_NCBI_SCOPE
End previously defined NCBI scope.
Definition: ncbistl.hpp:103
#define BEGIN_NCBI_SCOPE
Define ncbi namespace.
Definition: ncbistl.hpp:100
IO_PREFIX::ostream CNcbiOstream
Portable alias for ostream.
Definition: ncbistre.hpp:149
void Run(void)
Enter the main loop.
#define NCBI_GUIWIDGETS_FEEDBACK_EXPORT
Definition: gui_export.h:545
Defines to provide correct exporting from DLLs in Windows.
#define ID_TEXTCTRL4
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1227
Portable reference counted smart and weak pointers using CWeakRef, CRef, CObject and CObjectEx.
Format
Definition: njn_ioutil.hpp:52
#define ID_CHECKBOX
#define ID_TEXTCTRL5
#define ID_TEXTCTRL1
Modified on Wed May 01 14:25:24 2024 by modify_doxy.py rev. 669887