tarball: Updated for version 0.44.15
[sdk] / ide / src / designer / CodeEditor.ec
index 1518338..8656bd2 100644 (file)
@@ -606,7 +606,7 @@ bool Code_IsFunctionEmpty(ClassFunction function, Method method, ObjectInfo obje
    // Check if it contains any code
    if((!body.compound.declarations || !body.compound.declarations->count) && (!body.compound.statements || body.compound.statements->count <= 1))
    {
-      Class moduleClass = eSystem_FindClass(object.instance._class.module, "Module");
+      // Class moduleClass = eSystem_FindClass(object.instance._class.module, "Module");
       Statement stmt = body.compound.statements ? body.compound.statements->first : null;
       Type dataType = method.dataType;
       Type returnType = dataType.returnType;
@@ -618,7 +618,7 @@ bool Code_IsFunctionEmpty(ClassFunction function, Method method, ObjectInfo obje
       confirmation = false;
 
       // Check if default function should be calling base class:
-      if(object.instance._class._vTbl[method.vid] == moduleClass._vTbl[__ecereVMethodID___ecereNameSpace__ecere__com__Module_OnLoad]) // Temp Check for DefaultFunction
+      if(object.instance._class._vTbl[method.vid] == null /*moduleClass._vTbl[__ecereVMethodID___ecereNameSpace__ecere__com__Module_OnLoad]*/) // Temp Check for DefaultFunction
       {
          if(returnType.kind != voidType)
          {
@@ -760,7 +760,7 @@ class CodeEditor : Window
    bool inUseDebug;
    OpenedFileInfo openedFileInfo;
 
-   FontResource font { codeFont.faceName, codeFont.size };
+   FontResource font { codeFont.faceName, codeFont.size, codeFont.bold, codeFont.italic };
    saveDialog = codeEditorFileDialog;
 
    Designer designer { codeEditor = this, visible = false, saveDialog = codeEditorFormFileDialog };
@@ -2050,7 +2050,7 @@ class CodeEditor : Window
          int line = editBox.lineNumber + 1;
          if(projectView)
          {
-            CompilerConfig compiler = ideSettings.GetCompilerConfig(ide.workspace.compiler);
+            CompilerConfig compiler = ideConfig.compilers.GetCompilerConfig(ide.workspace.activeCompiler);
             ProjectConfig config = projectView.project.config;
             int bitDepth = ide.workspace.bitDepth;
             bool useValgrind = ide.workspace.useValgrind;
@@ -2101,7 +2101,7 @@ class CodeEditor : Window
       if(!parentClosing)
       {
          if(ide.workspace && fileName)
-            ide.workspace.UpdateOpenedFileInfo(fileName, closed);
+            ide.workspace.UpdateOpenedFileInfo(fileName, closed, false);
          if(inUseDebug && !debugClosing)
          {
             debugClosing = true;
@@ -2136,7 +2136,7 @@ class CodeEditor : Window
    void OnDestroy(void)
    {
       ObjectInfo oClass, next;
-      Class windowClass = eSystem_FindClass(this.privateModule, "ecere::gui::Window");
+      // Class windowClass = eSystem_FindClass(this.privateModule, "ecere::gui::Window");
 
       FreeType(this.functionType);
       FreeType(this.instanceType);
@@ -2332,7 +2332,7 @@ class CodeEditor : Window
 
          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 { creationActivation = flash, type = yesNo, master = /*parent = */parent, text = $"Document has been modified",
             contents = message }.Modal() == yes)
             reload = true;
       }
@@ -2610,6 +2610,7 @@ class CodeEditor : Window
 
    void ModifyCode()
    {
+      fixCaret = true;
       selected.modified = true;
       selected.oClass.modified = true;
 
@@ -2709,7 +2710,7 @@ class CodeEditor : Window
 #endif
       Project project;
 
-      // This temporarily fixes issue with 2 overrides in release mode with VC6 (only happens with both ecere.dll and ide.exe compiled in release mode)
+      // This temporarily fixes issue with 2 overrides in release mode with VC6 (only happens with both ecere.dll and ecere-ide.exe compiled in release mode)
       if(reentrant) return;
       reentrant = true;
 
@@ -2852,7 +2853,7 @@ class CodeEditor : Window
 
       if(ide.workspace)
       {
-         CompilerConfig compiler = ideSettings.GetCompilerConfig(ide.workspace.compiler);
+         CompilerConfig compiler = ideConfig.compilers.GetCompilerConfig(ide.workspace.activeCompiler);
          SetTargetBits(ide.workspace.bitDepth ? ide.workspace.bitDepth : GetHostBits());
          delete compiler;
       }
@@ -2905,7 +2906,7 @@ class CodeEditor : Window
       // TODO: Get symbolsDir from project settings instead...
       if(ide.projectView)
       {
-         CompilerConfig compiler = ideSettings.GetCompilerConfig(ide.workspace.compiler);
+         CompilerConfig compiler = ideConfig.compilers.GetCompilerConfig(ide.workspace.activeCompiler);
          ProjectConfig config = project.config;
          int bitDepth = ide.workspace.bitDepth;
          DirExpression objDir = project.GetObjDir(compiler, config, bitDepth);
@@ -3424,16 +3425,19 @@ class CodeEditor : Window
                                                                                           ObjectInfo check;
                                                                                           if(!strcmp(name, "this"))
                                                                                           {
-                                                                                             char * name = computed.member.member.string;
-                                                                                             ObjectInfo check;
-                                                                                             for(check = classObject.instances.first; check; check = check.next)
-                                                                                                if(check.name && !strcmp(name, check.name))
-                                                                                                {
-                                                                                                   if(prop.Set)
-                                                                                                      ((void (*)(void *, void *))(void *)prop.Set)(control, check.instance);
-                                                                                                   variable = false;
-                                                                                                   break;
-                                                                                                }
+                                                                                             if(computed.member.member)
+                                                                                             {
+                                                                                                char * name = computed.member.member.string;
+                                                                                                ObjectInfo check;
+                                                                                                for(check = classObject.instances.first; check; check = check.next)
+                                                                                                   if(check.name && !strcmp(name, check.name))
+                                                                                                   {
+                                                                                                      if(prop.Set)
+                                                                                                         ((void (*)(void *, void *))(void *)prop.Set)(control, check.instance);
+                                                                                                      variable = false;
+                                                                                                      break;
+                                                                                                   }
+                                                                                             }
                                                                                           }
                                                                                           else
                                                                                           {
@@ -4354,7 +4358,7 @@ class CodeEditor : Window
                }
                else
                {
-                  Class moduleClass = eSystem_FindClass(this.privateModule, "Module");
+                  // Class moduleClass = eSystem_FindClass(this.privateModule, "Module");
 
                   // ADDING METHOD HERE
                   f.Printf("\n      ");
@@ -4383,7 +4387,7 @@ class CodeEditor : Window
                   f.Printf(")\n");
                   f.Printf("      %c\n\n", OpenBracket);
 
-                  if(control._class._vTbl[method.vid] == moduleClass._vTbl[__ecereVMethodID___ecereNameSpace__ecere__com__Module_OnLoad]) // Temp Check for DefaultFunction
+                  if(control._class._vTbl[method.vid] == null /*moduleClass._vTbl[__ecereVMethodID___ecereNameSpace__ecere__com__Module_OnLoad]*/) // Temp Check for DefaultFunction
                   {
                      if(returnType.kind == classType && !strcmp(returnType._class.string, "bool"))
                         f.Printf("         return true;\n");
@@ -4967,7 +4971,7 @@ class CodeEditor : Window
                   Type dataType = method.dataType;
                   Type returnType = dataType.returnType;
                   Type param;
-                  Class moduleClass = eSystem_FindClass(this.privateModule, "Module");
+                  // Class moduleClass = eSystem_FindClass(this.privateModule, "Module");
 
                   f.Printf("\n\n");
                   f.Printf("   ");
@@ -4993,7 +4997,7 @@ class CodeEditor : Window
                   f.Printf(")\n");
                   f.Printf("   %c\n\n", OpenBracket);
 
-                  if(test._class._vTbl[method.vid] == moduleClass._vTbl[__ecereVMethodID___ecereNameSpace__ecere__com__Module_OnLoad]) // Temp Check for DefaultFunction
+                  if(test._class._vTbl[method.vid] == null /*moduleClass._vTbl[__ecereVMethodID___ecereNameSpace__ecere__com__Module_OnLoad]*/) // Temp Check for DefaultFunction
                   {
                      if(returnType && returnType.kind == classType && !strcmp(returnType._class.string, "bool"))
                         f.Printf("      return true;\n");
@@ -6363,7 +6367,7 @@ class CodeEditor : Window
          Type dataType = method.dataType;
          Type returnType = dataType.returnType;
          Type param;
-         Class moduleClass = eSystem_FindClass(this.privateModule, "Module");
+         // Class moduleClass = eSystem_FindClass(this.privateModule, "Module");
 
          if(insideDef.prev)
              f.Printf("\n\n");
@@ -6405,7 +6409,7 @@ class CodeEditor : Window
 
          if(!_class ||
             (
-               (isInstance ? _class : _class.base)._vTbl[method.vid] == moduleClass._vTbl[__ecereVMethodID___ecereNameSpace__ecere__com__Module_OnLoad] ||
+               (isInstance ? _class : _class.base)._vTbl[method.vid] == null /*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"))