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
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
#include "ide.h"

#define LLOG(x) // LOG(x)

int CharFilterVar(int c)
{
return IsAlNum(c) || c == '_' ? c : 0;
}

void DlCharset(DropList& d)
{
d.Add(CHARSET_UTF8, "UTF8");
d.Add(TextCtrl::CHARSET_UTF8_BOM, "UTF8 BOM");
for(int i = 1; i < CharsetCount(); i++)
d.Add(i, CharsetName(i));
}

class FontSelectManager {
DropList *face;
DropList *height;
Option *bold;
Option *italic;
Option *naa;

void FaceSelect();
void Select();

public:
Callback WhenAction;

typedef FontSelectManager CLASSNAME;

void Set(DropList& _face, DropList& _height,
Option& _bold, Option& _italic, Option& _naa);
void Set(Font f);
Font Get();
};

void FontSelectManager::FaceSelect() {
Select();
}

void FontSelectManager::Select() {
WhenAction();
}

void LoadFonts(DropList *face, Index<String>& fni, bool fixed)
{
for(int i = 0; i < Font::GetFaceCount(); i++)
if(!!(Font::GetFaceInfo(i) & Font::FIXEDPITCH) == fixed) {
String n = Font::GetFaceName(i);
if(fni.Find(n) < 0) {
fni.Add(n);
face->Add(i, n);
}
}
}

void FontSelectManager::Set(DropList& _face, DropList& _height,
Option& _bold, Option& _italic, Option& _naa) {
face = &_face;
face->WhenAction = THISBACK(FaceSelect);
height = &_height;
height->WhenAction = THISBACK(Select);
bold = &_bold;
bold->WhenAction = THISBACK(Select);
italic = &_italic;
italic->WhenAction = THISBACK(Select);
naa = &_naa;
naa->WhenAction = THISBACK(Select);
face->Clear();
Index<String> fni;
LoadFonts(face, fni, true);
face->AddSeparator();
LoadFonts(face, fni, false);
face->SetIndex(0);
height->ClearList();
for(int i = 6; i < 32; i++)
height->Add(i);
FaceSelect();
}

void FontSelectManager::Set(Font f) {
int fi = f.GetFace();
if(!face->HasKey(fi)) {
fi = face->FindValue(f.GetFaceName());
if(fi < 0)
fi = Font::COURIER;
else
fi = face->GetKey(fi);
}
face->SetData(fi);
FaceSelect();
height->SetData(f.GetHeight());
for(int i = 0; i < height->GetCount(); i++) {
int q = height->GetKey(i);
if(f.GetHeight() <= q) {
height->SetData(q);
break;
}
}
*bold = f.IsBold();
*italic = f.IsItalic();
*naa = f.IsNonAntiAliased();
}

Font FontSelectManager::Get() {
Font f(face->GetData(), height->GetData());
if(*bold) f.Bold();
if(*italic) f.Italic();
if(*naa) f.NonAntiAliased();
return f;
}

void Ide::UpdateFormat(CodeEditor& editor)
{
if(!IsActiveFile() || ActiveFile().tabsize <= 0)
editor.TabSize(editortabsize);
editor.IndentSpaces(indent_spaces);
editor.IndentAmount(indent_amount);
editor.ShowTabs(show_tabs);
editor.NoParenthesisIndent(no_parenthesis_indent);
editor.HiliteScope(hilite_scope);
editor.HiliteBracket(hilite_bracket);
editor.HiliteIfDef(hilite_ifdef);
editor.BarLine(barline);
editor.HiliteIfEndif(hilite_if_endif);
editor.LineNumbers(line_numbers);
editor.AutoEnclose(auto_enclose);
editor.MarkLines(mark_lines);
editor.BorderColumn(bordercolumn, bordercolor);
editor.Refresh();
}

void Ide::UpdateFormat() {
SetupEditor();
UpdateFormat(editor);
UpdateFormat(editor2);
console.SetFont(consolefont);
console.WrapText(wrap_console_text);
console2.SetFont(consolefont);
console2.WrapText(wrap_console_text);
statusbar.Show(show_status_bar);
SetupBars();

if(!designer) {
if(filetabs >=0) {
tabs.SetAlign(filetabs);
editpane.SetFrame(tabs);
} else {
editpane.SetFrame(ViewFrame());
}
}

tabs.Grouping(tabs_grouping);
tabs.Stacking(tabs_stacking);
tabs.FileIcons(tabs_icons, false);
tabs.Crosses(tabs_crosses >= 0, tabs_crosses);
}

void Ide::EditorFontScroll(int d)
{
if(!IsActiveFile())
return;
Package::File& f = ActiveFile();
if(f.font != 0 || editorsplit.GetZoom() < 0)
return;
int h = editorfont.GetCy();
int q = editorfont.GetHeight();
while(editorfont.GetCy() == h && (d < 0 ? editorfont.GetCy() > 5 : editorfont.GetCy() < 40))
editorfont.Height(q += d);
editor.SetFont(editorfont);
}

struct FormatDlg : TabDlg {
ColorPusher hl_color[CodeEditor::HL_COUNT];
};

void HlPusherFactory(One<Ctrl>& ctrl)
{
ctrl.Create<ColorPusher>().NotNull().Track();
}

void Ide::ReadHlStyles(ArrayCtrl& hlstyle)
{
hlstyle.Clear();
for(int i = 0; i < CodeEditor::HL_COUNT; i++) {
const CodeEditor::HlStyle& s = editor.GetHlStyle(i);
hlstyle.Add(editor.GetHlName(i), s.color, s.bold, s.italic, s.underline);
}
}

class AStyleSetupDialog : public WithSetupAstyleLayout<ParentCtrl> {
Ide *ide;

typedef AStyleSetupDialog CLASSNAME;

public:
AStyleSetupDialog(Ide *_ide);
void AstyleTest();
void UppDefaults();
};

AStyleSetupDialog::AStyleSetupDialog(Ide *_ide)
{
ide = _ide;

BracketFormatMode.Add(astyle::NONE_MODE, "none");
BracketFormatMode.Add(astyle::ATTACH_MODE, "attach");
BracketFormatMode.Add(astyle::BREAK_MODE, "break");
ParensPaddingMode.Add(astyle::PAD_NONE, "no space pad around parenthesis");
ParensPaddingMode.Add(astyle::PAD_INSIDE, "pad parenthesis inside with space");
ParensPaddingMode.Add(astyle::PAD_OUTSIDE, "pad parenthesis outside with space");
ParensPaddingMode.Add(astyle::PAD_BOTH, "pad both parenthesis sides with spaces");

Test <<= THISBACK(AstyleTest);
Defaults << THISBACK(UppDefaults);

}

void AStyleSetupDialog::AstyleTest()
{
astyle::ASFormatter Formatter;

// sets up parameters from astyle dialog
Formatter.setBracketIndent(BracketIndent);
Formatter.setNamespaceIndent(NamespaceIndent);
Formatter.setBlockIndent(BlockIndent);
Formatter.setCaseIndent(CaseIndent);
Formatter.setClassIndent(ClassIndent);
Formatter.setLabelIndent(LabelIndent);
Formatter.setSwitchIndent(SwitchIndent);
Formatter.setPreprocessorIndent(PreprocessorIndent);
Formatter.setMaxInStatementIndentLength(MaxInStatementIndentLength);
Formatter.setMinConditionalIndentLength(MinInStatementIndentLength);
Formatter.setBreakClosingHeaderBracketsMode(BreakClosingHeaderBracketsMode);
Formatter.setBreakElseIfsMode(BreakElseIfsMode);
Formatter.setBreakOneLineBlocksMode(BreakOneLineBlocksMode);
Formatter.setSingleStatementsMode(SingleStatementsMode);
Formatter.setBreakBlocksMode(BreakBlocksMode);
Formatter.setBreakClosingHeaderBlocksMode(BreakClosingHeaderBlocksMode);
Formatter.setBracketFormatMode((astyle::BracketMode)BracketFormatMode.GetIndex());
switch(ParensPaddingMode.GetIndex()) {
case astyle::PAD_INSIDE :
Formatter.setParensInsidePaddingMode(true);
Formatter.setParensOutsidePaddingMode(false);
break;
case astyle::PAD_OUTSIDE :
Formatter.setParensInsidePaddingMode(false);
Formatter.setParensOutsidePaddingMode(true);
break;
case astyle::PAD_BOTH :
Formatter.setParensInsidePaddingMode(true);
Formatter.setParensOutsidePaddingMode(true);
break;
default :
Formatter.setParensOutsidePaddingMode(false);
Formatter.setParensInsidePaddingMode(false);
break;
}
Formatter.setParensUnPaddingMode(ParensUnPaddingMode);
Formatter.setOperatorPaddingMode(OperatorPaddingMode);
Formatter.setEmptyLineFill(EmptyLineFill);
Formatter.setTabSpaceConversionMode(TabSpaceConversionMode);
Formatter.setTabIndentation(ide->editortabsize, ide->indent_spaces ? false : true);
Formatter.setSpaceIndentation(ide->indent_spaces ? ide->indent_amount : ide->editortabsize);

// formats text in test box
TestBox.Set(ide->FormatCodeString(TestBox.GetW(), Formatter));
}

void AStyleSetupDialog::UppDefaults()
{
BracketIndent = false;
NamespaceIndent = true;
BlockIndent = false;
CaseIndent = true;
ClassIndent = true;
LabelIndent = true;
SwitchIndent = true;
PreprocessorIndent = false;
MaxInStatementIndentLength = 20;
MinInStatementIndentLength = 2;
BreakClosingHeaderBracketsMode = 0;
BreakElseIfsMode = true;
BreakOneLineBlocksMode = true;
SingleStatementsMode = true;
BreakBlocksMode = false;
BreakClosingHeaderBlocksMode = false;
BracketFormatMode.SetIndex(1);
ParensPaddingMode.SetIndex(0);
ParensUnPaddingMode = true;
OperatorPaddingMode = false;
EmptyLineFill = false;
TabSpaceConversionMode = false;
}

void SetConsole(EditString *e, const char *text)
{
*e <<= text;
}

void Ide::SetupFormat() {
FormatDlg dlg;
dlg.Title("Format setup");
WithSetupFontLayout<ParentCtrl> fnt;
WithSetupHlLayout<ParentCtrl> hlt;
WithSetupEditorLayout<ParentCtrl> edt;
WithSetupIdeLayout<ParentCtrl> ide;
WithSetupAssistLayout<ParentCtrl> assist;
AStyleSetupDialog ast(this);
#ifdef PLATFORM_WIN32
ide.console_txt.Hide();
ide.console.Hide();
ide.kde.Hide();
ide.gnome.Hide();
ide.xterm.Hide();
#endif
ide.kde <<= callback2(SetConsole, &ide.console, "/usr/bin/konsole -e");
ide.gnome <<= callback2(SetConsole, &ide.console, "/usr/bin/gnome-terminal -x");
ide.xterm <<= callback2(SetConsole, &ide.console, "/usr/bin/xterm -e");

edt.filetabs
.Add(AlignedFrame::LEFT, "Left")
.Add(AlignedFrame::TOP, "Top")
.Add(AlignedFrame::RIGHT, "Right")
.Add(AlignedFrame::BOTTOM, "Bottom")
.Add(-1, "Off");

edt.tabs_crosses
.Add(AlignedFrame::LEFT, "Left")
.Add(AlignedFrame::RIGHT, "Right")
.Add(-1, "Off");

dlg.Add(fnt, "Fonts");
dlg.Add(hlt, "Syntax highlighting");
dlg.Add(edt, "Editor");
dlg.Add(assist, "Assist");
dlg.Add(ide, "IDE");
dlg.Add(ast, "Code formatting");
dlg.WhenClose = dlg.Acceptor(IDEXIT);
FontSelectManager ed, vf, con, f1, f2, tf;
ed.Set(fnt.face, fnt.height, fnt.bold, fnt.italic, fnt.naa);
vf.Set(fnt.vface, fnt.vheight, fnt.vbold, fnt.vitalic, fnt.vnaa);
con.Set(fnt.cface, fnt.cheight, fnt.cbold, fnt.citalic, fnt.cnaa);
tf.Set(fnt.tface, fnt.theight, fnt.tbold, fnt.titalic, fnt.tnaa);
f1.Set(fnt.face1, fnt.height1, fnt.bold1, fnt.italic1, fnt.naa1);
f2.Set(fnt.face2, fnt.height2, fnt.bold2, fnt.italic2, fnt.naa2);
ed.Set(editorfont);
vf.Set(veditorfont);
con.Set(consolefont);
tf.Set(tfont);
f1.Set(font1);
f2.Set(font2);
DlCharset(edt.charset);
edt.tabsize.MinMax(1, 100).NotNull();
edt.tabsize <<= editortabsize;
edt.indent_amount.MinMax(1, 100).NotNull();
edt.indent_amount <<= indent_spaces ? indent_amount : editortabsize;
edt.indent_amount.Enable(indent_spaces);
CtrlRetriever rtvr;
int hs = hilite_scope;
rtvr
(hlt.hilite_scope, hs)
(hlt.hilite_bracket, hilite_bracket)
(hlt.hilite_ifdef, hilite_ifdef)
(hlt.hilite_if_endif, hilite_if_endif)

(edt.indent_spaces, indent_spaces)
(edt.no_parenthesis_indent, no_parenthesis_indent)
(edt.showtabs, show_tabs)
(edt.forcecrlf, force_crlf)
(edt.numbers, line_numbers)
(edt.bookmark_pos, bookmark_pos)
(edt.bordercolumn, bordercolumn)
(edt.bordercolor, bordercolor)
(edt.findpicksel, find_pick_sel)
(edt.findpicktext, find_pick_text)
(edt.filetabs, filetabs)
(edt.tabs_icons, tabs_icons)
(edt.tabs_crosses, tabs_crosses)
(edt.tabs_grouping, tabs_grouping)
(edt.tabs_stacking, tabs_stacking)
(edt.tabs_serialize, tabs_serialize)

(assist.barline, barline)
(assist.auto_enclose, auto_enclose)
(assist.commentdp, editor.commentdp)
(assist.header_guards, header_guards)
(assist.insert_include, insert_include)
(assist.mark_lines, mark_lines)
(assist.qtfsel, qtfsel)
(assist.assist, editor.auto_assist)

(ide.showtime, showtime)
(ide.show_status_bar, show_status_bar)
(ide.toolbar_in_row, toolbar_in_row)
(ide.splash_screen, splash_screen)
(ide.sort, sort)
(ide.mute_sounds, mute_sounds)
(ide.wrap_console_text, wrap_console_text)
(ide.hydra1_threads, hydra1_threads)
(ide.gdbSelector, gdbSelector)
(ide.chstyle, chstyle)
(ide.console, LinuxHostConsole)
(ide.output_per_assembly, output_per_assembly)

(ast.BracketIndent, astyle_BracketIndent)
(ast.NamespaceIndent, astyle_NamespaceIndent)
(ast.BlockIndent, astyle_BlockIndent)
(ast.CaseIndent, astyle_CaseIndent)
(ast.ClassIndent, astyle_ClassIndent)
(ast.LabelIndent, astyle_LabelIndent)
(ast.SwitchIndent, astyle_SwitchIndent)
(ast.PreprocessorIndent, astyle_PreprocessorIndent)
(ast.MinInStatementIndentLength, astyle_MinInStatementIndentLength)
(ast.MaxInStatementIndentLength, astyle_MaxInStatementIndentLength)
(ast.BreakClosingHeaderBracketsMode,astyle_BreakClosingHeaderBracketsMode)
(ast.BreakElseIfsMode, astyle_BreakElseIfsMode)
(ast.BreakOneLineBlocksMode, astyle_BreakOneLineBlocksMode)
(ast.SingleStatementsMode, astyle_SingleStatementsMode)
(ast.BreakBlocksMode, astyle_BreakBlocksMode)
(ast.BreakClosingHeaderBlocksMode, astyle_BreakClosingHeaderBlocksMode)
(ast.BracketFormatMode, astyle_BracketFormatMode)
(ast.ParensPaddingMode, astyle_ParensPaddingMode)
(ast.ParensUnPaddingMode, astyle_ParensUnPaddingMode)
(ast.OperatorPaddingMode, astyle_OperatorPaddingMode)
(ast.EmptyLineFill, astyle_EmptyLineFill)
(ast.TabSpaceConversionMode, astyle_TabSpaceConversionMode)
(ast.TestBox, astyle_TestBox)
;
hlt.hlstyle.AddColumn("Style");
hlt.hlstyle.AddColumn("Color").Ctrls(HlPusherFactory);
hlt.hlstyle.AddColumn("Bold").Ctrls<Option>();
hlt.hlstyle.AddColumn("Italic").Ctrls<Option>();
hlt.hlstyle.AddColumn("Underline").Ctrls<Option>();
hlt.hlstyle.ColumnWidths("130 70 40 40 70");
hlt.hlstyle.EvenRowColor().NoHorzGrid().SetLineCy(EditField::GetStdHeight() + 2);
ReadHlStyles(hlt.hlstyle);
edt.charset <<= (int)default_charset;
edt.tabsize <<= rtvr <<=
hlt.hlstyle.WhenCtrlsAction = ed.WhenAction = tf.WhenAction =
con.WhenAction = f1.WhenAction = f2.WhenAction = dlg.Breaker(222);
ide.showtimeafter <<= Nvl((Date)FileGetTime(ConfigFile("version")), GetSysDate() - 1);
hlt.hl_restore <<= dlg.Breaker(333);
ide.chstyle.Add(0, "Host platform");
ide.chstyle.Add(1, "Standard");
ide.chstyle.Add(2, "Classic");
ide.chstyle.Add(3, "Host platform, blue bars");
ide.chstyle.Add(4, "Standard, blue bars");
for(;;) {
int c = dlg.Run();
editorfont = ed.Get();
tfont = tf.Get();
veditorfont = vf.Get();
consolefont = con.Get();
font1 = f1.Get();
font2 = f2.Get();
editortabsize = Nvl((int)~edt.tabsize, 4);
rtvr.Retrieve();
console.SetSlots(hydra1_threads);
hilite_scope = hs;
if(indent_spaces)
indent_amount = ~edt.indent_amount;
else
{
indent_amount = editortabsize;
edt.indent_amount <<= editortabsize;
}
edt.indent_amount.Enable(indent_spaces);
default_charset = (byte)(int)~edt.charset;
for(int i = 0; i < CodeEditor::HL_COUNT; i++)
editor.SetHlStyle(i, hlt.hlstyle.Get(i, 1), hlt.hlstyle.Get(i, 2),
hlt.hlstyle.Get(i, 3), hlt.hlstyle.Get(i, 4));
UpdateFormat();
if(c == IDEXIT)
break;
if(c == 333 && PromptYesNo("Restore default highlighting colors?")) {
editor.DefaultHlStyles();
ReadHlStyles(hlt.hlstyle);
}
}
FileSetTime(ConfigFile("version"), ToTime(~ide.showtimeafter));
FinishConfig();
SaveConfig();
}

void Ide::FinishConfig()
{
if(filelist.IsCursor()) {
FlushFile();
FileCursor();
}
SaveLoadPackage();
SyncCh();
}

struct MainConfigDlg : public WithConfigLayout<TopWindow> {
EditString ce, fe;
FrameRight<Button> cb;
const Workspace& wspc;

void FlagDlg();

bool Perform(const String& startwith);

typedef MainConfigDlg CLASSNAME;

MainConfigDlg(const Workspace& wspc);
};

bool SetSw(const String& flag, Ctrl& sw, const char *flg) {
if(flag == flg) {
sw <<= 1;
return true;
}
return false;
}

String GetSw(Ctrl& sw, const char *flag) {
if((int)~sw)
return String(flag) + ' ';
return Null;
}


static
void sSetOption(One<Ctrl>& ctrl)
{
ctrl.Create<Option>().NoWantFocus();
}

void MainConfigDlg::FlagDlg()
{
WithConfLayout<TopWindow> cfg;
CtrlLayoutOKCancel(cfg, "Configuration flags");
cfg.Sizeable().MaximizeBox();
Vector<String> flg = SplitFlags0(String(fe));
Vector<String> accepts = wspc.GetAllAccepts(0);
Sort(accepts, GetLanguageInfo());
enum { CC_SET, CC_NAME, CC_PACKAGES, CC_COUNT };
cfg.accepts.AddColumn("Set").Ctrls(sSetOption).HeaderTab().Fixed(40);
cfg.accepts.AddColumn("Flag", 1);
cfg.accepts.AddColumn("Packages", 2);
cfg.accepts.SetCount(accepts.GetCount());
for(int i = 0; i < accepts.GetCount(); i++) {
String acc = accepts[i];
Vector<String> pkg;
for(int p = 0; p < wspc.GetCount(); p++)
if(FindIndex(wspc.package[p].accepts, acc) >= 0)
pkg.Add(wspc[p]);
Sort(pkg, GetLanguageInfo());
cfg.accepts.Set(i, CC_NAME, accepts[i]);
cfg.accepts.Set(i, CC_PACKAGES, Join(pkg, ","));
}

cfg.other.SetFilter(FlagFilterM);
cfg.dll <<= cfg.gui <<= cfg.mt <<= cfg.sse2 <<= 0;
String other;
for(int i = 0; i < flg.GetCount(); i++) {
String f = flg[i];
if(!SetSw(f, cfg.dll, "DLL")
&& !SetSw(f, cfg.gui, "GUI")
&& !SetSw(f, cfg.mt, "MT")
&& !SetSw(f, cfg.sse2, "SSE2")) {
int x = (*f == '.' ? cfg.accepts.Find(f.Mid(1), CC_NAME) : -1);
if(x >= 0)
cfg.accepts.Set(x, CC_SET, true);
else {
if(!other.IsEmpty())
other << ' ';
other << f;
}
}
}
cfg.other <<= other;
if(cfg.Run() == IDOK) {
String flags;
flags
<< GetSw(cfg.dll, "DLL")
<< GetSw(cfg.gui, "GUI")
<< GetSw(cfg.mt, "MT")
<< GetSw(cfg.sse2, "SSE2");
for(int i = 0; i < cfg.accepts.GetCount(); i++)
if(cfg.accepts.Get(i, CC_SET))
flags << '.' << cfg.accepts.Get(i, CC_NAME) << ' ';
flags << cfg.other.GetText().ToString();
fe = Join(SplitFlags0(flags), " ").ToWString();
}
}

MainConfigDlg::MainConfigDlg(const Workspace& wspc_) : wspc(wspc_) {
CtrlLayoutOKCancel(*this, "Main package configuration(s)");
fe.AddFrame(cb);
fe.SetFilter(FlagFilterM);
cb.SetImage(CtrlImg::smallright()).NoWantFocus();
cb <<= THISBACK(FlagDlg);
list.AddColumn("Flags", 3).Edit(fe);
list.AddColumn("Optional name", 2).Edit(ce);
list.Appending().Removing();
}

bool MainConfigDlg::Perform(const String& startwith) {
list.SetCursor(0);
list.FindSetCursor(startwith);
return Run() == IDOK;
}

void Ide::MainConfig() {
package.SetCursor(0);
if(package.GetCursor() != 0) return;
MainConfigDlg dlg(IdeWorkspace());
for(int i = 0; i < actual.config.GetCount(); i++) {
const Package::Config& f = actual.config[i];
dlg.list.Add(f.param, f.name);
}
if(!dlg.Perform(mainconfigname)) return;
actual.config.Clear();
for(int i = 0; i < dlg.list.GetCount(); i++) {
Package::Config& f = actual.config.Add();
f.param = dlg.list.Get(i, 0);
f.name = dlg.list.Get(i, 1);
}
SavePackage();
if(dlg.list.IsCursor()) {
mainconfigparam = dlg.list.Get(0);
mainconfigname = Nvl((String)dlg.list.Get(1), mainconfigparam);
MakeTitle();
}
SyncMainConfigList();
SetHdependDirs();
MakeTitle();
}

Change log

r4506 by micio on Feb 1, 2012   Diff
TheIDE : Initial implementation of new GDB
debugger interface
Go to: 
Project members, sign in to write a code review

Older revisions

r4500 by cxl on Jan 30, 2012   Diff
ide: Environment settings now saved
after closing dialog and relodead in
other ide instances on change
r4169 by cxl on Nov 13, 2011   Diff
CtrlLib, ide: Support for UTF8-BOM
encoding (RM #129)
r3267 by cxl on Mar 6, 2011   Diff
theide: Use unique output directory
per assembly (append assembly name to
output director)
All revisions of this file

File info

Size: 18495 bytes, 633 lines

File properties

svn:eol-style
native
Powered by Google Project Hosting