My favorites | Sign in
Project Home Downloads Source
Checkout   Browse   Changes    
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
#include "ide.h"

void AssistEditor::SyncNavigator()
{
if(IsNavigator()) {
browser.Load();
SyncCursor();
}
navigatorframe.Show(navigator);
}

void AssistEditor::SyncCursor()
{
String k = "(" + GetKeyDesc(IdeKeys::AK_SEARCHCODE().key[0]) + ") ";
browser.search.NullText(String("Find ") + k);
browser.search.Tip(IsNull(browser.search) ? String() : "Clear " + k);
if(IsNavigator()) {
int ii = GetCursorLine();
String coderef;
while(ii >= 0 && IsNull(coderef))
coderef = GetAnnotation(ii--);
browser.Goto(coderef, theide->editfile);
}
}

void AssistEditor::SelectionChanged()
{
CodeEditor::SelectionChanged();
SyncCursor();
SyncParamInfo();
}

void AssistEditor::BrowserGotoNF()
{
Value scope = browser.scope.GetKey(); // do not scroll browser.item erratically
int scopesc = browser.scope.GetScroll();
String item = browser.item.GetKey();
int itemsc = browser.item.GetScroll();

String cref = browser.GetCodeRef();
if(theide && !theide->SwapSIf(cref))
theide->IdeGotoCodeRef(cref);

if(scope == browser.scope.GetKey()) {
browser.scope.ScrollTo(scopesc);
browser.scope.ScrollIntoCursor();
if(item == browser.item.GetKey()) {
browser.item.ScrollTo(itemsc);
browser.item.ScrollIntoCursor();
}
}
}

void AssistEditor::BrowserGoto()
{
BrowserGotoNF();
SetFocus();
}

void AssistEditor::GotoBrowserScope()
{
if(browser.scope.IsCursor()) {
Value x = browser.scope.Get(2);
if(IsNumber(x)) {
int file = (int)x;
theide->EditFile(GetCppFile(file));
return;
}
}
if(browser.item.GetCount()) {
browser.item.GoBegin();
BrowserGoto();
}
}

void AssistEditor::Navigator(bool nav)
{
navigator = nav;
navigatorframe.Show(navigator);
if(IsNavigator()) {
scope_item.Show();
browser.ClearSearch();
SetFocus();
}
SyncNavigator();
SyncCursor();
}

void AssistEditor::SerializeNavigator(Stream& s)
{
int version = 1;
s / version;
s % navigatorframe;
s % navigator;
if(version >= 1)
s % scope_item;
Navigator(navigator);
}

void Ide::ToggleNavigator()
{
editor.Navigator(!editor.navigator);
}

void Ide::SearchCode()
{
if(!editor.navigator)
editor.Navigator(true);
if(editor.browser.search.HasFocus() && editor.browser.IsSearch())
editor.browser.ClearSearch();
else {
String id = editor.GetI().ToString();
if(!IsNull(id)) {
editor.browser.search <<= Filter(id, SearchItemFilter);
editor.browser.search.SetSelection();
editor.browser.Load();
editor.browser.scope.GoBegin();
}
editor.browser.search.SetFocus();
}
}

void Ide::SwitchHeader() {
int c = filelist.GetCursor();
if(c < 0) return;
String currfile = filelist[c];
const char *ext = GetFileExtPos(currfile);
if(!stricmp(ext, ".h") || !stricmp(ext, ".hpp")
|| !stricmp(ext, ".lay") || !stricmp(ext, ".iml")) {
int f = filelist.Find(ForceExt(currfile, ".cpp"));
if(f < 0) f = filelist.Find(ForceExt(currfile, ".c"));
if(f < 0) f = filelist.Find(ForceExt(currfile, ".cc"));
if(f >= 0) filelist.SetCursor(f);
}
}

Change log

r4164 by cxl on Nov 12, 2011   Diff
*ide: Fixed issue with codebrowser and aux
package (RM #116)
Go to: 
Project members, sign in to write a code review

Older revisions

r2191 by cxl on Mar 7, 2010   Diff
CtrlLib: FileSel now has a left bar
with common folders (adjustable by
client code)
r1164 by cxl on May 12, 2009   Diff
theide: Navigator finetuning
r1124 by cxl on May 3, 2009   Diff
Search symbol (Ctrl+Q) now copies
current id search field
All revisions of this file

File info

Size: 3108 bytes, 135 lines
Powered by Google Project Hosting