import "DataBox"
import "ToolTip"
+#if defined(__WIN32__)
+import "Win32Interface"
+#endif
+
#if !defined(ECERE_VANILLA) && !defined(ECERE_NO3D)
import "Desktop3D"
#endif
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?
//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();
// ------------------------------------------------------
}
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; } };
}
w = gw;
h = gh;
- guiApp.interfaceDriver.PositionRootWindow(window, x, y, w, h, move, true);
+ if(window.state == minimized && !window.nativeDecorations && !window.hasMinimize)
+ y -= 26000;
+ guiApp.interfaceDriver.PositionRootWindow(window, x, y, w, h, move, true);
}
}
window.ExternalPosition(x, y, w, h);
}
+void Win32UpdateStyle(Window window)
+{
+ DWORD style = GetWindowLong(window.windowHandle, GWL_EXSTYLE);
+ if(window.showInTaskBar)
+ style |= WS_EX_APPWINDOW;
+ else
+ style &= ~WS_EX_APPWINDOW;
+
+ SetWindowLong(window.windowHandle, GWL_EXSTYLE, style);
+}
+
class Win32Interface : Interface
{
class_property(name) = "Win32";
HWND modalWindow = modalRoot ? modalRoot.windowHandle : null;
- FLASHWINFO flashInfo = { 0 };
- flashInfo.cbSize = sizeof(FLASHWINFO);
- flashInfo.hwnd = window.windowHandle;
- flashInfo.uCount = 0;
- flashInfo.dwFlags = FLASHW_STOP;
- FlashWindowEx((void *)&flashInfo);
+ if(window.creationActivation == flash || window.hasMinimize || window.borderStyle != sizableThin)
+ {
+ FLASHWINFO flashInfo = { 0 };
+ flashInfo.cbSize = sizeof(FLASHWINFO);
+ flashInfo.hwnd = window.windowHandle;
+ flashInfo.uCount = 0;
+ flashInfo.dwFlags = FLASHW_STOP;
+ FlashWindowEx((void *)&flashInfo);
+ }
if(modalWindow && modalWindow != windowHandle)
modalRoot.ExternalActivate(true, true, window, null);
if(window.style.stayOnTop)
exStyle |= WS_EX_TOPMOST;
- if(rootWindow && (window._isModal || window.style.interim))
+ if(rootWindow && (window._isModal || window.style.interim || (window.style.thin && !window.style.showInTaskBar)))
parentWindow = rootWindow.is3D ? rootWindow.parent.windowHandle : rootWindow.windowHandle;
if(window.alphaBlend)
exStyle |= WS_EX_LAYERED; // | WS_EX_TRANSPARENT;
// Toolwindow will disappear if they don't have AppWindow set
- if(window.style.showInTaskBar || (!parentWindow && window.style.thin))
+ if(window.style.showInTaskBar) // Took this out as a way to prevent sticky notes from showing in task bar... ( added flag to Communicator ) || (!parentWindow && window.style.thin))
{
exStyle |= WS_EX_APPWINDOW;
parentWindow = null;