summaryrefslogtreecommitdiff
path: root/src/corelib/gdi
diff options
context:
space:
mode:
authorGraeme Geldenhuys <graeme@mastermaths.co.za>2010-06-29 14:17:08 +0200
committerGraeme Geldenhuys <graeme@mastermaths.co.za>2010-06-29 14:17:08 +0200
commit09608574e4c7eae2f1e104749d69b09455ffb073 (patch)
tree64ca6767589f92454841d4e69393901f2fa33d47 /src/corelib/gdi
parent7280a5d03c3f15d73de97dbcd46144b13d304520 (diff)
downloadfpGUI-09608574e4c7eae2f1e104749d69b09455ffb073.tar.xz
GDI: minor code formatting.
* also improved if..else for WindowType * Moved AdjustWindowStyle to after all checks for WindowType so user could override it if needed.
Diffstat (limited to 'src/corelib/gdi')
-rw-r--r--src/corelib/gdi/fpg_gdi.pas19
1 files changed, 9 insertions, 10 deletions
diff --git a/src/corelib/gdi/fpg_gdi.pas b/src/corelib/gdi/fpg_gdi.pas
index df10d0a6..e8b05ede 100644
--- a/src/corelib/gdi/fpg_gdi.pas
+++ b/src/corelib/gdi/fpg_gdi.pas
@@ -1371,27 +1371,26 @@ begin
mid := 0;
wcname := 'FPGWIN';
- if aparent <> nil then
+ if AParent <> nil then
FParentWinHandle := TfpgGDIWindow(AParent).WinHandle
else
FParentWinHandle := 0;
- if FWindowType = wtChild then
+ if WindowType = wtChild then
begin
FWinStyle := WS_CHILD;
FWinStyleEx := 0;
mid := 1;
wcname := 'FPGWIDGET';
end
- else if FWindowType in [wtPopup] then
+ else if WindowType in [wtPopup] then
begin
// This prevents the popup window from stealing the focus. eg: ComboBox dropdown
FParentWinHandle := GetDesktopWindow;
FWinStyle := WS_CHILD;
FWinStyleEx := WS_EX_TOPMOST or WS_EX_TOOLWINDOW;
- end;
-
- if FWindowType = wtModalForm then
+ end
+ else if WindowType = wtModalForm then
begin
// set parent window to special hidden window. It helps to hide window taskbar button.
FParentWinHandle := wapplication.GetHiddenWindow;
@@ -1401,10 +1400,10 @@ begin
FWinStyleEx := 0;
end;
- AdjustWindowStyle;
-
if ((WindowType = wtWindow) or (WindowType = wtModalForm)) and (waBorderLess in FWindowAttributes) then
- FWinStyle := WS_POPUP; // this is different to wtPopop (toolwindow, hint window) because it can steal focus like a normal form
+ FWinStyle := FWinStyle and WS_POPUP; // this is different to wtPopop (toolwindow, hint window) because it can steal focus like a normal form
+
+ AdjustWindowStyle;
if waAutoPos in FWindowAttributes then
begin
@@ -1412,7 +1411,7 @@ begin
FTop := TfpgCoord(CW_USEDEFAULT);
end;
- if (FWindowType <> wtChild) and not (waSizeable in FWindowAttributes) then
+ if (WindowType <> wtChild) and not (waSizeable in FWindowAttributes) then
FWinStyle := FWinStyle and not (WS_SIZEBOX or WS_MAXIMIZEBOX);
FWinStyle := FWinStyle or WS_CLIPCHILDREN or WS_CLIPSIBLINGS;