mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-08-14 02:59:21 +02:00
win32: rename TWindowInfo -> TWin32WindowInfo, GetWindowInfo -> GetWin32WindowInfo, etc because of conflict with winapi functions and structures
git-svn-id: trunk@20836 -
This commit is contained in:
parent
319321c0d4
commit
87a2fea05c
@ -91,7 +91,7 @@ function CallDefaultWindowProc(Window: HWnd; Msg: UInt; WParam: Windows.WParam;
|
|||||||
Exit;
|
Exit;
|
||||||
Info.cbSize := SizeOf(Info);
|
Info.cbSize := SizeOf(Info);
|
||||||
Win32Extra.GetComboBoxInfo(Window, @Info);
|
Win32Extra.GetComboBoxInfo(Window, @Info);
|
||||||
Result := (Info.hwndItem <> 0) and GetWindowInfo(Info.hwndItem)^.isComboEdit;
|
Result := (Info.hwndItem <> 0) and GetWin32WindowInfo(Info.hwndItem)^.isComboEdit;
|
||||||
end;
|
end;
|
||||||
var
|
var
|
||||||
PrevWndProc: Windows.WNDPROC;
|
PrevWndProc: Windows.WNDPROC;
|
||||||
@ -105,7 +105,7 @@ begin
|
|||||||
if depthLen > 0 then
|
if depthLen > 0 then
|
||||||
MessageStackDepth[depthLen] := '#';
|
MessageStackDepth[depthLen] := '#';
|
||||||
{$endif}
|
{$endif}
|
||||||
PrevWndProc := GetWindowInfo(Window)^.DefWndProc;
|
PrevWndProc := GetWin32WindowInfo(Window)^.DefWndProc;
|
||||||
if (PrevWndProc = nil) or (PrevWndProc = @WindowProc) // <- prevent recursion
|
if (PrevWndProc = nil) or (PrevWndProc = @WindowProc) // <- prevent recursion
|
||||||
then begin
|
then begin
|
||||||
if UnicodeEnabledOS
|
if UnicodeEnabledOS
|
||||||
@ -198,7 +198,7 @@ begin
|
|||||||
Result := (-3 <= moveX) and (moveX <= 3) and (-3 <= moveY) and (moveY <= 3);
|
Result := (-3 <= moveX) and (moveX <= 3) and (-3 <= moveY) and (moveY <= 3);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function GetNeedParentPaint(AWindowInfo: PWindowInfo; AWinControl: TWinControl): boolean;
|
function GetNeedParentPaint(AWindowInfo: PWin32WindowInfo; AWinControl: TWinControl): boolean;
|
||||||
begin
|
begin
|
||||||
Result := AWindowInfo^.needParentPaint
|
Result := AWindowInfo^.needParentPaint
|
||||||
and ((AWinControl = nil) or not (csOpaque in AWinControl.ControlStyle));
|
and ((AWinControl = nil) or not (csOpaque in AWinControl.ControlStyle));
|
||||||
@ -232,14 +232,14 @@ var
|
|||||||
P: TPoint;
|
P: TPoint;
|
||||||
NewLeft, NewTop, NewWidth, NewHeight: integer;
|
NewLeft, NewTop, NewWidth, NewHeight: integer;
|
||||||
lWinControl, ChildWinControl: TWinControl;
|
lWinControl, ChildWinControl: TWinControl;
|
||||||
ChildWindowInfo: PWindowInfo;
|
ChildWindowInfo: PWin32WindowInfo;
|
||||||
TargetObject: TObject;
|
TargetObject: TObject;
|
||||||
WinProcess: Boolean;
|
WinProcess: Boolean;
|
||||||
NotifyUserInput: Boolean;
|
NotifyUserInput: Boolean;
|
||||||
OverlayWindow: HWND;
|
OverlayWindow: HWND;
|
||||||
TargetWindow: HWND;
|
TargetWindow: HWND;
|
||||||
eraseBkgndCommand: TEraseBkgndCommand;
|
eraseBkgndCommand: TEraseBkgndCommand;
|
||||||
WindowInfo: PWindowInfo;
|
WindowInfo: PWin32WindowInfo;
|
||||||
Flags: dword;
|
Flags: dword;
|
||||||
WindowDC: HDC;
|
WindowDC: HDC;
|
||||||
|
|
||||||
@ -265,7 +265,7 @@ var
|
|||||||
PageIndex, Flags: Integer;
|
PageIndex, Flags: Integer;
|
||||||
PageHandle: HWND;
|
PageHandle: HWND;
|
||||||
begin
|
begin
|
||||||
Notebook := GetWindowInfo(NotebookHandle)^.WinControl as TCustomNotebook;
|
Notebook := GetWin32WindowInfo(NotebookHandle)^.WinControl as TCustomNotebook;
|
||||||
PageIndex := Windows.SendMessage(NotebookHandle, TCM_GETCURSEL, 0, 0);
|
PageIndex := Windows.SendMessage(NotebookHandle, TCM_GETCURSEL, 0, 0);
|
||||||
PageIndex := NotebookPageRealToLCLIndex(Notebook, PageIndex);
|
PageIndex := NotebookPageRealToLCLIndex(Notebook, PageIndex);
|
||||||
if PageIndex = -1 then exit;
|
if PageIndex = -1 then exit;
|
||||||
@ -376,7 +376,7 @@ var
|
|||||||
// do not use default deliver message
|
// do not use default deliver message
|
||||||
if lWinControl = nil then
|
if lWinControl = nil then
|
||||||
begin
|
begin
|
||||||
lWinControl := GetWindowInfo(Window)^.PWinControl;
|
lWinControl := GetWin32WindowInfo(Window)^.PWinControl;
|
||||||
if lWinControl = nil then exit;
|
if lWinControl = nil then exit;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -396,7 +396,7 @@ var
|
|||||||
while (ParentPaintWindow <> 0) and not lNotebookFound do
|
while (ParentPaintWindow <> 0) and not lNotebookFound do
|
||||||
begin
|
begin
|
||||||
// notebook is parent of window that has istabpage
|
// notebook is parent of window that has istabpage
|
||||||
if GetWindowInfo(ParentPaintWindow)^.isTabPage then
|
if GetWin32WindowInfo(ParentPaintWindow)^.isTabPage then
|
||||||
lNotebookFound := true;
|
lNotebookFound := true;
|
||||||
ParentPaintWindow := Windows.GetParent(ParentPaintWindow);
|
ParentPaintWindow := Windows.GetParent(ParentPaintWindow);
|
||||||
end;
|
end;
|
||||||
@ -698,7 +698,7 @@ var
|
|||||||
begin
|
begin
|
||||||
ScrollbarHandle := HWND(LParam);
|
ScrollbarHandle := HWND(LParam);
|
||||||
if ScrollbarHandle<>0 then
|
if ScrollbarHandle<>0 then
|
||||||
lWinControl := GetWindowInfo(ScrollbarHandle)^.WinControl;
|
lWinControl := GetWin32WindowInfo(ScrollbarHandle)^.WinControl;
|
||||||
if lWinControl is TCustomTrackBar then
|
if lWinControl is TCustomTrackBar then
|
||||||
begin
|
begin
|
||||||
LMessage.Msg := LM_CHANGED;
|
LMessage.Msg := LM_CHANGED;
|
||||||
@ -910,9 +910,9 @@ var
|
|||||||
|
|
||||||
procedure HandleSpinEditChange(ASpinEdit: TCustomFloatSpinEdit);
|
procedure HandleSpinEditChange(ASpinEdit: TCustomFloatSpinEdit);
|
||||||
var
|
var
|
||||||
lWindowInfo: PWindowInfo;
|
lWindowInfo: PWin32WindowInfo;
|
||||||
begin
|
begin
|
||||||
lWindowInfo := GetWindowInfo(ASpinEdit.Handle);
|
lWindowInfo := GetWin32WindowInfo(ASpinEdit.Handle);
|
||||||
if lWindowInfo = @DefaultWindowInfo then exit;
|
if lWindowInfo = @DefaultWindowInfo then exit;
|
||||||
|
|
||||||
lWindowInfo^.spinValue := ASpinEdit.StrToValue(ASpinEdit.Text);
|
lWindowInfo^.spinValue := ASpinEdit.StrToValue(ASpinEdit.Text);
|
||||||
@ -1210,7 +1210,7 @@ begin
|
|||||||
NotifyUserInput := False;
|
NotifyUserInput := False;
|
||||||
|
|
||||||
Assert(False, 'Trace:WindowProc - Getting Object with Callback Procedure');
|
Assert(False, 'Trace:WindowProc - Getting Object with Callback Procedure');
|
||||||
WindowInfo := GetWindowInfo(Window);
|
WindowInfo := GetWin32WindowInfo(Window);
|
||||||
if WindowInfo^.isChildEdit then
|
if WindowInfo^.isChildEdit then
|
||||||
begin
|
begin
|
||||||
// combobox child edit weirdness
|
// combobox child edit weirdness
|
||||||
@ -1409,10 +1409,10 @@ begin
|
|||||||
end;
|
end;
|
||||||
end
|
end
|
||||||
else begin
|
else begin
|
||||||
lWinControl := GetWindowInfo(HWND(LParam))^.WinControl;
|
lWinControl := GetWin32WindowInfo(HWND(LParam))^.WinControl;
|
||||||
// buddy controls use 'awincontrol' to designate associated wincontrol
|
// buddy controls use 'awincontrol' to designate associated wincontrol
|
||||||
if lWinControl = nil then
|
if lWinControl = nil then
|
||||||
lWinControl := GetWindowInfo(HWND(LParam))^.AWinControl;
|
lWinControl := GetWin32WindowInfo(HWND(LParam))^.AWinControl;
|
||||||
|
|
||||||
if lWinControl is TCustomCheckbox then begin
|
if lWinControl is TCustomCheckbox then begin
|
||||||
case HIWORD(WParam) of
|
case HIWORD(WParam) of
|
||||||
@ -1503,7 +1503,7 @@ begin
|
|||||||
// others need to erased with their window color
|
// others need to erased with their window color
|
||||||
// scrollbar also has buttons
|
// scrollbar also has buttons
|
||||||
WindowDC := HDC(WParam);
|
WindowDC := HDC(WParam);
|
||||||
ChildWindowInfo := GetWindowInfo(HWND(LParam));
|
ChildWindowInfo := GetWin32WindowInfo(HWND(LParam));
|
||||||
ChildWinControl := ChildWindowInfo^.WinControl;
|
ChildWinControl := ChildWindowInfo^.WinControl;
|
||||||
if ChildWinControl = nil then
|
if ChildWinControl = nil then
|
||||||
ChildWinControl := ChildWindowInfo^.AWinControl;
|
ChildWinControl := ChildWindowInfo^.AWinControl;
|
||||||
@ -1588,7 +1588,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
// TODO: this could crash for a MenuItem.
|
// TODO: this could crash for a MenuItem.
|
||||||
WindowInfo := GetWindowInfo(PDrawItemStruct(LParam)^.hwndItem);
|
WindowInfo := GetWin32WindowInfo(PDrawItemStruct(LParam)^.hwndItem);
|
||||||
if WindowInfo^.WinControl<>nil then
|
if WindowInfo^.WinControl<>nil then
|
||||||
lWinControl := WindowInfo^.WinControl;
|
lWinControl := WindowInfo^.WinControl;
|
||||||
{$IFDEF MSG_DEBUG}
|
{$IFDEF MSG_DEBUG}
|
||||||
@ -1975,7 +1975,7 @@ begin
|
|||||||
|
|
||||||
// check if the window is an edit control of a combobox, if so,
|
// check if the window is an edit control of a combobox, if so,
|
||||||
// redirect it to the combobox, not the edit control
|
// redirect it to the combobox, not the edit control
|
||||||
if GetWindowInfo(TargetWindow)^.isComboEdit then
|
if GetWin32WindowInfo(TargetWindow)^.isComboEdit then
|
||||||
TargetWindow := Windows.GetParent(TargetWindow);
|
TargetWindow := Windows.GetParent(TargetWindow);
|
||||||
|
|
||||||
// check InMouseWheelRedirection to prevent recursion
|
// check InMouseWheelRedirection to prevent recursion
|
||||||
@ -2058,7 +2058,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
WM_NOTIFY:
|
WM_NOTIFY:
|
||||||
begin
|
begin
|
||||||
WindowInfo := GetWindowInfo(PNMHdr(LParam)^.hwndFrom);
|
WindowInfo := GetWin32WindowInfo(PNMHdr(LParam)^.hwndFrom);
|
||||||
{$ifdef MSG_DEBUG}
|
{$ifdef MSG_DEBUG}
|
||||||
DebugLn([MessageStackDepth, 'Notify code: ', PNMHdr(LParam)^.code]);
|
DebugLn([MessageStackDepth, 'Notify code: ', PNMHdr(LParam)^.code]);
|
||||||
{$endif}
|
{$endif}
|
||||||
@ -2489,7 +2489,7 @@ begin
|
|||||||
(WParam = Size_Restored) then
|
(WParam = Size_Restored) then
|
||||||
lWinControl.DoAdjustClientRectChange(False);
|
lWinControl.DoAdjustClientRectChange(False);
|
||||||
end;
|
end;
|
||||||
OverlayWindow := GetWindowInfo(Window)^.Overlay;
|
OverlayWindow := GetWin32WindowInfo(Window)^.Overlay;
|
||||||
if OverlayWindow <> 0 then
|
if OverlayWindow <> 0 then
|
||||||
Windows.SetWindowPos(OverlayWindow, HWND_TOP, 0, 0, NewWidth, NewHeight, SWP_NOMOVE);
|
Windows.SetWindowPos(OverlayWindow, HWND_TOP, 0, 0, NewWidth, NewHeight, SWP_NOMOVE);
|
||||||
end;
|
end;
|
||||||
@ -2609,7 +2609,7 @@ begin
|
|||||||
if LMNotify.Result = 0 then
|
if LMNotify.Result = 0 then
|
||||||
ShowHideTabPage(HWndFrom, False);
|
ShowHideTabPage(HWndFrom, False);
|
||||||
TCN_SELCHANGE:
|
TCN_SELCHANGE:
|
||||||
NotebookFocusNewControl(GetWindowInfo(hwndFrom)^.WinControl as TCustomNotebook, idFrom);
|
NotebookFocusNewControl(GetWin32WindowInfo(hwndFrom)^.WinControl as TCustomNotebook, idFrom);
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -2777,7 +2777,7 @@ begin
|
|||||||
|
|
||||||
// Check if overlayed control want to handle mouse messages
|
// Check if overlayed control want to handle mouse messages
|
||||||
Parent := Windows.GetParent(Window);
|
Parent := Windows.GetParent(Window);
|
||||||
Owner := GetWindowInfo(Parent)^.WinControl;
|
Owner := GetWin32WindowInfo(Parent)^.WinControl;
|
||||||
P.x := GET_X_LPARAM(lParam);
|
P.x := GET_X_LPARAM(lParam);
|
||||||
P.y := GET_Y_LPARAM(lParam);
|
P.y := GET_Y_LPARAM(lParam);
|
||||||
Windows.ScreenToClient(Parent, P);
|
Windows.ScreenToClient(Parent, P);
|
||||||
|
@ -369,7 +369,7 @@ begin
|
|||||||
begin
|
begin
|
||||||
while PeekMessage(AMessage, HWnd(nil), 0, 0, PM_REMOVE) do
|
while PeekMessage(AMessage, HWnd(nil), 0, 0, PM_REMOVE) do
|
||||||
begin
|
begin
|
||||||
AccelTable := GetWindowInfo(AMessage.HWnd)^.Accel;
|
AccelTable := GetWin32WindowInfo(AMessage.HWnd)^.Accel;
|
||||||
if (AccelTable = HACCEL(nil))
|
if (AccelTable = HACCEL(nil))
|
||||||
or (TranslateAccelerator(AMessage.HWnd, AccelTable, @AMessage) = 0) then
|
or (TranslateAccelerator(AMessage.HWnd, AccelTable, @AMessage) = 0) then
|
||||||
begin
|
begin
|
||||||
@ -726,7 +726,7 @@ var
|
|||||||
Flags: dword;
|
Flags: dword;
|
||||||
begin
|
begin
|
||||||
Handle := ObjectToHWND(Sender);
|
Handle := ObjectToHWND(Sender);
|
||||||
ParentPanel := GetWindowInfo(Handle)^.ParentPanel;
|
ParentPanel := GetWin32WindowInfo(Handle)^.ParentPanel;
|
||||||
if ParentPanel <> 0 then
|
if ParentPanel <> 0 then
|
||||||
Handle := ParentPanel;
|
Handle := ParentPanel;
|
||||||
if TControl(Sender).HandleObjectShouldBeVisible then
|
if TControl(Sender).HandleObjectShouldBeVisible then
|
||||||
|
@ -34,8 +34,8 @@ uses
|
|||||||
Type
|
Type
|
||||||
TEventType = (etNotify, etKey, etKeyPress, etMouseWheel, etMouseUpDown);
|
TEventType = (etNotify, etKey, etKeyPress, etMouseWheel, etMouseUpDown);
|
||||||
|
|
||||||
PWindowInfo = ^TWindowInfo;
|
PWin32WindowInfo = ^TWin32WindowInfo;
|
||||||
TWindowInfo = record
|
TWin32WindowInfo = record
|
||||||
AccelGroup: HACCEL;
|
AccelGroup: HACCEL;
|
||||||
Accel: HACCEL;
|
Accel: HACCEL;
|
||||||
Overlay: HWND; // overlay, transparent window on top, used by designer
|
Overlay: HWND; // overlay, transparent window on top, used by designer
|
||||||
@ -96,9 +96,9 @@ function BorderStyleToWin32Flags(Style: TFormBorderStyle): DWORD;
|
|||||||
function BorderStyleToWin32FlagsEx(Style: TFormBorderStyle): DWORD;
|
function BorderStyleToWin32FlagsEx(Style: TFormBorderStyle): DWORD;
|
||||||
function GetDesigningBorderStyle(const AForm: TCustomForm): TFormBorderStyle;
|
function GetDesigningBorderStyle(const AForm: TCustomForm): TFormBorderStyle;
|
||||||
|
|
||||||
function AllocWindowInfo(Window: HWND): PWindowInfo;
|
function AllocWindowInfo(Window: HWND): PWin32WindowInfo;
|
||||||
function DisposeWindowInfo(Window: HWND): boolean;
|
function DisposeWindowInfo(Window: HWND): boolean;
|
||||||
function GetWindowInfo(Window: HWND): PWindowInfo;
|
function GetWin32WindowInfo(Window: HWND): PWin32WindowInfo;
|
||||||
|
|
||||||
procedure RemoveStayOnTopFlags(Window: HWND);
|
procedure RemoveStayOnTopFlags(Window: HWND);
|
||||||
procedure RestoreStayOnTopFlags(Window: HWND);
|
procedure RestoreStayOnTopFlags(Window: HWND);
|
||||||
@ -149,7 +149,7 @@ type
|
|||||||
);
|
);
|
||||||
|
|
||||||
var
|
var
|
||||||
DefaultWindowInfo: TWindowInfo;
|
DefaultWindowInfo: TWin32WindowInfo;
|
||||||
WindowInfoAtom: ATOM;
|
WindowInfoAtom: ATOM;
|
||||||
ChangedMenus: TList; // list of HWNDs which menus needs to be redrawn
|
ChangedMenus: TList; // list of HWNDs which menus needs to be redrawn
|
||||||
UnicodeEnabledOS: Boolean = False;
|
UnicodeEnabledOS: Boolean = False;
|
||||||
@ -741,10 +741,10 @@ end;
|
|||||||
// ----------------------------------------------------------------------
|
// ----------------------------------------------------------------------
|
||||||
procedure SetAccelGroup(Const Control: HWND; Const AnAccelGroup: HACCEL);
|
procedure SetAccelGroup(Const Control: HWND; Const AnAccelGroup: HACCEL);
|
||||||
var
|
var
|
||||||
WindowInfo: PWindowInfo;
|
WindowInfo: PWin32WindowInfo;
|
||||||
begin
|
begin
|
||||||
Assert(False, 'Trace:TODO: Code SetAccelGroup');
|
Assert(False, 'Trace:TODO: Code SetAccelGroup');
|
||||||
WindowInfo := GetWindowInfo(Control);
|
WindowInfo := GetWin32WindowInfo(Control);
|
||||||
if WindowInfo <> @DefaultWindowInfo then
|
if WindowInfo <> @DefaultWindowInfo then
|
||||||
begin
|
begin
|
||||||
WindowInfo^.AccelGroup := AnAccelGroup;
|
WindowInfo^.AccelGroup := AnAccelGroup;
|
||||||
@ -756,7 +756,7 @@ end;
|
|||||||
function GetAccelGroup(Const Control: HWND): HACCEL;
|
function GetAccelGroup(Const Control: HWND): HACCEL;
|
||||||
begin
|
begin
|
||||||
Assert(False, 'Trace:TODO: Code GetAccelGroup');
|
Assert(False, 'Trace:TODO: Code GetAccelGroup');
|
||||||
Result := GetWindowInfo(Control)^.AccelGroup;
|
Result := GetWin32WindowInfo(Control)^.AccelGroup;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
procedure SetAccelKey(Window: HWND; Const CommandId: Word; Const AKey: word; Const AModifier: TShiftState);
|
procedure SetAccelKey(Window: HWND; Const CommandId: Word; Const AKey: word; Const AModifier: TShiftState);
|
||||||
@ -792,9 +792,9 @@ var AccelCount: integer; {number of accelerators in table}
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
var
|
var
|
||||||
WindowInfo: PWindowInfo;
|
WindowInfo: PWin32WindowInfo;
|
||||||
begin
|
begin
|
||||||
WindowInfo := GetWindowInfo(Window);
|
WindowInfo := GetWin32WindowInfo(Window);
|
||||||
OldAccel := WindowInfo^.Accel;
|
OldAccel := WindowInfo^.Accel;
|
||||||
NullAccel := nil;
|
NullAccel := nil;
|
||||||
AccelCount := CopyAcceleratorTable(OldAccel, NullAccel, 0);
|
AccelCount := CopyAcceleratorTable(OldAccel, NullAccel, 0);
|
||||||
@ -825,7 +825,7 @@ end;
|
|||||||
function GetAccelKey(Const Control: HWND): LPACCEL;
|
function GetAccelKey(Const Control: HWND): LPACCEL;
|
||||||
begin
|
begin
|
||||||
Assert(False, 'Trace:TODO: Code GetAccelKey');
|
Assert(False, 'Trace:TODO: Code GetAccelKey');
|
||||||
//Result := GetWindowInfo(Control)^.AccelKey;
|
//Result := GeWin32tWindowInfo(Control)^.AccelKey;
|
||||||
Result := nil;
|
Result := nil;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -909,7 +909,7 @@ function GetLCLClientBoundsOffset(Handle: HWnd; var Rect: TRect): boolean;
|
|||||||
var
|
var
|
||||||
OwnerObject: TObject;
|
OwnerObject: TObject;
|
||||||
begin
|
begin
|
||||||
OwnerObject := GetWindowInfo(Handle)^.WinControl;
|
OwnerObject := GetWin32WindowInfo(Handle)^.WinControl;
|
||||||
Result:=GetLCLClientBoundsOffset(OwnerObject, Rect);
|
Result:=GetLCLClientBoundsOffset(OwnerObject, Rect);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
@ -1017,9 +1017,9 @@ begin
|
|||||||
Result := AForm.BorderStyle;
|
Result := AForm.BorderStyle;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function AllocWindowInfo(Window: HWND): PWindowInfo;
|
function AllocWindowInfo(Window: HWND): PWin32WindowInfo;
|
||||||
var
|
var
|
||||||
WindowInfo: PWindowInfo;
|
WindowInfo: PWin32WindowInfo;
|
||||||
begin
|
begin
|
||||||
New(WindowInfo);
|
New(WindowInfo);
|
||||||
FillChar(WindowInfo^, sizeof(WindowInfo^), 0);
|
FillChar(WindowInfo^, sizeof(WindowInfo^), 0);
|
||||||
@ -1030,9 +1030,9 @@ end;
|
|||||||
|
|
||||||
function DisposeWindowInfo(Window: HWND): boolean;
|
function DisposeWindowInfo(Window: HWND): boolean;
|
||||||
var
|
var
|
||||||
WindowInfo: PWindowInfo;
|
WindowInfo: PWin32WindowInfo;
|
||||||
begin
|
begin
|
||||||
WindowInfo := PWindowInfo(Windows.GetProp(Window, PChar(PtrUInt(WindowInfoAtom))));
|
WindowInfo := PWin32WindowInfo(Windows.GetProp(Window, PChar(PtrUInt(WindowInfoAtom))));
|
||||||
Result := Windows.RemoveProp(Window, PChar(PtrUInt(WindowInfoAtom)))<>0;
|
Result := Windows.RemoveProp(Window, PChar(PtrUInt(WindowInfoAtom)))<>0;
|
||||||
if Result then
|
if Result then
|
||||||
begin
|
begin
|
||||||
@ -1041,9 +1041,9 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
function GetWindowInfo(Window: HWND): PWindowInfo;
|
function GetWin32WindowInfo(Window: HWND): PWin32WindowInfo;
|
||||||
begin
|
begin
|
||||||
Result := PWindowInfo(Windows.GetProp(Window, PChar(PtrUInt(WindowInfoAtom))));
|
Result := PWin32WindowInfo(Windows.GetProp(Window, PChar(PtrUInt(WindowInfoAtom))));
|
||||||
if Result = nil then
|
if Result = nil then
|
||||||
Result := @DefaultWindowInfo;
|
Result := @DefaultWindowInfo;
|
||||||
end;
|
end;
|
||||||
@ -1066,7 +1066,7 @@ end;
|
|||||||
procedure RemoveStayOnTopFlags(Window: HWND);
|
procedure RemoveStayOnTopFlags(Window: HWND);
|
||||||
var
|
var
|
||||||
StayOnTopWindowsInfo: PStayOnTopWindowsInfo;
|
StayOnTopWindowsInfo: PStayOnTopWindowsInfo;
|
||||||
WindowInfo: PWindowInfo;
|
WindowInfo: PWin32WindowInfo;
|
||||||
begin
|
begin
|
||||||
// WriteLn('RemoveStayOnTopFlags 1');
|
// WriteLn('RemoveStayOnTopFlags 1');
|
||||||
if InRemoveStayOnTopFlags = 0 then
|
if InRemoveStayOnTopFlags = 0 then
|
||||||
@ -1074,7 +1074,7 @@ begin
|
|||||||
New(StayOnTopWindowsInfo);
|
New(StayOnTopWindowsInfo);
|
||||||
StayOnTopWindowsInfo^.AppWindow := Window;
|
StayOnTopWindowsInfo^.AppWindow := Window;
|
||||||
StayOnTopWindowsInfo^.StayOnTopList := TList.Create;
|
StayOnTopWindowsInfo^.StayOnTopList := TList.Create;
|
||||||
WindowInfo := GetWindowInfo(Window);
|
WindowInfo := GetWin32WindowInfo(Window);
|
||||||
WindowInfo^.StayOnTopList := StayOnTopWindowsInfo^.StayOnTopList;
|
WindowInfo^.StayOnTopList := StayOnTopWindowsInfo^.StayOnTopList;
|
||||||
EnumThreadWindows(GetWindowThreadProcessId(Window, nil),
|
EnumThreadWindows(GetWindowThreadProcessId(Window, nil),
|
||||||
@EnumStayOnTopRemove, LPARAM(StayOnTopWindowsInfo));
|
@EnumStayOnTopRemove, LPARAM(StayOnTopWindowsInfo));
|
||||||
@ -1086,13 +1086,13 @@ end;
|
|||||||
|
|
||||||
procedure RestoreStayOnTopFlags(Window: HWND);
|
procedure RestoreStayOnTopFlags(Window: HWND);
|
||||||
var
|
var
|
||||||
WindowInfo: PWindowInfo;
|
WindowInfo: PWin32WindowInfo;
|
||||||
I: integer;
|
I: integer;
|
||||||
begin
|
begin
|
||||||
// WriteLn('RestoreStayOnTopFlags 1');
|
// WriteLn('RestoreStayOnTopFlags 1');
|
||||||
if InRemoveStayOnTopFlags = 1 then
|
if InRemoveStayOnTopFlags = 1 then
|
||||||
begin
|
begin
|
||||||
WindowInfo := GetWindowInfo(Window);
|
WindowInfo := GetWin32WindowInfo(Window);
|
||||||
if WindowInfo^.StayOnTopList <> nil then
|
if WindowInfo^.StayOnTopList <> nil then
|
||||||
begin
|
begin
|
||||||
for I := 0 to WindowInfo^.StayOnTopList.Count - 1 do
|
for I := 0 to WindowInfo^.StayOnTopList.Count - 1 do
|
||||||
|
@ -1800,9 +1800,9 @@ function TWin32WidgetSet.GetDesignerDC(WindowHandle: HWND): HDC;
|
|||||||
var
|
var
|
||||||
OverlayWindow: HWND;
|
OverlayWindow: HWND;
|
||||||
ARect: Windows.RECT;
|
ARect: Windows.RECT;
|
||||||
WindowInfo, OverlayWindowInfo: PWindowInfo;
|
WindowInfo, OverlayWindowInfo: PWin32WindowInfo;
|
||||||
begin
|
begin
|
||||||
WindowInfo := GetWindowInfo(WindowHandle);
|
WindowInfo := GetWin32WindowInfo(WindowHandle);
|
||||||
OverlayWindow := WindowInfo^.Overlay;
|
OverlayWindow := WindowInfo^.Overlay;
|
||||||
if OverlayWindow = HWND(nil) then
|
if OverlayWindow = HWND(nil) then
|
||||||
begin
|
begin
|
||||||
@ -2264,10 +2264,10 @@ var
|
|||||||
LeftTop:TPoint;
|
LeftTop:TPoint;
|
||||||
R: TRect;
|
R: TRect;
|
||||||
ParentHandle: THandle;
|
ParentHandle: THandle;
|
||||||
WindowInfo: PWindowInfo;
|
WindowInfo: PWin32WindowInfo;
|
||||||
begin
|
begin
|
||||||
Result:=false;
|
Result:=false;
|
||||||
WindowInfo := GetWindowInfo(Handle);
|
WindowInfo := GetWin32WindowInfo(Handle);
|
||||||
if (WindowInfo^.WinControl is TCustomFloatSpinEdit) then
|
if (WindowInfo^.WinControl is TCustomFloatSpinEdit) then
|
||||||
Handle := Windows.SendMessage(Handle, UDM_GETBUDDY, 0, 0);
|
Handle := Windows.SendMessage(Handle, UDM_GETBUDDY, 0, 0);
|
||||||
if not Windows.GetWindowRect(Handle,@R) then exit;
|
if not Windows.GetWindowRect(Handle,@R) then exit;
|
||||||
@ -2300,7 +2300,7 @@ var
|
|||||||
WP: WINDOWPLACEMENT;
|
WP: WINDOWPLACEMENT;
|
||||||
R: TRect;
|
R: TRect;
|
||||||
Style, ExStyle: PtrInt;
|
Style, ExStyle: PtrInt;
|
||||||
WindowInfo: PWindowInfo;
|
WindowInfo: PWin32WindowInfo;
|
||||||
|
|
||||||
procedure AdjustForBuddySize;
|
procedure AdjustForBuddySize;
|
||||||
var
|
var
|
||||||
@ -2335,7 +2335,7 @@ begin
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
WindowInfo := GetWindowInfo(Handle);
|
WindowInfo := GetWin32WindowInfo(Handle);
|
||||||
|
|
||||||
// convert top level lcl window coordinaties to win32 coord
|
// convert top level lcl window coordinaties to win32 coord
|
||||||
Style := GetWindowLong(Handle, GWL_STYLE);
|
Style := GetWindowLong(Handle, GWL_STYLE);
|
||||||
@ -2825,7 +2825,7 @@ var
|
|||||||
OverlayWindow: HWND;
|
OverlayWindow: HWND;
|
||||||
begin
|
begin
|
||||||
Assert(False, Format('Trace:> [TWin32WidgetSet.ReleaseDC] DC:0x%x', [DC]));
|
Assert(False, Format('Trace:> [TWin32WidgetSet.ReleaseDC] DC:0x%x', [DC]));
|
||||||
OverlayWindow := GetWindowInfo(Window)^.Overlay;
|
OverlayWindow := GetWin32WindowInfo(Window)^.Overlay;
|
||||||
if OverlayWindow <> HWND(nil) then
|
if OverlayWindow <> HWND(nil) then
|
||||||
Result := Windows.ReleaseDC(OverlayWindow, DC);
|
Result := Windows.ReleaseDC(OverlayWindow, DC);
|
||||||
Assert(False, Format('Trace:< [TWin32WidgetSet.ReleaseDC] DC:0x%x', [DC]));
|
Assert(False, Format('Trace:< [TWin32WidgetSet.ReleaseDC] DC:0x%x', [DC]));
|
||||||
|
@ -475,10 +475,10 @@ end;
|
|||||||
function BitBtnWndProc(Window: HWnd; Msg: UInt; WParam: Windows.WParam;
|
function BitBtnWndProc(Window: HWnd; Msg: UInt; WParam: Windows.WParam;
|
||||||
LParam: Windows.LParam): LResult; stdcall;
|
LParam: Windows.LParam): LResult; stdcall;
|
||||||
var
|
var
|
||||||
Info: PWindowInfo;
|
Info: PWin32WindowInfo;
|
||||||
Control: TWinControl;
|
Control: TWinControl;
|
||||||
begin
|
begin
|
||||||
Info := GetWindowInfo(Window);
|
Info := GetWin32WindowInfo(Window);
|
||||||
if (Info = nil) or (Info^.WinControl = nil) then
|
if (Info = nil) or (Info^.WinControl = nil) then
|
||||||
begin
|
begin
|
||||||
Result := CallDefaultWindowProc(Window, Msg, WParam, LParam);
|
Result := CallDefaultWindowProc(Window, Msg, WParam, LParam);
|
||||||
|
@ -64,7 +64,7 @@ var
|
|||||||
begin
|
begin
|
||||||
Handle := ACustomListBox.Handle;
|
Handle := ACustomListBox.Handle;
|
||||||
Result := TWin32CheckListBoxStrings.Create(Handle, ACustomListBox);
|
Result := TWin32CheckListBoxStrings.Create(Handle, ACustomListBox);
|
||||||
GetWindowInfo(Handle)^.List := Result;
|
GetWin32WindowInfo(Handle)^.List := Result;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
class function TWin32WSCustomCheckListBox.GetItemEnabled(
|
class function TWin32WSCustomCheckListBox.GetItemEnabled(
|
||||||
|
@ -330,11 +330,11 @@ end;
|
|||||||
function StatusBarWndProc(Window: HWnd; Msg: UInt; WParam: Windows.WParam;
|
function StatusBarWndProc(Window: HWnd; Msg: UInt; WParam: Windows.WParam;
|
||||||
LParam: Windows.LParam): LResult; stdcall;
|
LParam: Windows.LParam): LResult; stdcall;
|
||||||
var
|
var
|
||||||
Info: PWindowInfo;
|
Info: PWin32WindowInfo;
|
||||||
Control: TWinControl;
|
Control: TWinControl;
|
||||||
Details: TThemedElementDetails;
|
Details: TThemedElementDetails;
|
||||||
begin
|
begin
|
||||||
Info := GetWindowInfo(Window);
|
Info := GetWin32WindowInfo(Window);
|
||||||
if (Info = nil) or (Info^.WinControl = nil) then
|
if (Info = nil) or (Info^.WinControl = nil) then
|
||||||
begin
|
begin
|
||||||
Result := CallDefaultWindowProc(Window, Msg, WParam, LParam);
|
Result := CallDefaultWindowProc(Window, Msg, WParam, LParam);
|
||||||
@ -703,7 +703,7 @@ end;
|
|||||||
function TrackBarWndProc(Window: HWnd; Msg: UInt; WParam: Windows.WParam;
|
function TrackBarWndProc(Window: HWnd; Msg: UInt; WParam: Windows.WParam;
|
||||||
LParam: Windows.LParam): LResult; stdcall;
|
LParam: Windows.LParam): LResult; stdcall;
|
||||||
var
|
var
|
||||||
WindowInfo: PWindowInfo;
|
WindowInfo: PWin32WindowInfo;
|
||||||
Control: TWinControl;
|
Control: TWinControl;
|
||||||
FocusBorderWidth,
|
FocusBorderWidth,
|
||||||
FocusBorderHeight, Offset: Integer;
|
FocusBorderHeight, Offset: Integer;
|
||||||
@ -721,7 +721,7 @@ begin
|
|||||||
NMHdr := PNMHDR(LParam);
|
NMHdr := PNMHDR(LParam);
|
||||||
if NMHdr^.code = NM_CUSTOMDRAW then
|
if NMHdr^.code = NM_CUSTOMDRAW then
|
||||||
begin
|
begin
|
||||||
WindowInfo := GetWindowInfo(PNMHdr(LParam)^.hwndFrom);
|
WindowInfo := GetWin32WindowInfo(PNMHdr(LParam)^.hwndFrom);
|
||||||
Control := WindowInfo^.WinControl;
|
Control := WindowInfo^.WinControl;
|
||||||
case PNMCustomDraw(LParam)^.dwDrawStage of
|
case PNMCustomDraw(LParam)^.dwDrawStage of
|
||||||
CDDS_PREPAINT:
|
CDDS_PREPAINT:
|
||||||
|
@ -111,7 +111,7 @@ type
|
|||||||
TCreateWindowExParams = record
|
TCreateWindowExParams = record
|
||||||
Buddy, Parent, Window: HWND;
|
Buddy, Parent, Window: HWND;
|
||||||
Left, Top, Height, Width: integer;
|
Left, Top, Height, Width: integer;
|
||||||
WindowInfo, BuddyWindowInfo: PWindowInfo;
|
WindowInfo, BuddyWindowInfo: PWin32WindowInfo;
|
||||||
MenuHandle: HMENU;
|
MenuHandle: HMENU;
|
||||||
Flags, FlagsEx: dword;
|
Flags, FlagsEx: dword;
|
||||||
SubClassWndProc: pointer;
|
SubClassWndProc: pointer;
|
||||||
@ -240,7 +240,7 @@ begin
|
|||||||
begin
|
begin
|
||||||
// some controls (combobox) immediately send a message upon setting font
|
// some controls (combobox) immediately send a message upon setting font
|
||||||
WindowInfo := AllocWindowInfo(Window);
|
WindowInfo := AllocWindowInfo(Window);
|
||||||
if GetWindowInfo(Parent)^.needParentPaint then
|
if GetWin32WindowInfo(Parent)^.needParentPaint then
|
||||||
WindowInfo^.needParentPaint := true;
|
WindowInfo^.needParentPaint := true;
|
||||||
WindowInfo^.WinControl := AWinControl;
|
WindowInfo^.WinControl := AWinControl;
|
||||||
AWinControl.Handle := Window;
|
AWinControl.Handle := Window;
|
||||||
@ -333,7 +333,7 @@ begin
|
|||||||
Assert(False, 'Trace:AddControl - Parent Window Handle is $' + IntToHex(LongInt(ParentHandle), 8));
|
Assert(False, 'Trace:AddControl - Parent Window Handle is $' + IntToHex(LongInt(ParentHandle), 8));
|
||||||
Assert(False, 'Trace:AddControl - Child Window Handle is $' + IntToHex(LongInt(ChildHandle), 8));
|
Assert(False, 'Trace:AddControl - Child Window Handle is $' + IntToHex(LongInt(ChildHandle), 8));
|
||||||
// handle groupbox exception
|
// handle groupbox exception
|
||||||
ParentPanelHandle := GetWindowInfo(ChildHandle)^.ParentPanel;
|
ParentPanelHandle := GetWin32WindowInfo(ChildHandle)^.ParentPanel;
|
||||||
if ParentPanelHandle <> 0 then
|
if ParentPanelHandle <> 0 then
|
||||||
ChildHandle := ParentPanelHandle;
|
ChildHandle := ParentPanelHandle;
|
||||||
SetParent(ChildHandle, ParentHandle);
|
SetParent(ChildHandle, ParentHandle);
|
||||||
@ -508,7 +508,7 @@ var
|
|||||||
AccelTable: HACCEL;
|
AccelTable: HACCEL;
|
||||||
begin
|
begin
|
||||||
Handle := AWinControl.Handle;
|
Handle := AWinControl.Handle;
|
||||||
AccelTable := GetWindowInfo(Handle)^.Accel;
|
AccelTable := GetWin32WindowInfo(Handle)^.Accel;
|
||||||
if AccelTable <> 0 then
|
if AccelTable <> 0 then
|
||||||
DestroyAcceleratorTable(AccelTable);
|
DestroyAcceleratorTable(AccelTable);
|
||||||
DestroyWindow(Handle);
|
DestroyWindow(Handle);
|
||||||
|
@ -322,9 +322,9 @@ end;
|
|||||||
|
|
||||||
class procedure TWin32WSCustomPage.ThemeChange(Wnd: HWnd);
|
class procedure TWin32WSCustomPage.ThemeChange(Wnd: HWnd);
|
||||||
var
|
var
|
||||||
WindowInfo: PWindowInfo;
|
WindowInfo: PWin32WindowInfo;
|
||||||
begin
|
begin
|
||||||
WindowInfo := GetWindowInfo(Wnd);
|
WindowInfo := GetWin32WindowInfo(Wnd);
|
||||||
if WindowInfo <> nil then
|
if WindowInfo <> nil then
|
||||||
begin
|
begin
|
||||||
with WindowInfo^ do
|
with WindowInfo^ do
|
||||||
|
@ -1322,7 +1322,7 @@ const
|
|||||||
begin
|
begin
|
||||||
MenuHandle := APopupMenu.Handle;
|
MenuHandle := APopupMenu.Handle;
|
||||||
AppHandle := TWin32WidgetSet(WidgetSet).AppHandle;
|
AppHandle := TWin32WidgetSet(WidgetSet).AppHandle;
|
||||||
GetWindowInfo(AppHandle)^.PopupMenu := APopupMenu;
|
GetWin32WindowInfo(AppHandle)^.PopupMenu := APopupMenu;
|
||||||
TrackPopupMenuEx(MenuHandle,
|
TrackPopupMenuEx(MenuHandle,
|
||||||
lAlign[APopupMenu.IsRightToLeft] or
|
lAlign[APopupMenu.IsRightToLeft] or
|
||||||
TPM_LEFTBUTTON or TPM_RIGHTBUTTON or
|
TPM_LEFTBUTTON or TPM_RIGHTBUTTON or
|
||||||
|
@ -104,12 +104,12 @@ end;
|
|||||||
function SpinBuddyWindowProc(Window: HWnd; Msg: UInt; WParam: Windows.WParam;
|
function SpinBuddyWindowProc(Window: HWnd; Msg: UInt; WParam: Windows.WParam;
|
||||||
LParam: Windows.LParam): LResult; stdcall;
|
LParam: Windows.LParam): LResult; stdcall;
|
||||||
var
|
var
|
||||||
AWindowInfo: PWindowInfo;
|
AWindowInfo: PWin32WindowInfo;
|
||||||
begin
|
begin
|
||||||
Result := WindowProc(Window, Msg, WParam, LParam);
|
Result := WindowProc(Window, Msg, WParam, LParam);
|
||||||
if Msg = WM_KILLFOCUS then
|
if Msg = WM_KILLFOCUS then
|
||||||
begin
|
begin
|
||||||
AWindowInfo := GetWindowInfo(Window);
|
AWindowInfo := GetWin32WindowInfo(Window);
|
||||||
if AWindowInfo^.AWinControl is TCustomFloatSpinEdit then
|
if AWindowInfo^.AWinControl is TCustomFloatSpinEdit then
|
||||||
UpdateFloatSpinEditControl(AWindowInfo^.AWinControl.Handle,
|
UpdateFloatSpinEditControl(AWindowInfo^.AWinControl.Handle,
|
||||||
TCustomFloatSpinEdit(AWindowInfo^.AWinControl));
|
TCustomFloatSpinEdit(AWindowInfo^.AWinControl));
|
||||||
@ -119,9 +119,9 @@ end;
|
|||||||
procedure UpdateFloatSpinEditControl(const Handle: HWND;
|
procedure UpdateFloatSpinEditControl(const Handle: HWND;
|
||||||
const AFloatSpinEdit: TCustomFloatSpinEdit);
|
const AFloatSpinEdit: TCustomFloatSpinEdit);
|
||||||
var
|
var
|
||||||
lWindowInfo: PWindowInfo;
|
lWindowInfo: PWin32WindowInfo;
|
||||||
begin
|
begin
|
||||||
lWindowInfo := GetWindowInfo(Handle);
|
lWindowInfo := GetWin32WindowInfo(Handle);
|
||||||
if lWindowInfo <> @DefaultWindowInfo then
|
if lWindowInfo <> @DefaultWindowInfo then
|
||||||
begin
|
begin
|
||||||
lWindowInfo^.spinValue := AFloatSpinEdit.Value;
|
lWindowInfo^.spinValue := AFloatSpinEdit.Value;
|
||||||
@ -242,7 +242,7 @@ end;
|
|||||||
class function TWin32WSCustomFloatSpinEdit.GetValue(
|
class function TWin32WSCustomFloatSpinEdit.GetValue(
|
||||||
const ACustomFloatSpinEdit: TCustomFloatSpinEdit): Double;
|
const ACustomFloatSpinEdit: TCustomFloatSpinEdit): Double;
|
||||||
begin
|
begin
|
||||||
Result := GetWindowInfo(ACustomFloatSpinEdit.Handle)^.spinValue;
|
Result := GetWin32WindowInfo(ACustomFloatSpinEdit.Handle)^.spinValue;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
class procedure TWin32WSCustomFloatSpinEdit.SetReadOnly
|
class procedure TWin32WSCustomFloatSpinEdit.SetReadOnly
|
||||||
|
@ -459,7 +459,7 @@ begin
|
|||||||
// allocate windowinfo record ourselves, we do not call WindowInitBuddy
|
// allocate windowinfo record ourselves, we do not call WindowInitBuddy
|
||||||
BuddyWindowInfo := AllocWindowInfo(Buddy);
|
BuddyWindowInfo := AllocWindowInfo(Buddy);
|
||||||
BuddyWindowInfo^.PWinControl := AWinControl;
|
BuddyWindowInfo^.PWinControl := AWinControl;
|
||||||
if GetWindowInfo(Parent)^.needParentPaint then
|
if GetWin32WindowInfo(Parent)^.needParentPaint then
|
||||||
BuddyWindowInfo^.needParentPaint := true;
|
BuddyWindowInfo^.needParentPaint := true;
|
||||||
Parent := Buddy;
|
Parent := Buddy;
|
||||||
end;
|
end;
|
||||||
@ -494,7 +494,7 @@ var
|
|||||||
begin
|
begin
|
||||||
WinHandle := AWinControl.Handle;
|
WinHandle := AWinControl.Handle;
|
||||||
// check if we have a ``container'', if so, move that
|
// check if we have a ``container'', if so, move that
|
||||||
BuddyHandle := GetWindowInfo(WinHandle)^.ParentPanel;
|
BuddyHandle := GetWin32WindowInfo(WinHandle)^.ParentPanel;
|
||||||
if BuddyHandle <> 0 then
|
if BuddyHandle <> 0 then
|
||||||
begin
|
begin
|
||||||
MoveWindow(BuddyHandle, Left, Top, Width, Height, false);
|
MoveWindow(BuddyHandle, Left, Top, Width, Height, false);
|
||||||
@ -620,11 +620,11 @@ end;
|
|||||||
|
|
||||||
class function TWin32WSCustomListBox.GetSelected(const ACustomListBox: TCustomListBox; const AIndex: integer): boolean;
|
class function TWin32WSCustomListBox.GetSelected(const ACustomListBox: TCustomListBox; const AIndex: integer): boolean;
|
||||||
var
|
var
|
||||||
WindowInfo: PWindowInfo;
|
WindowInfo: PWin32WindowInfo;
|
||||||
winHandle: HWND;
|
winHandle: HWND;
|
||||||
begin
|
begin
|
||||||
winHandle := ACustomListBox.Handle;
|
winHandle := ACustomListBox.Handle;
|
||||||
WindowInfo := GetWindowInfo(winHandle);
|
WindowInfo := GetWin32WindowInfo(winHandle);
|
||||||
// if we're handling a WM_DRAWITEM, then LB_GETSEL is not reliable, check stored info
|
// if we're handling a WM_DRAWITEM, then LB_GETSEL is not reliable, check stored info
|
||||||
if (WindowInfo^.DrawItemIndex <> -1) and (WindowInfo^.DrawItemIndex = AIndex) then
|
if (WindowInfo^.DrawItemIndex <> -1) and (WindowInfo^.DrawItemIndex = AIndex) then
|
||||||
Result := WindowInfo^.DrawItemSelected
|
Result := WindowInfo^.DrawItemSelected
|
||||||
@ -638,7 +638,7 @@ var
|
|||||||
begin
|
begin
|
||||||
Handle := ACustomListBox.Handle;
|
Handle := ACustomListBox.Handle;
|
||||||
Result := TWin32ListStringList.Create(Handle, ACustomListBox);
|
Result := TWin32ListStringList.Create(Handle, ACustomListBox);
|
||||||
GetWindowInfo(Handle)^.List := Result;
|
GetWin32WindowInfo(Handle)^.List := Result;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
class function TWin32WSCustomListBox.GetTopIndex(const ACustomListBox: TCustomListBox): integer;
|
class function TWin32WSCustomListBox.GetTopIndex(const ACustomListBox: TCustomListBox): integer;
|
||||||
@ -740,7 +740,7 @@ class function TWin32WSCustomComboBox.GetStringList(
|
|||||||
begin
|
begin
|
||||||
Result := nil;
|
Result := nil;
|
||||||
if ACustomComboBox.Style <> csSimple then
|
if ACustomComboBox.Style <> csSimple then
|
||||||
Result := TWin32ComboBoxStringList(GetWindowInfo(ACustomComboBox.Handle)^.List);
|
Result := TWin32ComboBoxStringList(GetWin32WindowInfo(ACustomComboBox.Handle)^.List);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
class function TWin32WSCustomComboBox.CreateHandle(const AWinControl: TWinControl;
|
class function TWin32WSCustomComboBox.CreateHandle(const AWinControl: TWinControl;
|
||||||
@ -851,7 +851,7 @@ end;
|
|||||||
|
|
||||||
class function TWin32WSCustomComboBox.GetMaxLength(const ACustomComboBox: TCustomComboBox): integer;
|
class function TWin32WSCustomComboBox.GetMaxLength(const ACustomComboBox: TCustomComboBox): integer;
|
||||||
begin
|
begin
|
||||||
Result := GetWindowInfo(ACustomComboBox.Handle)^.MaxLength;
|
Result := GetWin32WindowInfo(ACustomComboBox.Handle)^.MaxLength;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
class function TWin32WSCustomComboBox.GetText(const AWinControl: TWinControl; var AText: string): boolean;
|
class function TWin32WSCustomComboBox.GetText(const AWinControl: TWinControl; var AText: string): boolean;
|
||||||
@ -912,7 +912,7 @@ var
|
|||||||
begin
|
begin
|
||||||
winhandle := ACustomComboBox.Handle;
|
winhandle := ACustomComboBox.Handle;
|
||||||
SendMessage(winhandle, CB_LIMITTEXT, NewLength, 0);
|
SendMessage(winhandle, CB_LIMITTEXT, NewLength, 0);
|
||||||
GetWindowInfo(winhandle)^.MaxLength := NewLength;
|
GetWin32WindowInfo(winhandle)^.MaxLength := NewLength;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
class procedure TWin32WSCustomComboBox.SetReadOnly(const ACustomComboBox: TCustomComboBox;
|
class procedure TWin32WSCustomComboBox.SetReadOnly(const ACustomComboBox: TCustomComboBox;
|
||||||
@ -964,7 +964,7 @@ var
|
|||||||
begin
|
begin
|
||||||
winhandle := ACustomComboBox.Handle;
|
winhandle := ACustomComboBox.Handle;
|
||||||
Result := TWin32ComboBoxStringList.Create(winhandle, ACustomComboBox);
|
Result := TWin32ComboBoxStringList.Create(winhandle, ACustomComboBox);
|
||||||
GetWindowInfo(winhandle)^.List := Result;
|
GetWin32WindowInfo(winhandle)^.List := Result;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
class procedure TWin32WSCustomComboBox.Sort(const ACustomComboBox: TCustomComboBox; AList: TStrings; IsSorted: boolean);
|
class procedure TWin32WSCustomComboBox.Sort(const ACustomComboBox: TCustomComboBox; AList: TStrings; IsSorted: boolean);
|
||||||
@ -1080,7 +1080,7 @@ end;
|
|||||||
|
|
||||||
class function TWin32WSCustomEdit.GetMaxLength(const ACustomEdit: TCustomEdit): integer;
|
class function TWin32WSCustomEdit.GetMaxLength(const ACustomEdit: TCustomEdit): integer;
|
||||||
begin
|
begin
|
||||||
Result := GetWindowInfo(ACustomEdit.Handle)^.MaxLength;
|
Result := GetWin32WindowInfo(ACustomEdit.Handle)^.MaxLength;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
class procedure TWin32WSCustomEdit.GetPreferredSize(
|
class procedure TWin32WSCustomEdit.GetPreferredSize(
|
||||||
@ -1137,7 +1137,7 @@ var
|
|||||||
begin
|
begin
|
||||||
winhandle := ACustomEdit.Handle;
|
winhandle := ACustomEdit.Handle;
|
||||||
SendMessage(winhandle, EM_LIMITTEXT, NewLength, 0);
|
SendMessage(winhandle, EM_LIMITTEXT, NewLength, 0);
|
||||||
GetWindowInfo(winhandle)^.MaxLength := NewLength;
|
GetWin32WindowInfo(winhandle)^.MaxLength := NewLength;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
class procedure TWin32WSCustomEdit.SetPasswordChar(const ACustomEdit: TCustomEdit; NewChar: char);
|
class procedure TWin32WSCustomEdit.SetPasswordChar(const ACustomEdit: TCustomEdit; NewChar: char);
|
||||||
|
Loading…
Reference in New Issue
Block a user