summaryrefslogtreecommitdiff
path: root/gfx/gdi/gfx_gdi.pas
diff options
context:
space:
mode:
authorFelipe Menteiro de Carvalho <sekelsenmat@users.sourceforge.net>2006-11-20 18:23:23 +0000
committerFelipe Menteiro de Carvalho <sekelsenmat@users.sourceforge.net>2006-11-20 18:23:23 +0000
commit3c479a4c97c9445e7aba0bcda2fbbf325448e11a (patch)
tree9b01e4a14a56c41a904588141b5996853b264c42 /gfx/gdi/gfx_gdi.pas
parent1035e7b3b4aa37e3528495a3715888d2f8bcf4b2 (diff)
downloadfpGUI-3c479a4c97c9445e7aba0bcda2fbbf325448e11a.tar.xz
Added support for sub windows on Gfx, and also an example program for this
Diffstat (limited to 'gfx/gdi/gfx_gdi.pas')
-rw-r--r--gfx/gdi/gfx_gdi.pas65
1 files changed, 34 insertions, 31 deletions
diff --git a/gfx/gdi/gfx_gdi.pas b/gfx/gdi/gfx_gdi.pas
index 82ce1214..219461d0 100644
--- a/gfx/gdi/gfx_gdi.pas
+++ b/gfx/gdi/gfx_gdi.pas
@@ -1075,52 +1075,55 @@ begin
FParent := AParent;
{ Initialize a window class, if necessary }
- if UnicodeEnabledOS then
+ if woWindow in WindowOptions then
begin
- if not Assigned(WindowClassW.lpfnWndProc) then
+ if UnicodeEnabledOS then
begin
- WindowClassW.style := CS_HREDRAW or CS_VREDRAW;
- WindowClassW.lpfnWndProc := WndProc(@fpGFXWindowProc);
- WindowClassW.hInstance := MainInstance;
- WindowClassW.hIcon := LoadIcon(0, IDI_APPLICATION);
- WindowClassW.hCursor := LoadCursor(0, IDC_ARROW);
- WindowClassW.hbrBackground := 0;
- WindowClassW.lpszClassName := 'fpGFX';
- end;
- Windows.RegisterClassW(@WindowClassW);
- end
- else
- begin
- if not Assigned(WindowClass.lpfnWndProc) then
+ if not Assigned(WindowClassW.lpfnWndProc) then
+ begin
+ WindowClassW.style := CS_HREDRAW or CS_VREDRAW;
+ WindowClassW.lpfnWndProc := WndProc(@fpGFXWindowProc);
+ WindowClassW.hInstance := MainInstance;
+ WindowClassW.hIcon := LoadIcon(0, IDI_APPLICATION);
+ WindowClassW.hCursor := LoadCursor(0, IDC_ARROW);
+ WindowClassW.hbrBackground := 0;
+ WindowClassW.lpszClassName := 'fpGFX';
+ end;
+ Windows.RegisterClassW(@WindowClassW);
+ end
+ else
begin
- WindowClass.style := CS_HREDRAW or CS_VREDRAW;
- WindowClass.lpfnWndProc := WndProc(@fpGFXWindowProc);
- WindowClass.hInstance := MainInstance;
- WindowClass.hIcon := LoadIcon(0, IDI_APPLICATION);
- WindowClass.hCursor := LoadCursor(0, IDC_ARROW);
- WindowClass.hbrBackground := 0;
- WindowClass.lpszClassName := 'fpGFX';
+ if not Assigned(WindowClass.lpfnWndProc) then
+ begin
+ WindowClass.style := CS_HREDRAW or CS_VREDRAW;
+ WindowClass.lpfnWndProc := WndProc(@fpGFXWindowProc);
+ WindowClass.hInstance := MainInstance;
+ WindowClass.hIcon := LoadIcon(0, IDI_APPLICATION);
+ WindowClass.hCursor := LoadCursor(0, IDC_ARROW);
+ WindowClass.hbrBackground := 0;
+ WindowClass.lpszClassName := 'fpGFX';
+ end;
+ Windows.RegisterClass(@WindowClass);
end;
- Windows.RegisterClass(@WindowClass);
end;
-
+
if Assigned(AParent) then
ParentHandle := AParent.Handle
else
ParentHandle := 0;
- if (woBorderless in FWindowOptions) and (woPopUp in FWindowOptions) then FWindowStyle := WS_POPUP
+ if not (woWindow in FWindowOptions) then FWindowStyle := WS_CHILD
+ else if (woBorderless in FWindowOptions) and (woPopUp in FWindowOptions) then FWindowStyle := WS_POPUP
else if woPopUp in FWindowOptions then FWindowStyle := WS_POPUPWINDOW
- else if woToolWindow in FWindowOptions then FWindowStyle := WS_OVERLAPPED
+ else if woToolWindow in FWindowOptions then FWindowStyle := WS_OVERLAPPEDWINDOW
else if woChildWindow in FWindowOptions then FWindowStyle := WS_CHILDWINDOW
else if woBorderless in FWindowOptions then FWindowStyle := WS_OVERLAPPED
- else if woWindow in FWindowOptions then FWindowStyle := WS_OVERLAPPEDWINDOW
- else FWindowStyle := 0;
+ else FWindowStyle := WS_OVERLAPPEDWINDOW;
- if woPopUp in FWindowOptions then FWindowStyleEx := WS_EX_TOOLWINDOW
+ if not (woWindow in FWindowOptions) then FWindowStyleEx := 0
+ else if woPopUp in FWindowOptions then FWindowStyleEx := WS_EX_TOOLWINDOW
else if woToolWindow in FWindowOptions then FWindowStyleEx := WS_EX_TOOLWINDOW
- else if woWindow in FWindowOptions then FWindowStyleEx := WS_EX_APPWINDOW
- else FWindowStyleEx := 0;
+ else FWindowStyleEx := WS_EX_APPWINDOW;
if UnicodeEnabledOS then
FHandle := Windows.CreateWindowExW(