Code::Blocks  SVN r11506
cbstyledtextctrl.h
Go to the documentation of this file.
1 /*
2  * This file is part of the Code::Blocks IDE and licensed under the GNU Lesser General Public License, version 3
3  * http://www.gnu.org/licenses/lgpl-3.0.html
4  */
5 
6 #ifndef CBSTYLEDTEXTCTRL_H_INCLUDED
7 #define CBSTYLEDTEXTCTRL_H_INCLUDED
8 
9 #include "wx/wxscintilla.h"
10 #include <wx/longlong.h>
11 #include "settings.h" // DLLIMPORT
12 
13 #include <map>
14 #include <set>
15 
16 class wxContextMenuEvent;
17 class wxFocusEvent;
18 class wxMouseEvent;
19 class wxPoint;
20 
22 {
23  public:
24  cbStyledTextCtrl(wxWindow* pParent, int id, const wxPoint& pos = wxDefaultPosition, const wxSize& size = wxDefaultSize, long style = 0);
25  ~cbStyledTextCtrl() override;
26 
28  void operator=(const cbStyledTextCtrl& /*rhs*/);
29 
30  wxDateTime GetLastFocusTime() const {return m_lastFocusTime;}
31  wxString GetLastSelectedText() const {return m_lastSelectedText;}
32 
33  void EnableTabSmartJump(bool enable = true);
35  bool IsCharacter(int style);
37  bool IsString(int style);
39  bool IsPreprocessor(int style);
41  bool IsComment(int style);
43  void CallTipCancel();
45  bool IsBraceShortcutActive();
46 
57  void DoBraceCompletion(const wxChar& ch);
65  bool DoSelectionBraceCompletion(const wxChar& ch);
66 
67  static std::map<int, std::set<int> > &GetCharacterLexerStyles();
68  static std::map<int, std::set<int> > &GetStringLexerStyles();
69  static std::map<int, std::set<int> > &GetPreprocessorLexerStyles();
70  static std::map<int, std::set<int> > &GetCommentLexerStyles();
71 
78  void MakeNearbyLinesVisible(int line);
79  private:
80  void OnContextMenu(wxContextMenuEvent& event);
81  void OnKillFocus(wxFocusEvent& event);
82  void OnSetFocus(wxFocusEvent& event);
83  void OnMouseMiddleDown(wxMouseEvent& event);
84  void OnKeyDown(wxKeyEvent& event);
85  void OnKeyUp(wxKeyEvent& event);
86  void OnMouseLeftUp(wxMouseEvent& event);
87 
88  bool AllowTabSmartJump();
89  void HighlightRightBrace();
90  void EmulateDwellStart();
91 
99 
100  static std::map<int, std::set<int> > CharacterLexerStyles;
101  static std::map<int, std::set<int> > StringLexerStyles;
102  static std::map<int, std::set<int> > PreprocessorLexerStyles;
103  static std::map<int, std::set<int> > CommentLexerStyles;
104 
106 };
107 
108 #endif // CBSTYLEDTEXTCTRL_H_INCLUDED
wxWindow * m_pParent
wxString GetLastSelectedText() const
void OnKeyDown(wxKeyEvent &evt)
#define DLLIMPORT
Definition: settings.h:16
wxDateTime GetLastFocusTime() const
wxUSE_UNICODE_dependent wxChar
static std::map< int, std::set< int > > CharacterLexerStyles
static std::map< int, std::set< int > > PreprocessorLexerStyles
static std::map< int, std::set< int > > CommentLexerStyles
wxLongLong m_lastFocusTime
const wxSize wxDefaultSize
const wxPoint wxDefaultPosition
void OnMouseLeftUp(wxMouseEvent &evt)
void CallTipCancel()
Remove the call tip from the screen.
static std::map< int, std::set< int > > StringLexerStyles
void OnContextMenu(wxContextMenuEvent &evt)
wxString m_lastSelectedText