📄 jvqexextctrls.pas
字号:
Mesg.WParam := WParam;
Mesg.LParam := LParam;
Mesg.Result := 0;
Dispatch(Mesg);
Result := Mesg.Result;
end;
function TJvExPaintBox.IsRightToLeft: Boolean;
begin
Result := False;
end;
{ QControl Create }
constructor TJvExImage.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
FHintColor := clDefault;
FWindowProc := WndProc;
end;
destructor TJvExImage.Destroy;
begin
inherited Destroy;
end;
procedure TJvExImage.WndProc(var Mesg: TMessage);
begin
//OutputDebugString(PAnsiChar(Format('JV_CONTROL %s: %s Msg $%x',[Name, ClassName, Mesg.Msg])));
with TJvMessage(Mesg) do
begin
case Msg of
{ Control Messages }
CM_FOCUSCHANGED: FocusChanged;
CM_MOUSEENTER: FMouseOver := True;
CM_MOUSELEAVE: FMouseOver := False;
CM_HINTSHOW:
case FHintColor of
clNone : HintInfo^.HintColor := Application.HintColor;
clDefault: HintInfo^.HintColor := GetHintColor(Parent);
else
HintInfo^.HintColor := FHintcolor;
end;
end;
end;
inherited Dispatch(Mesg);
end;
procedure TJvExImage.CMHitTest(var Mesg: TJvMessage);
begin
with Mesg do
begin
Handled := inherited HitTest(XPos, YPos);
if Handled then
Result := HTCLIENT;
end;
end;
procedure TJvExImage.ColorChanged;
begin
Perform(CM_COLORCHANGED, 0, 0);
inherited ColorChanged;
end;
procedure TJvExImage.FontChanged;
begin
Perform(CM_FONTCHANGED, 0, 0);
inherited FontChanged;
end;
procedure TJvExImage.FocusChanged;
begin
{ notification }
end;
{ QControl Common}
function TJvExImage.HitTest(X, Y: integer): Boolean;
begin
Result := Perform(CM_HITTEST, 0, 0) <> HTNOWHERE;
end;
procedure TJvExImage.CMHintShow(var Mesg: TJvMessage);
begin
with Mesg do
begin
Handled := inherited HintShow(HintInfo^);
end;
end;
procedure TJvExImage.CMSysFontChanged(var Mesg: TMessage);
begin
if FDesktopFont then
begin
Font.Assign(Application.Font);
FDesktopFont := True;
end;
end;
procedure TJvExImage.EnabledChanged;
begin
Perform(CM_ENABLEDCHANGED, 0, 0);
inherited EnabledChanged;
end;
procedure TJvExImage.TextChanged;
begin
Perform(CM_TEXTCHANGED, 0, 0);
inherited TextChanged;
end;
procedure TJvExImage.VisibleChanged;
begin
Perform(CM_VISIBLECHANGED, 0, 0);
inherited VisibleChanged;
end;
function TJvExImage.HintShow(var HintInfo : THintInfo): Boolean;
begin
Result := Perform(CM_HINTSHOW, 0, Integer(@HintInfo)) <> 0;
end;
procedure TJvExImage.MouseEnter(AControl: TControl);
begin
Perform(CM_MOUSEENTER, 0, 0);
inherited MouseEnter(AControl);
end;
procedure TJvExImage.MouseLeave(AControl: TControl);
begin
Perform(CM_MOUSELEAVE, 0, 0);
inherited MouseLeave(AControl);
end;
procedure TJvExImage.ParentColorChanged;
begin
inherited ParentColorChanged;
if Assigned(FOnParentColorChanged) then
FOnParentColorChanged(Self);
end;
procedure TJvExImage.SetDesktopFont(Value: Boolean);
begin
if FDesktopFont <> Value then
begin
FDesktopFont := Value;
Perform(CM_SYSFONTCHANGED, 0, 0);
end;
end;
procedure TJvExImage.Dispatch(var Mesg);
begin
if Assigned(FWindowProc) then
FWindowProc(TMessage(Mesg))
else
inherited Dispatch(Mesg);
end;
function TJvExImage.Perform(Msg: Cardinal; WParam, LParam: Longint): Longint;
var
Mesg: TMessage;
begin
Mesg.Msg := Msg;
Mesg.WParam := WParam;
Mesg.LParam := LParam;
Mesg.Result := 0;
Dispatch(Mesg);
Result := Mesg.Result;
end;
function TJvExImage.IsRightToLeft: Boolean;
begin
Result := False;
end;
{ QControl Create }
constructor TJvExBevel.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
FHintColor := clDefault;
FWindowProc := WndProc;
end;
destructor TJvExBevel.Destroy;
begin
inherited Destroy;
end;
procedure TJvExBevel.WndProc(var Mesg: TMessage);
begin
//OutputDebugString(PAnsiChar(Format('JV_CONTROL %s: %s Msg $%x',[Name, ClassName, Mesg.Msg])));
with TJvMessage(Mesg) do
begin
case Msg of
{ Control Messages }
CM_FOCUSCHANGED: FocusChanged;
CM_MOUSEENTER: FMouseOver := True;
CM_MOUSELEAVE: FMouseOver := False;
CM_HINTSHOW:
case FHintColor of
clNone : HintInfo^.HintColor := Application.HintColor;
clDefault: HintInfo^.HintColor := GetHintColor(Parent);
else
HintInfo^.HintColor := FHintcolor;
end;
end;
end;
inherited Dispatch(Mesg);
end;
procedure TJvExBevel.CMHitTest(var Mesg: TJvMessage);
begin
with Mesg do
begin
Handled := inherited HitTest(XPos, YPos);
if Handled then
Result := HTCLIENT;
end;
end;
procedure TJvExBevel.ColorChanged;
begin
Perform(CM_COLORCHANGED, 0, 0);
inherited ColorChanged;
end;
procedure TJvExBevel.FontChanged;
begin
Perform(CM_FONTCHANGED, 0, 0);
inherited FontChanged;
end;
procedure TJvExBevel.FocusChanged;
begin
{ notification }
end;
{ QControl Common}
function TJvExBevel.HitTest(X, Y: integer): Boolean;
begin
Result := Perform(CM_HITTEST, 0, 0) <> HTNOWHERE;
end;
procedure TJvExBevel.CMHintShow(var Mesg: TJvMessage);
begin
with Mesg do
begin
Handled := inherited HintShow(HintInfo^);
end;
end;
procedure TJvExBevel.CMSysFontChanged(var Mesg: TMessage);
begin
if FDesktopFont then
begin
Font.Assign(Application.Font);
FDesktopFont := True;
end;
end;
procedure TJvExBevel.EnabledChanged;
begin
Perform(CM_ENABLEDCHANGED, 0, 0);
inherited EnabledChanged;
end;
procedure TJvExBevel.TextChanged;
begin
Perform(CM_TEXTCHANGED, 0, 0);
inherited TextChanged;
end;
procedure TJvExBevel.VisibleChanged;
begin
Perform(CM_VISIBLECHANGED, 0, 0);
inherited VisibleChanged;
end;
function TJvExBevel.HintShow(var HintInfo : THintInfo): Boolean;
begin
Result := Perform(CM_HINTSHOW, 0, Integer(@HintInfo)) <> 0;
end;
procedure TJvExBevel.MouseEnter(AControl: TControl);
begin
Perform(CM_MOUSEENTER, 0, 0);
inherited MouseEnter(AControl);
end;
procedure TJvExBevel.MouseLeave(AControl: TControl);
begin
Perform(CM_MOUSELEAVE, 0, 0);
inherited MouseLeave(AControl);
end;
procedure TJvExBevel.ParentColorChanged;
begin
inherited ParentColorChanged;
if Assigned(FOnParentColorChanged) then
FOnParentColorChanged(Self);
end;
procedure TJvExBevel.SetDesktopFont(Value: Boolean);
begin
if FDesktopFont <> Value then
begin
FDesktopFont := Value;
Perform(CM_SYSFONTCHANGED, 0, 0);
end;
end;
procedure TJvExBevel.Dispatch(var Mesg);
begin
if Assigned(FWindowProc) then
FWindowProc(TMessage(Mesg))
else
inherited Dispatch(Mesg);
end;
function TJvExBevel.Perform(Msg: Cardinal; WParam, LParam: Longint): Longint;
var
Mesg: TMessage;
begin
Mesg.Msg := Msg;
Mesg.WParam := WParam;
Mesg.LParam := LParam;
Mesg.Result := 0;
Dispatch(Mesg);
Result := Mesg.Result;
end;
function TJvExBevel.IsRightToLeft: Boolean;
begin
Result := False;
end;
{$UNDEF HITTEST_CODE}
{$DEFINE HITTEST_CODE Handled := (XPos >= 0) and (YPos >= 0) and (XPos < Width) and (YPos < Height);}
{ QCustomControl Create }
constructor TJvExCustomControlBar.Create(AOwner: TComponent);
begin
inherited Create(AOwner);
FWindowProc := WndProc;
FInternalFontChanged := Font.OnChange;
Font.OnChange := DoOnFontChanged;
FHintColor := clDefault;
FDoubleBuffered := True;
end;
destructor TJvExCustomControlBar.Destroy;
begin
inherited Destroy;
end;
procedure TJvExCustomControlBar.WndProc(var Mesg: TMessage);
begin
//OutputDebugString(PAnsiChar(Format('WINCONTROL %s: %s Msg $%x',[Name, ClassName, Mesg.Msg])));
with TJvMessage(Mesg) do
begin
case Msg of
{ WinControl Messages }
WM_KILLFOCUS : DoKillFocus(FocusedWnd);
WM_SETFOCUS : DoSetFocus(FocusedWnd);
CM_FONTCHANGED : FInternalFontChanged(Font);
CM_HINTSHOW : HintInfo^.HintColor := GetHintcolor(Self);
WM_GETDLGCODE:
begin
Result := InputKeysToDlgCodes(InputKeys);
Exit;
end;
WM_ERASEBKGND:
begin
Canvas.Start;
try
Handled := DoPaintBackGround(Canvas, LParam);
finally
Canvas.Stop;
end;
Exit;
end;
{ Control Messages }
CM_FOCUSCHANGED: FocusChanged;
CM_MOUSEENTER: FMouseOver := True;
CM_MOUSELEAVE: FMouseOver := False;
end;
end;
inherited Dispatch(Mesg);
end;
{ QWinControl Common }
procedure TJvExCustomControlBar.CMDesignHitTest(var Mesg: TJvMessage);
begin
with Mesg do
begin
Handled := (XPos >= 0) and (YPos >= 0) and (XPos < Width) and (YPos < Height);
if Handled then
Result := HTCLIENT;
end;
end;
procedure TJvExCustomControlBar.CMHitTest(var Mesg: TJvMessage);
begin
with Mesg do
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -