ide: Renamed selection of 32/64 bit from 'bit depth' to 'bit length'; Updated credits
[sdk] / ide / src / ide.ec
index 1a40ff2..65967b0 100644 (file)
@@ -313,7 +313,7 @@ class IDEToolbar : ToolBar
 
    DropBox activeBitDepth
    {
-      this, toolTip = $"Active Bit Depth", size = { 60 }, disabled = true;
+      this, toolTip = $"Active Bit Length", size = { 60 }, disabled = true;
       bool NotifySelect(DropBox dropBox, DataRow row, Modifiers mods)
       {
          if(ide.workspace && ide.projectView && row)
@@ -2549,10 +2549,17 @@ class IDEWorkSpace : Window
    }
    */
 
+   void UpdateStateLight(StatusField fld, bool on)
+   {
+      fld.color = on ? lime : Color { 128,128,128 };
+      fld.backColor = on ? dimGray : 0;
+      fld.bold = on;
+   }
+
    bool OnActivate(bool active, Window swap, bool * goOnWithActivation, bool direct)
    {
-      caps.color = app.GetKeyState(capsState) ? black : Color { 128,128,128 };
-      num.color = app.GetKeyState(numState) ? black : Color { 128,128,128 };
+      UpdateStateLight(caps, app.GetKeyState(capsState));
+      UpdateStateLight(num, app.GetKeyState(numState));
       return true;
    }
 
@@ -2560,15 +2567,19 @@ class IDEWorkSpace : Window
    {
       switch(key)
       {
-         case b:
-            projectView.Update(null);
-            break;
-         case capsLock:
-            caps.color = app.GetKeyState(capsState) ? black : Color { 128,128,128 };
-            break;
-         case numLock:
-            num.color = app.GetKeyState(numState) ? black : Color { 128,128,128 };
-            break;
+         case b: projectView.Update(null); break;
+         case capsLock: UpdateStateLight(caps, app.GetKeyState(capsState)); break;
+         case numLock:  UpdateStateLight(num, app.GetKeyState(numState)); break;
+      }
+      return true;
+   }
+
+   bool OnKeyUp(Key key, unichar ch)
+   {
+      switch(key)
+      {
+         case capsLock: UpdateStateLight(caps, app.GetKeyState(capsState)); break;
+         case numLock:  UpdateStateLight(num, app.GetKeyState(numState)); break;
       }
       return true;
    }
@@ -2906,22 +2917,25 @@ class IDEWorkSpace : Window
 
             statusBar.AddField(pos);
 
-            caps = { width = 40, text = $"CAPS", color = app.GetKeyState(capsState) ? black : Color { 128, 128, 128 } };
+            caps = { width = 40, text = $"CAPS" };
             statusBar.AddField(caps);
+            UpdateStateLight(caps, app.GetKeyState(capsState));
 
-            ovr = { width = 30, text = $"OVR", color = (editBox && editBox.overwrite) ? black : Color { 128, 128, 128 } };
+            ovr = { width = 36, text = $"OVR" };
             statusBar.AddField(ovr);
+            UpdateStateLight(ovr, (editBox && editBox.overwrite));
 
-            num = { width = 30, text = $"NUM", color = app.GetKeyState(numState) ? black : Color { 128, 128, 128 } };
+            num = { width = 36, text = $"NUM" };
             statusBar.AddField(num);
+            UpdateStateLight(num, app.GetKeyState(numState));
 
             //statusBar.text = "Ready";
 
             if(projectView && projectView.project)
             {
                bool isCObject = false;
-               ProjectNode node = projectView.GetNodeFromWindow(client, null, false, false);
-               if(!node && (node = projectView.GetNodeFromWindow(client, null, false, true)))
+               ProjectNode node = projectView.GetNodeFromWindow(client, null, true, false, null);
+               if(!node && (node = projectView.GetNodeFromWindow(client, null, true, true, null)))
                   isCObject = true;
                if(node)
                {
@@ -2938,26 +2952,21 @@ class IDEWorkSpace : Window
                      {
                         if(projectView)
                         {
-                           bool result = false;
                            bool isCObject = false;
-                           ProjectNode node = null;
-                           for(p : ide.workspace.projects)
-                           {
-                              node = projectView.GetNodeFromWindow(activeClient, p, true, false);
-                              if(node) break;
-                           }
-                           if(!node && (node = projectView.GetNodeFromWindow(activeClient, null, true, true)))
-                              isCObject = true;
+                           bool isExcluded = false;
+                           ProjectNode node = projectView.GetNodeForCompilationFromWindow(activeClient, true, &isExcluded, &isCObject);
                            if(node)
                            {
-                              List<ProjectNode> nodes { };
-                              nodes.Add(node);
-                              projectView.Compile(node.project, nodes, mods.ctrl && mods.shift, isCObject ? cObject : normal);
-                              delete nodes;
-                              result = true;
+                              if(isExcluded)
+                                 ide.outputView.buildBox.Logf($"%s %s is excluded from current build configuration.\n", isCObject ? "Object file" : "File", node.name);
+                              else
+                              {
+                                 List<ProjectNode> nodes { };
+                                 nodes.Add(node);
+                                 projectView.Compile(node.project, nodes, mods.ctrl && mods.shift, isCObject ? cObject : normal);
+                                 delete nodes;
+                              }
                            }
-                           if(!result && node)
-                              ide.outputView.buildBox.Logf($"File %s is excluded from current build configuration.\n", node.name);
                         }
                         return true;
                      }