// *** Color Schemes ***
-//guiApp.currentSkin.selectionColor:
+// *** The Old Color Scheme that was causing me auras and ophtalmic migraines -- Uncomment at your own risk! ***
/*
+FontResource panelFont { $"Courier New", 10 };
+FontResource codeFont { $"Courier New", 10 };
Color selectionColor = Color { 10, 36, 106 };
Color selectionText = white;
Color viewsBackground = white;
Color viewsText = black;
-Color projectViewBackground = white;
-Color projectViewText = black;
Color outputBackground = white;
Color outputText = black;
-
+Color projectViewBackground = white;
+Color projectViewText = black;
Color codeEditorBG = white;
Color codeEditorFG = black;
Color marginColor = Color {230, 230, 230};
-Color lineNumbersColor = Color {60, 60, 60};
Color selectedMarginColor = Color {200, 200, 200};
+Color lineNumbersColor = Color {60, 60, 60};
SyntaxColorScheme colorScheme
{
- keywordColors = { blue, blue };
+ keywordColors = [ blue, blue ];
commentColor = dimGray;
- keywordColor = blue;
charLiteralColor = crimson;
stringLiteralColor = crimson;
preprocessorColor = green;
};
*/
+// The new nice dark scheme -- so peaceful on my brain
+
+FontResource panelFont { $"Courier New", 10 };
+FontResource codeFont { $"Courier New", 10 };
+/*
+FontResource panelFont { $"Consolas", 12 };
+FontResource codeFont { $"Consolas", 12 };
+*/
Color selectionColor = lightYellow;
Color selectionText = Color { 30, 40, 50 };
-
Color viewsBackground = Color { 30, 40, 50 };
Color viewsText = lightGray;
-
Color outputBackground = black;
Color outputText = lime;
-
Color projectViewBackground = Color { 30, 40, 50 };
Color projectViewText = lightGray;
-
+Color codeEditorBG = black;
+Color codeEditorFG = ivory;
Color marginColor = Color {24, 24, 24};
Color selectedMarginColor = Color {64, 64, 64};
Color lineNumbersColor = Color {160, 160, 160};
-Color codeEditorBG = black;
-Color codeEditorFG = ivory;
SyntaxColorScheme colorScheme
{
keywordColors = [ skyBlue, skyBlue ];
- commentColor = dimGray;
+ commentColor = Color { 125, 125, 125 };
charLiteralColor = Color { 245, 50, 245 };
stringLiteralColor = Color { 245, 50, 245 };
preprocessorColor = { 120, 220, 140 };
- numberColor = teal;
+ numberColor = Color { 0, 192, 192 };
};
+
// *********************
import "findCtx"
extern int __attribute__((__stdcall__)) __ecereDll_Unload_ecere(struct __ecereNameSpace__ecere__com__Instance * module);
#endif
-static FileFilter fileFilters[] =
-{
- {
- "C/C++/eC Files (*.ec, *.eh, *.c, *.cpp, *.cc, *.cxx, *.h, *.hpp, *.hh, *.hxx)",
- "ec, eh, c, cpp, cc, cxx, h, hpp, hh, hxx"
- },
- {
- "Header Files for C/C++ (*.eh, *.h, *.hpp, *.hh, *.hxx)",
- "eh, h, hpp, hh, hxx"
- },
- {
- "C/C++/eC Source Files (*.ec, *.c, *.cpp, *.cc, *.cxx)",
- "ec, c, cpp, cc, cxx"
- },
- {
- "Text files (*.txt)",
- "txt"
- },
- { "All files", null }
-};
-
-static FileType fileTypes[] =
-{
- { "eC Source Code", "ec", whenNoneGiven },
- { "Text Files", "txt", never }
-};
+static Array<FileFilter> fileFilters
+{ [
+ { $"C/C++/eC Files (*.ec, *.eh, *.c, *.cpp, *.cc, *.cxx, *.h, *.hpp, *.hh, *.hxx)", "ec, eh, c, cpp, cc, cxx, h, hpp, hh, hxx" },
+ { $"Header Files for C/C++ (*.eh, *.h, *.hpp, *.hh, *.hxx)", "eh, h, hpp, hh, hxx" },
+ { $"C/C++/eC Source Files (*.ec, *.c, *.cpp, *.cc, *.cxx)", "ec, c, cpp, cc, cxx" },
+ { $"Text files (*.txt)", "txt" },
+ { $"All files", null }
+] };
+
+static Array<FileType> fileTypes
+{ [
+ { $"eC Source Code", "ec", whenNoneGiven },
+ { $"Text Files", "txt", never }
+] };
static char * iconNames[] =
{
EditFileDialog codeEditorFileDialog
{
- type = multiOpen, text = "Open",
- types = fileTypes, sizeTypes = sizeof(fileTypes);
- filters = fileFilters, sizeFilters = sizeof(fileFilters)
+ type = multiOpen, text = $"Open",
+ types = fileTypes.array, sizeTypes = fileTypes.count * sizeof(FileType);
+ filters = fileFilters.array, sizeFilters = fileFilters.count * sizeof(FileFilter)
};
EditFileDialog codeEditorFormFileDialog
{
- type = open, text = "Open Project",
- types = fileTypes, sizeTypes = sizeof(fileTypes), filters = fileFilters, sizeFilters = sizeof(fileFilters)
+ type = open, text = $"Open Project",
+ types = fileTypes.array, sizeTypes = fileTypes.count * sizeof(FileType),
+ filters = fileFilters.array, sizeFilters = fileFilters.count * sizeof(FileFilter)
};
define OpenBracket = '{';
f.Printf("double");
break;
case classType:
- // ADD CODE TO DECIDE WHETHER TO OUTPUT FULLY QUAlIFIED OR NOT:
- f.Printf(type._class.shortName ? type._class.shortName : type._class.string);
+ {
+ if(type._class && !strcmp(type._class.string, "class"))
+ {
+ switch(type.classObjectType)
+ {
+ case anyObject:
+ f.Printf("any_object");
+ break;
+ default:
+ f.Printf("typed_object");
+ break;
+ }
+ if(type.byReference)
+ f.Printf(" &");
+ }
+ else
+ // ADD CODE TO DECIDE WHETHER TO OUTPUT FULLY QUAlIFIED OR NOT:
+ f.Printf(type._class.shortName ? type._class.shortName : type._class.string);
break;
+ }
case structType:
break;
case unionType:
if(prop.dataTypeString && (!prop.IsSet || prop.IsSet(selected.instance)))
{
Class dataType = prop.dataTypeClass;
- char string[1024] = "";
if(!dataType)
dataType = prop.dataTypeClass = eSystem_FindClass(test._class.module, prop.dataTypeString);
void * dataForm = new0 byte[dataType.structSize];
void * dataTest = new0 byte[dataType.structSize];
- prop.Get(selected.instance, dataForm);
- prop.Get(test, dataTest);
+ ((void (*)(void *, void *))(void *)prop.Get)(selected.instance, dataForm);
+ ((void (*)(void *, void *))(void *)prop.Get)(test, dataTest);
- if((prop.IsSet && !prop.IsSet(test)) || dataType._vTbl[__ecereVMethodID_class_OnCompare](dataType, dataForm, dataTest))
+ if((prop.IsSet && !prop.IsSet(test)) || ((int (*)(void *, void *, void *))(void *)dataType._vTbl[__ecereVMethodID_class_OnCompare])(dataType, dataForm, dataTest))
{
- prop.Set(test, dataForm);
+ ((void (*)(void *, void *))(void *)prop.Set)(test, dataForm);
result = true;
}
delete dataForm;
{
void * dataForm, * dataTest;
- dataForm = (void *)prop.Get(selected.instance);
- dataTest = (void *)prop.Get(test);
+ dataForm = ((void *(*)(void *))(void *)prop.Get)(selected.instance);
+ dataTest = ((void *(*)(void *))(void *)prop.Get)(test);
- if((prop.IsSet && !prop.IsSet(test)) || dataType._vTbl[__ecereVMethodID_class_OnCompare](dataType, dataForm, dataTest))
+ if((prop.IsSet && !prop.IsSet(test)) || ((int (*)(void *, void *, void *))(void *)dataType._vTbl[__ecereVMethodID_class_OnCompare])(dataType, dataForm, dataTest))
{
- prop.Set(test, dataForm);
+ ((void (*)(void *, void *))(void *)prop.Set)(test, dataForm);
result = true;
}
}
GetProperty(prop, selected.instance, &dataForm);
GetProperty(prop, test, &dataTest);
- if((prop.IsSet && !prop.IsSet(test)) || dataType._vTbl[__ecereVMethodID_class_OnCompare](dataType, &dataForm, &dataTest))
+ if((prop.IsSet && !prop.IsSet(test)) || ((int (*)(void *, void *, void *))(void *)dataType._vTbl[__ecereVMethodID_class_OnCompare])(dataType, &dataForm, &dataTest))
{
SetProperty(prop, test, dataForm);
if(strcmp(prop.name, "name"))
{
GetProperty(prop, selected.instance, &dataTest);
- if(dataType._vTbl[__ecereVMethodID_class_OnCompare](dataType, &dataForm, &dataTest))
+ if(((int (*)(void *, void *, void *))(void *)dataType._vTbl[__ecereVMethodID_class_OnCompare])(dataType, &dataForm, &dataTest))
SetProperty(prop, selected.instance, dataForm);
}
result = true;
char methodName[1024];
bool updatingCode;
+ bool loadingFile;
bool fixCaret;
bool membersListShown;
bool membersAbove;
BitmapResource icons[CodeObjectType];
- FontResource boldFont { "Tahoma", 8.25f, bold = true, window = this };
- FontResource normalFont { "Tahoma", 8.25f, window = this };
+ FontResource boldFont { $"Tahoma", 8.25f, bold = true, window = this };
+ FontResource normalFont { $"Tahoma", 8.25f, window = this };
Module privateModule;
NameSpace globalData;
bool inUseDebug;
OpenedFileInfo openedFileInfo;
- FontResource font { "Courier New", 10 };
+ FontResource font { codeFont.faceName, codeFont.size };
saveDialog = codeEditorFileDialog;
Designer designer { codeEditor = this, visible = false, saveDialog = codeEditorFormFileDialog };
+ bool noParsing;
+
+ property bool parsing { get { return editBox.syntaxHighlighting && !noParsing && !ide.noParsing; } };
+
void ProcessCaretMove(EditBox editBox, int line, int charPos)
{
char temp[512];
// OnActivateClient is called after OnActivate
if(!updatingCode)
{
- sprintf(temp, "Ln %d, Col %d", line, editBox.column + 1);
+ sprintf(temp, $"Ln %d, Col %d", line, editBox.column + 1);
ide.pos.text = temp;
}
if(sheet.codeEditor != this) return;
//Update(null);
}
- sprintf(temp, "Ln %d, Col %d", line, editBox.column + 1);
+ sprintf(temp, $"Ln %d, Col %d", line, editBox.column + 1);
ide.pos.text = temp;
if(expectingMove)
ProjectView projectView = ide.projectView;
if(projectView)
{
- ProjectNode node = projectView.GetNodeFromWindow(this, null);
+ ProjectNode node = projectView.GetNodeFromWindow(this, null, false);
if(node)
{
node.modified = modifiedDocument;
textVertScroll = true, multiLine = true, /*lineNumbers = ideSettings.showLineNumbers,*/
freeCaret = ideSettings.useFreeCaret, caretFollowsScrolling = ideSettings.caretFollowsScrolling,
tabKey = true, smartHome = true;
- tabSelection = true, maxLineSize = 65536, parent = this, hasHorzScroll = true, hasVertScroll = true;
+ tabSelection = true, /*maxLineSize = 65536, */parent = this, hasHorzScroll = true, hasVertScroll = true;
selectionColor = selectionColor, selectionText = selectionText,
background = codeEditorBG, foreground = codeEditorFG, syntaxColorScheme = colorScheme,
font = font, borderStyle = none;
bool NotifyCharsAdded(EditBox editBox, BufferLocation before, BufferLocation after, bool pasteOperation)
{
- if(!updatingCode)
+ if(!loadingFile && after.y != before.y)
{
- ObjectInfo oClass;
-
- if(after.y != before.y)
+ ProjectView projectView = ide.projectView;
+ if(projectView && fileName)
{
- ProjectView projectView = ide.projectView;
- if(projectView && fileName)
- {
- int c;
- // HOW WE MIGHT WANT TO DO IT:
- char * text = before.line.text;
- for(c = before.x-1; c>= 0; c--)
- if(!isspace(text[c]))
- break;
- ide.debugger.MoveIcons(fileName, before.y + (((!pasteOperation && c > -1) || !after.line.count) ? 1 : 0), after.y - before.y, false);
-
- // HOW VISUAL STUDIO DOES IT:
- /*
- char * text = after.line.text;
- for(c = after.line.count-1; c>= 0; c--)
- if(!isspace(text[c]))
- break;
- ide.debugger.MoveIcons(fileName, before.y + ((c < 0) ? 1 : 0), after.y - before.y, false);
- */
+ int c;
+ // HOW WE MIGHT WANT TO DO IT:
+ char * text = before.line.text;
+ for(c = before.x-1; c>= 0; c--)
+ if(!isspace(text[c]))
+ break;
+ ide.debugger.MoveIcons(fileName, before.y + (((!pasteOperation && c > -1) || !after.line.count) ? 1 : 0), after.y - before.y, false);
- Update(null);
- }
+ // HOW VISUAL STUDIO DOES IT:
+ /*
+ char * text = after.line.text;
+ for(c = after.line.count-1; c>= 0; c--)
+ if(!isspace(text[c]))
+ break;
+ ide.debugger.MoveIcons(fileName, before.y + ((c < 0) ? 1 : 0), after.y - before.y, false);
+ */
}
+ Update({ 0, 0, editBox.position.x, clientSize.h });
+ }
+
+ if(!updatingCode)
+ {
+ ObjectInfo oClass;
for(oClass = classes.first; oClass; oClass = oClass.next)
{
membersLoc.end.charPos += after.x - Max(membersLoc.start.charPos, before.x);
- for(c = membersLoc.start.charPos; c<membersLoc.end.charPos; c++)
+ for(c = membersLoc.start.charPos; c<membersLoc.end.charPos && len < sizeof(string)-1; c++)
{
bool isSpace = (buffer[c] == ' ' || buffer[c] == '\t');
if(!isalnum(buffer[c]) && buffer[c] != '_' && (!isSpace || !firstChar)) //|| membersList.currentRow
bool NotifyCharsDeleted(EditBox editBox, BufferLocation before, BufferLocation after, bool pasteOperation)
{
+ if(!loadingFile && after.y != before.y)
+ {
+ ProjectView projectView = ide.projectView;
+ if(projectView && fileName)
+ ide.debugger.MoveIcons(fileName, before.y + 1, before.y - after.y, before.x == 0);
+ Update({ 0, 0, editBox.position.x, clientSize.h });
+ }
+
if(!updatingCode)
{
ObjectInfo oClass;
- if(after.y != before.y)
- {
- ProjectView projectView = ide.projectView;
- if(projectView && fileName)
- {
- ide.debugger.MoveIcons(fileName, before.y + 1, before.y - after.y, before.x == 0);
- Update(null);
- }
- }
-
for(oClass = classes.first; oClass; oClass = oClass.next)
{
ObjectInfo object;
if(before.x >= membersLoc.start.charPos)
{
- for(c = membersLoc.start.charPos; c<before.x; c++)
+ for(c = membersLoc.start.charPos; c<before.x && len < sizeof(string)-1; c++)
{
bool isSpace = (buffer[c] == ' ' || buffer[c] == '\t');
if(!isalnum(buffer[c]) && buffer[c] != '_' && (!isSpace || !firstChar))
if(membersLoc.end.charPos >= after.x)
{
- for(c = after.x; c<membersLoc.end.charPos; c++)
+ for(c = after.x; c<membersLoc.end.charPos && len < sizeof(string)-1; c++)
{
bool isSpace = (buffer[c] == ' ' || buffer[c] == '\t');
if(!isalnum(buffer[c]) && buffer[c] != '_' && (!isSpace || !firstChar))
{
if(ide.projectView)
{
- ProjectNode node = ide.projectView.GetNodeFromWindow(this, null);
+ ProjectNode node = ide.projectView.GetNodeFromWindow(this, null, false);
+ if(!node)
+ node = ide.projectView.GetNodeFromWindow(this, null, true);
if(!node)
{
char * s;
- s = PrintString("The ", fileName, " file is not part of any project.\n",
- "It can't be compiled.");
- MessageBox { type = ok, parent = ide, master = ide, text = "File not in project error", contents = s }.Modal();
+ s = PrintString($"The ", fileName, $" file is not part of any project.\n",
+ $"It can't be compiled.");
+ MessageBox { type = ok, /*parent = ide, */master = ide, text = $"File not in project error", contents = s }.Modal();
delete s;
return false;
}
bool OnActivate(bool active, Window previous, bool * goOnWithActivation, bool direct)
{
CodeEditor editor = (CodeEditor)master;
- if(!active)
+ Window rw = previous ? previous.rootWindow : null;
+ if(!active && rw != editor.paramsList)
{
Destroy(0);
editor.membersListShown = false;
}
};
- ListBox paramsList
+ Window paramsList
{
master = this,
interim = true,
bool OnActivate(bool active, Window previous, bool * goOnWithActivation, bool direct)
{
CodeEditor editor = (CodeEditor)master;
- if(!active)
+ Window rw = previous ? previous.rootWindow : null;
+ if(!active && previous != editor.editBox && rw != editor.membersList)
{
Destroy(0);
editor.membersListShown = false;
}
- return ListBox::OnActivate(active, previous, goOnWithActivation, direct);
+ return Window::OnActivate(active, previous, goOnWithActivation, direct);
}
bool OnKeyHit(Key key, unichar ch)
surface.WriteText(x, y, "(", 1);
x += parW;
- if(methodType && !methodType.staticMethod)
+ if(methodType && !methodType.staticMethod && methodType.methodClass)
{
int tw = 0, width;
id ++;
}
- if(!methodType || methodType.staticMethod || !type.params.first || ((Type)type.params.first).kind != voidType || type.params.count > 1)
+ if(!methodType || (methodType.staticMethod || !methodType.methodClass) || !type.params.first || ((Type)type.params.first).kind != voidType || type.params.count > 1)
{
for(param = type.params.first; param; param = param.next)
{
}
};
- Menu fileMenu { menu, "File", f }; // MenuPlacement?
- MenuItem { fileMenu, "Save", s, Key { s, ctrl = true }, NotifySelect = MenuFileSave };
- MenuItem { fileMenu, "Save As...", a, NotifySelect = MenuFileSaveAs };
+ Menu fileMenu { menu, $"File", f }; // MenuPlacement?
+ MenuItem { fileMenu, $"Save", s, Key { s, ctrl = true }, NotifySelect = MenuFileSave };
+ MenuItem { fileMenu, $"Save As...", a, NotifySelect = MenuFileSaveAs };
- Menu debugMenu { menu, "Debug", d }; // MenuPlacement?
+ Menu debugMenu { menu, $"Debug", d }; // MenuPlacement?
MenuItem debugRunToCursor
{
- debugMenu, "Run To Cursor", c, Key { f10, ctrl = true };
+ debugMenu, $"Run To Cursor", c, Key { f10, ctrl = true };
bool NotifySelect(MenuItem selection, Modifiers mods)
{
ProjectView projectView = ide.projectView;
{
int line = editBox.lineNumber + 1;
if(projectView)
- ide.debugger.RunToCursor(fileName, line, false);
+ {
+ CompilerConfig compiler = ideSettings.GetCompilerConfig(ide.workspace.compiler);
+ ProjectConfig config = projectView.project.config;
+ int bitDepth = ide.workspace.bitDepth;
+ bool useValgrind = ide.workspace.useValgrind;
+ ide.debugger.RunToCursor(compiler, config, bitDepth, useValgrind, fileName, line, false, false);
+ delete compiler;
+ }
}
return true;
}
};
MenuItem debugSkipRunToCursor
{
- debugMenu, "Run To Cursor Skipping Breakpoints", u, Key { f10, ctrl = true, shift = true };
+ debugMenu, $"Run To Cursor Skipping Breakpoints", u, Key { f10, ctrl = true, shift = true };
bool NotifySelect(MenuItem selection, Modifiers mods)
{
ProjectView projectView = ide.projectView;
int line = editBox.lineNumber + 1;
if(projectView)
- ide.debugger.RunToCursor(fileName, line, true);
+ {
+ CompilerConfig compiler = ideSettings.GetCompilerConfig(ide.workspace.compiler);
+ ProjectConfig config = projectView.project.config;
+ int bitDepth = ide.workspace.bitDepth;
+ bool useValgrind = ide.workspace.useValgrind;
+ ide.debugger.RunToCursor(compiler, config, bitDepth, useValgrind, fileName, line, true, false);
+ delete compiler;
+ }
+ return true;
+ }
+ };
+ MenuItem debugSkipRunToCursorAtSameLevel
+ {
+ debugMenu, $"Run To Cursor At Same Level Skipping Breakpoints", u, Key { f10, alt = true };
+ bool NotifySelect(MenuItem selection, Modifiers mods)
+ {
+ ProjectView projectView = ide.projectView;
+ int line = editBox.lineNumber + 1;
+ if(projectView)
+ {
+ CompilerConfig compiler = ideSettings.GetCompilerConfig(ide.workspace.compiler);
+ ProjectConfig config = projectView.project.config;
+ int bitDepth = ide.workspace.bitDepth;
+ bool useValgrind = ide.workspace.useValgrind;
+ ide.debugger.RunToCursor(compiler, config, bitDepth, useValgrind, fileName, line, true, true);
+ delete compiler;
+ }
return true;
}
};
MenuDivider { debugMenu };
MenuItem debugToggleBreakpoint
{
- debugMenu, "Toggle Breakpoint", t, f9;
+ debugMenu, $"Toggle Breakpoint", t, f9;
bool NotifySelect(MenuItem selection, Modifiers mods)
{
ProjectView projectView = ide.projectView;
{
for(p : ide.workspace.projects)
{
- if(eString_PathInsideOf(fileName, p.topNode.path))
+ if(IsPathInsideOf(fileName, p.topNode.path))
{
prj = p;
break;
designer.parent = parent;
designer.Create();
- toolBox = ((IDE)master).toolBox;
+ toolBox = ((IDEWorkSpace)master).toolBox;
incref toolBox;
// Debugger bug here: value of toolBox appears as 0
- sheet = ((IDE)master).sheet;
+ sheet = ((IDEWorkSpace)master).sheet;
incref sheet;
return true;
}
{
if(ide.workspace && fileName)
ide.workspace.UpdateOpenedFileInfo(fileName, closed);
-
if(inUseDebug && !debugClosing)
{
debugClosing = true;
//formEditor.Destroy(0);
}*/
}
+ ide.AdjustFileMenus();
}
return true;
}
ProjectView projectView = ide.projectView;
if(projectView)
{
- ProjectNode node = projectView.GetNodeFromWindow(this, null);
+ ProjectNode node = projectView.GetNodeFromWindow(this, null, false);
if(node && node.modified)
{
node.modified = false;
*/
if(active && directActivation)
{
+ AdjustDebugMenus(ide.areDebugMenusUnavailable, ide.isBreakpointTogglingUnavailable, ide.isDebuggerExecuting);
if(openedFileInfo)
openedFileInfo.Activate();
if(designer)
{
char message[2048];
- sprintf(message, "The document %s was modified by another application.\n"
+ sprintf(message, $"The document %s was modified by another application.\n"
"Would you like to reload it and lose your changes?", fileName);
- if(MessageBox { type = yesNo, master = /*parent = */parent, text = "Document has been modified",
+ if(MessageBox { type = yesNo, master = /*parent = */parent, text = $"Document has been modified",
contents = message }.Modal() == yes)
reload = true;
}
int lineNumber, charPos, len;
Point scroll;
+ loadingFile = true;
updatingCode = true;
lineNumber = editBox.lineNumber;
charPos = editBox.charPos;
editBox.GoToPosition(editBox.line, lineNumber, charPos <= len ? charPos - 1 : (len ? len - 1 : 0));
editBox.scroll = scroll;
updatingCode = false;
+ loadingFile = false;
codeModified = true;
if(designer)
if(fileName)
{
GetExtension(fileName, ext);
- if(!strcmpi(ext, "ec"))
+
+ if(!strcmpi(ext, "ec") || !strcmpi(ext, "eh") || !strcmpi(ext, "c") || !strcmpi(ext, "h") || !strcmpi(ext, "cpp") ||
+ !strcmpi(ext, "hpp") || !strcmpi(ext, "cxx") || !strcmpi(ext, "hxx") || !strcmpi(ext, "cc") || !strcmpi(ext, "hh") ||
+ !strcmpi(ext, "m") || !strcmpi(ext, "mm") || !strcmpi(ext, "cs") || !strcmpi(ext, "java") || !strcmpi(ext, "y") || !strcmpi(ext, "l"))
+ editBox.syntaxHighlighting = true;
+ else
+ editBox.syntaxHighlighting = false;
+
+ if(parsing && !strcmpi(ext, "ec"))
{
codeModified = true;
EnsureUpToDate();
}
- if(!strcmpi(ext, "ec") || !strcmpi(ext, "c") || !strcmpi(ext, "cc") || !strcmpi(ext, "cpp") || !strcmpi(ext, "eh") || !strcmpi(ext, "hh") || !strcmpi(ext, "hpp") || !strcmpi(ext, "h") || !strcmpi(ext, "hxx") || !strcmpi(ext, "cxx"))
- editBox.syntaxHighlighting = true;
- else
- editBox.syntaxHighlighting = false;
{
int spaceW;
display.FontExtent(font.font, " ", 1, &spaceW, null);
{
// Added this here...
fileName = filePath;
+ loadingFile = true;
updatingCode = true;
editBox.Load(f);
updatingCode = false;
+ loadingFile = false;
Create();
delete(f);
return false;
}
- void DebugMenusDisabled()
+ void AdjustDebugMenus(bool unavailable, bool bpNoToggle, bool executing)
{
- bool debugMenusDisabled = ide.GetDebugMenusDisabled();
- debugRunToCursor.disabled = debugMenusDisabled;
- debugSkipRunToCursor.disabled = debugMenusDisabled;
- debugToggleBreakpoint.disabled = debugMenusDisabled;
+ debugRunToCursor.disabled = unavailable || executing;
+ debugSkipRunToCursor.disabled = unavailable || executing;
+ debugSkipRunToCursorAtSameLevel.disabled = unavailable || executing;
+ debugToggleBreakpoint.disabled = bpNoToggle;
}
CodeEditor()
if(designer)
{
char title[1024];
- sprintf(title, "Untitled %d", documentID);
+ sprintf(title, $"Untitled %d", documentID);
// designer.fileName = CopyString(title);
designer.fileName = title;
}
- DebugMenusDisabled();
+ AdjustDebugMenus(ide.areDebugMenusUnavailable, ide.isBreakpointTogglingUnavailable, ide.isDebuggerExecuting);
for(c = 0; c < CodeObjectType::enumSize; c++)
icons[c] = BitmapResource { iconNames[c], window = this };
****************************************************************************/
void FreeParser()
{
- this.defines.Free(FreeModuleDefine);
- this.imports.Free(FreeModuleImport);
-
if(ast != null)
{
FreeASTTree(ast);
ast = null;
}
+ this.defines.Free(FreeModuleDefine);
+ this.imports.Free(FreeModuleImport); // Moved this after FreeAST because Debug printing causes ModuleImports to be created
+
FreeExcludedSymbols(this.excludedSymbols);
FreeContext(this.globalContext);
+ FreeIncludeFiles();
+ FreeGlobalData(&this.globalData);
+ FindCtx_Terminate();
+ FindParams_Terminate();
if(GetGlobalContext() == globalContext)
{
char * fileName;
ImportedModule module;
char extension[MAX_EXTENSION];
+ PathBackup pathBackup { };
#ifdef _TIMINGS
Time parseCodeStart = GetTime();
Time startTime, startFindClass;
editBox.GetSelPos(&l1, &y1, &x1, &l2, &y2, &x2, false);
- defines.Free(FreeModuleDefine);
- imports.Free(FreeModuleImport);
+ FindCtx_Terminate();
+ FindParams_Terminate();
SetGlobalData(&globalData);
SetGlobalContext(globalContext);
// TOCHECK: COULDN'T WE CALL FreeParser here?
// Clear everything
+ FreeType(this.functionType);
+ FreeType(this.instanceType);
this.functionType = null;
this.instanceType = null;
ast = null;
//SetAST(null);
}
+ defines.Free(FreeModuleDefine);
+ imports.Free(FreeModuleImport);
FreeContext(this.globalContext);
FreeExcludedSymbols(this.excludedSymbols);
printf("classes.count: %d\n", globalContext.classes.count);
#endif
- this.privateModule = __ecere_COM_Initialize(false, 1, null);
+ if(ide.workspace)
+ {
+ CompilerConfig compiler = ideSettings.GetCompilerConfig(ide.workspace.compiler);
+ SetTargetBits(ide.workspace.bitDepth ? ide.workspace.bitDepth : GetHostBits());
+ delete compiler;
+ }
+ this.privateModule = __ecere_COM_Initialize(false | ((GetTargetBits() == sizeof(uintptr) *8) ? 0 : GetTargetBits() == 64 ? 2 : 4), 1, null);
SetPrivateModule(privateModule);
// TODO: Get symbolsDir from project settings instead...
if(ide.projectView)
{
- DirExpression objDir = project.objDir;
+ CompilerConfig compiler = ideSettings.GetCompilerConfig(ide.workspace.compiler);
+ ProjectConfig config = project.config;
+ int bitDepth = ide.workspace.bitDepth;
+ DirExpression objDir = project.GetObjDir(compiler, config, bitDepth);
SetSymbolsDir(objDir.dir);
+ ide.SetPath(true, compiler, config, bitDepth);
+
delete objDir;
+ delete compiler;
// SetIncludeDirs(ide.projectView.project.config.includeDirs);
// SetSysIncludeDirs(ide.ideSettings.systemDirs[includes]);
}
}
}
if(!strcmp(extension, "ec") || !strcmp(extension, "eh"))
+ {
SetDefaultDeclMode(privateAccess);
+ SetDeclMode(privateAccess);
+ }
else
+ {
SetDefaultDeclMode(defaultAccess);
+ SetDeclMode(defaultAccess);
+ }
StripExtension(mainModuleName);
module = ImportedModule { name = CopyString(mainModuleName), type = moduleDefinition };
defines.AddName(module);
#ifdef _DEBUG
- //yydebug = true;
+ // SetYydebug(true);
#endif
resetScanner();
computed.instance._class.symbol.registered &&
eClass_IsDerived(computed.instance._class.symbol.registered, propertyClass))
{
- prop.Set(instance, computed.instance.data);
+ ((void (*)(void *, void *))(void *)prop.Set)(instance, computed.instance.data);
// This was saved in the control and shouldn't be freed by FreeExpression...
if(propertyClass.type == normalClass)
}
}
// MOVED THIS UP NOW THAT char * IS A NORMAL CLASS
- else if(computed.type == stringExp)
+ else if(computed.type == stringExp && propertyClass.dataTypeString && strstr(propertyClass.dataTypeString, "char *"))
{
- char temp[1024];
+ String temp = new char[strlen(computed.string)+1];
ReadString(temp, computed.string);
- prop.Set(instance, temp);
+ ((void (*)(void *, void *))(void *)prop.Set)(instance, temp);
+ delete temp;
}
else
propDef.variable = true;
valueData.i64 = value.i64;
SetProperty(prop, instance, valueData);
}
- else if(computed.type == stringExp)
+ else if(computed.type == stringExp && propertyClass.dataTypeString && strstr(propertyClass.dataTypeString, "char *"))
{
- char temp[1024];
+ String temp = new char[strlen(computed.string)+1];
ReadString(temp, computed.string);
- prop.Set(instance, temp);
+ ((void (*)(void *, void *))(void *)prop.Set)(instance, temp);
+ delete temp;
}
}
else
{
curMember = thisMember;
curClass = curMember._class;
- memcpy(subMemberStack, _subMemberStack, sizeof(int) * _subMemberStackPos);
+ memcpy(subMemberStack, _subMemberStack, sizeof(DataMember) * _subMemberStackPos);
subMemberStackPos = _subMemberStackPos;
found = true;
}
if(propertyClass.type == structClass || propertyClass.type == normalClass || propertyClass.type == noHeadClass)
{
- Expression computed = CopyExpression(member.initializer.exp);
+ Expression computed;
+#ifdef _DEBUG
+ /*char debugExpString[4096];
+ debugExpString[0] = '\0';
+ PrintExpression(member.initializer.exp, debugExpString);*/
+#endif
+ computed = CopyExpression(member.initializer.exp);
if(computed)
{
ComputeExpression(computed);
computed.instance._class.symbol.registered &&
eClass_IsDerived(computed.instance._class.symbol.registered, propertyClass))
{
- prop.Set(control, computed.instance.data);
+ ((void (*)(void *, void *))(void *)prop.Set)(control, computed.instance.data);
// This was saved in the control and shouldn't be freed by FreeExpression...
if(propertyClass.type == normalClass)
if(!strcmp(name, "this"))
{
if(prop.Set)
- prop.Set(control, instance);
+ ((void (*)(void *, void *))(void *)prop.Set)(control, instance);
member.variable = false;
}
else
if(check.name && !strcmp(name, check.name))
{
if(prop.Set)
- prop.Set(control, check.instance);
+ ((void (*)(void *, void *))(void *)prop.Set)(control, check.instance);
member.variable = false;
break;
}
if(check.name && !strcmp(name, check.name))
{
if(prop.Set)
- prop.Set(control, check.instance);
+ ((void (*)(void *, void *))(void *)prop.Set)(control, check.instance);
member.variable = false;
break;
}
}
}
// MOVED THIS UP NOW THAT char * IS A NORMAL CLASS
- else if(computed.isConstant && computed.type == stringExp && (propertyClass.dataTypeString && !strcmp(propertyClass.dataTypeString, "char *")))
+ else if(computed.isConstant && computed.type == stringExp && propertyClass.dataTypeString && strstr(propertyClass.dataTypeString, "char *"))
{
- char temp[1024];
+ String temp = new char[strlen(computed.string)+1];
ReadString(temp, computed.string);
- prop.Set(control, temp);
+ ((void (*)(void *, void *))(void *)prop.Set)(control, temp);
+ delete temp;
}
else
member.variable = true;
else if(!strcmp(propertyClass.dataTypeString, "double"))
((void (*)(void *, double))(void *)prop.Set)(control, strtod(computed.constant, null));
else
- prop.Set(control, strtol(computed.constant, null, 0));
+ ((void (*)(void *, int))(void *)prop.Set)(control, strtol(computed.constant, null, 0));
}
- else if(computed.type == stringExp && (propertyClass.dataTypeString && !strcmp(propertyClass.dataTypeString, "char *"))) // || (!strcmp(propertyClass.name, "String"))))
+ else if(computed.type == stringExp && propertyClass.dataTypeString && strstr(propertyClass.dataTypeString, "char *"))
{
- char temp[1024];
+ String temp = new char[strlen(computed.string)+1];
ReadString(temp, computed.string);
- prop.Set(control, temp);
+ ((void (*)(void *, void *))(void *)prop.Set)(control, temp);
+ delete temp;
}
}
else
#endif
if(inUseDebug && ide.projectView)
ide.debugger.EvaluateWatches();
+
+ delete pathBackup;
}
void UpdateInstanceCodeClass(Class _class, ObjectInfo object, EditBoxStream f, Instance test, bool * prev, bool * lastIsMethod, DataMember * curMember, Class * curClass)
if(prop && prop.isProperty && !prop.conversion && eClass_FindProperty(object.instance._class, prop.name, privateModule))
{
if(prop.Set && prop.Get && prop.dataTypeString && strcmp(prop.name, "name") && !Code_IsPropertyDisabled(object, prop.name) &&
- (!prop.IsSet || prop.IsSet(control)))
+ prop.compiled && (!prop.IsSet || prop.IsSet(control)))
{
Class dataType = prop.dataTypeClass;
if(!dataType)
void * dataForm = new0 byte[dataType.structSize];
void * dataTest = new0 byte[dataType.structSize];
- ((void (*)())(void *)prop.Get)(control, dataForm);
- prop.Get(test, dataTest);
+ ((void (*)(void *, void *))(void *)prop.Get)(control, dataForm);
+ ((void (*)(void *, void *))(void *)prop.Get)(test, dataTest);
- if((prop.IsSet && !prop.IsSet(test)) || dataType._vTbl[__ecereVMethodID_class_OnCompare](dataType, dataForm, dataTest))
+ if((prop.IsSet && !prop.IsSet(test)) || ((int (*)(void *, void *, void *))(void *)dataType._vTbl[__ecereVMethodID_class_OnCompare])(dataType, dataForm, dataTest))
{
char tempString[1024] = "";
char * string = "";
if(*prev)
f.Printf(", ");
- prop.Set(test, dataForm);
+ ((void (*)(void *, void *))(void *)prop.Set)(test, dataForm);
- string = (char *)dataType._vTbl[__ecereVMethodID_class_OnGetString](dataType, dataForm, tempString, null, &needClass);
+ string = ((char * (*)(void *, void *, void *, void *, void *))(void *)dataType._vTbl[__ecereVMethodID_class_OnGetString])(dataType, dataForm, tempString, null, &needClass);
eClass_FindNextMember(_class, curClass, curMember, null, null);
if(*curMember != (DataMember)prop)
{
void * dataForm, * dataTest;
- dataForm = (void *)prop.Get(control);
- dataTest = (void *)prop.Get(test);
+ dataForm = ((void *(*)(void *))(void *)prop.Get)(control);
+ dataTest = ((void *(*)(void *))(void *)prop.Get)(test);
- if((prop.IsSet && !prop.IsSet(test)) || dataType._vTbl[__ecereVMethodID_class_OnCompare](dataType, dataForm, dataTest))
+ if((prop.IsSet && !prop.IsSet(test)) || ((int (*)(void *, void *, void *))(void *)dataType._vTbl[__ecereVMethodID_class_OnCompare])(dataType, dataForm, dataTest))
{
char tempString[1024] = "";
char * string = "";
if(*prev)
f.Printf(", ");
- prop.Set(test, dataForm);
+ ((void (*)(void *, void *))(void *)prop.Set)(test, dataForm);
eClass_FindNextMember(_class, curClass, curMember, null, null);
if(*curMember != (DataMember)prop)
if(!object)
{
bool needClass = true;
- string = (char *)dataType._vTbl[__ecereVMethodID_class_OnGetString](dataType, dataForm, tempString, null, &needClass);
+ string = ((char * (*)(void *, void *, void *, void *, void *))(void *)dataType._vTbl[__ecereVMethodID_class_OnGetString])(dataType, dataForm, tempString, null, &needClass);
f.Printf("%s", string);
}
}
else
{
bool needClass = true;
- string = (char *)dataType._vTbl[__ecereVMethodID_class_OnGetString](dataType, dataForm, tempString, null, &needClass);
+ string = ((char * (*)(void *, void *, void *, void *, void *))(void *)dataType._vTbl[__ecereVMethodID_class_OnGetString])(dataType, dataForm, tempString, null, &needClass);
if(!strcmp(dataType.dataTypeString, "char *"))
{
GetProperty(prop, control, &dataForm);
GetProperty(prop, test, &dataTest);
- if((prop.IsSet && !prop.IsSet(test)) || dataType._vTbl[__ecereVMethodID_class_OnCompare](dataType, &dataForm, &dataTest))
+ if((prop.IsSet && !prop.IsSet(test)) || ((int (*)(void *, void *, void *))(void *)dataType._vTbl[__ecereVMethodID_class_OnCompare])(dataType, &dataForm, &dataTest))
{
char * string;
char tempString[1024] = "";
}
}
else
- string = (char *)dataType._vTbl[__ecereVMethodID_class_OnGetString](dataType, &dataForm, tempString, null, &needClass);
+ string = ((char * (*)(void *, void *, void *, void *, void *))(void *)dataType._vTbl[__ecereVMethodID_class_OnGetString])(dataType, &dataForm, tempString, null, &needClass);
if(string && string[0])
{
*curMember = (DataMember)prop;
*curClass = curMember->_class;
- string = (char *)dataType._vTbl[__ecereVMethodID_class_OnGetString](dataType, &dataForm.ui, tempString, null, &needClass);
+ string = ((char * (*)(void *, void *, void *, void *, void *))(void *)dataType._vTbl[__ecereVMethodID_class_OnGetString])(dataType, &dataForm.ui, tempString, null, &needClass);
if(needClass)
f.Printf("%c %s %c", /*dataType.name, */OpenBracket, string, CloseBracket);
else
for(param = dataType.params.first; param; param = param.next)
{
if(param.prev) f.Printf(", ");
- f.Printf(param.name);
+ if(param.kind != voidType)
+ f.Printf(param.name);
}
f.Printf(");\n");
}
void * dataForm = new0 byte[dataType.structSize];
void * dataTest = new0 byte[dataType.structSize];
- prop.Get(classObject.instance, dataForm);
- prop.Get(test, dataTest);
+ ((void (*)(void *, void *))(void *)prop.Get)(classObject.instance, dataForm);
+ ((void (*)(void *, void *))(void *)prop.Get)(test, dataTest);
- if(dataType._vTbl[__ecereVMethodID_class_OnCompare](dataType, dataForm, dataTest))
+ if(((int (*)(void *, void *, void *))(void *)dataType._vTbl[__ecereVMethodID_class_OnCompare])(dataType, dataForm, dataTest))
{
bool needClass = true;
- string = (char *)dataType._vTbl[__ecereVMethodID_class_OnGetString](dataType, dataForm, tempString, null, &needClass);
- prop.Set(test, dataForm);
+ string = ((char * (*)(void *, void *, void *, void *, void *))(void *)dataType._vTbl[__ecereVMethodID_class_OnGetString])(dataType, dataForm, tempString, null, &needClass);
+ ((void (*)(void *, void *))(void *)prop.Set)(test, dataForm);
if(needClass)
f.Printf("\n %s%s = %c %s %c;", specify ? "property::" : "", prop.name, /*dataType.name, */OpenBracket, string, CloseBracket);
else
{
void * dataForm, * dataTest;
- dataForm = (void *)prop.Get(classObject.instance);
- dataTest = (void *)prop.Get(test);
+ dataForm = ((void *(*)(void *))(void *)prop.Get)(classObject.instance);
+ dataTest = ((void *(*)(void *))(void *)prop.Get)(test);
- if(dataType._vTbl[__ecereVMethodID_class_OnCompare](dataType, dataForm, dataTest))
+ if(((int (*)(void *, void *, void *))(void *)dataType._vTbl[__ecereVMethodID_class_OnCompare])(dataType, dataForm, dataTest))
{
char tempString[1024] = "";
char * string;
- prop.Set(test, dataForm);
+ ((void (*)(void *, void *))(void *)prop.Set)(test, dataForm);
if(eClass_IsDerived(classObject.instance._class, dataType) && classObject.instance == dataForm)
{
{
bool needClass = true;
- string = (char *)dataType._vTbl[__ecereVMethodID_class_OnGetString](dataType, dataForm, tempString, null, &needClass);
+ string = ((char * (*)(void *, void *, void *, void *, void *))(void *)dataType._vTbl[__ecereVMethodID_class_OnGetString])(dataType, dataForm, tempString, null, &needClass);
if(!strcmp(dataType.dataTypeString, "char *"))
{
GetProperty(prop, classObject.instance, &dataForm);
GetProperty(prop, test, &dataTest);
- if(dataType._vTbl[__ecereVMethodID_class_OnCompare](dataType, &dataForm, &dataTest))
+ if(((int (*)(void *, void *, void *))(void *)dataType._vTbl[__ecereVMethodID_class_OnCompare])(dataType, &dataForm, &dataTest))
{
SetProperty(prop, test, dataForm);
if(dataType.type == bitClass)
{
bool needClass = true;
- string = (char *)dataType._vTbl[__ecereVMethodID_class_OnGetString](dataType, &dataForm, tempString, null, &needClass);
+ string = ((char * (*)(void *, void *, void *, void *, void *))(void *)dataType._vTbl[__ecereVMethodID_class_OnGetString])(dataType, &dataForm, tempString, null, &needClass);
if(needClass)
f.Printf("\n %s%s = %c %s %c;", specify ? "property::" : "", prop.name, /*dataType.name, */OpenBracket, string, CloseBracket);
else if(string[0])
}
}
else
- string = (char *)dataType._vTbl[__ecereVMethodID_class_OnGetString](dataType, &dataForm, tempString, null, &needClass);
+ string = ((char * (*)(void *, void *, void *, void *, void *))(void *)dataType._vTbl[__ecereVMethodID_class_OnGetString])(dataType, &dataForm, tempString, null, &needClass);
if(!strcmp(dataType.dataTypeString, "float") && strchr(string, '.'))
f.Printf("\n %s%s = %sf;", specify ? "property::" : "", prop.name, string);
else if(string[0])
void UpdateFormCode()
{
if(!this) return;
-
+ if(!parsing) return;
+
updatingCode++;
if(codeModified)
{
for(param = dataType.params.first; param; param = param.next)
{
if(param.prev) f.Printf(", ");
- if(param.kind != voidType)
+ if(param.kind != voidType)
f.Printf(param.name);
}
f.Printf(");\n");
ParseCode();
delete text;
+
+ // TOFIX: Patch for a glitch where clicking at the end of the view seems one line off. No idea what could be going on?
+ editBox.OnVScroll(setRange, editBox.scroll.y, 0);
}
updatingCode--;
moveAttached = false;
function = null;
method = null;
-
}
int FindMethod(char * methodName /*Method method*/, ClassFunction*functionPtr, Location propLoc)
if(!method || method.type != virtualMethod)
{
char title[1024];
- sprintf(title, "Attach %s", function.declarator.symbol.string);
- if(MessageBox { type = yesNo, master = parent, text = title, contents = "Method is unused. Move method inside instance?"}.Modal() == yes)
+ sprintf(title, $"Attach %s", function.declarator.symbol.string);
+ if(MessageBox { type = yesNo, master = parent, text = title, contents = $"Method is unused. Move method inside instance?"}.Modal() == yes)
{
moveAttached = true;
}
if(!method || method.type != virtualMethod)
{
char title[1024];
- sprintf(title, "Attach %s", function.declarator.symbol.string);
+ sprintf(title, $"Attach %s", function.declarator.symbol.string);
if(MessageBox { type = yesNo, master = parent, text = title,
- contents = "Method is unused. Move method inside instance?" }.Modal() == yes)
+ contents = $"Method is unused. Move method inside instance?" }.Modal() == yes)
{
moveAttached = true;
}
Window dialog
{
hasClose = true, borderStyle = sizable, minClientSize = { 300, 55 },
- master = sheet, text = "Name detached method", background = activeBorder
+ master = sheet, text = $"Name detached method", background = formColor
};
Button cancelButton
{
- dialog, anchor = { horz = 45, top = 30 }, size = { 80 }, text = "Cancel", hotKey = escape,
+ dialog, anchor = { horz = 45, top = 30 }, size = { 80 }, text = $"Cancel", hotKey = escape,
id = DialogResult::cancel, NotifyClicked = ButtonCloseDialog
};
Button okButton
{
- dialog, anchor = { horz = -45, top = 30 }, size = { 80 }, text = "OK", isDefault = true,
+ dialog, anchor = { horz = -45, top = 30 }, size = { 80 }, text = $"OK", isDefault = true,
id = DialogResult::ok, NotifyClicked = ButtonCloseDialog
};
EditBox nameBox
void EnsureUpToDate()
{
- if(sheet && codeModified)
+ if(sheet && codeModified && parsing)
ParseCode();
}
for(oClass = classes.first; oClass; oClass = oClass.next)
{
- ObjectInfo object;
+ if(oClass.instance)
+ {
+ ObjectInfo object;
- sheet.AddObject(oClass, oClass.name ? oClass.name : oClass.instance._class.name, typeClass, false);
- for(object = oClass.instances.first; object; object = object.next)
- sheet.AddObject(object, object.name ? object.name : object.instance._class.name, typeData, false);
+ sheet.AddObject(oClass, oClass.name ? oClass.name : oClass.instance._class.name, typeClass, false);
+ for(object = oClass.instances.first; object; object = object.next)
+ sheet.AddObject(object, object.name ? object.name : object.instance._class.name, typeData, false);
+ }
}
sheet.SelectObject(selected);
}
}
}
- void ListClassPropertiesAndVirtual(Class whatClass)
+ void ListClassPropertiesAndVirtual(Class whatClass, String curString)
{
Class _class;
bool isPrivate = false;
- for(_class = whatClass; _class && _class.type != systemClass; _class = _class.base)
+ for(_class = whatClass; _class /*&& _class.type != systemClass*/; _class = _class.base)
{
Method method;
Property prop;
row.icon = icons[(member.memberAccess == publicAccess && !isPrivate) ? typeProperty : typePropertyPrivate];
}
}
- else if(member.name)
+ else if(member.name && (!curString || strcmp(curString, member.name)))
{
DataRow row = membersList.AddString(member.name);
for(link = (BTNamedLink)nameSpace.classes.first; link; link = (BTNamedLink)((BTNode)link).next)
{
Class _class = link.data;
- if(_class.type != systemClass)
+ if(_class.type != systemClass && !_class.templateClass) // Omit templatized classes
{
DataRow row = membersList.AddString(_class.name);
row.icon = (_class.type == unitClass || _class.type == enumClass) ? icons[typeDataType] : icons[typeClass];
void ListEnumValues(Class _class)
{
+ List<Class> classes { };
for(; _class && _class.type == enumClass; _class = _class.base)
+ classes.Insert(null, _class);
+ for(_class : classes)
{
EnumClassData enumeration = (EnumClassData)_class.data;
NamedLink item;
row.icon = icons[typeEnumValue];
}
}
+ delete classes;
}
bool ListEnumsModule(Module mainModule, Type dest)
for(link = (BTNamedLink)nameSpace.classes.first; link; link = (BTNamedLink)((BTNode)link).next)
{
Class _class = link.data;
- if(_class.type == enumClass && (dest.kind != classType || !dest._class || dest._class.registered != _class))
+ if(_class.type == enumClass && (dest.kind != classType || ((!dest._class || !dest._class.registered || (dest._class.registered != _class && strcmp(dest._class.registered.dataTypeString, "char *"))) && !dest.classObjectType)) &&
+ dest.kind != pointerType && dest.kind != ellipsisType)
{
OldList conversions { };
Type type { };
ListEnumValues(destType._class.registered);
if(insideClass)
- ListClassPropertiesAndVirtual(insideClass);
+ ListClassPropertiesAndVirtual(insideClass, null);
listedEnums = true;
}
}
if(insideClass)
- ListClassPropertiesAndVirtual(insideClass);
+ ListClassPropertiesAndVirtual(insideClass, null);
listedEnums = true;
}
else if(insideClass && !enumOnly)
{
- ListClassPropertiesAndVirtual(insideClass);
+ ListClassPropertiesAndVirtual(insideClass, string);
}
if(listedEnums && string && string[0])
f.Printf("\n");
- //if(test._class._vTbl[method.vid] == moduleClass._vTbl[__ecereVMethodID___ecereNameSpace__ecere__com__Module_OnLoad]) // Temp Check for DefaultFunction
+ if(!_class ||
+ (
+ (isInstance ? _class : _class.base)._vTbl[method.vid] == moduleClass._vTbl[__ecereVMethodID___ecereNameSpace__ecere__com__Module_OnLoad] ||
+ (isInstance ? _class : _class.base)._vTbl[method.vid] == DummyMethod)) // Temp Check for DefaultFunction
{
if(returnType && returnType.kind == classType && !strcmp(returnType._class.string, "bool"))
{
f.Printf(" return 0;\n");
}
}
- /*else
+ else
{
+ if(extraIndent) f.Printf(" ");
f.Printf(" ");
if(returnType.kind != voidType)
f.Printf("return ");
- f.Printf("%s::%s(this", classDef.base.name, method.name);
+ f.Printf("%s::%s(", isInstance ? _class.name : _class.base.name, method.name);
for(param = dataType.params.first; param; param = param.next)
{
- f.Printf(", ");
- f.Printf(param.name);
+ if(param.prev) f.Printf(", ");
+ if(param.kind != voidType)
+ f.Printf(param.name);
}
f.Printf(");\n");
- }*/
-
+ }
}
if(extraIndent) f.Printf(" ");
Expression memberExp = null;
Identifier realIdentifier = null;
+ if(!parsing) return true;
if(!privateModule) return !didOverride;
insideFunction = null;
EditLine l1, l2;
int x1,y1, x2,y2;
+ if(!parsing) return;
+
charPos = editBox.charPos + 1;
EnsureUpToDate();
document.Create();
return document;
}
-
-void CodeEditor_Terminate()
-{
- FindParams_Terminate();
- FindCtx_Terminate();
- FreeIncludeFiles();
-}