mirror of
https://gitlab.com/freepascal.org/lazarus/lazarus.git
synced 2025-09-24 09:19:21 +02:00
fix combobox edit being gray
git-svn-id: trunk@5589 -
This commit is contained in:
parent
ccbf3bc01e
commit
5f696cfe82
@ -403,13 +403,16 @@ Begin
|
|||||||
End;
|
End;
|
||||||
WM_COMMAND:
|
WM_COMMAND:
|
||||||
Begin
|
Begin
|
||||||
if LParam=0 then OwnerObject := GetMenuItemObject {menuitem or shortcut}
|
if LParam=0 then
|
||||||
else OwnerObject := TObject(GetProp(LParam, 'Wincontrol'));
|
begin
|
||||||
|
OwnerObject := GetMenuItemObject; {menuitem or shortcut}
|
||||||
// is this for speedbuttons?
|
end else begin
|
||||||
// If ((OwnerObject Is TControl) And (Not (OwnerObject Is TButton))) Then
|
OwnerObject := TObject(GetProp(LParam, 'Wincontrol'));
|
||||||
// CallEvent(OwnerObject, TControl(OwnerObject).OnClick, Nil, etNotify)
|
// buddy controls use 'awincontrol' to designate associated wincontrol
|
||||||
|
if OwnerObject = nil then
|
||||||
|
OwnerObject := TObject(GetProp(LParam, 'AWincontrol'));
|
||||||
|
end;
|
||||||
|
|
||||||
if OwnerObject is TMenuItem then
|
if OwnerObject is TMenuItem then
|
||||||
begin
|
begin
|
||||||
if (Hi(WParam) = 0) or (Hi(WParam) = 1) then
|
if (Hi(WParam) = 0) or (Hi(WParam) = 1) then
|
||||||
@ -451,21 +454,14 @@ Begin
|
|||||||
End;
|
End;
|
||||||
WM_CTLCOLORMSGBOX..WM_CTLCOLORSTATIC:
|
WM_CTLCOLORMSGBOX..WM_CTLCOLORSTATIC:
|
||||||
Begin
|
Begin
|
||||||
if HWnd(Windows.GetProp(Window, 'Overlay')) = HWnd(LParam) then
|
MsgObject := TObject(GetProp(LParam, 'Wincontrol'));
|
||||||
|
if MsgObject is TWinControl then
|
||||||
begin
|
begin
|
||||||
LMessage.Result := Windows.GetStockObject(NULL_BRUSH);
|
Windows.SetTextColor(HDC(WParam), Windows.COLORREF(ColorToRGB(TWinControl(MsgObject).Font.Color)));
|
||||||
Windows.SetBkMode(HDC(WParam), TRANSPARENT);
|
Windows.SetBkColor(HDC(WParam), Windows.COLORREF(ColorToRGB(TWinControl(MsgObject).Brush.Color)));
|
||||||
|
LMessage.Result := LResult(TWinControl(MsgObject).Brush.Handle);
|
||||||
|
// Override default handling
|
||||||
WinProcess := false;
|
WinProcess := false;
|
||||||
end else begin
|
|
||||||
MsgObject := TObject(GetProp(LParam, 'WinControl'));
|
|
||||||
if MsgObject is TWinControl then
|
|
||||||
begin
|
|
||||||
Windows.SetTextColor(HDC(WParam), Windows.COLORREF(ColorToRGB(TWinControl(MsgObject).Font.Color)));
|
|
||||||
Windows.SetBkColor(HDC(WParam), Windows.COLORREF(ColorToRGB(TWinControl(MsgObject).Brush.Color)));
|
|
||||||
LMessage.Result := LResult(TWinControl(MsgObject).Brush.Handle);
|
|
||||||
// Override default handling
|
|
||||||
WinProcess := false;
|
|
||||||
end;
|
|
||||||
end;
|
end;
|
||||||
End;
|
End;
|
||||||
WM_COPY:
|
WM_COPY:
|
||||||
@ -1088,7 +1084,8 @@ begin
|
|||||||
end;
|
end;
|
||||||
WM_KEYFIRST..WM_KEYLAST, WM_MOUSEFIRST..WM_MOUSELAST:
|
WM_KEYFIRST..WM_KEYLAST, WM_MOUSEFIRST..WM_MOUSELAST:
|
||||||
begin
|
begin
|
||||||
Windows.PostMessage(TWinControl(Windows.GetProp(Window, 'Wincontrol')).Handle, Msg, WParam, LParam);
|
// parent of overlay is the form
|
||||||
|
Windows.PostMessage(Windows.GetParent(Window), Msg, WParam, LParam);
|
||||||
end;
|
end;
|
||||||
else
|
else
|
||||||
Result := CallDefaultWindowProc(Window, Msg, WParam, LParam);
|
Result := CallDefaultWindowProc(Window, Msg, WParam, LParam);
|
||||||
@ -1180,7 +1177,7 @@ begin
|
|||||||
if NotifyUserInput then
|
if NotifyUserInput then
|
||||||
NotifyApplicationUserInput(PLMsg^.Msg);
|
NotifyApplicationUserInput(PLMsg^.Msg);
|
||||||
|
|
||||||
DeliverMessage(TObject(Windows.GetProp(GetParent(Window), 'Wincontrol')), PLMsg^);
|
DeliverMessage(TObject(Windows.GetProp(Window, 'AWinControl')), PLMsg^);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
Result := CallDefaultWindowProc(Window, Msg, WParam, LParam);
|
Result := CallDefaultWindowProc(Window, Msg, WParam, LParam);
|
||||||
@ -1256,6 +1253,9 @@ end;
|
|||||||
|
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
|
Revision 1.119 2004/06/20 13:58:15 micha
|
||||||
|
fix combobox edit being gray
|
||||||
|
|
||||||
Revision 1.118 2004/06/19 15:10:04 micha
|
Revision 1.118 2004/06/19 15:10:04 micha
|
||||||
fix spinedit not firing onchange event
|
fix spinedit not firing onchange event
|
||||||
|
|
||||||
|
@ -2608,7 +2608,7 @@ Begin
|
|||||||
If Buddy <> HWND(Nil) Then
|
If Buddy <> HWND(Nil) Then
|
||||||
begin
|
begin
|
||||||
Windows.SetProp(Buddy, 'DefWndProc', Windows.SetWindowLong(Buddy, GWL_WNDPROC, LongInt(SubClassWndProc)));
|
Windows.SetProp(Buddy, 'DefWndProc', Windows.SetWindowLong(Buddy, GWL_WNDPROC, LongInt(SubClassWndProc)));
|
||||||
Windows.SetProp(Buddy, 'Wincontrol', dword(Sender));
|
Windows.SetProp(Buddy, 'AWincontrol', dword(Sender));
|
||||||
Windows.SendMessage(Buddy, WM_SETFONT, WParam(FMessageFont), 0);
|
Windows.SendMessage(Buddy, WM_SETFONT, WParam(FMessageFont), 0);
|
||||||
end;
|
end;
|
||||||
End
|
End
|
||||||
@ -3281,6 +3281,9 @@ End;
|
|||||||
|
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
|
Revision 1.212 2004/06/20 13:58:15 micha
|
||||||
|
fix combobox edit being gray
|
||||||
|
|
||||||
Revision 1.211 2004/06/20 13:00:04 micha
|
Revision 1.211 2004/06/20 13:00:04 micha
|
||||||
fix groupbox-parent bug condition, use buddy
|
fix groupbox-parent bug condition, use buddy
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user