ecere/ide: Support automatically chaining modal masters, can now use master = ide...
authorJerome St-Louis <jerome@ecere.com>
Fri, 19 Aug 2011 07:40:24 +0000 (03:40 -0400)
committerJerome St-Louis <jerome@ecere.com>
Fri, 19 Aug 2011 07:40:24 +0000 (03:40 -0400)
ecere/src/gui/Window.ec
ecere/src/gui/drivers/Win32Interface.ec
ide/src/ProjectSettings.ec
ide/src/dialogs/ProjectTabSettings.ec

index c60cf96..198b235 100644 (file)
@@ -5216,7 +5216,7 @@ private:
             /*
             if(destroyed)
             {
-               OldLink slave = master.slaves.FindVoid(this);
+               OldLink slave = master.slaves.FindLink(this);
                master.slaves.Delete(slave);
             }
             */
@@ -5915,7 +5915,8 @@ public:
          if(!master) master = parent;
 
          if(style.modal && master.modalSlave)
-            return false;
+            property::master = master.modalSlave;
+            //return false;
 
          if(parent)
             parent.children.Remove(this);
@@ -9121,7 +9122,7 @@ public:
    property int documentID { get { return documentID; } };
    property Window previous { get { return prev; } }
    property Window next { get { return next; } }
-   property Window nextSlave { get { OldLink link = master.slaves.FindLink(this); return (link && link.next) ? link.next.data : null; } }
+   property Window nextSlave { get { OldLink link = master ? master.slaves.FindLink(this) : null; return (link && link.next) ? link.next.data : null; } }
    property PopupMenu menuBar { get { return menuBar; } }
    property ScrollBar sbv { get { return sbv; } }
    property ScrollBar sbh { get { return sbh; } }
index 1972f8c..d8db746 100644 (file)
@@ -1782,10 +1782,18 @@ class Win32Interface : Interface
       HICON oldIcon = (HICON)SendMessage(window.windowHandle, WM_GETICON, ICON_BIG, 0);
 
       // Dialogs Inherit master's icon if none set
-      Window master = window.master, rootWindow = (master && master != guiApp.desktop) ? master.rootWindow : null;
-
-      if(!resource && !window.style.showInTaskBar && window.hasClose && rootWindow && rootWindow.icon)
-         resource = rootWindow.icon;
+      if(!window.style.showInTaskBar && window.hasClose)
+      {
+         Window master = window.master;
+         while(master && !resource)
+         {
+            Window rootWindow = (master && master != guiApp.desktop) ? master.rootWindow : null;
+            if(rootWindow && rootWindow.icon)
+               resource = rootWindow.icon;
+            else
+               master = master.master;
+         }
+      }
 
       // WARNING -- putting this here as it is right after CreateRootWindow
       // Take out Layered flag if we're not in 24 bit
index c0e6afb..85947d3 100644 (file)
@@ -178,7 +178,7 @@ class ProjectSettings : Window
          {
             DialogResult diagRes = MessageBox
             {
-               type = okCancel, master = rootWindow,
+               type = okCancel, master = ide,
                text = "Lose Changes?",
                contents = "Are you sure you wish to discard changes made to the build options?"
             }.Modal();
@@ -1726,7 +1726,7 @@ class BuildTab : Tab
       {
          DialogResult diagRes = MessageBox
          {
-            type = yesNoCancel, master = rootWindow,
+            type = yesNoCancel, master = ide,
             text = "Save changes to project settings?",
             contents = "Would you like to save changes made to the build options?"
          }.Modal();
index f5659dc..79f08dc 100644 (file)
@@ -66,7 +66,7 @@ class ProjectTab : Tab
       {
          DialogResult diagRes = MessageBox
          {
-            type = yesNoCancel, master = rootWindow,
+            type = yesNoCancel, master = ide,
             text = "Save changes to project options?",
             contents = "Would you like to save changes made to the project options?"
          }.Modal();