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

Go to the SVN repository for this file.

1 #ifndef GUI_WIDGETS_WX___RICHTEXTCTRL__EX_H
2 #define GUI_WIDGETS_WX___RICHTEXTCTRL__EX_H
3 
4 /* $Id: richtextctrl.hpp 43835 2019-09-09 18:56:51Z 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: Vladimir Tereshkov
30  *
31  * File Description:
32  *
33  */
34 
35 #include <corelib/ncbistd.hpp>
36 #include <gui/gui_export.h>
37 
38 #include <wx/textctrl.h>
39 
40 class wxMenu;
41 
43 
44 ///////////////////////////////////////////////////////////////////////////////
45 /// CRichTextCtrl - a wrapper for wxRichTextCtrl that handles additional
46 /// keyboard events (such as Clipboard shortcuts).
47 
49  public wxTextCtrl
50 {
51 public:
52  CRichTextCtrl();
53  CRichTextCtrl( wxWindow* parent, wxWindowID id = -1,
54  const wxString& value = wxEmptyString,
55  const wxPoint& pos = wxDefaultPosition,
56  const wxSize& size = wxDefaultSize,
57  long style = 0,
58  const wxValidator& validator = wxDefaultValidator,
59  const wxString& name = wxTextCtrlNameStr);
60 
61  ~CRichTextCtrl();
62 
63  bool Create(wxWindow* parent,
64  wxWindowID id,
65  const wxString& value,
66  const wxPoint& pos, const wxSize& size, long style,
67  const wxValidator& validator, const wxString& name);
68 
69  void OnKeyDown(wxKeyEvent &event);
70  void OnContextMenu(wxContextMenuEvent& event);
71  void RemoveFormatting();
72 
73  // On mac, rich text controls use left and right double and single quotes when user
74  // types into control. Standard utf8 conversion does not convert these back
75  // so this handles those special characters
76  string GetUtf8() const;
77 
78  void SetContextMenu(wxMenu* contextMenu);
79 
80 #ifdef __WXOSX_COCOA__
81  enum
82  {
83  kCustomCut = 10000,
84  kCustomCopy,
85  kCustomPaste,
86  kCustomDelete
87  };
88 #endif
89 
91 
92 protected:
93  wxMenu* m_ContextMenu;
94 };
95 
97 
98 #endif
CRichTextCtrl - a wrapper for wxRichTextCtrl that handles additional keyboard events (such as Clipboa...
wxMenu * m_ContextMenu
Include a standard set of the NCBI C++ Toolkit most basic headers.
#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_WX_EXPORT
Definition: gui_export.h:543
Defines to provide correct exporting from DLLs in Windows.
const struct ncbi::grid::netcache::search::fields::SIZE size
const GenericPointer< typename T::ValueType > T2 value
Definition: pointer.h:1227
Modified on Sun May 19 04:47:02 2024 by modify_doxy.py rev. 669887