1
//////////////////////////////////////////////////////////////////////////////
2
//////////////////////////////////////////////////////////////////////////////
4
// copyright : (C) 2008 by Eran Ifrah
5
// file name : cc_box.h
7
// -------------------------------------------------------------------------
10
// / __ \ | | | | (_) |
11
// | / \/ ___ __| | ___| | _| |_ ___
12
// | | / _ \ / _ |/ _ \ | | | __/ _ )
13
// | \__/\ (_) | (_| | __/ |___| | || __/
14
// \____/\___/ \__,_|\___\_____/_|\__\___|
18
// This program is free software; you can redistribute it and/or modify
19
// it under the terms of the GNU General Public License as published by
20
// the Free Software Foundation; either version 2 of the License, or
21
// (at your option) any later version.
23
//////////////////////////////////////////////////////////////////////////////
24
//////////////////////////////////////////////////////////////////////////////
30
Subclass of CCBoxBase, which is generated by wxFormBuilder.
33
#include "cc_boxbase.h"
40
/** Implementing CCBoxBase */
41
class CCBox : public CCBoxBase {
43
std::vector<TagEntryPtr> m_tags;
47
bool m_insertSingleChoice;
48
std::map<wxString, int> m_userImages;
49
wxEvtHandler * m_owner;
53
// Handlers for CCBoxBase events.
54
void OnItemActivated( wxListEvent& event );
55
void OnItemDeSelected( wxListEvent& event );
56
void OnItemSelected( wxListEvent& event );
58
void OnShowPublicItems(wxCommandEvent& event);
62
int GetImageId(const TagEntry &entry);
63
void SelectItem(long item);
64
void Show(const wxString &word);
65
void DoInsertSelection(const wxString &word, bool triggerTip = true);
70
CCBox(LEditor* parent, bool autoHide = true, bool autoInsertSingleChoice = true);
73
void Show(const std::vector<TagEntryPtr> &tags, const wxString &word, bool showFullDecl, wxEvtHandler *owner = NULL);
74
void InsertSelection();
78
// can this window have focus? (no)
79
bool AcceptsFocus() const {
83
bool SelectWord(const wxString &word);
88
void SetAutoHide(const bool& autoHide) {
89
this->m_autoHide = autoHide;
91
void SetInsertSingleChoice(const bool& insertSingleChoice) {
92
this->m_insertSingleChoice = insertSingleChoice;
95
const bool& GetAutoHide() const {
98
const bool& GetInsertSingleChoice() const {
99
return m_insertSingleChoice;
103
* @brief register new user image fot TagEntry kind
104
* @param kind the kind string that will be associated with the bitmap (TagEntry::GetKind())
105
* @param bmp 16x16 bitmap
107
void RegisterImageForKind(const wxString &kind, const wxBitmap &bmp);
1
//////////////////////////////////////////////////////////////////////////////
2
//////////////////////////////////////////////////////////////////////////////
4
// copyright : (C) 2008 by Eran Ifrah
5
// file name : cc_box.h
7
// -------------------------------------------------------------------------
10
// / __ \ | | | | (_) |
11
// | / \/ ___ __| | ___| | _| |_ ___
12
// | | / _ \ / _ |/ _ \ | | | __/ _ )
13
// | \__/\ (_) | (_| | __/ |___| | || __/
14
// \____/\___/ \__,_|\___\_____/_|\__\___|
18
// This program is free software; you can redistribute it and/or modify
19
// it under the terms of the GNU General Public License as published by
20
// the Free Software Foundation; either version 2 of the License, or
21
// (at your option) any later version.
23
//////////////////////////////////////////////////////////////////////////////
24
//////////////////////////////////////////////////////////////////////////////
30
Subclass of CCBoxBase, which is generated by wxFormBuilder.
33
#include "cc_boxbase.h"
34
#include "comment_parser.h"
38
#include "wx/wxscintilla.h"
42
/** Implementing CCBoxBase */
43
class CCBox : public CCBoxBase
46
std::vector<TagEntryPtr> m_tags;
50
bool m_insertSingleChoice;
51
std::map<wxString, int> m_userImages;
52
wxEvtHandler * m_owner;
54
bool m_hideExtInfoPane;
55
CommentParseResult m_comments;
58
CCItemInfo m_currentItem;
65
// Handlers for CCBoxBase events.
66
void OnItemActivated( wxListEvent& event );
67
void OnItemDeSelected( wxListEvent& event );
68
void OnItemSelected( wxListEvent& event );
70
void OnShowPublicItems(wxCommandEvent& event);
71
void OnShowComments(wxCommandEvent& event);
72
void OnTipClicked(wxScintillaEvent &event);
74
void OnKeyDown(wxListEvent& event);
78
int GetImageId(TagEntryPtr entry);
79
void SelectItem(long item);
80
void Show(const wxString &word);
81
void DoInsertSelection(const wxString &word, bool triggerTip = true);
82
void DoFormatDescriptionPage(const CCItemInfo& tag);
84
void DoHideCCHelpTab();
85
void DoFilterCompletionEntries(CCItemInfo& item);
88
CCBox(LEditor* parent, bool autoHide = true, bool autoInsertSingleChoice = true);
92
void Show(const std::vector<TagEntryPtr> &tags, const wxString &word, bool showFullDecl, wxEvtHandler *owner = NULL);
93
void InsertSelection();
97
// can this window have focus? (no)
98
bool AcceptsFocus() const {
102
void EnableExtInfoPane();
103
bool SelectWord(const wxString &word);
108
void SetAutoHide(const bool& autoHide) {
109
this->m_autoHide = autoHide;
111
void SetInsertSingleChoice(const bool& insertSingleChoice) {
112
this->m_insertSingleChoice = insertSingleChoice;
115
const bool& GetAutoHide() const {
118
const bool& GetInsertSingleChoice() const {
119
return m_insertSingleChoice;
123
* @brief register new user image fot TagEntry kind
124
* @param kind the kind string that will be associated with the bitmap (TagEntry::GetKind())
125
* @param bmp 16x16 bitmap
127
void RegisterImageForKind(const wxString &kind, const wxBitmap &bmp);