ecere/gui/drivers/Win32Interface: Hacks for Pimiento StickyNotes
[sdk] / ecere / src / gui / Window.ec
index a65d1e8..6572e81 100644 (file)
@@ -25,6 +25,10 @@ import "EditBox"
 import "DataBox"
 import "ToolTip"
 
+#if defined(__WIN32__)
+import "Win32Interface"
+#endif
+
 #if !defined(ECERE_VANILLA) && !defined(ECERE_NO3D)
 import "Desktop3D"
 #endif
@@ -5854,35 +5858,38 @@ private:
                break;
             case minimized:
             {
-               int maxIcons = parent.clientSize.w / MINIMIZED_WIDTH;
-               Window child;
-               int size = 256;
-               byte * idBuffer = new0 byte[size];
-               int c;
-               for(child = parent.children.first; child; child = child.next)
+               if(hasMinimize)
                {
-                  if(child != this && child.state == minimized)
+                  int maxIcons = parent.clientSize.w / MINIMIZED_WIDTH;
+                  Window child;
+                  int size = 256;
+                  byte * idBuffer = new0 byte[size];
+                  int c;
+                  for(child = parent.children.first; child; child = child.next)
                   {
-                     if(child.iconID > size - 2)
+                     if(child != this && child.state == minimized)
                      {
-                        idBuffer = renew0 idBuffer byte[size*2];
-                        memset(idBuffer + size, 0, size);
-                        size *= 2;
+                        if(child.iconID > size - 2)
+                        {
+                           idBuffer = renew0 idBuffer byte[size*2];
+                           memset(idBuffer + size, 0, size);
+                           size *= 2;
+                        }
+                        idBuffer[child.iconID] = (byte)bool::true;
                      }
-                     idBuffer[child.iconID] = (byte)bool::true;
                   }
-               }
-               for(c = 0; c<size; c++)
-                  if(!idBuffer[c])
-                     break;
-               iconID = c;
-               delete idBuffer;
-               if(style.isActiveClient && !style.hidden)
-                  parent.numIcons++;
+                  for(c = 0; c<size; c++)
+                     if(!idBuffer[c])
+                        break;
+                  iconID = c;
+                  delete idBuffer;
+                  if(style.isActiveClient && !style.hidden)
+                     parent.numIcons++;
 
-               stateAnchor = Anchor { left = (iconID % maxIcons) * MINIMIZED_WIDTH, bottom = (iconID / maxIcons) * (guiApp.textMode ? 16 : 24) };
-               stateSizeAnchor = SizeAnchor { size.w = MINIMIZED_WIDTH };
-               break;
+                  stateAnchor = Anchor { left = (iconID % maxIcons) * MINIMIZED_WIDTH, bottom = (iconID / maxIcons) * (guiApp.textMode ? 16 : 24) };
+                  stateSizeAnchor = SizeAnchor { size.w = MINIMIZED_WIDTH };
+                  break;
+               }
             }
          }
          // TOCHECK: Why was this here?
@@ -5890,13 +5897,15 @@ private:
          //position.y = (ty > 0) ? ty & 0xFFFFF : ty;
          ComputeAnchors(stateAnchor, stateSizeAnchor, &x, &y, &w, &h);
 
-         Position(x, y, w, h, true, true, true, true, false, true);
+         if(state != minimized || hasMinimize)
+            Position(x, y, w, h, true, true, true, true, false, true);
 
          if(!style.inactive && !style.interim && parent && this == parent.activeClient)
             parent.UpdateActiveDocument(null);
       }
 
-      CreateSystemChildren();
+      if(state != minimized || hasMinimize)
+         CreateSystemChildren();
       // ------------------------------------------------------
    }
 
@@ -9432,7 +9441,13 @@ public:
    property bool showInTaskBar
    {
       property_category $"Window Style"
-      set { style.showInTaskBar = value; }
+      set
+      {
+         style.showInTaskBar = value;
+#if defined(__WIN32__)
+         Win32UpdateStyle(this);
+#endif
+      }
       get { return style.showInTaskBar; }
    };
    property FileDialog saveDialog { set { saveDialog = value; } };