ide/ecere: Put back master assignment, as this is required for the dialogs not to...
authorJerome St-Louis <jerome@ecere.com>
Fri, 19 Aug 2011 05:50:12 +0000 (01:50 -0400)
committerJerome St-Louis <jerome@ecere.com>
Fri, 19 Aug 2011 05:50:12 +0000 (01:50 -0400)
ecere/src/gui/Window.ec
ecere/src/gui/drivers/Win32Interface.ec
ide/src/ide.ec

index 4575916..c60cf96 100644 (file)
@@ -428,14 +428,14 @@ private class ScrollFlags
    bool snapX:1, snapY:1, dontHide:1;   
 };
 
-public class BorderBits { public: bool contour:1, fixed:1, sizable:1, deep:1, bevel:1; };
+public class BorderBits { public: bool contour:1, fixed:1, sizable:1, deep:1, bevel:1, thin:1; };
 
 class WindowBits : BorderBits
 {
-   BorderBits borderBits:5:0;
-   bool hidden:1, isActiveClient:1, hasHorzScroll:1, hasVertScroll:1, stayOnTop:1, modal:1, unused1:1, isDefault:1, inactive:1, isRemote:1, drawBehind:1;
+   BorderBits borderBits:6:0;
+   bool hidden:1, isActiveClient:1, hasHorzScroll:1, hasVertScroll:1, stayOnTop:1, modal:1, isDefault:1, inactive:1, isRemote:1, drawBehind:1;
    bool interim:1, tabCycle:1, noCycle:1, dontScrollHorz:1, dontScrollVert:1, hasMaximize:1, hasMinimize:1, hasClose:1;
-   bool embedded:1, unused2:1, hasMenuBar:1, isDocument:1, showInTaskBar:1, hasStatusBar:1, nonClient:1, clickThrough:1;
+   bool embedded:1, hasMenuBar:1, isDocument:1, showInTaskBar:1, hasStatusBar:1, nonClient:1, clickThrough:1;
 };
 
 public enum BorderStyle : BorderBits
@@ -444,6 +444,8 @@ public enum BorderStyle : BorderBits
    contour      = BorderBits { contour = true },
    fixed        = BorderBits { fixed = true } | contour,
    sizable      = BorderBits { sizable = true } | fixed,
+   thin         = BorderBits { fixed = true, thin = true } | contour,
+   sizableThin  = BorderBits { sizable = true } | thin,
    deep         = BorderBits { deep = true },
    bevel        = BorderBits { bevel = true },
    sizableDeep  = sizable|deep,
index 517a2ee..1972f8c 100644 (file)
@@ -1335,20 +1335,12 @@ class Win32Interface : Interface
          DWORD style = 0;
          DWORD exStyle = 0;
          HWND parentWindow = null; //HWND_DESKTOP; // we get different behaviors with desktop...
+         Window master = window.master, rootWindow = (master && master != guiApp.desktop) ? master.rootWindow : null;
          if(window.style.stayOnTop)
             exStyle |= WS_EX_TOPMOST;
 
-         // exStyle |= WS_EX_TOOLWINDOW;
-
-         if(window.master.rootWindow && window.master.rootWindow != guiApp.desktop && (window.style.modal || window.style.interim))
-         {
-            Window master = window.master;
-            Window rootWindow = window.master.rootWindow;
-
+         if(rootWindow && (window.style.modal || window.style.interim))
             parentWindow = rootWindow.is3D ? rootWindow.parent.windowHandle : rootWindow.windowHandle;
-
-            // parentWindow = window.master.rootWindow.is3D ? window.master.rootWindow.parent.windowHandle : window.master.rootWindow.windowHandle;
-         }
             
          if(window.alphaBlend)
          // if(window.background.a < 255) //&& window.style & ES_REDRAW) Not needed anymore?
@@ -1358,23 +1350,10 @@ class Win32Interface : Interface
          {
             exStyle |= WS_EX_APPWINDOW;
             parentWindow = null;
-            //style |= WS_SYSMENU;
          }
-         else if(window.master.rootWindow && window.master.rootWindow != guiApp.desktop)
-         {
+
+         if(window.style.thin)
             exStyle |= WS_EX_TOOLWINDOW;
-            //exStyle |=  WS_EX_APPWINDOW;
-            //style |= WS_SYSMENU;
-         }
-         else
-         {
-            // exStyle |= WS_EX_APPWINDOW;
-            //style |= WS_SYSMENU;
-         }
-         /*else if(parentWindow)
-            exStyle |= WS_EX_TOOLWINDOW;*/
-         /*if(window.interim)
-            parentWindow = window.master.rootWindow.windowHandle;*/
 
          if(window.windowHandle)
             windowHandle = window.windowHandle;
@@ -1401,7 +1380,6 @@ class Win32Interface : Interface
                style | (window.systemParent ? WS_CHILD : 
                (WS_POPUP | (window.style.hasMinimize ? WS_MINIMIZEBOX : 0))),
                   0,0,1,1, parentWindow, null, hInstance, null);
-               
    #if 0
             if(exStyle & WS_EX_LAYERED)
                SetLayeredWindowAttributes(windowHandle, 0, 255 /*A(window.background)*/, LWA_ALPHA);
@@ -1803,6 +1781,12 @@ class Win32Interface : Interface
       HICON icon = null;
       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;
+
       // WARNING -- putting this here as it is right after CreateRootWindow
       // Take out Layered flag if we're not in 24 bit
       {
index 2152cff..d27c591 100644 (file)
@@ -517,7 +517,7 @@ class IDE : Window
                         gotWhatWeWant = true;
                   }
                   if(gotWhatWeWant ||
-                     MessageBox { type = yesNo, /*master = this, */text = "Error opening file", 
+                     MessageBox { type = yesNo, master = this, text = "Error opening file", 
                      contents = "Open a different file?" }.Modal() == no)
                   {
                      if(!projectView && gotWhatWeWant)
@@ -563,7 +563,7 @@ class IDE : Window
          fileMenu, "Global Settings...", g;
          bool NotifySelect(MenuItem selection, Modifiers mods)
          {
-            // globalSettingsDialog.master = this;
+            globalSettingsDialog.master = this;
             if(ide.workspace && ide.workspace.compiler)
                globalSettingsDialog.workspaceActiveCompiler = ide.workspace.compiler;
             else if(ideSettings.defaultCompiler)
@@ -681,7 +681,7 @@ class IDE : Window
                {
                   if(OpenFile(ideProjectFileDialog.filePath, normal, true, projectTypes[ideProjectFileDialog.fileType].typeExtension, no, add))
                      break;
-                  if(MessageBox { type = yesNo, /*master = this, */text = "Error opening project file", 
+                  if(MessageBox { type = yesNo, master = this, text = "Error opening project file", 
                         contents = "Add a different project?" }.Modal() == no)
                   {
                      break;
@@ -1138,7 +1138,7 @@ class IDE : Window
          helpMenu, "About...", a;
          bool NotifySelect(MenuItem selection, Modifiers mods)
          {
-            AboutIDE { /*master = this */}.Modal();
+            AboutIDE { master = this }.Modal();
             return true;
          }
       }
@@ -1349,7 +1349,7 @@ class IDE : Window
       char temp[4096];
       sprintf(temp, "The document %s was modified by another application.\n"
             "Would you like to reload it and lose your changes?", this.fileName);
-      if(MessageBox { type = yesNo/*, master = this*//*.parent*/,
+      if(MessageBox { type = yesNo, master = this/*.parent*/,
             text = "Document has been modified", contents = temp }.Modal() == yes)
       {
          char * fileName = CopyString(this.fileName);
@@ -1501,7 +1501,7 @@ class IDE : Window
    {
       if(debugger.isActive)
       {
-         if(MessageBox { type = yesNo, /*master = ide, */
+         if(MessageBox { type = yesNo, master = ide, 
                            contents = "Do you want to terminate the debugging session in progress?", 
                            text = title }.Modal() == no)
             return true;
@@ -1689,7 +1689,7 @@ class IDE : Window
                }
                if(prj)
                {
-                  MessageBox { type = ok, parent = parent, /*master = this, */text = "Same Project", 
+                  MessageBox { type = ok, parent = parent, master = this, text = "Same Project", 
                         contents = "This project is already present in workspace." }.Modal();
                }
                else
@@ -2440,9 +2440,9 @@ class IDE : Window
          skinItems[c].id = c;
          skinItems[c].isRadio = true;         
       }
-*/    /*
+*/
       ideFileDialog.master = this;
-      ideProjectFileDialog.master = this;*/
+      ideProjectFileDialog.master = this;
 
       //SetDriverAndSkin();
       return true;