git-svn-id: https://192.168.0.254/svn/Componentes.Terceros.jvcl@12 7f62d464-2af8-f54e-996c-e91b33f51cbe
11482 lines
352 KiB
ObjectPascal
11482 lines
352 KiB
ObjectPascal
{-----------------------------------------------------------------------------
|
|
The contents of this file are subject to the Mozilla Public License
|
|
Version 1.1 (the "License"); you may not use this file except in compliance
|
|
with the License. You may obtain a copy of the License at
|
|
http://www.mozilla.org/MPL/MPL-1.1.html
|
|
|
|
Software distributed under the License is distributed on an "AS IS" basis,
|
|
WITHOUT WARRANTY OF ANY KIND, either expressed or implied. See the License for
|
|
the specific language governing rights and limitations under the License.
|
|
|
|
The Original Code is: JvExComCtrls.pas, released on 2004-01-04
|
|
|
|
The Initial Developer of the Original Code is Andreas Hausladen [Andreas dott Hausladen att gmx dott de]
|
|
Portions created by Andreas Hausladen are Copyright (C) 2004 Andreas Hausladen.
|
|
All Rights Reserved.
|
|
|
|
Contributor(s): -
|
|
|
|
You may retrieve the latest version of this file at the Project JEDI's JVCL home page,
|
|
located at http://jvcl.sourceforge.net
|
|
|
|
Known Issues:
|
|
-----------------------------------------------------------------------------}
|
|
// $Id: JvExComCtrls.pas 11950 2008-10-07 17:11:29Z ahuser $
|
|
|
|
unit JvExComCtrls;
|
|
|
|
{$I jvcl.inc}
|
|
{MACROINCLUDE JvExControls.macros}
|
|
|
|
{*****************************************************************************
|
|
* WARNING: Do not edit this file.
|
|
* This file is autogenerated from the source in devtools/JvExVCL/src.
|
|
* If you do it despite this warning your changes will be discarded by the next
|
|
* update of this file. Do your changes in the template files.
|
|
****************************************************************************}
|
|
{$D-} // do not step into this unit
|
|
|
|
interface
|
|
|
|
uses
|
|
Windows, Messages,
|
|
{$IFDEF HAS_UNIT_TYPES}
|
|
Types,
|
|
{$ENDIF HAS_UNIT_TYPES}
|
|
SysUtils, Classes, Graphics, Controls, Forms, ComCtrls,
|
|
{$IFDEF UNITVERSIONING}
|
|
JclUnitVersioning,
|
|
{$ENDIF UNITVERSIONING}
|
|
JvConsts, JvTypes, JvThemes, JVCLVer, JvExControls;
|
|
|
|
type
|
|
{$IFDEF COMPILER6_UP}
|
|
TJvExCustomHeaderControl = class(TCustomHeaderControl, IJvExControl)
|
|
private
|
|
FAboutJVCL: TJVCLAboutInfo;
|
|
FHintColor: TColor;
|
|
FMouseOver: Boolean;
|
|
FHintWindowClass: THintWindowClass;
|
|
FOnMouseEnter: TNotifyEvent;
|
|
FOnMouseLeave: TNotifyEvent;
|
|
FOnParentColorChanged: TNotifyEvent;
|
|
function BaseWndProc(Msg: Integer; WParam: Integer = 0; LParam: Longint = 0): Integer; overload;
|
|
function BaseWndProc(Msg: Integer; WParam: Integer; LParam: TControl): Integer; overload;
|
|
function BaseWndProcEx(Msg: Integer; WParam: Integer; var LParam): Integer;
|
|
protected
|
|
procedure WndProc(var Msg: TMessage); override;
|
|
{$IFNDEF CLR}
|
|
procedure FocusChanged(AControl: TWinControl); dynamic;
|
|
{$ENDIF !CLR}
|
|
procedure VisibleChanged; reintroduce; dynamic;
|
|
procedure EnabledChanged; reintroduce; dynamic;
|
|
procedure TextChanged; reintroduce; virtual;
|
|
procedure ColorChanged; reintroduce; dynamic;
|
|
procedure FontChanged; reintroduce; dynamic;
|
|
procedure ParentFontChanged; reintroduce; dynamic;
|
|
procedure ParentColorChanged; reintroduce; dynamic;
|
|
procedure ParentShowHintChanged; reintroduce; dynamic;
|
|
function WantKey(Key: Integer; Shift: TShiftState; const KeyText: WideString): Boolean; reintroduce; virtual;
|
|
function HintShow(var HintInfo: THintInfo): Boolean; reintroduce; dynamic;
|
|
function HitTest(X, Y: Integer): Boolean; reintroduce; virtual;
|
|
procedure MouseEnter(AControl: TControl); reintroduce; dynamic;
|
|
procedure MouseLeave(AControl: TControl); reintroduce; dynamic;
|
|
{$IFDEF COMPILER5}
|
|
{$IFNDEF HASAUTOSIZE}
|
|
procedure CMSetAutoSize(var Msg: TMessage); message CM_SETAUTOSIZE;
|
|
procedure SetAutoSize(Value: Boolean); virtual;
|
|
{$ENDIF !HASAUTOSIZE}
|
|
{$ENDIF COMPILER5}
|
|
property MouseOver: Boolean read FMouseOver write FMouseOver;
|
|
property HintColor: TColor read FHintColor write FHintColor default clDefault;
|
|
property OnMouseEnter: TNotifyEvent read FOnMouseEnter write FOnMouseEnter;
|
|
property OnMouseLeave: TNotifyEvent read FOnMouseLeave write FOnMouseLeave;
|
|
property OnParentColorChange: TNotifyEvent read FOnParentColorChanged write FOnParentColorChanged;
|
|
public
|
|
constructor Create(AOwner: TComponent); override;
|
|
property HintWindowClass: THintWindowClass read FHintWindowClass write FHintWindowClass;
|
|
published
|
|
property AboutJVCL: TJVCLAboutInfo read FAboutJVCL write FAboutJVCL stored False;
|
|
private
|
|
FDotNetHighlighting: Boolean;
|
|
protected
|
|
procedure BoundsChanged; reintroduce; virtual;
|
|
procedure CursorChanged; reintroduce; dynamic;
|
|
procedure ShowingChanged; reintroduce; dynamic;
|
|
procedure ShowHintChanged; reintroduce; dynamic;
|
|
{$IFNDEF CLR}
|
|
procedure ControlsListChanging(Control: TControl; Inserting: Boolean); reintroduce; dynamic;
|
|
procedure ControlsListChanged(Control: TControl; Inserting: Boolean); reintroduce; dynamic;
|
|
{$ENDIF !CLR}
|
|
procedure GetDlgCode(var Code: TDlgCodes); virtual;
|
|
procedure FocusSet(PrevWnd: THandle); virtual;
|
|
procedure FocusKilled(NextWnd: THandle); virtual;
|
|
function DoEraseBackground(Canvas: TCanvas; Param: Integer): Boolean; virtual;
|
|
{$IFDEF JVCLThemesEnabledD56}
|
|
private
|
|
function GetParentBackground: Boolean;
|
|
protected
|
|
procedure SetParentBackground(Value: Boolean); virtual;
|
|
property ParentBackground: Boolean read GetParentBackground write SetParentBackground;
|
|
{$ENDIF JVCLThemesEnabledD56}
|
|
published
|
|
property DotNetHighlighting: Boolean read FDotNetHighlighting write FDotNetHighlighting default False;
|
|
end;
|
|
{$ENDIF COMPILER6_UP}
|
|
|
|
TJvExHeaderControl = class(THeaderControl, IJvExControl)
|
|
private
|
|
FAboutJVCL: TJVCLAboutInfo;
|
|
FHintColor: TColor;
|
|
FMouseOver: Boolean;
|
|
FHintWindowClass: THintWindowClass;
|
|
FOnMouseEnter: TNotifyEvent;
|
|
FOnMouseLeave: TNotifyEvent;
|
|
FOnParentColorChanged: TNotifyEvent;
|
|
function BaseWndProc(Msg: Integer; WParam: Integer = 0; LParam: Longint = 0): Integer; overload;
|
|
function BaseWndProc(Msg: Integer; WParam: Integer; LParam: TControl): Integer; overload;
|
|
function BaseWndProcEx(Msg: Integer; WParam: Integer; var LParam): Integer;
|
|
protected
|
|
procedure WndProc(var Msg: TMessage); override;
|
|
{$IFNDEF CLR}
|
|
procedure FocusChanged(AControl: TWinControl); dynamic;
|
|
{$ENDIF !CLR}
|
|
procedure VisibleChanged; reintroduce; dynamic;
|
|
procedure EnabledChanged; reintroduce; dynamic;
|
|
procedure TextChanged; reintroduce; virtual;
|
|
procedure ColorChanged; reintroduce; dynamic;
|
|
procedure FontChanged; reintroduce; dynamic;
|
|
procedure ParentFontChanged; reintroduce; dynamic;
|
|
procedure ParentColorChanged; reintroduce; dynamic;
|
|
procedure ParentShowHintChanged; reintroduce; dynamic;
|
|
function WantKey(Key: Integer; Shift: TShiftState; const KeyText: WideString): Boolean; reintroduce; virtual;
|
|
function HintShow(var HintInfo: THintInfo): Boolean; reintroduce; dynamic;
|
|
function HitTest(X, Y: Integer): Boolean; reintroduce; virtual;
|
|
procedure MouseEnter(AControl: TControl); reintroduce; dynamic;
|
|
procedure MouseLeave(AControl: TControl); reintroduce; dynamic;
|
|
{$IFDEF COMPILER5}
|
|
{$IFNDEF HASAUTOSIZE}
|
|
procedure CMSetAutoSize(var Msg: TMessage); message CM_SETAUTOSIZE;
|
|
procedure SetAutoSize(Value: Boolean); virtual;
|
|
{$ENDIF !HASAUTOSIZE}
|
|
{$ENDIF COMPILER5}
|
|
property MouseOver: Boolean read FMouseOver write FMouseOver;
|
|
property HintColor: TColor read FHintColor write FHintColor default clDefault;
|
|
property OnMouseEnter: TNotifyEvent read FOnMouseEnter write FOnMouseEnter;
|
|
property OnMouseLeave: TNotifyEvent read FOnMouseLeave write FOnMouseLeave;
|
|
property OnParentColorChange: TNotifyEvent read FOnParentColorChanged write FOnParentColorChanged;
|
|
public
|
|
constructor Create(AOwner: TComponent); override;
|
|
property HintWindowClass: THintWindowClass read FHintWindowClass write FHintWindowClass;
|
|
published
|
|
property AboutJVCL: TJVCLAboutInfo read FAboutJVCL write FAboutJVCL stored False;
|
|
private
|
|
FDotNetHighlighting: Boolean;
|
|
protected
|
|
procedure BoundsChanged; reintroduce; virtual;
|
|
procedure CursorChanged; reintroduce; dynamic;
|
|
procedure ShowingChanged; reintroduce; dynamic;
|
|
procedure ShowHintChanged; reintroduce; dynamic;
|
|
{$IFNDEF CLR}
|
|
procedure ControlsListChanging(Control: TControl; Inserting: Boolean); reintroduce; dynamic;
|
|
procedure ControlsListChanged(Control: TControl; Inserting: Boolean); reintroduce; dynamic;
|
|
{$ENDIF !CLR}
|
|
procedure GetDlgCode(var Code: TDlgCodes); virtual;
|
|
procedure FocusSet(PrevWnd: THandle); virtual;
|
|
procedure FocusKilled(NextWnd: THandle); virtual;
|
|
function DoEraseBackground(Canvas: TCanvas; Param: Integer): Boolean; virtual;
|
|
{$IFDEF JVCLThemesEnabledD56}
|
|
private
|
|
function GetParentBackground: Boolean;
|
|
protected
|
|
procedure SetParentBackground(Value: Boolean); virtual;
|
|
property ParentBackground: Boolean read GetParentBackground write SetParentBackground;
|
|
{$ENDIF JVCLThemesEnabledD56}
|
|
published
|
|
property DotNetHighlighting: Boolean read FDotNetHighlighting write FDotNetHighlighting default False;
|
|
end;
|
|
|
|
TJvExCustomTreeView = class(TCustomTreeView, IJvExControl)
|
|
private
|
|
FAboutJVCL: TJVCLAboutInfo;
|
|
FHintColor: TColor;
|
|
FMouseOver: Boolean;
|
|
FHintWindowClass: THintWindowClass;
|
|
FOnMouseEnter: TNotifyEvent;
|
|
FOnMouseLeave: TNotifyEvent;
|
|
FOnParentColorChanged: TNotifyEvent;
|
|
function BaseWndProc(Msg: Integer; WParam: Integer = 0; LParam: Longint = 0): Integer; overload;
|
|
function BaseWndProc(Msg: Integer; WParam: Integer; LParam: TControl): Integer; overload;
|
|
function BaseWndProcEx(Msg: Integer; WParam: Integer; var LParam): Integer;
|
|
protected
|
|
procedure WndProc(var Msg: TMessage); override;
|
|
{$IFNDEF CLR}
|
|
procedure FocusChanged(AControl: TWinControl); dynamic;
|
|
{$ENDIF !CLR}
|
|
procedure VisibleChanged; reintroduce; dynamic;
|
|
procedure EnabledChanged; reintroduce; dynamic;
|
|
procedure TextChanged; reintroduce; virtual;
|
|
procedure ColorChanged; reintroduce; dynamic;
|
|
procedure FontChanged; reintroduce; dynamic;
|
|
procedure ParentFontChanged; reintroduce; dynamic;
|
|
procedure ParentColorChanged; reintroduce; dynamic;
|
|
procedure ParentShowHintChanged; reintroduce; dynamic;
|
|
function WantKey(Key: Integer; Shift: TShiftState; const KeyText: WideString): Boolean; reintroduce; virtual;
|
|
function HintShow(var HintInfo: THintInfo): Boolean; reintroduce; dynamic;
|
|
function HitTest(X, Y: Integer): Boolean; reintroduce; virtual;
|
|
procedure MouseEnter(AControl: TControl); reintroduce; dynamic;
|
|
procedure MouseLeave(AControl: TControl); reintroduce; dynamic;
|
|
{$IFDEF COMPILER5}
|
|
{$IFNDEF HASAUTOSIZE}
|
|
procedure CMSetAutoSize(var Msg: TMessage); message CM_SETAUTOSIZE;
|
|
procedure SetAutoSize(Value: Boolean); virtual;
|
|
{$ENDIF !HASAUTOSIZE}
|
|
{$ENDIF COMPILER5}
|
|
property MouseOver: Boolean read FMouseOver write FMouseOver;
|
|
property HintColor: TColor read FHintColor write FHintColor default clDefault;
|
|
property OnMouseEnter: TNotifyEvent read FOnMouseEnter write FOnMouseEnter;
|
|
property OnMouseLeave: TNotifyEvent read FOnMouseLeave write FOnMouseLeave;
|
|
property OnParentColorChange: TNotifyEvent read FOnParentColorChanged write FOnParentColorChanged;
|
|
public
|
|
constructor Create(AOwner: TComponent); override;
|
|
property HintWindowClass: THintWindowClass read FHintWindowClass write FHintWindowClass;
|
|
published
|
|
property AboutJVCL: TJVCLAboutInfo read FAboutJVCL write FAboutJVCL stored False;
|
|
private
|
|
FDotNetHighlighting: Boolean;
|
|
protected
|
|
procedure BoundsChanged; reintroduce; virtual;
|
|
procedure CursorChanged; reintroduce; dynamic;
|
|
procedure ShowingChanged; reintroduce; dynamic;
|
|
procedure ShowHintChanged; reintroduce; dynamic;
|
|
{$IFNDEF CLR}
|
|
procedure ControlsListChanging(Control: TControl; Inserting: Boolean); reintroduce; dynamic;
|
|
procedure ControlsListChanged(Control: TControl; Inserting: Boolean); reintroduce; dynamic;
|
|
{$ENDIF !CLR}
|
|
procedure GetDlgCode(var Code: TDlgCodes); virtual;
|
|
procedure FocusSet(PrevWnd: THandle); virtual;
|
|
procedure FocusKilled(NextWnd: THandle); virtual;
|
|
function DoEraseBackground(Canvas: TCanvas; Param: Integer): Boolean; virtual;
|
|
{$IFDEF JVCLThemesEnabledD56}
|
|
private
|
|
function GetParentBackground: Boolean;
|
|
protected
|
|
procedure SetParentBackground(Value: Boolean); virtual;
|
|
property ParentBackground: Boolean read GetParentBackground write SetParentBackground;
|
|
{$ENDIF JVCLThemesEnabledD56}
|
|
published
|
|
property DotNetHighlighting: Boolean read FDotNetHighlighting write FDotNetHighlighting default False;
|
|
end;
|
|
|
|
TJvExTreeView = class(TTreeView, IJvExControl)
|
|
private
|
|
FAboutJVCL: TJVCLAboutInfo;
|
|
FHintColor: TColor;
|
|
FMouseOver: Boolean;
|
|
FHintWindowClass: THintWindowClass;
|
|
FOnMouseEnter: TNotifyEvent;
|
|
FOnMouseLeave: TNotifyEvent;
|
|
FOnParentColorChanged: TNotifyEvent;
|
|
function BaseWndProc(Msg: Integer; WParam: Integer = 0; LParam: Longint = 0): Integer; overload;
|
|
function BaseWndProc(Msg: Integer; WParam: Integer; LParam: TControl): Integer; overload;
|
|
function BaseWndProcEx(Msg: Integer; WParam: Integer; var LParam): Integer;
|
|
protected
|
|
procedure WndProc(var Msg: TMessage); override;
|
|
{$IFNDEF CLR}
|
|
procedure FocusChanged(AControl: TWinControl); dynamic;
|
|
{$ENDIF !CLR}
|
|
procedure VisibleChanged; reintroduce; dynamic;
|
|
procedure EnabledChanged; reintroduce; dynamic;
|
|
procedure TextChanged; reintroduce; virtual;
|
|
procedure ColorChanged; reintroduce; dynamic;
|
|
procedure FontChanged; reintroduce; dynamic;
|
|
procedure ParentFontChanged; reintroduce; dynamic;
|
|
procedure ParentColorChanged; reintroduce; dynamic;
|
|
procedure ParentShowHintChanged; reintroduce; dynamic;
|
|
function WantKey(Key: Integer; Shift: TShiftState; const KeyText: WideString): Boolean; reintroduce; virtual;
|
|
function HintShow(var HintInfo: THintInfo): Boolean; reintroduce; dynamic;
|
|
function HitTest(X, Y: Integer): Boolean; reintroduce; virtual;
|
|
procedure MouseEnter(AControl: TControl); reintroduce; dynamic;
|
|
procedure MouseLeave(AControl: TControl); reintroduce; dynamic;
|
|
{$IFDEF COMPILER5}
|
|
{$IFNDEF HASAUTOSIZE}
|
|
procedure CMSetAutoSize(var Msg: TMessage); message CM_SETAUTOSIZE;
|
|
procedure SetAutoSize(Value: Boolean); virtual;
|
|
{$ENDIF !HASAUTOSIZE}
|
|
{$ENDIF COMPILER5}
|
|
property MouseOver: Boolean read FMouseOver write FMouseOver;
|
|
property HintColor: TColor read FHintColor write FHintColor default clDefault;
|
|
property OnMouseEnter: TNotifyEvent read FOnMouseEnter write FOnMouseEnter;
|
|
property OnMouseLeave: TNotifyEvent read FOnMouseLeave write FOnMouseLeave;
|
|
property OnParentColorChange: TNotifyEvent read FOnParentColorChanged write FOnParentColorChanged;
|
|
public
|
|
constructor Create(AOwner: TComponent); override;
|
|
property HintWindowClass: THintWindowClass read FHintWindowClass write FHintWindowClass;
|
|
published
|
|
property AboutJVCL: TJVCLAboutInfo read FAboutJVCL write FAboutJVCL stored False;
|
|
private
|
|
FDotNetHighlighting: Boolean;
|
|
protected
|
|
procedure BoundsChanged; reintroduce; virtual;
|
|
procedure CursorChanged; reintroduce; dynamic;
|
|
procedure ShowingChanged; reintroduce; dynamic;
|
|
procedure ShowHintChanged; reintroduce; dynamic;
|
|
{$IFNDEF CLR}
|
|
procedure ControlsListChanging(Control: TControl; Inserting: Boolean); reintroduce; dynamic;
|
|
procedure ControlsListChanged(Control: TControl; Inserting: Boolean); reintroduce; dynamic;
|
|
{$ENDIF !CLR}
|
|
procedure GetDlgCode(var Code: TDlgCodes); virtual;
|
|
procedure FocusSet(PrevWnd: THandle); virtual;
|
|
procedure FocusKilled(NextWnd: THandle); virtual;
|
|
function DoEraseBackground(Canvas: TCanvas; Param: Integer): Boolean; virtual;
|
|
{$IFDEF JVCLThemesEnabledD56}
|
|
private
|
|
function GetParentBackground: Boolean;
|
|
protected
|
|
procedure SetParentBackground(Value: Boolean); virtual;
|
|
property ParentBackground: Boolean read GetParentBackground write SetParentBackground;
|
|
{$ENDIF JVCLThemesEnabledD56}
|
|
published
|
|
property DotNetHighlighting: Boolean read FDotNetHighlighting write FDotNetHighlighting default False;
|
|
end;
|
|
|
|
TJvExCustomListView = class(TCustomListView, IJvExControl)
|
|
private
|
|
FAboutJVCL: TJVCLAboutInfo;
|
|
FHintColor: TColor;
|
|
FMouseOver: Boolean;
|
|
FHintWindowClass: THintWindowClass;
|
|
FOnMouseEnter: TNotifyEvent;
|
|
FOnMouseLeave: TNotifyEvent;
|
|
FOnParentColorChanged: TNotifyEvent;
|
|
function BaseWndProc(Msg: Integer; WParam: Integer = 0; LParam: Longint = 0): Integer; overload;
|
|
function BaseWndProc(Msg: Integer; WParam: Integer; LParam: TControl): Integer; overload;
|
|
function BaseWndProcEx(Msg: Integer; WParam: Integer; var LParam): Integer;
|
|
protected
|
|
procedure WndProc(var Msg: TMessage); override;
|
|
{$IFNDEF CLR}
|
|
procedure FocusChanged(AControl: TWinControl); dynamic;
|
|
{$ENDIF !CLR}
|
|
procedure VisibleChanged; reintroduce; dynamic;
|
|
procedure EnabledChanged; reintroduce; dynamic;
|
|
procedure TextChanged; reintroduce; virtual;
|
|
procedure ColorChanged; reintroduce; dynamic;
|
|
procedure FontChanged; reintroduce; dynamic;
|
|
procedure ParentFontChanged; reintroduce; dynamic;
|
|
procedure ParentColorChanged; reintroduce; dynamic;
|
|
procedure ParentShowHintChanged; reintroduce; dynamic;
|
|
function WantKey(Key: Integer; Shift: TShiftState; const KeyText: WideString): Boolean; reintroduce; virtual;
|
|
function HintShow(var HintInfo: THintInfo): Boolean; reintroduce; dynamic;
|
|
function HitTest(X, Y: Integer): Boolean; reintroduce; virtual;
|
|
procedure MouseEnter(AControl: TControl); reintroduce; dynamic;
|
|
procedure MouseLeave(AControl: TControl); reintroduce; dynamic;
|
|
{$IFDEF COMPILER5}
|
|
{$IFNDEF HASAUTOSIZE}
|
|
procedure CMSetAutoSize(var Msg: TMessage); message CM_SETAUTOSIZE;
|
|
procedure SetAutoSize(Value: Boolean); virtual;
|
|
{$ENDIF !HASAUTOSIZE}
|
|
{$ENDIF COMPILER5}
|
|
property MouseOver: Boolean read FMouseOver write FMouseOver;
|
|
property HintColor: TColor read FHintColor write FHintColor default clDefault;
|
|
property OnMouseEnter: TNotifyEvent read FOnMouseEnter write FOnMouseEnter;
|
|
property OnMouseLeave: TNotifyEvent read FOnMouseLeave write FOnMouseLeave;
|
|
property OnParentColorChange: TNotifyEvent read FOnParentColorChanged write FOnParentColorChanged;
|
|
public
|
|
constructor Create(AOwner: TComponent); override;
|
|
property HintWindowClass: THintWindowClass read FHintWindowClass write FHintWindowClass;
|
|
published
|
|
property AboutJVCL: TJVCLAboutInfo read FAboutJVCL write FAboutJVCL stored False;
|
|
private
|
|
FDotNetHighlighting: Boolean;
|
|
protected
|
|
procedure BoundsChanged; reintroduce; virtual;
|
|
procedure CursorChanged; reintroduce; dynamic;
|
|
procedure ShowingChanged; reintroduce; dynamic;
|
|
procedure ShowHintChanged; reintroduce; dynamic;
|
|
{$IFNDEF CLR}
|
|
procedure ControlsListChanging(Control: TControl; Inserting: Boolean); reintroduce; dynamic;
|
|
procedure ControlsListChanged(Control: TControl; Inserting: Boolean); reintroduce; dynamic;
|
|
{$ENDIF !CLR}
|
|
procedure GetDlgCode(var Code: TDlgCodes); virtual;
|
|
procedure FocusSet(PrevWnd: THandle); virtual;
|
|
procedure FocusKilled(NextWnd: THandle); virtual;
|
|
function DoEraseBackground(Canvas: TCanvas; Param: Integer): Boolean; virtual;
|
|
{$IFDEF JVCLThemesEnabledD56}
|
|
private
|
|
function GetParentBackground: Boolean;
|
|
protected
|
|
procedure SetParentBackground(Value: Boolean); virtual;
|
|
property ParentBackground: Boolean read GetParentBackground write SetParentBackground;
|
|
{$ENDIF JVCLThemesEnabledD56}
|
|
published
|
|
property DotNetHighlighting: Boolean read FDotNetHighlighting write FDotNetHighlighting default False;
|
|
end;
|
|
|
|
TJvExListView = class(TListView, IJvExControl)
|
|
private
|
|
FAboutJVCL: TJVCLAboutInfo;
|
|
FHintColor: TColor;
|
|
FMouseOver: Boolean;
|
|
FHintWindowClass: THintWindowClass;
|
|
FOnMouseEnter: TNotifyEvent;
|
|
FOnMouseLeave: TNotifyEvent;
|
|
FOnParentColorChanged: TNotifyEvent;
|
|
function BaseWndProc(Msg: Integer; WParam: Integer = 0; LParam: Longint = 0): Integer; overload;
|
|
function BaseWndProc(Msg: Integer; WParam: Integer; LParam: TControl): Integer; overload;
|
|
function BaseWndProcEx(Msg: Integer; WParam: Integer; var LParam): Integer;
|
|
protected
|
|
procedure WndProc(var Msg: TMessage); override;
|
|
{$IFNDEF CLR}
|
|
procedure FocusChanged(AControl: TWinControl); dynamic;
|
|
{$ENDIF !CLR}
|
|
procedure VisibleChanged; reintroduce; dynamic;
|
|
procedure EnabledChanged; reintroduce; dynamic;
|
|
procedure TextChanged; reintroduce; virtual;
|
|
procedure ColorChanged; reintroduce; dynamic;
|
|
procedure FontChanged; reintroduce; dynamic;
|
|
procedure ParentFontChanged; reintroduce; dynamic;
|
|
procedure ParentColorChanged; reintroduce; dynamic;
|
|
procedure ParentShowHintChanged; reintroduce; dynamic;
|
|
function WantKey(Key: Integer; Shift: TShiftState; const KeyText: WideString): Boolean; reintroduce; virtual;
|
|
function HintShow(var HintInfo: THintInfo): Boolean; reintroduce; dynamic;
|
|
function HitTest(X, Y: Integer): Boolean; reintroduce; virtual;
|
|
procedure MouseEnter(AControl: TControl); reintroduce; dynamic;
|
|
procedure MouseLeave(AControl: TControl); reintroduce; dynamic;
|
|
{$IFDEF COMPILER5}
|
|
{$IFNDEF HASAUTOSIZE}
|
|
procedure CMSetAutoSize(var Msg: TMessage); message CM_SETAUTOSIZE;
|
|
procedure SetAutoSize(Value: Boolean); virtual;
|
|
{$ENDIF !HASAUTOSIZE}
|
|
{$ENDIF COMPILER5}
|
|
property MouseOver: Boolean read FMouseOver write FMouseOver;
|
|
property HintColor: TColor read FHintColor write FHintColor default clDefault;
|
|
property OnMouseEnter: TNotifyEvent read FOnMouseEnter write FOnMouseEnter;
|
|
property OnMouseLeave: TNotifyEvent read FOnMouseLeave write FOnMouseLeave;
|
|
property OnParentColorChange: TNotifyEvent read FOnParentColorChanged write FOnParentColorChanged;
|
|
public
|
|
constructor Create(AOwner: TComponent); override;
|
|
property HintWindowClass: THintWindowClass read FHintWindowClass write FHintWindowClass;
|
|
published
|
|
property AboutJVCL: TJVCLAboutInfo read FAboutJVCL write FAboutJVCL stored False;
|
|
private
|
|
FDotNetHighlighting: Boolean;
|
|
protected
|
|
procedure BoundsChanged; reintroduce; virtual;
|
|
procedure CursorChanged; reintroduce; dynamic;
|
|
procedure ShowingChanged; reintroduce; dynamic;
|
|
procedure ShowHintChanged; reintroduce; dynamic;
|
|
{$IFNDEF CLR}
|
|
procedure ControlsListChanging(Control: TControl; Inserting: Boolean); reintroduce; dynamic;
|
|
procedure ControlsListChanged(Control: TControl; Inserting: Boolean); reintroduce; dynamic;
|
|
{$ENDIF !CLR}
|
|
procedure GetDlgCode(var Code: TDlgCodes); virtual;
|
|
procedure FocusSet(PrevWnd: THandle); virtual;
|
|
procedure FocusKilled(NextWnd: THandle); virtual;
|
|
function DoEraseBackground(Canvas: TCanvas; Param: Integer): Boolean; virtual;
|
|
{$IFDEF JVCLThemesEnabledD56}
|
|
private
|
|
function GetParentBackground: Boolean;
|
|
protected
|
|
procedure SetParentBackground(Value: Boolean); virtual;
|
|
property ParentBackground: Boolean read GetParentBackground write SetParentBackground;
|
|
{$ENDIF JVCLThemesEnabledD56}
|
|
published
|
|
property DotNetHighlighting: Boolean read FDotNetHighlighting write FDotNetHighlighting default False;
|
|
end;
|
|
|
|
TJvExPageControl = class(TPageControl, IJvExControl)
|
|
private
|
|
FAboutJVCL: TJVCLAboutInfo;
|
|
FHintColor: TColor;
|
|
FMouseOver: Boolean;
|
|
FHintWindowClass: THintWindowClass;
|
|
FOnMouseEnter: TNotifyEvent;
|
|
FOnMouseLeave: TNotifyEvent;
|
|
FOnParentColorChanged: TNotifyEvent;
|
|
function BaseWndProc(Msg: Integer; WParam: Integer = 0; LParam: Longint = 0): Integer; overload;
|
|
function BaseWndProc(Msg: Integer; WParam: Integer; LParam: TControl): Integer; overload;
|
|
function BaseWndProcEx(Msg: Integer; WParam: Integer; var LParam): Integer;
|
|
protected
|
|
procedure WndProc(var Msg: TMessage); override;
|
|
{$IFNDEF CLR}
|
|
procedure FocusChanged(AControl: TWinControl); dynamic;
|
|
{$ENDIF !CLR}
|
|
procedure VisibleChanged; reintroduce; dynamic;
|
|
procedure EnabledChanged; reintroduce; dynamic;
|
|
procedure TextChanged; reintroduce; virtual;
|
|
procedure ColorChanged; reintroduce; dynamic;
|
|
procedure FontChanged; reintroduce; dynamic;
|
|
procedure ParentFontChanged; reintroduce; dynamic;
|
|
procedure ParentColorChanged; reintroduce; dynamic;
|
|
procedure ParentShowHintChanged; reintroduce; dynamic;
|
|
function WantKey(Key: Integer; Shift: TShiftState; const KeyText: WideString): Boolean; reintroduce; virtual;
|
|
function HintShow(var HintInfo: THintInfo): Boolean; reintroduce; dynamic;
|
|
function HitTest(X, Y: Integer): Boolean; reintroduce; virtual;
|
|
procedure MouseEnter(AControl: TControl); reintroduce; dynamic;
|
|
procedure MouseLeave(AControl: TControl); reintroduce; dynamic;
|
|
{$IFDEF COMPILER5}
|
|
{$IFNDEF HASAUTOSIZE}
|
|
procedure CMSetAutoSize(var Msg: TMessage); message CM_SETAUTOSIZE;
|
|
procedure SetAutoSize(Value: Boolean); virtual;
|
|
{$ENDIF !HASAUTOSIZE}
|
|
{$ENDIF COMPILER5}
|
|
property MouseOver: Boolean read FMouseOver write FMouseOver;
|
|
property HintColor: TColor read FHintColor write FHintColor default clDefault;
|
|
property OnMouseEnter: TNotifyEvent read FOnMouseEnter write FOnMouseEnter;
|
|
property OnMouseLeave: TNotifyEvent read FOnMouseLeave write FOnMouseLeave;
|
|
property OnParentColorChange: TNotifyEvent read FOnParentColorChanged write FOnParentColorChanged;
|
|
public
|
|
constructor Create(AOwner: TComponent); override;
|
|
property HintWindowClass: THintWindowClass read FHintWindowClass write FHintWindowClass;
|
|
published
|
|
property AboutJVCL: TJVCLAboutInfo read FAboutJVCL write FAboutJVCL stored False;
|
|
private
|
|
FDotNetHighlighting: Boolean;
|
|
protected
|
|
procedure BoundsChanged; reintroduce; virtual;
|
|
procedure CursorChanged; reintroduce; dynamic;
|
|
procedure ShowingChanged; reintroduce; dynamic;
|
|
procedure ShowHintChanged; reintroduce; dynamic;
|
|
{$IFNDEF CLR}
|
|
procedure ControlsListChanging(Control: TControl; Inserting: Boolean); reintroduce; dynamic;
|
|
procedure ControlsListChanged(Control: TControl; Inserting: Boolean); reintroduce; dynamic;
|
|
{$ENDIF !CLR}
|
|
procedure GetDlgCode(var Code: TDlgCodes); virtual;
|
|
procedure FocusSet(PrevWnd: THandle); virtual;
|
|
procedure FocusKilled(NextWnd: THandle); virtual;
|
|
function DoEraseBackground(Canvas: TCanvas; Param: Integer): Boolean; virtual;
|
|
{$IFDEF JVCLThemesEnabledD56}
|
|
private
|
|
function GetParentBackground: Boolean;
|
|
protected
|
|
procedure SetParentBackground(Value: Boolean); virtual;
|
|
property ParentBackground: Boolean read GetParentBackground write SetParentBackground;
|
|
{$ENDIF JVCLThemesEnabledD56}
|
|
published
|
|
property DotNetHighlighting: Boolean read FDotNetHighlighting write FDotNetHighlighting default False;
|
|
end;
|
|
|
|
TJvExCustomTabControl = class(TCustomTabControl, IJvExControl)
|
|
private
|
|
FAboutJVCL: TJVCLAboutInfo;
|
|
FHintColor: TColor;
|
|
FMouseOver: Boolean;
|
|
FHintWindowClass: THintWindowClass;
|
|
FOnMouseEnter: TNotifyEvent;
|
|
FOnMouseLeave: TNotifyEvent;
|
|
FOnParentColorChanged: TNotifyEvent;
|
|
function BaseWndProc(Msg: Integer; WParam: Integer = 0; LParam: Longint = 0): Integer; overload;
|
|
function BaseWndProc(Msg: Integer; WParam: Integer; LParam: TControl): Integer; overload;
|
|
function BaseWndProcEx(Msg: Integer; WParam: Integer; var LParam): Integer;
|
|
protected
|
|
procedure WndProc(var Msg: TMessage); override;
|
|
{$IFNDEF CLR}
|
|
procedure FocusChanged(AControl: TWinControl); dynamic;
|
|
{$ENDIF !CLR}
|
|
procedure VisibleChanged; reintroduce; dynamic;
|
|
procedure EnabledChanged; reintroduce; dynamic;
|
|
procedure TextChanged; reintroduce; virtual;
|
|
procedure ColorChanged; reintroduce; dynamic;
|
|
procedure FontChanged; reintroduce; dynamic;
|
|
procedure ParentFontChanged; reintroduce; dynamic;
|
|
procedure ParentColorChanged; reintroduce; dynamic;
|
|
procedure ParentShowHintChanged; reintroduce; dynamic;
|
|
function WantKey(Key: Integer; Shift: TShiftState; const KeyText: WideString): Boolean; reintroduce; virtual;
|
|
function HintShow(var HintInfo: THintInfo): Boolean; reintroduce; dynamic;
|
|
function HitTest(X, Y: Integer): Boolean; reintroduce; virtual;
|
|
procedure MouseEnter(AControl: TControl); reintroduce; dynamic;
|
|
procedure MouseLeave(AControl: TControl); reintroduce; dynamic;
|
|
{$IFDEF COMPILER5}
|
|
{$IFNDEF HASAUTOSIZE}
|
|
procedure CMSetAutoSize(var Msg: TMessage); message CM_SETAUTOSIZE;
|
|
procedure SetAutoSize(Value: Boolean); virtual;
|
|
{$ENDIF !HASAUTOSIZE}
|
|
{$ENDIF COMPILER5}
|
|
property MouseOver: Boolean read FMouseOver write FMouseOver;
|
|
property HintColor: TColor read FHintColor write FHintColor default clDefault;
|
|
property OnMouseEnter: TNotifyEvent read FOnMouseEnter write FOnMouseEnter;
|
|
property OnMouseLeave: TNotifyEvent read FOnMouseLeave write FOnMouseLeave;
|
|
property OnParentColorChange: TNotifyEvent read FOnParentColorChanged write FOnParentColorChanged;
|
|
public
|
|
constructor Create(AOwner: TComponent); override;
|
|
property HintWindowClass: THintWindowClass read FHintWindowClass write FHintWindowClass;
|
|
published
|
|
property AboutJVCL: TJVCLAboutInfo read FAboutJVCL write FAboutJVCL stored False;
|
|
private
|
|
FDotNetHighlighting: Boolean;
|
|
protected
|
|
procedure BoundsChanged; reintroduce; virtual;
|
|
procedure CursorChanged; reintroduce; dynamic;
|
|
procedure ShowingChanged; reintroduce; dynamic;
|
|
procedure ShowHintChanged; reintroduce; dynamic;
|
|
{$IFNDEF CLR}
|
|
procedure ControlsListChanging(Control: TControl; Inserting: Boolean); reintroduce; dynamic;
|
|
procedure ControlsListChanged(Control: TControl; Inserting: Boolean); reintroduce; dynamic;
|
|
{$ENDIF !CLR}
|
|
procedure GetDlgCode(var Code: TDlgCodes); virtual;
|
|
procedure FocusSet(PrevWnd: THandle); virtual;
|
|
procedure FocusKilled(NextWnd: THandle); virtual;
|
|
function DoEraseBackground(Canvas: TCanvas; Param: Integer): Boolean; virtual;
|
|
{$IFDEF JVCLThemesEnabledD56}
|
|
private
|
|
function GetParentBackground: Boolean;
|
|
protected
|
|
procedure SetParentBackground(Value: Boolean); virtual;
|
|
property ParentBackground: Boolean read GetParentBackground write SetParentBackground;
|
|
{$ENDIF JVCLThemesEnabledD56}
|
|
published
|
|
property DotNetHighlighting: Boolean read FDotNetHighlighting write FDotNetHighlighting default False;
|
|
end;
|
|
|
|
TJvExTabControl = class(TTabControl, IJvExControl)
|
|
private
|
|
FAboutJVCL: TJVCLAboutInfo;
|
|
FHintColor: TColor;
|
|
FMouseOver: Boolean;
|
|
FHintWindowClass: THintWindowClass;
|
|
FOnMouseEnter: TNotifyEvent;
|
|
FOnMouseLeave: TNotifyEvent;
|
|
FOnParentColorChanged: TNotifyEvent;
|
|
function BaseWndProc(Msg: Integer; WParam: Integer = 0; LParam: Longint = 0): Integer; overload;
|
|
function BaseWndProc(Msg: Integer; WParam: Integer; LParam: TControl): Integer; overload;
|
|
function BaseWndProcEx(Msg: Integer; WParam: Integer; var LParam): Integer;
|
|
protected
|
|
procedure WndProc(var Msg: TMessage); override;
|
|
{$IFNDEF CLR}
|
|
procedure FocusChanged(AControl: TWinControl); dynamic;
|
|
{$ENDIF !CLR}
|
|
procedure VisibleChanged; reintroduce; dynamic;
|
|
procedure EnabledChanged; reintroduce; dynamic;
|
|
procedure TextChanged; reintroduce; virtual;
|
|
procedure ColorChanged; reintroduce; dynamic;
|
|
procedure FontChanged; reintroduce; dynamic;
|
|
procedure ParentFontChanged; reintroduce; dynamic;
|
|
procedure ParentColorChanged; reintroduce; dynamic;
|
|
procedure ParentShowHintChanged; reintroduce; dynamic;
|
|
function WantKey(Key: Integer; Shift: TShiftState; const KeyText: WideString): Boolean; reintroduce; virtual;
|
|
function HintShow(var HintInfo: THintInfo): Boolean; reintroduce; dynamic;
|
|
function HitTest(X, Y: Integer): Boolean; reintroduce; virtual;
|
|
procedure MouseEnter(AControl: TControl); reintroduce; dynamic;
|
|
procedure MouseLeave(AControl: TControl); reintroduce; dynamic;
|
|
{$IFDEF COMPILER5}
|
|
{$IFNDEF HASAUTOSIZE}
|
|
procedure CMSetAutoSize(var Msg: TMessage); message CM_SETAUTOSIZE;
|
|
procedure SetAutoSize(Value: Boolean); virtual;
|
|
{$ENDIF !HASAUTOSIZE}
|
|
{$ENDIF COMPILER5}
|
|
property MouseOver: Boolean read FMouseOver write FMouseOver;
|
|
property HintColor: TColor read FHintColor write FHintColor default clDefault;
|
|
property OnMouseEnter: TNotifyEvent read FOnMouseEnter write FOnMouseEnter;
|
|
property OnMouseLeave: TNotifyEvent read FOnMouseLeave write FOnMouseLeave;
|
|
property OnParentColorChange: TNotifyEvent read FOnParentColorChanged write FOnParentColorChanged;
|
|
public
|
|
constructor Create(AOwner: TComponent); override;
|
|
property HintWindowClass: THintWindowClass read FHintWindowClass write FHintWindowClass;
|
|
published
|
|
property AboutJVCL: TJVCLAboutInfo read FAboutJVCL write FAboutJVCL stored False;
|
|
private
|
|
FDotNetHighlighting: Boolean;
|
|
protected
|
|
procedure BoundsChanged; reintroduce; virtual;
|
|
procedure CursorChanged; reintroduce; dynamic;
|
|
procedure ShowingChanged; reintroduce; dynamic;
|
|
procedure ShowHintChanged; reintroduce; dynamic;
|
|
{$IFNDEF CLR}
|
|
procedure ControlsListChanging(Control: TControl; Inserting: Boolean); reintroduce; dynamic;
|
|
procedure ControlsListChanged(Control: TControl; Inserting: Boolean); reintroduce; dynamic;
|
|
{$ENDIF !CLR}
|
|
procedure GetDlgCode(var Code: TDlgCodes); virtual;
|
|
procedure FocusSet(PrevWnd: THandle); virtual;
|
|
procedure FocusKilled(NextWnd: THandle); virtual;
|
|
function DoEraseBackground(Canvas: TCanvas; Param: Integer): Boolean; virtual;
|
|
{$IFDEF JVCLThemesEnabledD56}
|
|
private
|
|
function GetParentBackground: Boolean;
|
|
protected
|
|
procedure SetParentBackground(Value: Boolean); virtual;
|
|
property ParentBackground: Boolean read GetParentBackground write SetParentBackground;
|
|
{$ENDIF JVCLThemesEnabledD56}
|
|
published
|
|
property DotNetHighlighting: Boolean read FDotNetHighlighting write FDotNetHighlighting default False;
|
|
end;
|
|
|
|
TJvExTrackBar = class(TTrackBar, IJvExControl)
|
|
private
|
|
FAboutJVCL: TJVCLAboutInfo;
|
|
FHintColor: TColor;
|
|
FMouseOver: Boolean;
|
|
FHintWindowClass: THintWindowClass;
|
|
FOnMouseEnter: TNotifyEvent;
|
|
FOnMouseLeave: TNotifyEvent;
|
|
FOnParentColorChanged: TNotifyEvent;
|
|
function BaseWndProc(Msg: Integer; WParam: Integer = 0; LParam: Longint = 0): Integer; overload;
|
|
function BaseWndProc(Msg: Integer; WParam: Integer; LParam: TControl): Integer; overload;
|
|
function BaseWndProcEx(Msg: Integer; WParam: Integer; var LParam): Integer;
|
|
protected
|
|
procedure WndProc(var Msg: TMessage); override;
|
|
{$IFNDEF CLR}
|
|
procedure FocusChanged(AControl: TWinControl); dynamic;
|
|
{$ENDIF !CLR}
|
|
procedure VisibleChanged; reintroduce; dynamic;
|
|
procedure EnabledChanged; reintroduce; dynamic;
|
|
procedure TextChanged; reintroduce; virtual;
|
|
procedure ColorChanged; reintroduce; dynamic;
|
|
procedure FontChanged; reintroduce; dynamic;
|
|
procedure ParentFontChanged; reintroduce; dynamic;
|
|
procedure ParentColorChanged; reintroduce; dynamic;
|
|
procedure ParentShowHintChanged; reintroduce; dynamic;
|
|
function WantKey(Key: Integer; Shift: TShiftState; const KeyText: WideString): Boolean; reintroduce; virtual;
|
|
function HintShow(var HintInfo: THintInfo): Boolean; reintroduce; dynamic;
|
|
function HitTest(X, Y: Integer): Boolean; reintroduce; virtual;
|
|
procedure MouseEnter(AControl: TControl); reintroduce; dynamic;
|
|
procedure MouseLeave(AControl: TControl); reintroduce; dynamic;
|
|
{$IFDEF COMPILER5}
|
|
{$IFNDEF HASAUTOSIZE}
|
|
procedure CMSetAutoSize(var Msg: TMessage); message CM_SETAUTOSIZE;
|
|
procedure SetAutoSize(Value: Boolean); virtual;
|
|
{$ENDIF !HASAUTOSIZE}
|
|
{$ENDIF COMPILER5}
|
|
property MouseOver: Boolean read FMouseOver write FMouseOver;
|
|
property HintColor: TColor read FHintColor write FHintColor default clDefault;
|
|
property OnMouseEnter: TNotifyEvent read FOnMouseEnter write FOnMouseEnter;
|
|
property OnMouseLeave: TNotifyEvent read FOnMouseLeave write FOnMouseLeave;
|
|
property OnParentColorChange: TNotifyEvent read FOnParentColorChanged write FOnParentColorChanged;
|
|
public
|
|
constructor Create(AOwner: TComponent); override;
|
|
property HintWindowClass: THintWindowClass read FHintWindowClass write FHintWindowClass;
|
|
published
|
|
property AboutJVCL: TJVCLAboutInfo read FAboutJVCL write FAboutJVCL stored False;
|
|
private
|
|
FDotNetHighlighting: Boolean;
|
|
protected
|
|
procedure BoundsChanged; reintroduce; virtual;
|
|
procedure CursorChanged; reintroduce; dynamic;
|
|
procedure ShowingChanged; reintroduce; dynamic;
|
|
procedure ShowHintChanged; reintroduce; dynamic;
|
|
{$IFNDEF CLR}
|
|
procedure ControlsListChanging(Control: TControl; Inserting: Boolean); reintroduce; dynamic;
|
|
procedure ControlsListChanged(Control: TControl; Inserting: Boolean); reintroduce; dynamic;
|
|
{$ENDIF !CLR}
|
|
procedure GetDlgCode(var Code: TDlgCodes); virtual;
|
|
procedure FocusSet(PrevWnd: THandle); virtual;
|
|
procedure FocusKilled(NextWnd: THandle); virtual;
|
|
function DoEraseBackground(Canvas: TCanvas; Param: Integer): Boolean; virtual;
|
|
{$IFDEF JVCLThemesEnabledD56}
|
|
private
|
|
function GetParentBackground: Boolean;
|
|
protected
|
|
procedure SetParentBackground(Value: Boolean); virtual;
|
|
property ParentBackground: Boolean read GetParentBackground write SetParentBackground;
|
|
{$ENDIF JVCLThemesEnabledD56}
|
|
published
|
|
property DotNetHighlighting: Boolean read FDotNetHighlighting write FDotNetHighlighting default False;
|
|
end;
|
|
|
|
TJvExAnimate = class(TAnimate, IJvExControl)
|
|
private
|
|
FAboutJVCL: TJVCLAboutInfo;
|
|
FHintColor: TColor;
|
|
FMouseOver: Boolean;
|
|
FHintWindowClass: THintWindowClass;
|
|
FOnMouseEnter: TNotifyEvent;
|
|
FOnMouseLeave: TNotifyEvent;
|
|
FOnParentColorChanged: TNotifyEvent;
|
|
function BaseWndProc(Msg: Integer; WParam: Integer = 0; LParam: Longint = 0): Integer; overload;
|
|
function BaseWndProc(Msg: Integer; WParam: Integer; LParam: TControl): Integer; overload;
|
|
function BaseWndProcEx(Msg: Integer; WParam: Integer; var LParam): Integer;
|
|
protected
|
|
procedure WndProc(var Msg: TMessage); override;
|
|
{$IFNDEF CLR}
|
|
procedure FocusChanged(AControl: TWinControl); dynamic;
|
|
{$ENDIF !CLR}
|
|
procedure VisibleChanged; reintroduce; dynamic;
|
|
procedure EnabledChanged; reintroduce; dynamic;
|
|
procedure TextChanged; reintroduce; virtual;
|
|
procedure ColorChanged; reintroduce; dynamic;
|
|
procedure FontChanged; reintroduce; dynamic;
|
|
procedure ParentFontChanged; reintroduce; dynamic;
|
|
procedure ParentColorChanged; reintroduce; dynamic;
|
|
procedure ParentShowHintChanged; reintroduce; dynamic;
|
|
function WantKey(Key: Integer; Shift: TShiftState; const KeyText: WideString): Boolean; reintroduce; virtual;
|
|
function HintShow(var HintInfo: THintInfo): Boolean; reintroduce; dynamic;
|
|
function HitTest(X, Y: Integer): Boolean; reintroduce; virtual;
|
|
procedure MouseEnter(AControl: TControl); reintroduce; dynamic;
|
|
procedure MouseLeave(AControl: TControl); reintroduce; dynamic;
|
|
{$IFDEF COMPILER5}
|
|
{$IFNDEF HASAUTOSIZE}
|
|
procedure CMSetAutoSize(var Msg: TMessage); message CM_SETAUTOSIZE;
|
|
procedure SetAutoSize(Value: Boolean); virtual;
|
|
{$ENDIF !HASAUTOSIZE}
|
|
{$ENDIF COMPILER5}
|
|
property MouseOver: Boolean read FMouseOver write FMouseOver;
|
|
property HintColor: TColor read FHintColor write FHintColor default clDefault;
|
|
property OnMouseEnter: TNotifyEvent read FOnMouseEnter write FOnMouseEnter;
|
|
property OnMouseLeave: TNotifyEvent read FOnMouseLeave write FOnMouseLeave;
|
|
property OnParentColorChange: TNotifyEvent read FOnParentColorChanged write FOnParentColorChanged;
|
|
public
|
|
constructor Create(AOwner: TComponent); override;
|
|
property HintWindowClass: THintWindowClass read FHintWindowClass write FHintWindowClass;
|
|
published
|
|
property AboutJVCL: TJVCLAboutInfo read FAboutJVCL write FAboutJVCL stored False;
|
|
private
|
|
FDotNetHighlighting: Boolean;
|
|
protected
|
|
procedure BoundsChanged; reintroduce; virtual;
|
|
procedure CursorChanged; reintroduce; dynamic;
|
|
procedure ShowingChanged; reintroduce; dynamic;
|
|
procedure ShowHintChanged; reintroduce; dynamic;
|
|
{$IFNDEF CLR}
|
|
procedure ControlsListChanging(Control: TControl; Inserting: Boolean); reintroduce; dynamic;
|
|
procedure ControlsListChanged(Control: TControl; Inserting: Boolean); reintroduce; dynamic;
|
|
{$ENDIF !CLR}
|
|
procedure GetDlgCode(var Code: TDlgCodes); virtual;
|
|
procedure FocusSet(PrevWnd: THandle); virtual;
|
|
procedure FocusKilled(NextWnd: THandle); virtual;
|
|
function DoEraseBackground(Canvas: TCanvas; Param: Integer): Boolean; virtual;
|
|
{$IFDEF JVCLThemesEnabledD56}
|
|
private
|
|
function GetParentBackground: Boolean;
|
|
protected
|
|
procedure SetParentBackground(Value: Boolean); virtual;
|
|
property ParentBackground: Boolean read GetParentBackground write SetParentBackground;
|
|
{$ENDIF JVCLThemesEnabledD56}
|
|
published
|
|
property DotNetHighlighting: Boolean read FDotNetHighlighting write FDotNetHighlighting default False;
|
|
end;
|
|
|
|
{$IFDEF COMPILER6_UP}
|
|
|
|
TJvExCustomComboBoxEx = class(TCustomComboBoxEx, IJvExControl)
|
|
private
|
|
FAboutJVCL: TJVCLAboutInfo;
|
|
FHintColor: TColor;
|
|
FMouseOver: Boolean;
|
|
FHintWindowClass: THintWindowClass;
|
|
FOnMouseEnter: TNotifyEvent;
|
|
FOnMouseLeave: TNotifyEvent;
|
|
FOnParentColorChanged: TNotifyEvent;
|
|
function BaseWndProc(Msg: Integer; WParam: Integer = 0; LParam: Longint = 0): Integer; overload;
|
|
function BaseWndProc(Msg: Integer; WParam: Integer; LParam: TControl): Integer; overload;
|
|
function BaseWndProcEx(Msg: Integer; WParam: Integer; var LParam): Integer;
|
|
protected
|
|
procedure WndProc(var Msg: TMessage); override;
|
|
{$IFNDEF CLR}
|
|
procedure FocusChanged(AControl: TWinControl); dynamic;
|
|
{$ENDIF !CLR}
|
|
procedure VisibleChanged; reintroduce; dynamic;
|
|
procedure EnabledChanged; reintroduce; dynamic;
|
|
procedure TextChanged; reintroduce; virtual;
|
|
procedure ColorChanged; reintroduce; dynamic;
|
|
procedure FontChanged; reintroduce; dynamic;
|
|
procedure ParentFontChanged; reintroduce; dynamic;
|
|
procedure ParentColorChanged; reintroduce; dynamic;
|
|
procedure ParentShowHintChanged; reintroduce; dynamic;
|
|
function WantKey(Key: Integer; Shift: TShiftState; const KeyText: WideString): Boolean; reintroduce; virtual;
|
|
function HintShow(var HintInfo: THintInfo): Boolean; reintroduce; dynamic;
|
|
function HitTest(X, Y: Integer): Boolean; reintroduce; virtual;
|
|
procedure MouseEnter(AControl: TControl); reintroduce; dynamic;
|
|
procedure MouseLeave(AControl: TControl); reintroduce; dynamic;
|
|
{$IFDEF COMPILER5}
|
|
{$IFNDEF HASAUTOSIZE}
|
|
procedure CMSetAutoSize(var Msg: TMessage); message CM_SETAUTOSIZE;
|
|
procedure SetAutoSize(Value: Boolean); virtual;
|
|
{$ENDIF !HASAUTOSIZE}
|
|
{$ENDIF COMPILER5}
|
|
property MouseOver: Boolean read FMouseOver write FMouseOver;
|
|
property HintColor: TColor read FHintColor write FHintColor default clDefault;
|
|
property OnMouseEnter: TNotifyEvent read FOnMouseEnter write FOnMouseEnter;
|
|
property OnMouseLeave: TNotifyEvent read FOnMouseLeave write FOnMouseLeave;
|
|
property OnParentColorChange: TNotifyEvent read FOnParentColorChanged write FOnParentColorChanged;
|
|
public
|
|
constructor Create(AOwner: TComponent); override;
|
|
property HintWindowClass: THintWindowClass read FHintWindowClass write FHintWindowClass;
|
|
published
|
|
property AboutJVCL: TJVCLAboutInfo read FAboutJVCL write FAboutJVCL stored False;
|
|
private
|
|
FDotNetHighlighting: Boolean;
|
|
protected
|
|
procedure BoundsChanged; reintroduce; virtual;
|
|
procedure CursorChanged; reintroduce; dynamic;
|
|
procedure ShowingChanged; reintroduce; dynamic;
|
|
procedure ShowHintChanged; reintroduce; dynamic;
|
|
{$IFNDEF CLR}
|
|
procedure ControlsListChanging(Control: TControl; Inserting: Boolean); reintroduce; dynamic;
|
|
procedure ControlsListChanged(Control: TControl; Inserting: Boolean); reintroduce; dynamic;
|
|
{$ENDIF !CLR}
|
|
procedure GetDlgCode(var Code: TDlgCodes); virtual;
|
|
procedure FocusSet(PrevWnd: THandle); virtual;
|
|
procedure FocusKilled(NextWnd: THandle); virtual;
|
|
function DoEraseBackground(Canvas: TCanvas; Param: Integer): Boolean; virtual;
|
|
{$IFDEF JVCLThemesEnabledD56}
|
|
private
|
|
function GetParentBackground: Boolean;
|
|
protected
|
|
procedure SetParentBackground(Value: Boolean); virtual;
|
|
property ParentBackground: Boolean read GetParentBackground write SetParentBackground;
|
|
{$ENDIF JVCLThemesEnabledD56}
|
|
published
|
|
property DotNetHighlighting: Boolean read FDotNetHighlighting write FDotNetHighlighting default False;
|
|
end;
|
|
|
|
TJvExCustomStatusBar = class(TCustomStatusBar, IJvExControl)
|
|
private
|
|
FAboutJVCL: TJVCLAboutInfo;
|
|
FHintColor: TColor;
|
|
FMouseOver: Boolean;
|
|
FHintWindowClass: THintWindowClass;
|
|
FOnMouseEnter: TNotifyEvent;
|
|
FOnMouseLeave: TNotifyEvent;
|
|
FOnParentColorChanged: TNotifyEvent;
|
|
function BaseWndProc(Msg: Integer; WParam: Integer = 0; LParam: Longint = 0): Integer; overload;
|
|
function BaseWndProc(Msg: Integer; WParam: Integer; LParam: TControl): Integer; overload;
|
|
function BaseWndProcEx(Msg: Integer; WParam: Integer; var LParam): Integer;
|
|
protected
|
|
procedure WndProc(var Msg: TMessage); override;
|
|
{$IFNDEF CLR}
|
|
procedure FocusChanged(AControl: TWinControl); dynamic;
|
|
{$ENDIF !CLR}
|
|
procedure VisibleChanged; reintroduce; dynamic;
|
|
procedure EnabledChanged; reintroduce; dynamic;
|
|
procedure TextChanged; reintroduce; virtual;
|
|
procedure ColorChanged; reintroduce; dynamic;
|
|
procedure FontChanged; reintroduce; dynamic;
|
|
procedure ParentFontChanged; reintroduce; dynamic;
|
|
procedure ParentColorChanged; reintroduce; dynamic;
|
|
procedure ParentShowHintChanged; reintroduce; dynamic;
|
|
function WantKey(Key: Integer; Shift: TShiftState; const KeyText: WideString): Boolean; reintroduce; virtual;
|
|
function HintShow(var HintInfo: THintInfo): Boolean; reintroduce; dynamic;
|
|
function HitTest(X, Y: Integer): Boolean; reintroduce; virtual;
|
|
procedure MouseEnter(AControl: TControl); reintroduce; dynamic;
|
|
procedure MouseLeave(AControl: TControl); reintroduce; dynamic;
|
|
{$IFDEF COMPILER5}
|
|
{$IFNDEF HASAUTOSIZE}
|
|
procedure CMSetAutoSize(var Msg: TMessage); message CM_SETAUTOSIZE;
|
|
procedure SetAutoSize(Value: Boolean); virtual;
|
|
{$ENDIF !HASAUTOSIZE}
|
|
{$ENDIF COMPILER5}
|
|
property MouseOver: Boolean read FMouseOver write FMouseOver;
|
|
property HintColor: TColor read FHintColor write FHintColor default clDefault;
|
|
property OnMouseEnter: TNotifyEvent read FOnMouseEnter write FOnMouseEnter;
|
|
property OnMouseLeave: TNotifyEvent read FOnMouseLeave write FOnMouseLeave;
|
|
property OnParentColorChange: TNotifyEvent read FOnParentColorChanged write FOnParentColorChanged;
|
|
public
|
|
constructor Create(AOwner: TComponent); override;
|
|
property HintWindowClass: THintWindowClass read FHintWindowClass write FHintWindowClass;
|
|
published
|
|
property AboutJVCL: TJVCLAboutInfo read FAboutJVCL write FAboutJVCL stored False;
|
|
private
|
|
FDotNetHighlighting: Boolean;
|
|
protected
|
|
procedure BoundsChanged; reintroduce; virtual;
|
|
procedure CursorChanged; reintroduce; dynamic;
|
|
procedure ShowingChanged; reintroduce; dynamic;
|
|
procedure ShowHintChanged; reintroduce; dynamic;
|
|
{$IFNDEF CLR}
|
|
procedure ControlsListChanging(Control: TControl; Inserting: Boolean); reintroduce; dynamic;
|
|
procedure ControlsListChanged(Control: TControl; Inserting: Boolean); reintroduce; dynamic;
|
|
{$ENDIF !CLR}
|
|
procedure GetDlgCode(var Code: TDlgCodes); virtual;
|
|
procedure FocusSet(PrevWnd: THandle); virtual;
|
|
procedure FocusKilled(NextWnd: THandle); virtual;
|
|
function DoEraseBackground(Canvas: TCanvas; Param: Integer): Boolean; virtual;
|
|
{$IFDEF JVCLThemesEnabledD56}
|
|
private
|
|
function GetParentBackground: Boolean;
|
|
protected
|
|
procedure SetParentBackground(Value: Boolean); virtual;
|
|
property ParentBackground: Boolean read GetParentBackground write SetParentBackground;
|
|
{$ENDIF JVCLThemesEnabledD56}
|
|
published
|
|
property DotNetHighlighting: Boolean read FDotNetHighlighting write FDotNetHighlighting default False;
|
|
end;
|
|
|
|
TJvExComboBoxEx = class(TComboBoxEx, IJvExControl)
|
|
private
|
|
FAboutJVCL: TJVCLAboutInfo;
|
|
FHintColor: TColor;
|
|
FMouseOver: Boolean;
|
|
FHintWindowClass: THintWindowClass;
|
|
FOnMouseEnter: TNotifyEvent;
|
|
FOnMouseLeave: TNotifyEvent;
|
|
FOnParentColorChanged: TNotifyEvent;
|
|
function BaseWndProc(Msg: Integer; WParam: Integer = 0; LParam: Longint = 0): Integer; overload;
|
|
function BaseWndProc(Msg: Integer; WParam: Integer; LParam: TControl): Integer; overload;
|
|
function BaseWndProcEx(Msg: Integer; WParam: Integer; var LParam): Integer;
|
|
protected
|
|
procedure WndProc(var Msg: TMessage); override;
|
|
{$IFNDEF CLR}
|
|
procedure FocusChanged(AControl: TWinControl); dynamic;
|
|
{$ENDIF !CLR}
|
|
procedure VisibleChanged; reintroduce; dynamic;
|
|
procedure EnabledChanged; reintroduce; dynamic;
|
|
procedure TextChanged; reintroduce; virtual;
|
|
procedure ColorChanged; reintroduce; dynamic;
|
|
procedure FontChanged; reintroduce; dynamic;
|
|
procedure ParentFontChanged; reintroduce; dynamic;
|
|
procedure ParentColorChanged; reintroduce; dynamic;
|
|
procedure ParentShowHintChanged; reintroduce; dynamic;
|
|
function WantKey(Key: Integer; Shift: TShiftState; const KeyText: WideString): Boolean; reintroduce; virtual;
|
|
function HintShow(var HintInfo: THintInfo): Boolean; reintroduce; dynamic;
|
|
function HitTest(X, Y: Integer): Boolean; reintroduce; virtual;
|
|
procedure MouseEnter(AControl: TControl); reintroduce; dynamic;
|
|
procedure MouseLeave(AControl: TControl); reintroduce; dynamic;
|
|
{$IFDEF COMPILER5}
|
|
{$IFNDEF HASAUTOSIZE}
|
|
procedure CMSetAutoSize(var Msg: TMessage); message CM_SETAUTOSIZE;
|
|
procedure SetAutoSize(Value: Boolean); virtual;
|
|
{$ENDIF !HASAUTOSIZE}
|
|
{$ENDIF COMPILER5}
|
|
property MouseOver: Boolean read FMouseOver write FMouseOver;
|
|
property HintColor: TColor read FHintColor write FHintColor default clDefault;
|
|
property OnMouseEnter: TNotifyEvent read FOnMouseEnter write FOnMouseEnter;
|
|
property OnMouseLeave: TNotifyEvent read FOnMouseLeave write FOnMouseLeave;
|
|
property OnParentColorChange: TNotifyEvent read FOnParentColorChanged write FOnParentColorChanged;
|
|
public
|
|
constructor Create(AOwner: TComponent); override;
|
|
property HintWindowClass: THintWindowClass read FHintWindowClass write FHintWindowClass;
|
|
published
|
|
property AboutJVCL: TJVCLAboutInfo read FAboutJVCL write FAboutJVCL stored False;
|
|
private
|
|
FDotNetHighlighting: Boolean;
|
|
protected
|
|
procedure BoundsChanged; reintroduce; virtual;
|
|
procedure CursorChanged; reintroduce; dynamic;
|
|
procedure ShowingChanged; reintroduce; dynamic;
|
|
procedure ShowHintChanged; reintroduce; dynamic;
|
|
{$IFNDEF CLR}
|
|
procedure ControlsListChanging(Control: TControl; Inserting: Boolean); reintroduce; dynamic;
|
|
procedure ControlsListChanged(Control: TControl; Inserting: Boolean); reintroduce; dynamic;
|
|
{$ENDIF !CLR}
|
|
procedure GetDlgCode(var Code: TDlgCodes); virtual;
|
|
procedure FocusSet(PrevWnd: THandle); virtual;
|
|
procedure FocusKilled(NextWnd: THandle); virtual;
|
|
function DoEraseBackground(Canvas: TCanvas; Param: Integer): Boolean; virtual;
|
|
{$IFDEF JVCLThemesEnabledD56}
|
|
private
|
|
function GetParentBackground: Boolean;
|
|
protected
|
|
procedure SetParentBackground(Value: Boolean); virtual;
|
|
property ParentBackground: Boolean read GetParentBackground write SetParentBackground;
|
|
{$ENDIF JVCLThemesEnabledD56}
|
|
published
|
|
property DotNetHighlighting: Boolean read FDotNetHighlighting write FDotNetHighlighting default False;
|
|
end;
|
|
|
|
{$ENDIF COMPILER6_UP}
|
|
|
|
TJvExCoolBar = class(TCoolBar, IJvExControl)
|
|
private
|
|
FAboutJVCL: TJVCLAboutInfo;
|
|
FHintColor: TColor;
|
|
FMouseOver: Boolean;
|
|
FHintWindowClass: THintWindowClass;
|
|
FOnMouseEnter: TNotifyEvent;
|
|
FOnMouseLeave: TNotifyEvent;
|
|
FOnParentColorChanged: TNotifyEvent;
|
|
function BaseWndProc(Msg: Integer; WParam: Integer = 0; LParam: Longint = 0): Integer; overload;
|
|
function BaseWndProc(Msg: Integer; WParam: Integer; LParam: TControl): Integer; overload;
|
|
function BaseWndProcEx(Msg: Integer; WParam: Integer; var LParam): Integer;
|
|
protected
|
|
procedure WndProc(var Msg: TMessage); override;
|
|
{$IFNDEF CLR}
|
|
procedure FocusChanged(AControl: TWinControl); dynamic;
|
|
{$ENDIF !CLR}
|
|
procedure VisibleChanged; reintroduce; dynamic;
|
|
procedure EnabledChanged; reintroduce; dynamic;
|
|
procedure TextChanged; reintroduce; virtual;
|
|
procedure ColorChanged; reintroduce; dynamic;
|
|
procedure FontChanged; reintroduce; dynamic;
|
|
procedure ParentFontChanged; reintroduce; dynamic;
|
|
procedure ParentColorChanged; reintroduce; dynamic;
|
|
procedure ParentShowHintChanged; reintroduce; dynamic;
|
|
function WantKey(Key: Integer; Shift: TShiftState; const KeyText: WideString): Boolean; reintroduce; virtual;
|
|
function HintShow(var HintInfo: THintInfo): Boolean; reintroduce; dynamic;
|
|
function HitTest(X, Y: Integer): Boolean; reintroduce; virtual;
|
|
procedure MouseEnter(AControl: TControl); reintroduce; dynamic;
|
|
procedure MouseLeave(AControl: TControl); reintroduce; dynamic;
|
|
{$IFDEF COMPILER5}
|
|
{$IFNDEF HASAUTOSIZE}
|
|
procedure CMSetAutoSize(var Msg: TMessage); message CM_SETAUTOSIZE;
|
|
procedure SetAutoSize(Value: Boolean); virtual;
|
|
{$ENDIF !HASAUTOSIZE}
|
|
{$ENDIF COMPILER5}
|
|
property MouseOver: Boolean read FMouseOver write FMouseOver;
|
|
property HintColor: TColor read FHintColor write FHintColor default clDefault;
|
|
property OnMouseEnter: TNotifyEvent read FOnMouseEnter write FOnMouseEnter;
|
|
property OnMouseLeave: TNotifyEvent read FOnMouseLeave write FOnMouseLeave;
|
|
property OnParentColorChange: TNotifyEvent read FOnParentColorChanged write FOnParentColorChanged;
|
|
public
|
|
constructor Create(AOwner: TComponent); override;
|
|
property HintWindowClass: THintWindowClass read FHintWindowClass write FHintWindowClass;
|
|
published
|
|
property AboutJVCL: TJVCLAboutInfo read FAboutJVCL write FAboutJVCL stored False;
|
|
private
|
|
FDotNetHighlighting: Boolean;
|
|
protected
|
|
procedure BoundsChanged; reintroduce; virtual;
|
|
procedure CursorChanged; reintroduce; dynamic;
|
|
procedure ShowingChanged; reintroduce; dynamic;
|
|
procedure ShowHintChanged; reintroduce; dynamic;
|
|
{$IFNDEF CLR}
|
|
procedure ControlsListChanging(Control: TControl; Inserting: Boolean); reintroduce; dynamic;
|
|
procedure ControlsListChanged(Control: TControl; Inserting: Boolean); reintroduce; dynamic;
|
|
{$ENDIF !CLR}
|
|
procedure GetDlgCode(var Code: TDlgCodes); virtual;
|
|
procedure FocusSet(PrevWnd: THandle); virtual;
|
|
procedure FocusKilled(NextWnd: THandle); virtual;
|
|
function DoEraseBackground(Canvas: TCanvas; Param: Integer): Boolean; virtual;
|
|
{$IFDEF JVCLThemesEnabledD56}
|
|
private
|
|
function GetParentBackground: Boolean;
|
|
protected
|
|
procedure SetParentBackground(Value: Boolean); virtual;
|
|
property ParentBackground: Boolean read GetParentBackground write SetParentBackground;
|
|
{$ENDIF JVCLThemesEnabledD56}
|
|
published
|
|
property DotNetHighlighting: Boolean read FDotNetHighlighting write FDotNetHighlighting default False;
|
|
end;
|
|
|
|
TJvExCommonCalendar = class(TCommonCalendar, IJvExControl)
|
|
private
|
|
FAboutJVCL: TJVCLAboutInfo;
|
|
FHintColor: TColor;
|
|
FMouseOver: Boolean;
|
|
FHintWindowClass: THintWindowClass;
|
|
FOnMouseEnter: TNotifyEvent;
|
|
FOnMouseLeave: TNotifyEvent;
|
|
FOnParentColorChanged: TNotifyEvent;
|
|
function BaseWndProc(Msg: Integer; WParam: Integer = 0; LParam: Longint = 0): Integer; overload;
|
|
function BaseWndProc(Msg: Integer; WParam: Integer; LParam: TControl): Integer; overload;
|
|
function BaseWndProcEx(Msg: Integer; WParam: Integer; var LParam): Integer;
|
|
protected
|
|
procedure WndProc(var Msg: TMessage); override;
|
|
{$IFNDEF CLR}
|
|
procedure FocusChanged(AControl: TWinControl); dynamic;
|
|
{$ENDIF !CLR}
|
|
procedure VisibleChanged; reintroduce; dynamic;
|
|
procedure EnabledChanged; reintroduce; dynamic;
|
|
procedure TextChanged; reintroduce; virtual;
|
|
procedure ColorChanged; reintroduce; dynamic;
|
|
procedure FontChanged; reintroduce; dynamic;
|
|
procedure ParentFontChanged; reintroduce; dynamic;
|
|
procedure ParentColorChanged; reintroduce; dynamic;
|
|
procedure ParentShowHintChanged; reintroduce; dynamic;
|
|
function WantKey(Key: Integer; Shift: TShiftState; const KeyText: WideString): Boolean; reintroduce; virtual;
|
|
function HintShow(var HintInfo: THintInfo): Boolean; reintroduce; dynamic;
|
|
function HitTest(X, Y: Integer): Boolean; reintroduce; virtual;
|
|
procedure MouseEnter(AControl: TControl); reintroduce; dynamic;
|
|
procedure MouseLeave(AControl: TControl); reintroduce; dynamic;
|
|
{$IFDEF COMPILER5}
|
|
{$IFNDEF HASAUTOSIZE}
|
|
procedure CMSetAutoSize(var Msg: TMessage); message CM_SETAUTOSIZE;
|
|
procedure SetAutoSize(Value: Boolean); virtual;
|
|
{$ENDIF !HASAUTOSIZE}
|
|
{$ENDIF COMPILER5}
|
|
property MouseOver: Boolean read FMouseOver write FMouseOver;
|
|
property HintColor: TColor read FHintColor write FHintColor default clDefault;
|
|
property OnMouseEnter: TNotifyEvent read FOnMouseEnter write FOnMouseEnter;
|
|
property OnMouseLeave: TNotifyEvent read FOnMouseLeave write FOnMouseLeave;
|
|
property OnParentColorChange: TNotifyEvent read FOnParentColorChanged write FOnParentColorChanged;
|
|
public
|
|
constructor Create(AOwner: TComponent); override;
|
|
property HintWindowClass: THintWindowClass read FHintWindowClass write FHintWindowClass;
|
|
published
|
|
property AboutJVCL: TJVCLAboutInfo read FAboutJVCL write FAboutJVCL stored False;
|
|
private
|
|
FDotNetHighlighting: Boolean;
|
|
protected
|
|
procedure BoundsChanged; reintroduce; virtual;
|
|
procedure CursorChanged; reintroduce; dynamic;
|
|
procedure ShowingChanged; reintroduce; dynamic;
|
|
procedure ShowHintChanged; reintroduce; dynamic;
|
|
{$IFNDEF CLR}
|
|
procedure ControlsListChanging(Control: TControl; Inserting: Boolean); reintroduce; dynamic;
|
|
procedure ControlsListChanged(Control: TControl; Inserting: Boolean); reintroduce; dynamic;
|
|
{$ENDIF !CLR}
|
|
procedure GetDlgCode(var Code: TDlgCodes); virtual;
|
|
procedure FocusSet(PrevWnd: THandle); virtual;
|
|
procedure FocusKilled(NextWnd: THandle); virtual;
|
|
function DoEraseBackground(Canvas: TCanvas; Param: Integer): Boolean; virtual;
|
|
{$IFDEF JVCLThemesEnabledD56}
|
|
private
|
|
function GetParentBackground: Boolean;
|
|
protected
|
|
procedure SetParentBackground(Value: Boolean); virtual;
|
|
property ParentBackground: Boolean read GetParentBackground write SetParentBackground;
|
|
{$ENDIF JVCLThemesEnabledD56}
|
|
published
|
|
property DotNetHighlighting: Boolean read FDotNetHighlighting write FDotNetHighlighting default False;
|
|
end;
|
|
|
|
TJvExMonthCalendar = class(TMonthCalendar, IJvExControl)
|
|
private
|
|
FAboutJVCL: TJVCLAboutInfo;
|
|
FHintColor: TColor;
|
|
FMouseOver: Boolean;
|
|
FHintWindowClass: THintWindowClass;
|
|
FOnMouseEnter: TNotifyEvent;
|
|
FOnMouseLeave: TNotifyEvent;
|
|
FOnParentColorChanged: TNotifyEvent;
|
|
function BaseWndProc(Msg: Integer; WParam: Integer = 0; LParam: Longint = 0): Integer; overload;
|
|
function BaseWndProc(Msg: Integer; WParam: Integer; LParam: TControl): Integer; overload;
|
|
function BaseWndProcEx(Msg: Integer; WParam: Integer; var LParam): Integer;
|
|
protected
|
|
procedure WndProc(var Msg: TMessage); override;
|
|
{$IFNDEF CLR}
|
|
procedure FocusChanged(AControl: TWinControl); dynamic;
|
|
{$ENDIF !CLR}
|
|
procedure VisibleChanged; reintroduce; dynamic;
|
|
procedure EnabledChanged; reintroduce; dynamic;
|
|
procedure TextChanged; reintroduce; virtual;
|
|
procedure ColorChanged; reintroduce; dynamic;
|
|
procedure FontChanged; reintroduce; dynamic;
|
|
procedure ParentFontChanged; reintroduce; dynamic;
|
|
procedure ParentColorChanged; reintroduce; dynamic;
|
|
procedure ParentShowHintChanged; reintroduce; dynamic;
|
|
function WantKey(Key: Integer; Shift: TShiftState; const KeyText: WideString): Boolean; reintroduce; virtual;
|
|
function HintShow(var HintInfo: THintInfo): Boolean; reintroduce; dynamic;
|
|
function HitTest(X, Y: Integer): Boolean; reintroduce; virtual;
|
|
procedure MouseEnter(AControl: TControl); reintroduce; dynamic;
|
|
procedure MouseLeave(AControl: TControl); reintroduce; dynamic;
|
|
{$IFDEF COMPILER5}
|
|
{$IFNDEF HASAUTOSIZE}
|
|
procedure CMSetAutoSize(var Msg: TMessage); message CM_SETAUTOSIZE;
|
|
procedure SetAutoSize(Value: Boolean); virtual;
|
|
{$ENDIF !HASAUTOSIZE}
|
|
{$ENDIF COMPILER5}
|
|
property MouseOver: Boolean read FMouseOver write FMouseOver;
|
|
property HintColor: TColor read FHintColor write FHintColor default clDefault;
|
|
property OnMouseEnter: TNotifyEvent read FOnMouseEnter write FOnMouseEnter;
|
|
property OnMouseLeave: TNotifyEvent read FOnMouseLeave write FOnMouseLeave;
|
|
property OnParentColorChange: TNotifyEvent read FOnParentColorChanged write FOnParentColorChanged;
|
|
public
|
|
constructor Create(AOwner: TComponent); override;
|
|
property HintWindowClass: THintWindowClass read FHintWindowClass write FHintWindowClass;
|
|
published
|
|
property AboutJVCL: TJVCLAboutInfo read FAboutJVCL write FAboutJVCL stored False;
|
|
private
|
|
FDotNetHighlighting: Boolean;
|
|
protected
|
|
procedure BoundsChanged; reintroduce; virtual;
|
|
procedure CursorChanged; reintroduce; dynamic;
|
|
procedure ShowingChanged; reintroduce; dynamic;
|
|
procedure ShowHintChanged; reintroduce; dynamic;
|
|
{$IFNDEF CLR}
|
|
procedure ControlsListChanging(Control: TControl; Inserting: Boolean); reintroduce; dynamic;
|
|
procedure ControlsListChanged(Control: TControl; Inserting: Boolean); reintroduce; dynamic;
|
|
{$ENDIF !CLR}
|
|
procedure GetDlgCode(var Code: TDlgCodes); virtual;
|
|
procedure FocusSet(PrevWnd: THandle); virtual;
|
|
procedure FocusKilled(NextWnd: THandle); virtual;
|
|
function DoEraseBackground(Canvas: TCanvas; Param: Integer): Boolean; virtual;
|
|
{$IFDEF JVCLThemesEnabledD56}
|
|
private
|
|
function GetParentBackground: Boolean;
|
|
protected
|
|
procedure SetParentBackground(Value: Boolean); virtual;
|
|
property ParentBackground: Boolean read GetParentBackground write SetParentBackground;
|
|
{$ENDIF JVCLThemesEnabledD56}
|
|
published
|
|
property DotNetHighlighting: Boolean read FDotNetHighlighting write FDotNetHighlighting default False;
|
|
end;
|
|
|
|
TJvExCustomHotKey = class(TCustomHotKey, IJvExControl)
|
|
private
|
|
FAboutJVCL: TJVCLAboutInfo;
|
|
FHintColor: TColor;
|
|
FMouseOver: Boolean;
|
|
FHintWindowClass: THintWindowClass;
|
|
FOnMouseEnter: TNotifyEvent;
|
|
FOnMouseLeave: TNotifyEvent;
|
|
FOnParentColorChanged: TNotifyEvent;
|
|
function BaseWndProc(Msg: Integer; WParam: Integer = 0; LParam: Longint = 0): Integer; overload;
|
|
function BaseWndProc(Msg: Integer; WParam: Integer; LParam: TControl): Integer; overload;
|
|
function BaseWndProcEx(Msg: Integer; WParam: Integer; var LParam): Integer;
|
|
protected
|
|
procedure WndProc(var Msg: TMessage); override;
|
|
{$IFNDEF CLR}
|
|
procedure FocusChanged(AControl: TWinControl); dynamic;
|
|
{$ENDIF !CLR}
|
|
procedure VisibleChanged; reintroduce; dynamic;
|
|
procedure EnabledChanged; reintroduce; dynamic;
|
|
procedure TextChanged; reintroduce; virtual;
|
|
procedure ColorChanged; reintroduce; dynamic;
|
|
procedure FontChanged; reintroduce; dynamic;
|
|
procedure ParentFontChanged; reintroduce; dynamic;
|
|
procedure ParentColorChanged; reintroduce; dynamic;
|
|
procedure ParentShowHintChanged; reintroduce; dynamic;
|
|
function WantKey(Key: Integer; Shift: TShiftState; const KeyText: WideString): Boolean; reintroduce; virtual;
|
|
function HintShow(var HintInfo: THintInfo): Boolean; reintroduce; dynamic;
|
|
function HitTest(X, Y: Integer): Boolean; reintroduce; virtual;
|
|
procedure MouseEnter(AControl: TControl); reintroduce; dynamic;
|
|
procedure MouseLeave(AControl: TControl); reintroduce; dynamic;
|
|
{$IFDEF COMPILER5}
|
|
{$IFNDEF HASAUTOSIZE}
|
|
procedure CMSetAutoSize(var Msg: TMessage); message CM_SETAUTOSIZE;
|
|
procedure SetAutoSize(Value: Boolean); virtual;
|
|
{$ENDIF !HASAUTOSIZE}
|
|
{$ENDIF COMPILER5}
|
|
property MouseOver: Boolean read FMouseOver write FMouseOver;
|
|
property HintColor: TColor read FHintColor write FHintColor default clDefault;
|
|
property OnMouseEnter: TNotifyEvent read FOnMouseEnter write FOnMouseEnter;
|
|
property OnMouseLeave: TNotifyEvent read FOnMouseLeave write FOnMouseLeave;
|
|
property OnParentColorChange: TNotifyEvent read FOnParentColorChanged write FOnParentColorChanged;
|
|
public
|
|
constructor Create(AOwner: TComponent); override;
|
|
property HintWindowClass: THintWindowClass read FHintWindowClass write FHintWindowClass;
|
|
published
|
|
property AboutJVCL: TJVCLAboutInfo read FAboutJVCL write FAboutJVCL stored False;
|
|
private
|
|
FDotNetHighlighting: Boolean;
|
|
protected
|
|
procedure BoundsChanged; reintroduce; virtual;
|
|
procedure CursorChanged; reintroduce; dynamic;
|
|
procedure ShowingChanged; reintroduce; dynamic;
|
|
procedure ShowHintChanged; reintroduce; dynamic;
|
|
{$IFNDEF CLR}
|
|
procedure ControlsListChanging(Control: TControl; Inserting: Boolean); reintroduce; dynamic;
|
|
procedure ControlsListChanged(Control: TControl; Inserting: Boolean); reintroduce; dynamic;
|
|
{$ENDIF !CLR}
|
|
procedure GetDlgCode(var Code: TDlgCodes); virtual;
|
|
procedure FocusSet(PrevWnd: THandle); virtual;
|
|
procedure FocusKilled(NextWnd: THandle); virtual;
|
|
function DoEraseBackground(Canvas: TCanvas; Param: Integer): Boolean; virtual;
|
|
{$IFDEF JVCLThemesEnabledD56}
|
|
private
|
|
function GetParentBackground: Boolean;
|
|
protected
|
|
procedure SetParentBackground(Value: Boolean); virtual;
|
|
property ParentBackground: Boolean read GetParentBackground write SetParentBackground;
|
|
{$ENDIF JVCLThemesEnabledD56}
|
|
published
|
|
property DotNetHighlighting: Boolean read FDotNetHighlighting write FDotNetHighlighting default False;
|
|
end;
|
|
|
|
TJvExHotKey = class(THotKey, IJvExControl)
|
|
private
|
|
FAboutJVCL: TJVCLAboutInfo;
|
|
FHintColor: TColor;
|
|
FMouseOver: Boolean;
|
|
FHintWindowClass: THintWindowClass;
|
|
FOnMouseEnter: TNotifyEvent;
|
|
FOnMouseLeave: TNotifyEvent;
|
|
FOnParentColorChanged: TNotifyEvent;
|
|
function BaseWndProc(Msg: Integer; WParam: Integer = 0; LParam: Longint = 0): Integer; overload;
|
|
function BaseWndProc(Msg: Integer; WParam: Integer; LParam: TControl): Integer; overload;
|
|
function BaseWndProcEx(Msg: Integer; WParam: Integer; var LParam): Integer;
|
|
protected
|
|
procedure WndProc(var Msg: TMessage); override;
|
|
{$IFNDEF CLR}
|
|
procedure FocusChanged(AControl: TWinControl); dynamic;
|
|
{$ENDIF !CLR}
|
|
procedure VisibleChanged; reintroduce; dynamic;
|
|
procedure EnabledChanged; reintroduce; dynamic;
|
|
procedure TextChanged; reintroduce; virtual;
|
|
procedure ColorChanged; reintroduce; dynamic;
|
|
procedure FontChanged; reintroduce; dynamic;
|
|
procedure ParentFontChanged; reintroduce; dynamic;
|
|
procedure ParentColorChanged; reintroduce; dynamic;
|
|
procedure ParentShowHintChanged; reintroduce; dynamic;
|
|
function WantKey(Key: Integer; Shift: TShiftState; const KeyText: WideString): Boolean; reintroduce; virtual;
|
|
function HintShow(var HintInfo: THintInfo): Boolean; reintroduce; dynamic;
|
|
function HitTest(X, Y: Integer): Boolean; reintroduce; virtual;
|
|
procedure MouseEnter(AControl: TControl); reintroduce; dynamic;
|
|
procedure MouseLeave(AControl: TControl); reintroduce; dynamic;
|
|
{$IFDEF COMPILER5}
|
|
{$IFNDEF HASAUTOSIZE}
|
|
procedure CMSetAutoSize(var Msg: TMessage); message CM_SETAUTOSIZE;
|
|
procedure SetAutoSize(Value: Boolean); virtual;
|
|
{$ENDIF !HASAUTOSIZE}
|
|
{$ENDIF COMPILER5}
|
|
property MouseOver: Boolean read FMouseOver write FMouseOver;
|
|
property HintColor: TColor read FHintColor write FHintColor default clDefault;
|
|
property OnMouseEnter: TNotifyEvent read FOnMouseEnter write FOnMouseEnter;
|
|
property OnMouseLeave: TNotifyEvent read FOnMouseLeave write FOnMouseLeave;
|
|
property OnParentColorChange: TNotifyEvent read FOnParentColorChanged write FOnParentColorChanged;
|
|
public
|
|
constructor Create(AOwner: TComponent); override;
|
|
property HintWindowClass: THintWindowClass read FHintWindowClass write FHintWindowClass;
|
|
published
|
|
property AboutJVCL: TJVCLAboutInfo read FAboutJVCL write FAboutJVCL stored False;
|
|
private
|
|
FDotNetHighlighting: Boolean;
|
|
protected
|
|
procedure BoundsChanged; reintroduce; virtual;
|
|
procedure CursorChanged; reintroduce; dynamic;
|
|
procedure ShowingChanged; reintroduce; dynamic;
|
|
procedure ShowHintChanged; reintroduce; dynamic;
|
|
{$IFNDEF CLR}
|
|
procedure ControlsListChanging(Control: TControl; Inserting: Boolean); reintroduce; dynamic;
|
|
procedure ControlsListChanged(Control: TControl; Inserting: Boolean); reintroduce; dynamic;
|
|
{$ENDIF !CLR}
|
|
procedure GetDlgCode(var Code: TDlgCodes); virtual;
|
|
procedure FocusSet(PrevWnd: THandle); virtual;
|
|
procedure FocusKilled(NextWnd: THandle); virtual;
|
|
function DoEraseBackground(Canvas: TCanvas; Param: Integer): Boolean; virtual;
|
|
{$IFDEF JVCLThemesEnabledD56}
|
|
private
|
|
function GetParentBackground: Boolean;
|
|
protected
|
|
procedure SetParentBackground(Value: Boolean); virtual;
|
|
property ParentBackground: Boolean read GetParentBackground write SetParentBackground;
|
|
{$ENDIF JVCLThemesEnabledD56}
|
|
published
|
|
property DotNetHighlighting: Boolean read FDotNetHighlighting write FDotNetHighlighting default False;
|
|
end;
|
|
|
|
TJvExCustomUpDown = class(TCustomUpDown, IJvExControl)
|
|
private
|
|
FAboutJVCL: TJVCLAboutInfo;
|
|
FHintColor: TColor;
|
|
FMouseOver: Boolean;
|
|
FHintWindowClass: THintWindowClass;
|
|
FOnMouseEnter: TNotifyEvent;
|
|
FOnMouseLeave: TNotifyEvent;
|
|
FOnParentColorChanged: TNotifyEvent;
|
|
function BaseWndProc(Msg: Integer; WParam: Integer = 0; LParam: Longint = 0): Integer; overload;
|
|
function BaseWndProc(Msg: Integer; WParam: Integer; LParam: TControl): Integer; overload;
|
|
function BaseWndProcEx(Msg: Integer; WParam: Integer; var LParam): Integer;
|
|
protected
|
|
procedure WndProc(var Msg: TMessage); override;
|
|
{$IFNDEF CLR}
|
|
procedure FocusChanged(AControl: TWinControl); dynamic;
|
|
{$ENDIF !CLR}
|
|
procedure VisibleChanged; reintroduce; dynamic;
|
|
procedure EnabledChanged; reintroduce; dynamic;
|
|
procedure TextChanged; reintroduce; virtual;
|
|
procedure ColorChanged; reintroduce; dynamic;
|
|
procedure FontChanged; reintroduce; dynamic;
|
|
procedure ParentFontChanged; reintroduce; dynamic;
|
|
procedure ParentColorChanged; reintroduce; dynamic;
|
|
procedure ParentShowHintChanged; reintroduce; dynamic;
|
|
function WantKey(Key: Integer; Shift: TShiftState; const KeyText: WideString): Boolean; reintroduce; virtual;
|
|
function HintShow(var HintInfo: THintInfo): Boolean; reintroduce; dynamic;
|
|
function HitTest(X, Y: Integer): Boolean; reintroduce; virtual;
|
|
procedure MouseEnter(AControl: TControl); reintroduce; dynamic;
|
|
procedure MouseLeave(AControl: TControl); reintroduce; dynamic;
|
|
{$IFDEF COMPILER5}
|
|
{$IFNDEF HASAUTOSIZE}
|
|
procedure CMSetAutoSize(var Msg: TMessage); message CM_SETAUTOSIZE;
|
|
procedure SetAutoSize(Value: Boolean); virtual;
|
|
{$ENDIF !HASAUTOSIZE}
|
|
{$ENDIF COMPILER5}
|
|
property MouseOver: Boolean read FMouseOver write FMouseOver;
|
|
property HintColor: TColor read FHintColor write FHintColor default clDefault;
|
|
property OnMouseEnter: TNotifyEvent read FOnMouseEnter write FOnMouseEnter;
|
|
property OnMouseLeave: TNotifyEvent read FOnMouseLeave write FOnMouseLeave;
|
|
property OnParentColorChange: TNotifyEvent read FOnParentColorChanged write FOnParentColorChanged;
|
|
public
|
|
constructor Create(AOwner: TComponent); override;
|
|
property HintWindowClass: THintWindowClass read FHintWindowClass write FHintWindowClass;
|
|
published
|
|
property AboutJVCL: TJVCLAboutInfo read FAboutJVCL write FAboutJVCL stored False;
|
|
private
|
|
FDotNetHighlighting: Boolean;
|
|
protected
|
|
procedure BoundsChanged; reintroduce; virtual;
|
|
procedure CursorChanged; reintroduce; dynamic;
|
|
procedure ShowingChanged; reintroduce; dynamic;
|
|
procedure ShowHintChanged; reintroduce; dynamic;
|
|
{$IFNDEF CLR}
|
|
procedure ControlsListChanging(Control: TControl; Inserting: Boolean); reintroduce; dynamic;
|
|
procedure ControlsListChanged(Control: TControl; Inserting: Boolean); reintroduce; dynamic;
|
|
{$ENDIF !CLR}
|
|
procedure GetDlgCode(var Code: TDlgCodes); virtual;
|
|
procedure FocusSet(PrevWnd: THandle); virtual;
|
|
procedure FocusKilled(NextWnd: THandle); virtual;
|
|
function DoEraseBackground(Canvas: TCanvas; Param: Integer): Boolean; virtual;
|
|
{$IFDEF JVCLThemesEnabledD56}
|
|
private
|
|
function GetParentBackground: Boolean;
|
|
protected
|
|
procedure SetParentBackground(Value: Boolean); virtual;
|
|
property ParentBackground: Boolean read GetParentBackground write SetParentBackground;
|
|
{$ENDIF JVCLThemesEnabledD56}
|
|
published
|
|
property DotNetHighlighting: Boolean read FDotNetHighlighting write FDotNetHighlighting default False;
|
|
end;
|
|
|
|
TJvExUpDown = class(TUpDown, IJvExControl)
|
|
private
|
|
FAboutJVCL: TJVCLAboutInfo;
|
|
FHintColor: TColor;
|
|
FMouseOver: Boolean;
|
|
FHintWindowClass: THintWindowClass;
|
|
FOnMouseEnter: TNotifyEvent;
|
|
FOnMouseLeave: TNotifyEvent;
|
|
FOnParentColorChanged: TNotifyEvent;
|
|
function BaseWndProc(Msg: Integer; WParam: Integer = 0; LParam: Longint = 0): Integer; overload;
|
|
function BaseWndProc(Msg: Integer; WParam: Integer; LParam: TControl): Integer; overload;
|
|
function BaseWndProcEx(Msg: Integer; WParam: Integer; var LParam): Integer;
|
|
protected
|
|
procedure WndProc(var Msg: TMessage); override;
|
|
{$IFNDEF CLR}
|
|
procedure FocusChanged(AControl: TWinControl); dynamic;
|
|
{$ENDIF !CLR}
|
|
procedure VisibleChanged; reintroduce; dynamic;
|
|
procedure EnabledChanged; reintroduce; dynamic;
|
|
procedure TextChanged; reintroduce; virtual;
|
|
procedure ColorChanged; reintroduce; dynamic;
|
|
procedure FontChanged; reintroduce; dynamic;
|
|
procedure ParentFontChanged; reintroduce; dynamic;
|
|
procedure ParentColorChanged; reintroduce; dynamic;
|
|
procedure ParentShowHintChanged; reintroduce; dynamic;
|
|
function WantKey(Key: Integer; Shift: TShiftState; const KeyText: WideString): Boolean; reintroduce; virtual;
|
|
function HintShow(var HintInfo: THintInfo): Boolean; reintroduce; dynamic;
|
|
function HitTest(X, Y: Integer): Boolean; reintroduce; virtual;
|
|
procedure MouseEnter(AControl: TControl); reintroduce; dynamic;
|
|
procedure MouseLeave(AControl: TControl); reintroduce; dynamic;
|
|
{$IFDEF COMPILER5}
|
|
{$IFNDEF HASAUTOSIZE}
|
|
procedure CMSetAutoSize(var Msg: TMessage); message CM_SETAUTOSIZE;
|
|
procedure SetAutoSize(Value: Boolean); virtual;
|
|
{$ENDIF !HASAUTOSIZE}
|
|
{$ENDIF COMPILER5}
|
|
property MouseOver: Boolean read FMouseOver write FMouseOver;
|
|
property HintColor: TColor read FHintColor write FHintColor default clDefault;
|
|
property OnMouseEnter: TNotifyEvent read FOnMouseEnter write FOnMouseEnter;
|
|
property OnMouseLeave: TNotifyEvent read FOnMouseLeave write FOnMouseLeave;
|
|
property OnParentColorChange: TNotifyEvent read FOnParentColorChanged write FOnParentColorChanged;
|
|
public
|
|
constructor Create(AOwner: TComponent); override;
|
|
property HintWindowClass: THintWindowClass read FHintWindowClass write FHintWindowClass;
|
|
published
|
|
property AboutJVCL: TJVCLAboutInfo read FAboutJVCL write FAboutJVCL stored False;
|
|
private
|
|
FDotNetHighlighting: Boolean;
|
|
protected
|
|
procedure BoundsChanged; reintroduce; virtual;
|
|
procedure CursorChanged; reintroduce; dynamic;
|
|
procedure ShowingChanged; reintroduce; dynamic;
|
|
procedure ShowHintChanged; reintroduce; dynamic;
|
|
{$IFNDEF CLR}
|
|
procedure ControlsListChanging(Control: TControl; Inserting: Boolean); reintroduce; dynamic;
|
|
procedure ControlsListChanged(Control: TControl; Inserting: Boolean); reintroduce; dynamic;
|
|
{$ENDIF !CLR}
|
|
procedure GetDlgCode(var Code: TDlgCodes); virtual;
|
|
procedure FocusSet(PrevWnd: THandle); virtual;
|
|
procedure FocusKilled(NextWnd: THandle); virtual;
|
|
function DoEraseBackground(Canvas: TCanvas; Param: Integer): Boolean; virtual;
|
|
{$IFDEF JVCLThemesEnabledD56}
|
|
private
|
|
function GetParentBackground: Boolean;
|
|
protected
|
|
procedure SetParentBackground(Value: Boolean); virtual;
|
|
property ParentBackground: Boolean read GetParentBackground write SetParentBackground;
|
|
{$ENDIF JVCLThemesEnabledD56}
|
|
published
|
|
property DotNetHighlighting: Boolean read FDotNetHighlighting write FDotNetHighlighting default False;
|
|
end;
|
|
|
|
TJvExDateTimePicker = class(TDateTimePicker, IJvExControl)
|
|
private
|
|
FAboutJVCL: TJVCLAboutInfo;
|
|
FHintColor: TColor;
|
|
FMouseOver: Boolean;
|
|
FHintWindowClass: THintWindowClass;
|
|
FOnMouseEnter: TNotifyEvent;
|
|
FOnMouseLeave: TNotifyEvent;
|
|
FOnParentColorChanged: TNotifyEvent;
|
|
function BaseWndProc(Msg: Integer; WParam: Integer = 0; LParam: Longint = 0): Integer; overload;
|
|
function BaseWndProc(Msg: Integer; WParam: Integer; LParam: TControl): Integer; overload;
|
|
function BaseWndProcEx(Msg: Integer; WParam: Integer; var LParam): Integer;
|
|
protected
|
|
procedure WndProc(var Msg: TMessage); override;
|
|
{$IFNDEF CLR}
|
|
procedure FocusChanged(AControl: TWinControl); dynamic;
|
|
{$ENDIF !CLR}
|
|
procedure VisibleChanged; reintroduce; dynamic;
|
|
procedure EnabledChanged; reintroduce; dynamic;
|
|
procedure TextChanged; reintroduce; virtual;
|
|
procedure ColorChanged; reintroduce; dynamic;
|
|
procedure FontChanged; reintroduce; dynamic;
|
|
procedure ParentFontChanged; reintroduce; dynamic;
|
|
procedure ParentColorChanged; reintroduce; dynamic;
|
|
procedure ParentShowHintChanged; reintroduce; dynamic;
|
|
function WantKey(Key: Integer; Shift: TShiftState; const KeyText: WideString): Boolean; reintroduce; virtual;
|
|
function HintShow(var HintInfo: THintInfo): Boolean; reintroduce; dynamic;
|
|
function HitTest(X, Y: Integer): Boolean; reintroduce; virtual;
|
|
procedure MouseEnter(AControl: TControl); reintroduce; dynamic;
|
|
procedure MouseLeave(AControl: TControl); reintroduce; dynamic;
|
|
{$IFDEF COMPILER5}
|
|
{$IFNDEF HASAUTOSIZE}
|
|
procedure CMSetAutoSize(var Msg: TMessage); message CM_SETAUTOSIZE;
|
|
procedure SetAutoSize(Value: Boolean); virtual;
|
|
{$ENDIF !HASAUTOSIZE}
|
|
{$ENDIF COMPILER5}
|
|
property MouseOver: Boolean read FMouseOver write FMouseOver;
|
|
property HintColor: TColor read FHintColor write FHintColor default clDefault;
|
|
property OnMouseEnter: TNotifyEvent read FOnMouseEnter write FOnMouseEnter;
|
|
property OnMouseLeave: TNotifyEvent read FOnMouseLeave write FOnMouseLeave;
|
|
property OnParentColorChange: TNotifyEvent read FOnParentColorChanged write FOnParentColorChanged;
|
|
public
|
|
constructor Create(AOwner: TComponent); override;
|
|
property HintWindowClass: THintWindowClass read FHintWindowClass write FHintWindowClass;
|
|
published
|
|
property AboutJVCL: TJVCLAboutInfo read FAboutJVCL write FAboutJVCL stored False;
|
|
private
|
|
FDotNetHighlighting: Boolean;
|
|
protected
|
|
procedure BoundsChanged; reintroduce; virtual;
|
|
procedure CursorChanged; reintroduce; dynamic;
|
|
procedure ShowingChanged; reintroduce; dynamic;
|
|
procedure ShowHintChanged; reintroduce; dynamic;
|
|
{$IFNDEF CLR}
|
|
procedure ControlsListChanging(Control: TControl; Inserting: Boolean); reintroduce; dynamic;
|
|
procedure ControlsListChanged(Control: TControl; Inserting: Boolean); reintroduce; dynamic;
|
|
{$ENDIF !CLR}
|
|
procedure GetDlgCode(var Code: TDlgCodes); virtual;
|
|
procedure FocusSet(PrevWnd: THandle); virtual;
|
|
procedure FocusKilled(NextWnd: THandle); virtual;
|
|
function DoEraseBackground(Canvas: TCanvas; Param: Integer): Boolean; virtual;
|
|
{$IFDEF JVCLThemesEnabledD56}
|
|
private
|
|
function GetParentBackground: Boolean;
|
|
protected
|
|
procedure SetParentBackground(Value: Boolean); virtual;
|
|
property ParentBackground: Boolean read GetParentBackground write SetParentBackground;
|
|
{$ENDIF JVCLThemesEnabledD56}
|
|
published
|
|
property DotNetHighlighting: Boolean read FDotNetHighlighting write FDotNetHighlighting default False;
|
|
end;
|
|
|
|
TJvExPageScroller = class(TPageScroller, IJvExControl)
|
|
private
|
|
FAboutJVCL: TJVCLAboutInfo;
|
|
FHintColor: TColor;
|
|
FMouseOver: Boolean;
|
|
FHintWindowClass: THintWindowClass;
|
|
FOnMouseEnter: TNotifyEvent;
|
|
FOnMouseLeave: TNotifyEvent;
|
|
FOnParentColorChanged: TNotifyEvent;
|
|
function BaseWndProc(Msg: Integer; WParam: Integer = 0; LParam: Longint = 0): Integer; overload;
|
|
function BaseWndProc(Msg: Integer; WParam: Integer; LParam: TControl): Integer; overload;
|
|
function BaseWndProcEx(Msg: Integer; WParam: Integer; var LParam): Integer;
|
|
protected
|
|
procedure WndProc(var Msg: TMessage); override;
|
|
{$IFNDEF CLR}
|
|
procedure FocusChanged(AControl: TWinControl); dynamic;
|
|
{$ENDIF !CLR}
|
|
procedure VisibleChanged; reintroduce; dynamic;
|
|
procedure EnabledChanged; reintroduce; dynamic;
|
|
procedure TextChanged; reintroduce; virtual;
|
|
procedure ColorChanged; reintroduce; dynamic;
|
|
procedure FontChanged; reintroduce; dynamic;
|
|
procedure ParentFontChanged; reintroduce; dynamic;
|
|
procedure ParentColorChanged; reintroduce; dynamic;
|
|
procedure ParentShowHintChanged; reintroduce; dynamic;
|
|
function WantKey(Key: Integer; Shift: TShiftState; const KeyText: WideString): Boolean; reintroduce; virtual;
|
|
function HintShow(var HintInfo: THintInfo): Boolean; reintroduce; dynamic;
|
|
function HitTest(X, Y: Integer): Boolean; reintroduce; virtual;
|
|
procedure MouseEnter(AControl: TControl); reintroduce; dynamic;
|
|
procedure MouseLeave(AControl: TControl); reintroduce; dynamic;
|
|
{$IFDEF COMPILER5}
|
|
{$IFNDEF HASAUTOSIZE}
|
|
procedure CMSetAutoSize(var Msg: TMessage); message CM_SETAUTOSIZE;
|
|
procedure SetAutoSize(Value: Boolean); virtual;
|
|
{$ENDIF !HASAUTOSIZE}
|
|
{$ENDIF COMPILER5}
|
|
property MouseOver: Boolean read FMouseOver write FMouseOver;
|
|
property HintColor: TColor read FHintColor write FHintColor default clDefault;
|
|
property OnMouseEnter: TNotifyEvent read FOnMouseEnter write FOnMouseEnter;
|
|
property OnMouseLeave: TNotifyEvent read FOnMouseLeave write FOnMouseLeave;
|
|
property OnParentColorChange: TNotifyEvent read FOnParentColorChanged write FOnParentColorChanged;
|
|
public
|
|
constructor Create(AOwner: TComponent); override;
|
|
property HintWindowClass: THintWindowClass read FHintWindowClass write FHintWindowClass;
|
|
published
|
|
property AboutJVCL: TJVCLAboutInfo read FAboutJVCL write FAboutJVCL stored False;
|
|
private
|
|
FDotNetHighlighting: Boolean;
|
|
protected
|
|
procedure BoundsChanged; reintroduce; virtual;
|
|
procedure CursorChanged; reintroduce; dynamic;
|
|
procedure ShowingChanged; reintroduce; dynamic;
|
|
procedure ShowHintChanged; reintroduce; dynamic;
|
|
{$IFNDEF CLR}
|
|
procedure ControlsListChanging(Control: TControl; Inserting: Boolean); reintroduce; dynamic;
|
|
procedure ControlsListChanged(Control: TControl; Inserting: Boolean); reintroduce; dynamic;
|
|
{$ENDIF !CLR}
|
|
procedure GetDlgCode(var Code: TDlgCodes); virtual;
|
|
procedure FocusSet(PrevWnd: THandle); virtual;
|
|
procedure FocusKilled(NextWnd: THandle); virtual;
|
|
function DoEraseBackground(Canvas: TCanvas; Param: Integer): Boolean; virtual;
|
|
{$IFDEF JVCLThemesEnabledD56}
|
|
private
|
|
function GetParentBackground: Boolean;
|
|
protected
|
|
procedure SetParentBackground(Value: Boolean); virtual;
|
|
property ParentBackground: Boolean read GetParentBackground write SetParentBackground;
|
|
{$ENDIF JVCLThemesEnabledD56}
|
|
published
|
|
property DotNetHighlighting: Boolean read FDotNetHighlighting write FDotNetHighlighting default False;
|
|
end;
|
|
|
|
TJvExProgressBar = class(TProgressBar, IJvExControl)
|
|
private
|
|
FAboutJVCL: TJVCLAboutInfo;
|
|
FHintColor: TColor;
|
|
FMouseOver: Boolean;
|
|
FHintWindowClass: THintWindowClass;
|
|
FOnMouseEnter: TNotifyEvent;
|
|
FOnMouseLeave: TNotifyEvent;
|
|
FOnParentColorChanged: TNotifyEvent;
|
|
function BaseWndProc(Msg: Integer; WParam: Integer = 0; LParam: Longint = 0): Integer; overload;
|
|
function BaseWndProc(Msg: Integer; WParam: Integer; LParam: TControl): Integer; overload;
|
|
function BaseWndProcEx(Msg: Integer; WParam: Integer; var LParam): Integer;
|
|
protected
|
|
procedure WndProc(var Msg: TMessage); override;
|
|
{$IFNDEF CLR}
|
|
procedure FocusChanged(AControl: TWinControl); dynamic;
|
|
{$ENDIF !CLR}
|
|
procedure VisibleChanged; reintroduce; dynamic;
|
|
procedure EnabledChanged; reintroduce; dynamic;
|
|
procedure TextChanged; reintroduce; virtual;
|
|
procedure ColorChanged; reintroduce; dynamic;
|
|
procedure FontChanged; reintroduce; dynamic;
|
|
procedure ParentFontChanged; reintroduce; dynamic;
|
|
procedure ParentColorChanged; reintroduce; dynamic;
|
|
procedure ParentShowHintChanged; reintroduce; dynamic;
|
|
function WantKey(Key: Integer; Shift: TShiftState; const KeyText: WideString): Boolean; reintroduce; virtual;
|
|
function HintShow(var HintInfo: THintInfo): Boolean; reintroduce; dynamic;
|
|
function HitTest(X, Y: Integer): Boolean; reintroduce; virtual;
|
|
procedure MouseEnter(AControl: TControl); reintroduce; dynamic;
|
|
procedure MouseLeave(AControl: TControl); reintroduce; dynamic;
|
|
{$IFDEF COMPILER5}
|
|
{$IFNDEF HASAUTOSIZE}
|
|
procedure CMSetAutoSize(var Msg: TMessage); message CM_SETAUTOSIZE;
|
|
procedure SetAutoSize(Value: Boolean); virtual;
|
|
{$ENDIF !HASAUTOSIZE}
|
|
{$ENDIF COMPILER5}
|
|
property MouseOver: Boolean read FMouseOver write FMouseOver;
|
|
property HintColor: TColor read FHintColor write FHintColor default clDefault;
|
|
property OnMouseEnter: TNotifyEvent read FOnMouseEnter write FOnMouseEnter;
|
|
property OnMouseLeave: TNotifyEvent read FOnMouseLeave write FOnMouseLeave;
|
|
property OnParentColorChange: TNotifyEvent read FOnParentColorChanged write FOnParentColorChanged;
|
|
public
|
|
constructor Create(AOwner: TComponent); override;
|
|
property HintWindowClass: THintWindowClass read FHintWindowClass write FHintWindowClass;
|
|
published
|
|
property AboutJVCL: TJVCLAboutInfo read FAboutJVCL write FAboutJVCL stored False;
|
|
private
|
|
FDotNetHighlighting: Boolean;
|
|
protected
|
|
procedure BoundsChanged; reintroduce; virtual;
|
|
procedure CursorChanged; reintroduce; dynamic;
|
|
procedure ShowingChanged; reintroduce; dynamic;
|
|
procedure ShowHintChanged; reintroduce; dynamic;
|
|
{$IFNDEF CLR}
|
|
procedure ControlsListChanging(Control: TControl; Inserting: Boolean); reintroduce; dynamic;
|
|
procedure ControlsListChanged(Control: TControl; Inserting: Boolean); reintroduce; dynamic;
|
|
{$ENDIF !CLR}
|
|
procedure GetDlgCode(var Code: TDlgCodes); virtual;
|
|
procedure FocusSet(PrevWnd: THandle); virtual;
|
|
procedure FocusKilled(NextWnd: THandle); virtual;
|
|
function DoEraseBackground(Canvas: TCanvas; Param: Integer): Boolean; virtual;
|
|
{$IFDEF JVCLThemesEnabledD56}
|
|
private
|
|
function GetParentBackground: Boolean;
|
|
protected
|
|
procedure SetParentBackground(Value: Boolean); virtual;
|
|
property ParentBackground: Boolean read GetParentBackground write SetParentBackground;
|
|
{$ENDIF JVCLThemesEnabledD56}
|
|
published
|
|
property DotNetHighlighting: Boolean read FDotNetHighlighting write FDotNetHighlighting default False;
|
|
end;
|
|
|
|
TJvExStatusBar = class(TStatusBar, IJvExControl)
|
|
private
|
|
FAboutJVCL: TJVCLAboutInfo;
|
|
FHintColor: TColor;
|
|
FMouseOver: Boolean;
|
|
FHintWindowClass: THintWindowClass;
|
|
FOnMouseEnter: TNotifyEvent;
|
|
FOnMouseLeave: TNotifyEvent;
|
|
FOnParentColorChanged: TNotifyEvent;
|
|
function BaseWndProc(Msg: Integer; WParam: Integer = 0; LParam: Longint = 0): Integer; overload;
|
|
function BaseWndProc(Msg: Integer; WParam: Integer; LParam: TControl): Integer; overload;
|
|
function BaseWndProcEx(Msg: Integer; WParam: Integer; var LParam): Integer;
|
|
protected
|
|
procedure WndProc(var Msg: TMessage); override;
|
|
{$IFNDEF CLR}
|
|
procedure FocusChanged(AControl: TWinControl); dynamic;
|
|
{$ENDIF !CLR}
|
|
procedure VisibleChanged; reintroduce; dynamic;
|
|
procedure EnabledChanged; reintroduce; dynamic;
|
|
procedure TextChanged; reintroduce; virtual;
|
|
procedure ColorChanged; reintroduce; dynamic;
|
|
procedure FontChanged; reintroduce; dynamic;
|
|
procedure ParentFontChanged; reintroduce; dynamic;
|
|
procedure ParentColorChanged; reintroduce; dynamic;
|
|
procedure ParentShowHintChanged; reintroduce; dynamic;
|
|
function WantKey(Key: Integer; Shift: TShiftState; const KeyText: WideString): Boolean; reintroduce; virtual;
|
|
function HintShow(var HintInfo: THintInfo): Boolean; reintroduce; dynamic;
|
|
function HitTest(X, Y: Integer): Boolean; reintroduce; virtual;
|
|
procedure MouseEnter(AControl: TControl); reintroduce; dynamic;
|
|
procedure MouseLeave(AControl: TControl); reintroduce; dynamic;
|
|
{$IFDEF COMPILER5}
|
|
{$IFNDEF HASAUTOSIZE}
|
|
procedure CMSetAutoSize(var Msg: TMessage); message CM_SETAUTOSIZE;
|
|
procedure SetAutoSize(Value: Boolean); virtual;
|
|
{$ENDIF !HASAUTOSIZE}
|
|
{$ENDIF COMPILER5}
|
|
property MouseOver: Boolean read FMouseOver write FMouseOver;
|
|
property HintColor: TColor read FHintColor write FHintColor default clDefault;
|
|
property OnMouseEnter: TNotifyEvent read FOnMouseEnter write FOnMouseEnter;
|
|
property OnMouseLeave: TNotifyEvent read FOnMouseLeave write FOnMouseLeave;
|
|
property OnParentColorChange: TNotifyEvent read FOnParentColorChanged write FOnParentColorChanged;
|
|
public
|
|
constructor Create(AOwner: TComponent); override;
|
|
property HintWindowClass: THintWindowClass read FHintWindowClass write FHintWindowClass;
|
|
published
|
|
property AboutJVCL: TJVCLAboutInfo read FAboutJVCL write FAboutJVCL stored False;
|
|
private
|
|
FDotNetHighlighting: Boolean;
|
|
protected
|
|
procedure BoundsChanged; reintroduce; virtual;
|
|
procedure CursorChanged; reintroduce; dynamic;
|
|
procedure ShowingChanged; reintroduce; dynamic;
|
|
procedure ShowHintChanged; reintroduce; dynamic;
|
|
{$IFNDEF CLR}
|
|
procedure ControlsListChanging(Control: TControl; Inserting: Boolean); reintroduce; dynamic;
|
|
procedure ControlsListChanged(Control: TControl; Inserting: Boolean); reintroduce; dynamic;
|
|
{$ENDIF !CLR}
|
|
procedure GetDlgCode(var Code: TDlgCodes); virtual;
|
|
procedure FocusSet(PrevWnd: THandle); virtual;
|
|
procedure FocusKilled(NextWnd: THandle); virtual;
|
|
function DoEraseBackground(Canvas: TCanvas; Param: Integer): Boolean; virtual;
|
|
{$IFDEF JVCLThemesEnabledD56}
|
|
private
|
|
function GetParentBackground: Boolean;
|
|
protected
|
|
procedure SetParentBackground(Value: Boolean); virtual;
|
|
property ParentBackground: Boolean read GetParentBackground write SetParentBackground;
|
|
{$ENDIF JVCLThemesEnabledD56}
|
|
published
|
|
property DotNetHighlighting: Boolean read FDotNetHighlighting write FDotNetHighlighting default False;
|
|
end;
|
|
|
|
TJvExTabSheet = class(TTabSheet, IJvExControl)
|
|
private
|
|
FAboutJVCL: TJVCLAboutInfo;
|
|
FHintColor: TColor;
|
|
FMouseOver: Boolean;
|
|
FHintWindowClass: THintWindowClass;
|
|
FOnMouseEnter: TNotifyEvent;
|
|
FOnMouseLeave: TNotifyEvent;
|
|
FOnParentColorChanged: TNotifyEvent;
|
|
function BaseWndProc(Msg: Integer; WParam: Integer = 0; LParam: Longint = 0): Integer; overload;
|
|
function BaseWndProc(Msg: Integer; WParam: Integer; LParam: TControl): Integer; overload;
|
|
function BaseWndProcEx(Msg: Integer; WParam: Integer; var LParam): Integer;
|
|
protected
|
|
procedure WndProc(var Msg: TMessage); override;
|
|
{$IFNDEF CLR}
|
|
procedure FocusChanged(AControl: TWinControl); dynamic;
|
|
{$ENDIF !CLR}
|
|
procedure VisibleChanged; reintroduce; dynamic;
|
|
procedure EnabledChanged; reintroduce; dynamic;
|
|
procedure TextChanged; reintroduce; virtual;
|
|
procedure ColorChanged; reintroduce; dynamic;
|
|
procedure FontChanged; reintroduce; dynamic;
|
|
procedure ParentFontChanged; reintroduce; dynamic;
|
|
procedure ParentColorChanged; reintroduce; dynamic;
|
|
procedure ParentShowHintChanged; reintroduce; dynamic;
|
|
function WantKey(Key: Integer; Shift: TShiftState; const KeyText: WideString): Boolean; reintroduce; virtual;
|
|
function HintShow(var HintInfo: THintInfo): Boolean; reintroduce; dynamic;
|
|
function HitTest(X, Y: Integer): Boolean; reintroduce; virtual;
|
|
procedure MouseEnter(AControl: TControl); reintroduce; dynamic;
|
|
procedure MouseLeave(AControl: TControl); reintroduce; dynamic;
|
|
{$IFDEF COMPILER5}
|
|
{$IFNDEF HASAUTOSIZE}
|
|
procedure CMSetAutoSize(var Msg: TMessage); message CM_SETAUTOSIZE;
|
|
procedure SetAutoSize(Value: Boolean); virtual;
|
|
{$ENDIF !HASAUTOSIZE}
|
|
{$ENDIF COMPILER5}
|
|
property MouseOver: Boolean read FMouseOver write FMouseOver;
|
|
property HintColor: TColor read FHintColor write FHintColor default clDefault;
|
|
property OnMouseEnter: TNotifyEvent read FOnMouseEnter write FOnMouseEnter;
|
|
property OnMouseLeave: TNotifyEvent read FOnMouseLeave write FOnMouseLeave;
|
|
property OnParentColorChange: TNotifyEvent read FOnParentColorChanged write FOnParentColorChanged;
|
|
public
|
|
constructor Create(AOwner: TComponent); override;
|
|
property HintWindowClass: THintWindowClass read FHintWindowClass write FHintWindowClass;
|
|
published
|
|
property AboutJVCL: TJVCLAboutInfo read FAboutJVCL write FAboutJVCL stored False;
|
|
private
|
|
FDotNetHighlighting: Boolean;
|
|
protected
|
|
procedure BoundsChanged; reintroduce; virtual;
|
|
procedure CursorChanged; reintroduce; dynamic;
|
|
procedure ShowingChanged; reintroduce; dynamic;
|
|
procedure ShowHintChanged; reintroduce; dynamic;
|
|
{$IFNDEF CLR}
|
|
procedure ControlsListChanging(Control: TControl; Inserting: Boolean); reintroduce; dynamic;
|
|
procedure ControlsListChanged(Control: TControl; Inserting: Boolean); reintroduce; dynamic;
|
|
{$ENDIF !CLR}
|
|
procedure GetDlgCode(var Code: TDlgCodes); virtual;
|
|
procedure FocusSet(PrevWnd: THandle); virtual;
|
|
procedure FocusKilled(NextWnd: THandle); virtual;
|
|
function DoEraseBackground(Canvas: TCanvas; Param: Integer): Boolean; virtual;
|
|
{$IFDEF JVCLThemesEnabledD56}
|
|
private
|
|
function GetParentBackground: Boolean;
|
|
protected
|
|
procedure SetParentBackground(Value: Boolean); virtual;
|
|
property ParentBackground: Boolean read GetParentBackground write SetParentBackground;
|
|
{$ENDIF JVCLThemesEnabledD56}
|
|
published
|
|
property DotNetHighlighting: Boolean read FDotNetHighlighting write FDotNetHighlighting default False;
|
|
end;
|
|
|
|
TJvExToolBar = class(TToolBar, IJvExControl)
|
|
private
|
|
FAboutJVCL: TJVCLAboutInfo;
|
|
FHintColor: TColor;
|
|
FMouseOver: Boolean;
|
|
FHintWindowClass: THintWindowClass;
|
|
FOnMouseEnter: TNotifyEvent;
|
|
FOnMouseLeave: TNotifyEvent;
|
|
FOnParentColorChanged: TNotifyEvent;
|
|
function BaseWndProc(Msg: Integer; WParam: Integer = 0; LParam: Longint = 0): Integer; overload;
|
|
function BaseWndProc(Msg: Integer; WParam: Integer; LParam: TControl): Integer; overload;
|
|
function BaseWndProcEx(Msg: Integer; WParam: Integer; var LParam): Integer;
|
|
protected
|
|
procedure WndProc(var Msg: TMessage); override;
|
|
{$IFNDEF CLR}
|
|
procedure FocusChanged(AControl: TWinControl); dynamic;
|
|
{$ENDIF !CLR}
|
|
procedure VisibleChanged; reintroduce; dynamic;
|
|
procedure EnabledChanged; reintroduce; dynamic;
|
|
procedure TextChanged; reintroduce; virtual;
|
|
procedure ColorChanged; reintroduce; dynamic;
|
|
procedure FontChanged; reintroduce; dynamic;
|
|
procedure ParentFontChanged; reintroduce; dynamic;
|
|
procedure ParentColorChanged; reintroduce; dynamic;
|
|
procedure ParentShowHintChanged; reintroduce; dynamic;
|
|
function WantKey(Key: Integer; Shift: TShiftState; const KeyText: WideString): Boolean; reintroduce; virtual;
|
|
function HintShow(var HintInfo: THintInfo): Boolean; reintroduce; dynamic;
|
|
function HitTest(X, Y: Integer): Boolean; reintroduce; virtual;
|
|
procedure MouseEnter(AControl: TControl); reintroduce; dynamic;
|
|
procedure MouseLeave(AControl: TControl); reintroduce; dynamic;
|
|
{$IFDEF COMPILER5}
|
|
{$IFNDEF HASAUTOSIZE}
|
|
procedure CMSetAutoSize(var Msg: TMessage); message CM_SETAUTOSIZE;
|
|
procedure SetAutoSize(Value: Boolean); virtual;
|
|
{$ENDIF !HASAUTOSIZE}
|
|
{$ENDIF COMPILER5}
|
|
property MouseOver: Boolean read FMouseOver write FMouseOver;
|
|
property HintColor: TColor read FHintColor write FHintColor default clDefault;
|
|
property OnMouseEnter: TNotifyEvent read FOnMouseEnter write FOnMouseEnter;
|
|
property OnMouseLeave: TNotifyEvent read FOnMouseLeave write FOnMouseLeave;
|
|
property OnParentColorChange: TNotifyEvent read FOnParentColorChanged write FOnParentColorChanged;
|
|
public
|
|
constructor Create(AOwner: TComponent); override;
|
|
property HintWindowClass: THintWindowClass read FHintWindowClass write FHintWindowClass;
|
|
published
|
|
property AboutJVCL: TJVCLAboutInfo read FAboutJVCL write FAboutJVCL stored False;
|
|
private
|
|
FDotNetHighlighting: Boolean;
|
|
protected
|
|
procedure BoundsChanged; reintroduce; virtual;
|
|
procedure CursorChanged; reintroduce; dynamic;
|
|
procedure ShowingChanged; reintroduce; dynamic;
|
|
procedure ShowHintChanged; reintroduce; dynamic;
|
|
{$IFNDEF CLR}
|
|
procedure ControlsListChanging(Control: TControl; Inserting: Boolean); reintroduce; dynamic;
|
|
procedure ControlsListChanged(Control: TControl; Inserting: Boolean); reintroduce; dynamic;
|
|
{$ENDIF !CLR}
|
|
procedure GetDlgCode(var Code: TDlgCodes); virtual;
|
|
procedure FocusSet(PrevWnd: THandle); virtual;
|
|
procedure FocusKilled(NextWnd: THandle); virtual;
|
|
function DoEraseBackground(Canvas: TCanvas; Param: Integer): Boolean; virtual;
|
|
{$IFDEF JVCLThemesEnabledD56}
|
|
private
|
|
function GetParentBackground: Boolean;
|
|
protected
|
|
procedure SetParentBackground(Value: Boolean); virtual;
|
|
property ParentBackground: Boolean read GetParentBackground write SetParentBackground;
|
|
{$ENDIF JVCLThemesEnabledD56}
|
|
published
|
|
property DotNetHighlighting: Boolean read FDotNetHighlighting write FDotNetHighlighting default False;
|
|
end;
|
|
|
|
TJvExToolButton = class(TToolButton, IJvExControl)
|
|
private
|
|
FAboutJVCL: TJVCLAboutInfo;
|
|
FHintColor: TColor;
|
|
FMouseOver: Boolean;
|
|
FHintWindowClass: THintWindowClass;
|
|
FOnMouseEnter: TNotifyEvent;
|
|
FOnMouseLeave: TNotifyEvent;
|
|
FOnParentColorChanged: TNotifyEvent;
|
|
function BaseWndProc(Msg: Integer; WParam: Integer = 0; LParam: Longint = 0): Integer; overload;
|
|
function BaseWndProc(Msg: Integer; WParam: Integer; LParam: TControl): Integer; overload;
|
|
function BaseWndProcEx(Msg: Integer; WParam: Integer; var LParam): Integer;
|
|
protected
|
|
procedure WndProc(var Msg: TMessage); override;
|
|
{$IFNDEF CLR}
|
|
procedure FocusChanged(AControl: TWinControl); dynamic;
|
|
{$ENDIF !CLR}
|
|
procedure VisibleChanged; reintroduce; dynamic;
|
|
procedure EnabledChanged; reintroduce; dynamic;
|
|
procedure TextChanged; reintroduce; virtual;
|
|
procedure ColorChanged; reintroduce; dynamic;
|
|
procedure FontChanged; reintroduce; dynamic;
|
|
procedure ParentFontChanged; reintroduce; dynamic;
|
|
procedure ParentColorChanged; reintroduce; dynamic;
|
|
procedure ParentShowHintChanged; reintroduce; dynamic;
|
|
function WantKey(Key: Integer; Shift: TShiftState; const KeyText: WideString): Boolean; reintroduce; virtual;
|
|
function HintShow(var HintInfo: THintInfo): Boolean; reintroduce; dynamic;
|
|
function HitTest(X, Y: Integer): Boolean; reintroduce; virtual;
|
|
procedure MouseEnter(AControl: TControl); reintroduce; dynamic;
|
|
procedure MouseLeave(AControl: TControl); reintroduce; dynamic;
|
|
{$IFDEF COMPILER5}
|
|
{$IFNDEF HASAUTOSIZE}
|
|
procedure CMSetAutoSize(var Msg: TMessage); message CM_SETAUTOSIZE;
|
|
procedure SetAutoSize(Value: Boolean); virtual;
|
|
{$ENDIF !HASAUTOSIZE}
|
|
{$ENDIF COMPILER5}
|
|
property MouseOver: Boolean read FMouseOver write FMouseOver;
|
|
property HintColor: TColor read FHintColor write FHintColor default clDefault;
|
|
property OnMouseEnter: TNotifyEvent read FOnMouseEnter write FOnMouseEnter;
|
|
property OnMouseLeave: TNotifyEvent read FOnMouseLeave write FOnMouseLeave;
|
|
property OnParentColorChange: TNotifyEvent read FOnParentColorChanged write FOnParentColorChanged;
|
|
public
|
|
constructor Create(AOwner: TComponent); override;
|
|
property HintWindowClass: THintWindowClass read FHintWindowClass write FHintWindowClass;
|
|
published
|
|
property AboutJVCL: TJVCLAboutInfo read FAboutJVCL write FAboutJVCL stored False;
|
|
end;
|
|
|
|
{$IFDEF UNITVERSIONING}
|
|
const
|
|
UnitVersioning: TUnitVersionInfo = (
|
|
RCSfile: '$URL: https://jvcl.svn.sourceforge.net/svnroot/jvcl/branches/JVCL3_36_PREPARATION/run/JvExComCtrls.pas $';
|
|
Revision: '$Revision: 11950 $';
|
|
Date: '$Date: 2008-10-07 19:11:29 +0200 (mar., 07 oct. 2008) $';
|
|
LogPath: 'JVCL\run'
|
|
);
|
|
{$ENDIF UNITVERSIONING}
|
|
|
|
implementation
|
|
|
|
{$IFDEF COMPILER6_UP}
|
|
|
|
constructor TJvExCustomComboBoxEx.Create(AOwner: TComponent);
|
|
begin
|
|
inherited Create(AOwner);
|
|
FHintColor := clDefault;
|
|
end;
|
|
|
|
function TJvExCustomComboBoxEx.BaseWndProc(Msg: Integer; WParam: Integer = 0; LParam: Longint = 0): Integer;
|
|
var
|
|
Mesg: TMessage;
|
|
begin
|
|
Mesg := CreateWMMessage(Msg, WParam, LParam);
|
|
inherited WndProc(Mesg);
|
|
Result := Mesg.Result;
|
|
end;
|
|
|
|
function TJvExCustomComboBoxEx.BaseWndProc(Msg: Integer; WParam: Integer; LParam: TControl): Integer;
|
|
var
|
|
Mesg: TMessage;
|
|
begin
|
|
Mesg := CreateWMMessage(Msg, WParam, LParam);
|
|
inherited WndProc(Mesg);
|
|
Result := Mesg.Result;
|
|
end;
|
|
|
|
function TJvExCustomComboBoxEx.BaseWndProcEx(Msg: Integer; WParam: Integer; var LParam): Integer;
|
|
var
|
|
Mesg: TStructPtrMessage;
|
|
begin
|
|
Mesg := TStructPtrMessage.Create(Msg, WParam, LParam);
|
|
try
|
|
inherited WndProc(Mesg.Msg);
|
|
finally
|
|
Result := Mesg.Msg.Result;
|
|
Mesg.Free;
|
|
end;
|
|
end;
|
|
|
|
procedure TJvExCustomComboBoxEx.VisibleChanged;
|
|
begin
|
|
BaseWndProc(CM_VISIBLECHANGED);
|
|
end;
|
|
|
|
procedure TJvExCustomComboBoxEx.EnabledChanged;
|
|
begin
|
|
BaseWndProc(CM_ENABLEDCHANGED);
|
|
end;
|
|
|
|
procedure TJvExCustomComboBoxEx.TextChanged;
|
|
begin
|
|
BaseWndProc(CM_TEXTCHANGED);
|
|
end;
|
|
|
|
procedure TJvExCustomComboBoxEx.FontChanged;
|
|
begin
|
|
BaseWndProc(CM_FONTCHANGED);
|
|
end;
|
|
|
|
procedure TJvExCustomComboBoxEx.ColorChanged;
|
|
begin
|
|
BaseWndProc(CM_COLORCHANGED);
|
|
end;
|
|
|
|
procedure TJvExCustomComboBoxEx.ParentFontChanged;
|
|
begin
|
|
BaseWndProc(CM_PARENTFONTCHANGED);
|
|
end;
|
|
|
|
procedure TJvExCustomComboBoxEx.ParentColorChanged;
|
|
begin
|
|
BaseWndProc(CM_PARENTCOLORCHANGED);
|
|
if Assigned(OnParentColorChange) then
|
|
OnParentColorChange(Self);
|
|
end;
|
|
|
|
procedure TJvExCustomComboBoxEx.ParentShowHintChanged;
|
|
begin
|
|
BaseWndProc(CM_PARENTSHOWHINTCHANGED);
|
|
end;
|
|
|
|
function TJvExCustomComboBoxEx.WantKey(Key: Integer; Shift: TShiftState; const KeyText: WideString): Boolean;
|
|
begin
|
|
Result := BaseWndProc(CM_DIALOGCHAR, Word(Key), ShiftStateToKeyData(Shift)) <> 0;
|
|
end;
|
|
|
|
function TJvExCustomComboBoxEx.HitTest(X, Y: Integer): Boolean;
|
|
begin
|
|
Result := BaseWndProc(CM_HITTEST, 0, SmallPointToLong(PointToSmallPoint(Point(X, Y)))) <> 0;
|
|
end;
|
|
|
|
function TJvExCustomComboBoxEx.HintShow(var HintInfo: THintInfo): Boolean;
|
|
begin
|
|
GetHintColor(HintInfo, Self, FHintColor);
|
|
if FHintWindowClass <> nil then
|
|
HintInfo.HintWindowClass := FHintWindowClass;
|
|
Result := BaseWndProcEx(CM_HINTSHOW, 0, HintInfo) <> 0;
|
|
end;
|
|
|
|
procedure TJvExCustomComboBoxEx.MouseEnter(AControl: TControl);
|
|
begin
|
|
FMouseOver := True;
|
|
if Assigned(FOnMouseEnter) then
|
|
FOnMouseEnter(Self);
|
|
BaseWndProc(CM_MOUSEENTER, 0, AControl);
|
|
end;
|
|
|
|
procedure TJvExCustomComboBoxEx.MouseLeave(AControl: TControl);
|
|
begin
|
|
FMouseOver := False;
|
|
BaseWndProc(CM_MOUSELEAVE, 0, AControl);
|
|
if Assigned(FOnMouseLeave) then
|
|
FOnMouseLeave(Self);
|
|
end;
|
|
|
|
{$IFNDEF CLR}
|
|
procedure TJvExCustomComboBoxEx.FocusChanged(AControl: TWinControl);
|
|
begin
|
|
BaseWndProc(CM_FOCUSCHANGED, 0, AControl);
|
|
end;
|
|
{$ENDIF !CLR}
|
|
|
|
{$IFDEF COMPILER5}
|
|
{$IFNDEF HASAUTOSIZE}
|
|
|
|
procedure TJvExCustomComboBoxEx.CMSetAutoSize(var Msg: TMessage);
|
|
begin
|
|
SetAutoSize(Msg.WParam <> 0);
|
|
end;
|
|
|
|
procedure TJvExCustomComboBoxEx.SetAutoSize(Value: Boolean);
|
|
begin
|
|
TOpenControl_SetAutoSize(Self, Value);
|
|
end;
|
|
|
|
{$ENDIF !HASAUTOSIZE}
|
|
{$ENDIF COMPILER5}
|
|
|
|
procedure TJvExCustomComboBoxEx.BoundsChanged;
|
|
begin
|
|
end;
|
|
|
|
procedure TJvExCustomComboBoxEx.CursorChanged;
|
|
begin
|
|
BaseWndProc(CM_CURSORCHANGED);
|
|
end;
|
|
|
|
procedure TJvExCustomComboBoxEx.ShowingChanged;
|
|
begin
|
|
BaseWndProc(CM_SHOWINGCHANGED);
|
|
end;
|
|
|
|
procedure TJvExCustomComboBoxEx.ShowHintChanged;
|
|
begin
|
|
BaseWndProc(CM_SHOWHINTCHANGED);
|
|
end;
|
|
|
|
{$IFNDEF CLR}
|
|
{ VCL sends CM_CONTROLLISTCHANGE and CM_CONTROLCHANGE in a different order than
|
|
the CLX methods are used. So we must correct it by evaluating "Inserting". }
|
|
procedure TJvExCustomComboBoxEx.ControlsListChanging(Control: TControl; Inserting: Boolean);
|
|
begin
|
|
if Inserting then
|
|
BaseWndProc(CM_CONTROLLISTCHANGE, Integer(Control), Integer(Inserting))
|
|
else
|
|
BaseWndProc(CM_CONTROLCHANGE, Integer(Control), Integer(Inserting));
|
|
end;
|
|
|
|
procedure TJvExCustomComboBoxEx.ControlsListChanged(Control: TControl; Inserting: Boolean);
|
|
begin
|
|
if not Inserting then
|
|
BaseWndProc(CM_CONTROLLISTCHANGE, Integer(Control), Integer(Inserting))
|
|
else
|
|
BaseWndProc(CM_CONTROLCHANGE, Integer(Control), Integer(Inserting));
|
|
end;
|
|
{$ENDIF !CLR}
|
|
|
|
procedure TJvExCustomComboBoxEx.GetDlgCode(var Code: TDlgCodes);
|
|
begin
|
|
end;
|
|
|
|
procedure TJvExCustomComboBoxEx.FocusSet(PrevWnd: THandle);
|
|
begin
|
|
BaseWndProc(WM_SETFOCUS, Integer(PrevWnd), 0);
|
|
end;
|
|
|
|
procedure TJvExCustomComboBoxEx.FocusKilled(NextWnd: THandle);
|
|
begin
|
|
BaseWndProc(WM_KILLFOCUS, Integer(NextWnd), 0);
|
|
end;
|
|
|
|
function TJvExCustomComboBoxEx.DoEraseBackground(Canvas: TCanvas; Param: Integer): Boolean;
|
|
begin
|
|
Result := BaseWndProc(WM_ERASEBKGND, Canvas.Handle, Param) <> 0;
|
|
end;
|
|
|
|
{$IFDEF JVCLThemesEnabledD56}
|
|
function TJvExCustomComboBoxEx.GetParentBackground: Boolean;
|
|
begin
|
|
Result := JvThemes.GetParentBackground(Self);
|
|
end;
|
|
|
|
procedure TJvExCustomComboBoxEx.SetParentBackground(Value: Boolean);
|
|
begin
|
|
JvThemes.SetParentBackground(Self, Value);
|
|
end;
|
|
{$ENDIF JVCLThemesEnabledD56}
|
|
|
|
procedure TJvExCustomComboBoxEx.WndProc(var Msg: TMessage);
|
|
var
|
|
IdSaveDC: Integer;
|
|
DlgCodes: TDlgCodes;
|
|
Canvas: TCanvas;
|
|
{$IFDEF CLR}
|
|
AHintInfo: THintInfo;
|
|
{$ENDIF CLR}
|
|
begin
|
|
if not DispatchIsDesignMsg(Self, Msg) then
|
|
begin
|
|
case Msg.Msg of
|
|
CM_DENYSUBCLASSING:
|
|
{$IFNDEF CLR}
|
|
Msg.Result := Ord(GetInterfaceEntry(IJvDenySubClassing) <> nil);
|
|
{$ELSE}
|
|
Msg.Result := Integer(Supports(Self, IJvDenySubClassing));
|
|
{$ENDIF !CLR}
|
|
CM_DIALOGCHAR:
|
|
with TCMDialogChar{$IFDEF CLR}.Create{$ENDIF}(Msg) do
|
|
Result := Ord(WantKey(CharCode, KeyDataToShiftState(KeyData), WideChar(CharCode)));
|
|
CM_HINTSHOW:
|
|
{$IFNDEF CLR}
|
|
with TCMHintShow(Msg) do
|
|
Result := Integer(HintShow(HintInfo^));
|
|
{$ELSE}
|
|
with TCMHintShow.Create(Msg) do
|
|
begin
|
|
AHintInfo := HintInfo;
|
|
Result := Integer(HintShow(AHintInfo));
|
|
HintInfo := AHintInfo;
|
|
end;
|
|
{$ENDIF !CLR}
|
|
CM_HITTEST:
|
|
with TCMHitTest{$IFDEF CLR}.Create{$ENDIF}(Msg) do
|
|
Result := Integer(HitTest(XPos, YPos));
|
|
CM_MOUSEENTER:
|
|
MouseEnter({$IFDEF CLR}nil{$ELSE}TControl(Msg.LParam){$ENDIF});
|
|
CM_MOUSELEAVE:
|
|
MouseLeave({$IFDEF CLR}nil{$ELSE}TControl(Msg.LParam){$ENDIF});
|
|
CM_VISIBLECHANGED:
|
|
VisibleChanged;
|
|
CM_ENABLEDCHANGED:
|
|
EnabledChanged;
|
|
CM_TEXTCHANGED:
|
|
TextChanged;
|
|
CM_FONTCHANGED:
|
|
FontChanged;
|
|
CM_COLORCHANGED:
|
|
ColorChanged;
|
|
{$IFNDEF CLR}
|
|
CM_FOCUSCHANGED:
|
|
FocusChanged(TWinControl(Msg.LParam));
|
|
{$ENDIF !CLR}
|
|
CM_PARENTFONTCHANGED:
|
|
ParentFontChanged;
|
|
CM_PARENTCOLORCHANGED:
|
|
ParentColorChanged;
|
|
CM_PARENTSHOWHINTCHANGED:
|
|
ParentShowHintChanged;
|
|
CM_CURSORCHANGED:
|
|
CursorChanged;
|
|
CM_SHOWINGCHANGED:
|
|
ShowingChanged;
|
|
CM_SHOWHINTCHANGED:
|
|
ShowHintChanged;
|
|
{$IFNDEF CLR}
|
|
CM_CONTROLLISTCHANGE:
|
|
if Msg.LParam <> 0 then
|
|
ControlsListChanging(TControl(Msg.WParam), True)
|
|
else
|
|
ControlsListChanged(TControl(Msg.WParam), False);
|
|
CM_CONTROLCHANGE:
|
|
if Msg.LParam = 0 then
|
|
ControlsListChanging(TControl(Msg.WParam), False)
|
|
else
|
|
ControlsListChanged(TControl(Msg.WParam), True);
|
|
{$ENDIF !CLR}
|
|
WM_SETFOCUS:
|
|
FocusSet(THandle(Msg.WParam));
|
|
WM_KILLFOCUS:
|
|
FocusKilled(THandle(Msg.WParam));
|
|
WM_SIZE, WM_MOVE:
|
|
begin
|
|
inherited WndProc(Msg);
|
|
BoundsChanged;
|
|
end;
|
|
WM_ERASEBKGND:
|
|
if Msg.WParam <> 0 then
|
|
begin
|
|
IdSaveDC := SaveDC(HDC(Msg.WParam)); // protect DC against Stock-Objects from Canvas
|
|
Canvas := TCanvas.Create;
|
|
try
|
|
Canvas.Handle := HDC(Msg.WParam);
|
|
Msg.Result := Ord(DoEraseBackground(Canvas, Msg.LParam));
|
|
finally
|
|
Canvas.Handle := 0;
|
|
Canvas.Free;
|
|
RestoreDC(HDC(Msg.WParam), IdSaveDC);
|
|
end;
|
|
end
|
|
else
|
|
inherited WndProc(Msg);
|
|
{$IFNDEF DELPHI2007_UP}
|
|
WM_PRINTCLIENT, WM_PRINT: // VCL bug fix
|
|
begin
|
|
IdSaveDC := SaveDC(HDC(Msg.WParam)); // protect DC against changes
|
|
try
|
|
inherited WndProc(Msg);
|
|
finally
|
|
RestoreDC(HDC(Msg.WParam), IdSaveDC);
|
|
end;
|
|
end;
|
|
{$ENDIF ~DELPHI2007_UP}
|
|
WM_GETDLGCODE:
|
|
begin
|
|
inherited WndProc(Msg);
|
|
DlgCodes := [dcNative] + DlgcToDlgCodes(Msg.Result);
|
|
GetDlgCode(DlgCodes);
|
|
if not (dcNative in DlgCodes) then
|
|
Msg.Result := DlgCodesToDlgc(DlgCodes);
|
|
end;
|
|
else
|
|
inherited WndProc(Msg);
|
|
end;
|
|
case Msg.Msg of // precheck message to prevent access violations on released controls
|
|
CM_MOUSEENTER, CM_MOUSELEAVE, WM_KILLFOCUS, WM_SETFOCUS, WM_NCPAINT:
|
|
if DotNetHighlighting then
|
|
HandleDotNetHighlighting(Self, Msg, MouseOver, Color);
|
|
end;
|
|
end;
|
|
end;
|
|
|
|
//============================================================================
|
|
|
|
constructor TJvExCustomStatusBar.Create(AOwner: TComponent);
|
|
begin
|
|
inherited Create(AOwner);
|
|
FHintColor := clDefault;
|
|
end;
|
|
|
|
function TJvExCustomStatusBar.BaseWndProc(Msg: Integer; WParam: Integer = 0; LParam: Longint = 0): Integer;
|
|
var
|
|
Mesg: TMessage;
|
|
begin
|
|
Mesg := CreateWMMessage(Msg, WParam, LParam);
|
|
inherited WndProc(Mesg);
|
|
Result := Mesg.Result;
|
|
end;
|
|
|
|
function TJvExCustomStatusBar.BaseWndProc(Msg: Integer; WParam: Integer; LParam: TControl): Integer;
|
|
var
|
|
Mesg: TMessage;
|
|
begin
|
|
Mesg := CreateWMMessage(Msg, WParam, LParam);
|
|
inherited WndProc(Mesg);
|
|
Result := Mesg.Result;
|
|
end;
|
|
|
|
function TJvExCustomStatusBar.BaseWndProcEx(Msg: Integer; WParam: Integer; var LParam): Integer;
|
|
var
|
|
Mesg: TStructPtrMessage;
|
|
begin
|
|
Mesg := TStructPtrMessage.Create(Msg, WParam, LParam);
|
|
try
|
|
inherited WndProc(Mesg.Msg);
|
|
finally
|
|
Result := Mesg.Msg.Result;
|
|
Mesg.Free;
|
|
end;
|
|
end;
|
|
|
|
procedure TJvExCustomStatusBar.VisibleChanged;
|
|
begin
|
|
BaseWndProc(CM_VISIBLECHANGED);
|
|
end;
|
|
|
|
procedure TJvExCustomStatusBar.EnabledChanged;
|
|
begin
|
|
BaseWndProc(CM_ENABLEDCHANGED);
|
|
end;
|
|
|
|
procedure TJvExCustomStatusBar.TextChanged;
|
|
begin
|
|
BaseWndProc(CM_TEXTCHANGED);
|
|
end;
|
|
|
|
procedure TJvExCustomStatusBar.FontChanged;
|
|
begin
|
|
BaseWndProc(CM_FONTCHANGED);
|
|
end;
|
|
|
|
procedure TJvExCustomStatusBar.ColorChanged;
|
|
begin
|
|
BaseWndProc(CM_COLORCHANGED);
|
|
end;
|
|
|
|
procedure TJvExCustomStatusBar.ParentFontChanged;
|
|
begin
|
|
BaseWndProc(CM_PARENTFONTCHANGED);
|
|
end;
|
|
|
|
procedure TJvExCustomStatusBar.ParentColorChanged;
|
|
begin
|
|
BaseWndProc(CM_PARENTCOLORCHANGED);
|
|
if Assigned(OnParentColorChange) then
|
|
OnParentColorChange(Self);
|
|
end;
|
|
|
|
procedure TJvExCustomStatusBar.ParentShowHintChanged;
|
|
begin
|
|
BaseWndProc(CM_PARENTSHOWHINTCHANGED);
|
|
end;
|
|
|
|
function TJvExCustomStatusBar.WantKey(Key: Integer; Shift: TShiftState; const KeyText: WideString): Boolean;
|
|
begin
|
|
Result := BaseWndProc(CM_DIALOGCHAR, Word(Key), ShiftStateToKeyData(Shift)) <> 0;
|
|
end;
|
|
|
|
function TJvExCustomStatusBar.HitTest(X, Y: Integer): Boolean;
|
|
begin
|
|
Result := BaseWndProc(CM_HITTEST, 0, SmallPointToLong(PointToSmallPoint(Point(X, Y)))) <> 0;
|
|
end;
|
|
|
|
function TJvExCustomStatusBar.HintShow(var HintInfo: THintInfo): Boolean;
|
|
begin
|
|
GetHintColor(HintInfo, Self, FHintColor);
|
|
if FHintWindowClass <> nil then
|
|
HintInfo.HintWindowClass := FHintWindowClass;
|
|
Result := BaseWndProcEx(CM_HINTSHOW, 0, HintInfo) <> 0;
|
|
end;
|
|
|
|
procedure TJvExCustomStatusBar.MouseEnter(AControl: TControl);
|
|
begin
|
|
FMouseOver := True;
|
|
if Assigned(FOnMouseEnter) then
|
|
FOnMouseEnter(Self);
|
|
BaseWndProc(CM_MOUSEENTER, 0, AControl);
|
|
end;
|
|
|
|
procedure TJvExCustomStatusBar.MouseLeave(AControl: TControl);
|
|
begin
|
|
FMouseOver := False;
|
|
BaseWndProc(CM_MOUSELEAVE, 0, AControl);
|
|
if Assigned(FOnMouseLeave) then
|
|
FOnMouseLeave(Self);
|
|
end;
|
|
|
|
{$IFNDEF CLR}
|
|
procedure TJvExCustomStatusBar.FocusChanged(AControl: TWinControl);
|
|
begin
|
|
BaseWndProc(CM_FOCUSCHANGED, 0, AControl);
|
|
end;
|
|
{$ENDIF !CLR}
|
|
|
|
{$IFDEF COMPILER5}
|
|
{$IFNDEF HASAUTOSIZE}
|
|
|
|
procedure TJvExCustomStatusBar.CMSetAutoSize(var Msg: TMessage);
|
|
begin
|
|
SetAutoSize(Msg.WParam <> 0);
|
|
end;
|
|
|
|
procedure TJvExCustomStatusBar.SetAutoSize(Value: Boolean);
|
|
begin
|
|
TOpenControl_SetAutoSize(Self, Value);
|
|
end;
|
|
|
|
{$ENDIF !HASAUTOSIZE}
|
|
{$ENDIF COMPILER5}
|
|
|
|
procedure TJvExCustomStatusBar.BoundsChanged;
|
|
begin
|
|
end;
|
|
|
|
procedure TJvExCustomStatusBar.CursorChanged;
|
|
begin
|
|
BaseWndProc(CM_CURSORCHANGED);
|
|
end;
|
|
|
|
procedure TJvExCustomStatusBar.ShowingChanged;
|
|
begin
|
|
BaseWndProc(CM_SHOWINGCHANGED);
|
|
end;
|
|
|
|
procedure TJvExCustomStatusBar.ShowHintChanged;
|
|
begin
|
|
BaseWndProc(CM_SHOWHINTCHANGED);
|
|
end;
|
|
|
|
{$IFNDEF CLR}
|
|
{ VCL sends CM_CONTROLLISTCHANGE and CM_CONTROLCHANGE in a different order than
|
|
the CLX methods are used. So we must correct it by evaluating "Inserting". }
|
|
procedure TJvExCustomStatusBar.ControlsListChanging(Control: TControl; Inserting: Boolean);
|
|
begin
|
|
if Inserting then
|
|
BaseWndProc(CM_CONTROLLISTCHANGE, Integer(Control), Integer(Inserting))
|
|
else
|
|
BaseWndProc(CM_CONTROLCHANGE, Integer(Control), Integer(Inserting));
|
|
end;
|
|
|
|
procedure TJvExCustomStatusBar.ControlsListChanged(Control: TControl; Inserting: Boolean);
|
|
begin
|
|
if not Inserting then
|
|
BaseWndProc(CM_CONTROLLISTCHANGE, Integer(Control), Integer(Inserting))
|
|
else
|
|
BaseWndProc(CM_CONTROLCHANGE, Integer(Control), Integer(Inserting));
|
|
end;
|
|
{$ENDIF !CLR}
|
|
|
|
procedure TJvExCustomStatusBar.GetDlgCode(var Code: TDlgCodes);
|
|
begin
|
|
end;
|
|
|
|
procedure TJvExCustomStatusBar.FocusSet(PrevWnd: THandle);
|
|
begin
|
|
BaseWndProc(WM_SETFOCUS, Integer(PrevWnd), 0);
|
|
end;
|
|
|
|
procedure TJvExCustomStatusBar.FocusKilled(NextWnd: THandle);
|
|
begin
|
|
BaseWndProc(WM_KILLFOCUS, Integer(NextWnd), 0);
|
|
end;
|
|
|
|
function TJvExCustomStatusBar.DoEraseBackground(Canvas: TCanvas; Param: Integer): Boolean;
|
|
begin
|
|
Result := BaseWndProc(WM_ERASEBKGND, Canvas.Handle, Param) <> 0;
|
|
end;
|
|
|
|
{$IFDEF JVCLThemesEnabledD56}
|
|
function TJvExCustomStatusBar.GetParentBackground: Boolean;
|
|
begin
|
|
Result := JvThemes.GetParentBackground(Self);
|
|
end;
|
|
|
|
procedure TJvExCustomStatusBar.SetParentBackground(Value: Boolean);
|
|
begin
|
|
JvThemes.SetParentBackground(Self, Value);
|
|
end;
|
|
{$ENDIF JVCLThemesEnabledD56}
|
|
|
|
procedure TJvExCustomStatusBar.WndProc(var Msg: TMessage);
|
|
var
|
|
IdSaveDC: Integer;
|
|
DlgCodes: TDlgCodes;
|
|
Canvas: TCanvas;
|
|
{$IFDEF CLR}
|
|
AHintInfo: THintInfo;
|
|
{$ENDIF CLR}
|
|
begin
|
|
if not DispatchIsDesignMsg(Self, Msg) then
|
|
begin
|
|
case Msg.Msg of
|
|
CM_DENYSUBCLASSING:
|
|
{$IFNDEF CLR}
|
|
Msg.Result := Ord(GetInterfaceEntry(IJvDenySubClassing) <> nil);
|
|
{$ELSE}
|
|
Msg.Result := Integer(Supports(Self, IJvDenySubClassing));
|
|
{$ENDIF !CLR}
|
|
CM_DIALOGCHAR:
|
|
with TCMDialogChar{$IFDEF CLR}.Create{$ENDIF}(Msg) do
|
|
Result := Ord(WantKey(CharCode, KeyDataToShiftState(KeyData), WideChar(CharCode)));
|
|
CM_HINTSHOW:
|
|
{$IFNDEF CLR}
|
|
with TCMHintShow(Msg) do
|
|
Result := Integer(HintShow(HintInfo^));
|
|
{$ELSE}
|
|
with TCMHintShow.Create(Msg) do
|
|
begin
|
|
AHintInfo := HintInfo;
|
|
Result := Integer(HintShow(AHintInfo));
|
|
HintInfo := AHintInfo;
|
|
end;
|
|
{$ENDIF !CLR}
|
|
CM_HITTEST:
|
|
with TCMHitTest{$IFDEF CLR}.Create{$ENDIF}(Msg) do
|
|
Result := Integer(HitTest(XPos, YPos));
|
|
CM_MOUSEENTER:
|
|
MouseEnter({$IFDEF CLR}nil{$ELSE}TControl(Msg.LParam){$ENDIF});
|
|
CM_MOUSELEAVE:
|
|
MouseLeave({$IFDEF CLR}nil{$ELSE}TControl(Msg.LParam){$ENDIF});
|
|
CM_VISIBLECHANGED:
|
|
VisibleChanged;
|
|
CM_ENABLEDCHANGED:
|
|
EnabledChanged;
|
|
CM_TEXTCHANGED:
|
|
TextChanged;
|
|
CM_FONTCHANGED:
|
|
FontChanged;
|
|
CM_COLORCHANGED:
|
|
ColorChanged;
|
|
{$IFNDEF CLR}
|
|
CM_FOCUSCHANGED:
|
|
FocusChanged(TWinControl(Msg.LParam));
|
|
{$ENDIF !CLR}
|
|
CM_PARENTFONTCHANGED:
|
|
ParentFontChanged;
|
|
CM_PARENTCOLORCHANGED:
|
|
ParentColorChanged;
|
|
CM_PARENTSHOWHINTCHANGED:
|
|
ParentShowHintChanged;
|
|
CM_CURSORCHANGED:
|
|
CursorChanged;
|
|
CM_SHOWINGCHANGED:
|
|
ShowingChanged;
|
|
CM_SHOWHINTCHANGED:
|
|
ShowHintChanged;
|
|
{$IFNDEF CLR}
|
|
CM_CONTROLLISTCHANGE:
|
|
if Msg.LParam <> 0 then
|
|
ControlsListChanging(TControl(Msg.WParam), True)
|
|
else
|
|
ControlsListChanged(TControl(Msg.WParam), False);
|
|
CM_CONTROLCHANGE:
|
|
if Msg.LParam = 0 then
|
|
ControlsListChanging(TControl(Msg.WParam), False)
|
|
else
|
|
ControlsListChanged(TControl(Msg.WParam), True);
|
|
{$ENDIF !CLR}
|
|
WM_SETFOCUS:
|
|
FocusSet(THandle(Msg.WParam));
|
|
WM_KILLFOCUS:
|
|
FocusKilled(THandle(Msg.WParam));
|
|
WM_SIZE, WM_MOVE:
|
|
begin
|
|
inherited WndProc(Msg);
|
|
BoundsChanged;
|
|
end;
|
|
WM_ERASEBKGND:
|
|
if Msg.WParam <> 0 then
|
|
begin
|
|
IdSaveDC := SaveDC(HDC(Msg.WParam)); // protect DC against Stock-Objects from Canvas
|
|
Canvas := TCanvas.Create;
|
|
try
|
|
Canvas.Handle := HDC(Msg.WParam);
|
|
Msg.Result := Ord(DoEraseBackground(Canvas, Msg.LParam));
|
|
finally
|
|
Canvas.Handle := 0;
|
|
Canvas.Free;
|
|
RestoreDC(HDC(Msg.WParam), IdSaveDC);
|
|
end;
|
|
end
|
|
else
|
|
inherited WndProc(Msg);
|
|
{$IFNDEF DELPHI2007_UP}
|
|
WM_PRINTCLIENT, WM_PRINT: // VCL bug fix
|
|
begin
|
|
IdSaveDC := SaveDC(HDC(Msg.WParam)); // protect DC against changes
|
|
try
|
|
inherited WndProc(Msg);
|
|
finally
|
|
RestoreDC(HDC(Msg.WParam), IdSaveDC);
|
|
end;
|
|
end;
|
|
{$ENDIF ~DELPHI2007_UP}
|
|
WM_GETDLGCODE:
|
|
begin
|
|
inherited WndProc(Msg);
|
|
DlgCodes := [dcNative] + DlgcToDlgCodes(Msg.Result);
|
|
GetDlgCode(DlgCodes);
|
|
if not (dcNative in DlgCodes) then
|
|
Msg.Result := DlgCodesToDlgc(DlgCodes);
|
|
end;
|
|
else
|
|
inherited WndProc(Msg);
|
|
end;
|
|
case Msg.Msg of // precheck message to prevent access violations on released controls
|
|
CM_MOUSEENTER, CM_MOUSELEAVE, WM_KILLFOCUS, WM_SETFOCUS, WM_NCPAINT:
|
|
if DotNetHighlighting then
|
|
HandleDotNetHighlighting(Self, Msg, MouseOver, Color);
|
|
end;
|
|
end;
|
|
end;
|
|
|
|
//============================================================================
|
|
|
|
constructor TJvExComboBoxEx.Create(AOwner: TComponent);
|
|
begin
|
|
inherited Create(AOwner);
|
|
FHintColor := clDefault;
|
|
end;
|
|
|
|
function TJvExComboBoxEx.BaseWndProc(Msg: Integer; WParam: Integer = 0; LParam: Longint = 0): Integer;
|
|
var
|
|
Mesg: TMessage;
|
|
begin
|
|
Mesg := CreateWMMessage(Msg, WParam, LParam);
|
|
inherited WndProc(Mesg);
|
|
Result := Mesg.Result;
|
|
end;
|
|
|
|
function TJvExComboBoxEx.BaseWndProc(Msg: Integer; WParam: Integer; LParam: TControl): Integer;
|
|
var
|
|
Mesg: TMessage;
|
|
begin
|
|
Mesg := CreateWMMessage(Msg, WParam, LParam);
|
|
inherited WndProc(Mesg);
|
|
Result := Mesg.Result;
|
|
end;
|
|
|
|
function TJvExComboBoxEx.BaseWndProcEx(Msg: Integer; WParam: Integer; var LParam): Integer;
|
|
var
|
|
Mesg: TStructPtrMessage;
|
|
begin
|
|
Mesg := TStructPtrMessage.Create(Msg, WParam, LParam);
|
|
try
|
|
inherited WndProc(Mesg.Msg);
|
|
finally
|
|
Result := Mesg.Msg.Result;
|
|
Mesg.Free;
|
|
end;
|
|
end;
|
|
|
|
procedure TJvExComboBoxEx.VisibleChanged;
|
|
begin
|
|
BaseWndProc(CM_VISIBLECHANGED);
|
|
end;
|
|
|
|
procedure TJvExComboBoxEx.EnabledChanged;
|
|
begin
|
|
BaseWndProc(CM_ENABLEDCHANGED);
|
|
end;
|
|
|
|
procedure TJvExComboBoxEx.TextChanged;
|
|
begin
|
|
BaseWndProc(CM_TEXTCHANGED);
|
|
end;
|
|
|
|
procedure TJvExComboBoxEx.FontChanged;
|
|
begin
|
|
BaseWndProc(CM_FONTCHANGED);
|
|
end;
|
|
|
|
procedure TJvExComboBoxEx.ColorChanged;
|
|
begin
|
|
BaseWndProc(CM_COLORCHANGED);
|
|
end;
|
|
|
|
procedure TJvExComboBoxEx.ParentFontChanged;
|
|
begin
|
|
BaseWndProc(CM_PARENTFONTCHANGED);
|
|
end;
|
|
|
|
procedure TJvExComboBoxEx.ParentColorChanged;
|
|
begin
|
|
BaseWndProc(CM_PARENTCOLORCHANGED);
|
|
if Assigned(OnParentColorChange) then
|
|
OnParentColorChange(Self);
|
|
end;
|
|
|
|
procedure TJvExComboBoxEx.ParentShowHintChanged;
|
|
begin
|
|
BaseWndProc(CM_PARENTSHOWHINTCHANGED);
|
|
end;
|
|
|
|
function TJvExComboBoxEx.WantKey(Key: Integer; Shift: TShiftState; const KeyText: WideString): Boolean;
|
|
begin
|
|
Result := BaseWndProc(CM_DIALOGCHAR, Word(Key), ShiftStateToKeyData(Shift)) <> 0;
|
|
end;
|
|
|
|
function TJvExComboBoxEx.HitTest(X, Y: Integer): Boolean;
|
|
begin
|
|
Result := BaseWndProc(CM_HITTEST, 0, SmallPointToLong(PointToSmallPoint(Point(X, Y)))) <> 0;
|
|
end;
|
|
|
|
function TJvExComboBoxEx.HintShow(var HintInfo: THintInfo): Boolean;
|
|
begin
|
|
GetHintColor(HintInfo, Self, FHintColor);
|
|
if FHintWindowClass <> nil then
|
|
HintInfo.HintWindowClass := FHintWindowClass;
|
|
Result := BaseWndProcEx(CM_HINTSHOW, 0, HintInfo) <> 0;
|
|
end;
|
|
|
|
procedure TJvExComboBoxEx.MouseEnter(AControl: TControl);
|
|
begin
|
|
FMouseOver := True;
|
|
if Assigned(FOnMouseEnter) then
|
|
FOnMouseEnter(Self);
|
|
BaseWndProc(CM_MOUSEENTER, 0, AControl);
|
|
end;
|
|
|
|
procedure TJvExComboBoxEx.MouseLeave(AControl: TControl);
|
|
begin
|
|
FMouseOver := False;
|
|
BaseWndProc(CM_MOUSELEAVE, 0, AControl);
|
|
if Assigned(FOnMouseLeave) then
|
|
FOnMouseLeave(Self);
|
|
end;
|
|
|
|
{$IFNDEF CLR}
|
|
procedure TJvExComboBoxEx.FocusChanged(AControl: TWinControl);
|
|
begin
|
|
BaseWndProc(CM_FOCUSCHANGED, 0, AControl);
|
|
end;
|
|
{$ENDIF !CLR}
|
|
|
|
{$IFDEF COMPILER5}
|
|
{$IFNDEF HASAUTOSIZE}
|
|
|
|
procedure TJvExComboBoxEx.CMSetAutoSize(var Msg: TMessage);
|
|
begin
|
|
SetAutoSize(Msg.WParam <> 0);
|
|
end;
|
|
|
|
procedure TJvExComboBoxEx.SetAutoSize(Value: Boolean);
|
|
begin
|
|
TOpenControl_SetAutoSize(Self, Value);
|
|
end;
|
|
|
|
{$ENDIF !HASAUTOSIZE}
|
|
{$ENDIF COMPILER5}
|
|
|
|
procedure TJvExComboBoxEx.BoundsChanged;
|
|
begin
|
|
end;
|
|
|
|
procedure TJvExComboBoxEx.CursorChanged;
|
|
begin
|
|
BaseWndProc(CM_CURSORCHANGED);
|
|
end;
|
|
|
|
procedure TJvExComboBoxEx.ShowingChanged;
|
|
begin
|
|
BaseWndProc(CM_SHOWINGCHANGED);
|
|
end;
|
|
|
|
procedure TJvExComboBoxEx.ShowHintChanged;
|
|
begin
|
|
BaseWndProc(CM_SHOWHINTCHANGED);
|
|
end;
|
|
|
|
{$IFNDEF CLR}
|
|
{ VCL sends CM_CONTROLLISTCHANGE and CM_CONTROLCHANGE in a different order than
|
|
the CLX methods are used. So we must correct it by evaluating "Inserting". }
|
|
procedure TJvExComboBoxEx.ControlsListChanging(Control: TControl; Inserting: Boolean);
|
|
begin
|
|
if Inserting then
|
|
BaseWndProc(CM_CONTROLLISTCHANGE, Integer(Control), Integer(Inserting))
|
|
else
|
|
BaseWndProc(CM_CONTROLCHANGE, Integer(Control), Integer(Inserting));
|
|
end;
|
|
|
|
procedure TJvExComboBoxEx.ControlsListChanged(Control: TControl; Inserting: Boolean);
|
|
begin
|
|
if not Inserting then
|
|
BaseWndProc(CM_CONTROLLISTCHANGE, Integer(Control), Integer(Inserting))
|
|
else
|
|
BaseWndProc(CM_CONTROLCHANGE, Integer(Control), Integer(Inserting));
|
|
end;
|
|
{$ENDIF !CLR}
|
|
|
|
procedure TJvExComboBoxEx.GetDlgCode(var Code: TDlgCodes);
|
|
begin
|
|
end;
|
|
|
|
procedure TJvExComboBoxEx.FocusSet(PrevWnd: THandle);
|
|
begin
|
|
BaseWndProc(WM_SETFOCUS, Integer(PrevWnd), 0);
|
|
end;
|
|
|
|
procedure TJvExComboBoxEx.FocusKilled(NextWnd: THandle);
|
|
begin
|
|
BaseWndProc(WM_KILLFOCUS, Integer(NextWnd), 0);
|
|
end;
|
|
|
|
function TJvExComboBoxEx.DoEraseBackground(Canvas: TCanvas; Param: Integer): Boolean;
|
|
begin
|
|
Result := BaseWndProc(WM_ERASEBKGND, Canvas.Handle, Param) <> 0;
|
|
end;
|
|
|
|
{$IFDEF JVCLThemesEnabledD56}
|
|
function TJvExComboBoxEx.GetParentBackground: Boolean;
|
|
begin
|
|
Result := JvThemes.GetParentBackground(Self);
|
|
end;
|
|
|
|
procedure TJvExComboBoxEx.SetParentBackground(Value: Boolean);
|
|
begin
|
|
JvThemes.SetParentBackground(Self, Value);
|
|
end;
|
|
{$ENDIF JVCLThemesEnabledD56}
|
|
|
|
procedure TJvExComboBoxEx.WndProc(var Msg: TMessage);
|
|
var
|
|
IdSaveDC: Integer;
|
|
DlgCodes: TDlgCodes;
|
|
Canvas: TCanvas;
|
|
{$IFDEF CLR}
|
|
AHintInfo: THintInfo;
|
|
{$ENDIF CLR}
|
|
begin
|
|
if not DispatchIsDesignMsg(Self, Msg) then
|
|
begin
|
|
case Msg.Msg of
|
|
CM_DENYSUBCLASSING:
|
|
{$IFNDEF CLR}
|
|
Msg.Result := Ord(GetInterfaceEntry(IJvDenySubClassing) <> nil);
|
|
{$ELSE}
|
|
Msg.Result := Integer(Supports(Self, IJvDenySubClassing));
|
|
{$ENDIF !CLR}
|
|
CM_DIALOGCHAR:
|
|
with TCMDialogChar{$IFDEF CLR}.Create{$ENDIF}(Msg) do
|
|
Result := Ord(WantKey(CharCode, KeyDataToShiftState(KeyData), WideChar(CharCode)));
|
|
CM_HINTSHOW:
|
|
{$IFNDEF CLR}
|
|
with TCMHintShow(Msg) do
|
|
Result := Integer(HintShow(HintInfo^));
|
|
{$ELSE}
|
|
with TCMHintShow.Create(Msg) do
|
|
begin
|
|
AHintInfo := HintInfo;
|
|
Result := Integer(HintShow(AHintInfo));
|
|
HintInfo := AHintInfo;
|
|
end;
|
|
{$ENDIF !CLR}
|
|
CM_HITTEST:
|
|
with TCMHitTest{$IFDEF CLR}.Create{$ENDIF}(Msg) do
|
|
Result := Integer(HitTest(XPos, YPos));
|
|
CM_MOUSEENTER:
|
|
MouseEnter({$IFDEF CLR}nil{$ELSE}TControl(Msg.LParam){$ENDIF});
|
|
CM_MOUSELEAVE:
|
|
MouseLeave({$IFDEF CLR}nil{$ELSE}TControl(Msg.LParam){$ENDIF});
|
|
CM_VISIBLECHANGED:
|
|
VisibleChanged;
|
|
CM_ENABLEDCHANGED:
|
|
EnabledChanged;
|
|
CM_TEXTCHANGED:
|
|
TextChanged;
|
|
CM_FONTCHANGED:
|
|
FontChanged;
|
|
CM_COLORCHANGED:
|
|
ColorChanged;
|
|
{$IFNDEF CLR}
|
|
CM_FOCUSCHANGED:
|
|
FocusChanged(TWinControl(Msg.LParam));
|
|
{$ENDIF !CLR}
|
|
CM_PARENTFONTCHANGED:
|
|
ParentFontChanged;
|
|
CM_PARENTCOLORCHANGED:
|
|
ParentColorChanged;
|
|
CM_PARENTSHOWHINTCHANGED:
|
|
ParentShowHintChanged;
|
|
CM_CURSORCHANGED:
|
|
CursorChanged;
|
|
CM_SHOWINGCHANGED:
|
|
ShowingChanged;
|
|
CM_SHOWHINTCHANGED:
|
|
ShowHintChanged;
|
|
{$IFNDEF CLR}
|
|
CM_CONTROLLISTCHANGE:
|
|
if Msg.LParam <> 0 then
|
|
ControlsListChanging(TControl(Msg.WParam), True)
|
|
else
|
|
ControlsListChanged(TControl(Msg.WParam), False);
|
|
CM_CONTROLCHANGE:
|
|
if Msg.LParam = 0 then
|
|
ControlsListChanging(TControl(Msg.WParam), False)
|
|
else
|
|
ControlsListChanged(TControl(Msg.WParam), True);
|
|
{$ENDIF !CLR}
|
|
WM_SETFOCUS:
|
|
FocusSet(THandle(Msg.WParam));
|
|
WM_KILLFOCUS:
|
|
FocusKilled(THandle(Msg.WParam));
|
|
WM_SIZE, WM_MOVE:
|
|
begin
|
|
inherited WndProc(Msg);
|
|
BoundsChanged;
|
|
end;
|
|
WM_ERASEBKGND:
|
|
if Msg.WParam <> 0 then
|
|
begin
|
|
IdSaveDC := SaveDC(HDC(Msg.WParam)); // protect DC against Stock-Objects from Canvas
|
|
Canvas := TCanvas.Create;
|
|
try
|
|
Canvas.Handle := HDC(Msg.WParam);
|
|
Msg.Result := Ord(DoEraseBackground(Canvas, Msg.LParam));
|
|
finally
|
|
Canvas.Handle := 0;
|
|
Canvas.Free;
|
|
RestoreDC(HDC(Msg.WParam), IdSaveDC);
|
|
end;
|
|
end
|
|
else
|
|
inherited WndProc(Msg);
|
|
{$IFNDEF DELPHI2007_UP}
|
|
WM_PRINTCLIENT, WM_PRINT: // VCL bug fix
|
|
begin
|
|
IdSaveDC := SaveDC(HDC(Msg.WParam)); // protect DC against changes
|
|
try
|
|
inherited WndProc(Msg);
|
|
finally
|
|
RestoreDC(HDC(Msg.WParam), IdSaveDC);
|
|
end;
|
|
end;
|
|
{$ENDIF ~DELPHI2007_UP}
|
|
WM_GETDLGCODE:
|
|
begin
|
|
inherited WndProc(Msg);
|
|
DlgCodes := [dcNative] + DlgcToDlgCodes(Msg.Result);
|
|
GetDlgCode(DlgCodes);
|
|
if not (dcNative in DlgCodes) then
|
|
Msg.Result := DlgCodesToDlgc(DlgCodes);
|
|
end;
|
|
else
|
|
inherited WndProc(Msg);
|
|
end;
|
|
case Msg.Msg of // precheck message to prevent access violations on released controls
|
|
CM_MOUSEENTER, CM_MOUSELEAVE, WM_KILLFOCUS, WM_SETFOCUS, WM_NCPAINT:
|
|
if DotNetHighlighting then
|
|
HandleDotNetHighlighting(Self, Msg, MouseOver, Color);
|
|
end;
|
|
end;
|
|
end;
|
|
|
|
//============================================================================
|
|
|
|
constructor TJvExCustomHeaderControl.Create(AOwner: TComponent);
|
|
begin
|
|
inherited Create(AOwner);
|
|
FHintColor := clDefault;
|
|
end;
|
|
|
|
function TJvExCustomHeaderControl.BaseWndProc(Msg: Integer; WParam: Integer = 0; LParam: Longint = 0): Integer;
|
|
var
|
|
Mesg: TMessage;
|
|
begin
|
|
Mesg := CreateWMMessage(Msg, WParam, LParam);
|
|
inherited WndProc(Mesg);
|
|
Result := Mesg.Result;
|
|
end;
|
|
|
|
function TJvExCustomHeaderControl.BaseWndProc(Msg: Integer; WParam: Integer; LParam: TControl): Integer;
|
|
var
|
|
Mesg: TMessage;
|
|
begin
|
|
Mesg := CreateWMMessage(Msg, WParam, LParam);
|
|
inherited WndProc(Mesg);
|
|
Result := Mesg.Result;
|
|
end;
|
|
|
|
function TJvExCustomHeaderControl.BaseWndProcEx(Msg: Integer; WParam: Integer; var LParam): Integer;
|
|
var
|
|
Mesg: TStructPtrMessage;
|
|
begin
|
|
Mesg := TStructPtrMessage.Create(Msg, WParam, LParam);
|
|
try
|
|
inherited WndProc(Mesg.Msg);
|
|
finally
|
|
Result := Mesg.Msg.Result;
|
|
Mesg.Free;
|
|
end;
|
|
end;
|
|
|
|
procedure TJvExCustomHeaderControl.VisibleChanged;
|
|
begin
|
|
BaseWndProc(CM_VISIBLECHANGED);
|
|
end;
|
|
|
|
procedure TJvExCustomHeaderControl.EnabledChanged;
|
|
begin
|
|
BaseWndProc(CM_ENABLEDCHANGED);
|
|
end;
|
|
|
|
procedure TJvExCustomHeaderControl.TextChanged;
|
|
begin
|
|
BaseWndProc(CM_TEXTCHANGED);
|
|
end;
|
|
|
|
procedure TJvExCustomHeaderControl.FontChanged;
|
|
begin
|
|
BaseWndProc(CM_FONTCHANGED);
|
|
end;
|
|
|
|
procedure TJvExCustomHeaderControl.ColorChanged;
|
|
begin
|
|
BaseWndProc(CM_COLORCHANGED);
|
|
end;
|
|
|
|
procedure TJvExCustomHeaderControl.ParentFontChanged;
|
|
begin
|
|
BaseWndProc(CM_PARENTFONTCHANGED);
|
|
end;
|
|
|
|
procedure TJvExCustomHeaderControl.ParentColorChanged;
|
|
begin
|
|
BaseWndProc(CM_PARENTCOLORCHANGED);
|
|
if Assigned(OnParentColorChange) then
|
|
OnParentColorChange(Self);
|
|
end;
|
|
|
|
procedure TJvExCustomHeaderControl.ParentShowHintChanged;
|
|
begin
|
|
BaseWndProc(CM_PARENTSHOWHINTCHANGED);
|
|
end;
|
|
|
|
function TJvExCustomHeaderControl.WantKey(Key: Integer; Shift: TShiftState; const KeyText: WideString): Boolean;
|
|
begin
|
|
Result := BaseWndProc(CM_DIALOGCHAR, Word(Key), ShiftStateToKeyData(Shift)) <> 0;
|
|
end;
|
|
|
|
function TJvExCustomHeaderControl.HitTest(X, Y: Integer): Boolean;
|
|
begin
|
|
Result := BaseWndProc(CM_HITTEST, 0, SmallPointToLong(PointToSmallPoint(Point(X, Y)))) <> 0;
|
|
end;
|
|
|
|
function TJvExCustomHeaderControl.HintShow(var HintInfo: THintInfo): Boolean;
|
|
begin
|
|
GetHintColor(HintInfo, Self, FHintColor);
|
|
if FHintWindowClass <> nil then
|
|
HintInfo.HintWindowClass := FHintWindowClass;
|
|
Result := BaseWndProcEx(CM_HINTSHOW, 0, HintInfo) <> 0;
|
|
end;
|
|
|
|
procedure TJvExCustomHeaderControl.MouseEnter(AControl: TControl);
|
|
begin
|
|
FMouseOver := True;
|
|
if Assigned(FOnMouseEnter) then
|
|
FOnMouseEnter(Self);
|
|
BaseWndProc(CM_MOUSEENTER, 0, AControl);
|
|
end;
|
|
|
|
procedure TJvExCustomHeaderControl.MouseLeave(AControl: TControl);
|
|
begin
|
|
FMouseOver := False;
|
|
BaseWndProc(CM_MOUSELEAVE, 0, AControl);
|
|
if Assigned(FOnMouseLeave) then
|
|
FOnMouseLeave(Self);
|
|
end;
|
|
|
|
{$IFNDEF CLR}
|
|
procedure TJvExCustomHeaderControl.FocusChanged(AControl: TWinControl);
|
|
begin
|
|
BaseWndProc(CM_FOCUSCHANGED, 0, AControl);
|
|
end;
|
|
{$ENDIF !CLR}
|
|
|
|
{$IFDEF COMPILER5}
|
|
{$IFNDEF HASAUTOSIZE}
|
|
|
|
procedure TJvExCustomHeaderControl.CMSetAutoSize(var Msg: TMessage);
|
|
begin
|
|
SetAutoSize(Msg.WParam <> 0);
|
|
end;
|
|
|
|
procedure TJvExCustomHeaderControl.SetAutoSize(Value: Boolean);
|
|
begin
|
|
TOpenControl_SetAutoSize(Self, Value);
|
|
end;
|
|
|
|
{$ENDIF !HASAUTOSIZE}
|
|
{$ENDIF COMPILER5}
|
|
|
|
procedure TJvExCustomHeaderControl.BoundsChanged;
|
|
begin
|
|
end;
|
|
|
|
procedure TJvExCustomHeaderControl.CursorChanged;
|
|
begin
|
|
BaseWndProc(CM_CURSORCHANGED);
|
|
end;
|
|
|
|
procedure TJvExCustomHeaderControl.ShowingChanged;
|
|
begin
|
|
BaseWndProc(CM_SHOWINGCHANGED);
|
|
end;
|
|
|
|
procedure TJvExCustomHeaderControl.ShowHintChanged;
|
|
begin
|
|
BaseWndProc(CM_SHOWHINTCHANGED);
|
|
end;
|
|
|
|
{$IFNDEF CLR}
|
|
{ VCL sends CM_CONTROLLISTCHANGE and CM_CONTROLCHANGE in a different order than
|
|
the CLX methods are used. So we must correct it by evaluating "Inserting". }
|
|
procedure TJvExCustomHeaderControl.ControlsListChanging(Control: TControl; Inserting: Boolean);
|
|
begin
|
|
if Inserting then
|
|
BaseWndProc(CM_CONTROLLISTCHANGE, Integer(Control), Integer(Inserting))
|
|
else
|
|
BaseWndProc(CM_CONTROLCHANGE, Integer(Control), Integer(Inserting));
|
|
end;
|
|
|
|
procedure TJvExCustomHeaderControl.ControlsListChanged(Control: TControl; Inserting: Boolean);
|
|
begin
|
|
if not Inserting then
|
|
BaseWndProc(CM_CONTROLLISTCHANGE, Integer(Control), Integer(Inserting))
|
|
else
|
|
BaseWndProc(CM_CONTROLCHANGE, Integer(Control), Integer(Inserting));
|
|
end;
|
|
{$ENDIF !CLR}
|
|
|
|
procedure TJvExCustomHeaderControl.GetDlgCode(var Code: TDlgCodes);
|
|
begin
|
|
end;
|
|
|
|
procedure TJvExCustomHeaderControl.FocusSet(PrevWnd: THandle);
|
|
begin
|
|
BaseWndProc(WM_SETFOCUS, Integer(PrevWnd), 0);
|
|
end;
|
|
|
|
procedure TJvExCustomHeaderControl.FocusKilled(NextWnd: THandle);
|
|
begin
|
|
BaseWndProc(WM_KILLFOCUS, Integer(NextWnd), 0);
|
|
end;
|
|
|
|
function TJvExCustomHeaderControl.DoEraseBackground(Canvas: TCanvas; Param: Integer): Boolean;
|
|
begin
|
|
Result := BaseWndProc(WM_ERASEBKGND, Canvas.Handle, Param) <> 0;
|
|
end;
|
|
|
|
{$IFDEF JVCLThemesEnabledD56}
|
|
function TJvExCustomHeaderControl.GetParentBackground: Boolean;
|
|
begin
|
|
Result := JvThemes.GetParentBackground(Self);
|
|
end;
|
|
|
|
procedure TJvExCustomHeaderControl.SetParentBackground(Value: Boolean);
|
|
begin
|
|
JvThemes.SetParentBackground(Self, Value);
|
|
end;
|
|
{$ENDIF JVCLThemesEnabledD56}
|
|
|
|
procedure TJvExCustomHeaderControl.WndProc(var Msg: TMessage);
|
|
var
|
|
IdSaveDC: Integer;
|
|
DlgCodes: TDlgCodes;
|
|
Canvas: TCanvas;
|
|
{$IFDEF CLR}
|
|
AHintInfo: THintInfo;
|
|
{$ENDIF CLR}
|
|
begin
|
|
if not DispatchIsDesignMsg(Self, Msg) then
|
|
begin
|
|
case Msg.Msg of
|
|
CM_DENYSUBCLASSING:
|
|
{$IFNDEF CLR}
|
|
Msg.Result := Ord(GetInterfaceEntry(IJvDenySubClassing) <> nil);
|
|
{$ELSE}
|
|
Msg.Result := Integer(Supports(Self, IJvDenySubClassing));
|
|
{$ENDIF !CLR}
|
|
CM_DIALOGCHAR:
|
|
with TCMDialogChar{$IFDEF CLR}.Create{$ENDIF}(Msg) do
|
|
Result := Ord(WantKey(CharCode, KeyDataToShiftState(KeyData), WideChar(CharCode)));
|
|
CM_HINTSHOW:
|
|
{$IFNDEF CLR}
|
|
with TCMHintShow(Msg) do
|
|
Result := Integer(HintShow(HintInfo^));
|
|
{$ELSE}
|
|
with TCMHintShow.Create(Msg) do
|
|
begin
|
|
AHintInfo := HintInfo;
|
|
Result := Integer(HintShow(AHintInfo));
|
|
HintInfo := AHintInfo;
|
|
end;
|
|
{$ENDIF !CLR}
|
|
CM_HITTEST:
|
|
with TCMHitTest{$IFDEF CLR}.Create{$ENDIF}(Msg) do
|
|
Result := Integer(HitTest(XPos, YPos));
|
|
CM_MOUSEENTER:
|
|
MouseEnter({$IFDEF CLR}nil{$ELSE}TControl(Msg.LParam){$ENDIF});
|
|
CM_MOUSELEAVE:
|
|
MouseLeave({$IFDEF CLR}nil{$ELSE}TControl(Msg.LParam){$ENDIF});
|
|
CM_VISIBLECHANGED:
|
|
VisibleChanged;
|
|
CM_ENABLEDCHANGED:
|
|
EnabledChanged;
|
|
CM_TEXTCHANGED:
|
|
TextChanged;
|
|
CM_FONTCHANGED:
|
|
FontChanged;
|
|
CM_COLORCHANGED:
|
|
ColorChanged;
|
|
{$IFNDEF CLR}
|
|
CM_FOCUSCHANGED:
|
|
FocusChanged(TWinControl(Msg.LParam));
|
|
{$ENDIF !CLR}
|
|
CM_PARENTFONTCHANGED:
|
|
ParentFontChanged;
|
|
CM_PARENTCOLORCHANGED:
|
|
ParentColorChanged;
|
|
CM_PARENTSHOWHINTCHANGED:
|
|
ParentShowHintChanged;
|
|
CM_CURSORCHANGED:
|
|
CursorChanged;
|
|
CM_SHOWINGCHANGED:
|
|
ShowingChanged;
|
|
CM_SHOWHINTCHANGED:
|
|
ShowHintChanged;
|
|
{$IFNDEF CLR}
|
|
CM_CONTROLLISTCHANGE:
|
|
if Msg.LParam <> 0 then
|
|
ControlsListChanging(TControl(Msg.WParam), True)
|
|
else
|
|
ControlsListChanged(TControl(Msg.WParam), False);
|
|
CM_CONTROLCHANGE:
|
|
if Msg.LParam = 0 then
|
|
ControlsListChanging(TControl(Msg.WParam), False)
|
|
else
|
|
ControlsListChanged(TControl(Msg.WParam), True);
|
|
{$ENDIF !CLR}
|
|
WM_SETFOCUS:
|
|
FocusSet(THandle(Msg.WParam));
|
|
WM_KILLFOCUS:
|
|
FocusKilled(THandle(Msg.WParam));
|
|
WM_SIZE, WM_MOVE:
|
|
begin
|
|
inherited WndProc(Msg);
|
|
BoundsChanged;
|
|
end;
|
|
WM_ERASEBKGND:
|
|
if Msg.WParam <> 0 then
|
|
begin
|
|
IdSaveDC := SaveDC(HDC(Msg.WParam)); // protect DC against Stock-Objects from Canvas
|
|
Canvas := TCanvas.Create;
|
|
try
|
|
Canvas.Handle := HDC(Msg.WParam);
|
|
Msg.Result := Ord(DoEraseBackground(Canvas, Msg.LParam));
|
|
finally
|
|
Canvas.Handle := 0;
|
|
Canvas.Free;
|
|
RestoreDC(HDC(Msg.WParam), IdSaveDC);
|
|
end;
|
|
end
|
|
else
|
|
inherited WndProc(Msg);
|
|
{$IFNDEF DELPHI2007_UP}
|
|
WM_PRINTCLIENT, WM_PRINT: // VCL bug fix
|
|
begin
|
|
IdSaveDC := SaveDC(HDC(Msg.WParam)); // protect DC against changes
|
|
try
|
|
inherited WndProc(Msg);
|
|
finally
|
|
RestoreDC(HDC(Msg.WParam), IdSaveDC);
|
|
end;
|
|
end;
|
|
{$ENDIF ~DELPHI2007_UP}
|
|
WM_GETDLGCODE:
|
|
begin
|
|
inherited WndProc(Msg);
|
|
DlgCodes := [dcNative] + DlgcToDlgCodes(Msg.Result);
|
|
GetDlgCode(DlgCodes);
|
|
if not (dcNative in DlgCodes) then
|
|
Msg.Result := DlgCodesToDlgc(DlgCodes);
|
|
end;
|
|
else
|
|
inherited WndProc(Msg);
|
|
end;
|
|
case Msg.Msg of // precheck message to prevent access violations on released controls
|
|
CM_MOUSEENTER, CM_MOUSELEAVE, WM_KILLFOCUS, WM_SETFOCUS, WM_NCPAINT:
|
|
if DotNetHighlighting then
|
|
HandleDotNetHighlighting(Self, Msg, MouseOver, Color);
|
|
end;
|
|
end;
|
|
end;
|
|
|
|
//============================================================================
|
|
|
|
{$ENDIF COMPILER6_UP}
|
|
|
|
constructor TJvExHeaderControl.Create(AOwner: TComponent);
|
|
begin
|
|
inherited Create(AOwner);
|
|
FHintColor := clDefault;
|
|
end;
|
|
|
|
function TJvExHeaderControl.BaseWndProc(Msg: Integer; WParam: Integer = 0; LParam: Longint = 0): Integer;
|
|
var
|
|
Mesg: TMessage;
|
|
begin
|
|
Mesg := CreateWMMessage(Msg, WParam, LParam);
|
|
inherited WndProc(Mesg);
|
|
Result := Mesg.Result;
|
|
end;
|
|
|
|
function TJvExHeaderControl.BaseWndProc(Msg: Integer; WParam: Integer; LParam: TControl): Integer;
|
|
var
|
|
Mesg: TMessage;
|
|
begin
|
|
Mesg := CreateWMMessage(Msg, WParam, LParam);
|
|
inherited WndProc(Mesg);
|
|
Result := Mesg.Result;
|
|
end;
|
|
|
|
function TJvExHeaderControl.BaseWndProcEx(Msg: Integer; WParam: Integer; var LParam): Integer;
|
|
var
|
|
Mesg: TStructPtrMessage;
|
|
begin
|
|
Mesg := TStructPtrMessage.Create(Msg, WParam, LParam);
|
|
try
|
|
inherited WndProc(Mesg.Msg);
|
|
finally
|
|
Result := Mesg.Msg.Result;
|
|
Mesg.Free;
|
|
end;
|
|
end;
|
|
|
|
procedure TJvExHeaderControl.VisibleChanged;
|
|
begin
|
|
BaseWndProc(CM_VISIBLECHANGED);
|
|
end;
|
|
|
|
procedure TJvExHeaderControl.EnabledChanged;
|
|
begin
|
|
BaseWndProc(CM_ENABLEDCHANGED);
|
|
end;
|
|
|
|
procedure TJvExHeaderControl.TextChanged;
|
|
begin
|
|
BaseWndProc(CM_TEXTCHANGED);
|
|
end;
|
|
|
|
procedure TJvExHeaderControl.FontChanged;
|
|
begin
|
|
BaseWndProc(CM_FONTCHANGED);
|
|
end;
|
|
|
|
procedure TJvExHeaderControl.ColorChanged;
|
|
begin
|
|
BaseWndProc(CM_COLORCHANGED);
|
|
end;
|
|
|
|
procedure TJvExHeaderControl.ParentFontChanged;
|
|
begin
|
|
BaseWndProc(CM_PARENTFONTCHANGED);
|
|
end;
|
|
|
|
procedure TJvExHeaderControl.ParentColorChanged;
|
|
begin
|
|
BaseWndProc(CM_PARENTCOLORCHANGED);
|
|
if Assigned(OnParentColorChange) then
|
|
OnParentColorChange(Self);
|
|
end;
|
|
|
|
procedure TJvExHeaderControl.ParentShowHintChanged;
|
|
begin
|
|
BaseWndProc(CM_PARENTSHOWHINTCHANGED);
|
|
end;
|
|
|
|
function TJvExHeaderControl.WantKey(Key: Integer; Shift: TShiftState; const KeyText: WideString): Boolean;
|
|
begin
|
|
Result := BaseWndProc(CM_DIALOGCHAR, Word(Key), ShiftStateToKeyData(Shift)) <> 0;
|
|
end;
|
|
|
|
function TJvExHeaderControl.HitTest(X, Y: Integer): Boolean;
|
|
begin
|
|
Result := BaseWndProc(CM_HITTEST, 0, SmallPointToLong(PointToSmallPoint(Point(X, Y)))) <> 0;
|
|
end;
|
|
|
|
function TJvExHeaderControl.HintShow(var HintInfo: THintInfo): Boolean;
|
|
begin
|
|
GetHintColor(HintInfo, Self, FHintColor);
|
|
if FHintWindowClass <> nil then
|
|
HintInfo.HintWindowClass := FHintWindowClass;
|
|
Result := BaseWndProcEx(CM_HINTSHOW, 0, HintInfo) <> 0;
|
|
end;
|
|
|
|
procedure TJvExHeaderControl.MouseEnter(AControl: TControl);
|
|
begin
|
|
FMouseOver := True;
|
|
if Assigned(FOnMouseEnter) then
|
|
FOnMouseEnter(Self);
|
|
BaseWndProc(CM_MOUSEENTER, 0, AControl);
|
|
end;
|
|
|
|
procedure TJvExHeaderControl.MouseLeave(AControl: TControl);
|
|
begin
|
|
FMouseOver := False;
|
|
BaseWndProc(CM_MOUSELEAVE, 0, AControl);
|
|
if Assigned(FOnMouseLeave) then
|
|
FOnMouseLeave(Self);
|
|
end;
|
|
|
|
{$IFNDEF CLR}
|
|
procedure TJvExHeaderControl.FocusChanged(AControl: TWinControl);
|
|
begin
|
|
BaseWndProc(CM_FOCUSCHANGED, 0, AControl);
|
|
end;
|
|
{$ENDIF !CLR}
|
|
|
|
{$IFDEF COMPILER5}
|
|
{$IFNDEF HASAUTOSIZE}
|
|
|
|
procedure TJvExHeaderControl.CMSetAutoSize(var Msg: TMessage);
|
|
begin
|
|
SetAutoSize(Msg.WParam <> 0);
|
|
end;
|
|
|
|
procedure TJvExHeaderControl.SetAutoSize(Value: Boolean);
|
|
begin
|
|
TOpenControl_SetAutoSize(Self, Value);
|
|
end;
|
|
|
|
{$ENDIF !HASAUTOSIZE}
|
|
{$ENDIF COMPILER5}
|
|
|
|
procedure TJvExHeaderControl.BoundsChanged;
|
|
begin
|
|
end;
|
|
|
|
procedure TJvExHeaderControl.CursorChanged;
|
|
begin
|
|
BaseWndProc(CM_CURSORCHANGED);
|
|
end;
|
|
|
|
procedure TJvExHeaderControl.ShowingChanged;
|
|
begin
|
|
BaseWndProc(CM_SHOWINGCHANGED);
|
|
end;
|
|
|
|
procedure TJvExHeaderControl.ShowHintChanged;
|
|
begin
|
|
BaseWndProc(CM_SHOWHINTCHANGED);
|
|
end;
|
|
|
|
{$IFNDEF CLR}
|
|
{ VCL sends CM_CONTROLLISTCHANGE and CM_CONTROLCHANGE in a different order than
|
|
the CLX methods are used. So we must correct it by evaluating "Inserting". }
|
|
procedure TJvExHeaderControl.ControlsListChanging(Control: TControl; Inserting: Boolean);
|
|
begin
|
|
if Inserting then
|
|
BaseWndProc(CM_CONTROLLISTCHANGE, Integer(Control), Integer(Inserting))
|
|
else
|
|
BaseWndProc(CM_CONTROLCHANGE, Integer(Control), Integer(Inserting));
|
|
end;
|
|
|
|
procedure TJvExHeaderControl.ControlsListChanged(Control: TControl; Inserting: Boolean);
|
|
begin
|
|
if not Inserting then
|
|
BaseWndProc(CM_CONTROLLISTCHANGE, Integer(Control), Integer(Inserting))
|
|
else
|
|
BaseWndProc(CM_CONTROLCHANGE, Integer(Control), Integer(Inserting));
|
|
end;
|
|
{$ENDIF !CLR}
|
|
|
|
procedure TJvExHeaderControl.GetDlgCode(var Code: TDlgCodes);
|
|
begin
|
|
end;
|
|
|
|
procedure TJvExHeaderControl.FocusSet(PrevWnd: THandle);
|
|
begin
|
|
BaseWndProc(WM_SETFOCUS, Integer(PrevWnd), 0);
|
|
end;
|
|
|
|
procedure TJvExHeaderControl.FocusKilled(NextWnd: THandle);
|
|
begin
|
|
BaseWndProc(WM_KILLFOCUS, Integer(NextWnd), 0);
|
|
end;
|
|
|
|
function TJvExHeaderControl.DoEraseBackground(Canvas: TCanvas; Param: Integer): Boolean;
|
|
begin
|
|
Result := BaseWndProc(WM_ERASEBKGND, Canvas.Handle, Param) <> 0;
|
|
end;
|
|
|
|
{$IFDEF JVCLThemesEnabledD56}
|
|
function TJvExHeaderControl.GetParentBackground: Boolean;
|
|
begin
|
|
Result := JvThemes.GetParentBackground(Self);
|
|
end;
|
|
|
|
procedure TJvExHeaderControl.SetParentBackground(Value: Boolean);
|
|
begin
|
|
JvThemes.SetParentBackground(Self, Value);
|
|
end;
|
|
{$ENDIF JVCLThemesEnabledD56}
|
|
|
|
procedure TJvExHeaderControl.WndProc(var Msg: TMessage);
|
|
var
|
|
IdSaveDC: Integer;
|
|
DlgCodes: TDlgCodes;
|
|
Canvas: TCanvas;
|
|
{$IFDEF CLR}
|
|
AHintInfo: THintInfo;
|
|
{$ENDIF CLR}
|
|
begin
|
|
if not DispatchIsDesignMsg(Self, Msg) then
|
|
begin
|
|
case Msg.Msg of
|
|
CM_DENYSUBCLASSING:
|
|
{$IFNDEF CLR}
|
|
Msg.Result := Ord(GetInterfaceEntry(IJvDenySubClassing) <> nil);
|
|
{$ELSE}
|
|
Msg.Result := Integer(Supports(Self, IJvDenySubClassing));
|
|
{$ENDIF !CLR}
|
|
CM_DIALOGCHAR:
|
|
with TCMDialogChar{$IFDEF CLR}.Create{$ENDIF}(Msg) do
|
|
Result := Ord(WantKey(CharCode, KeyDataToShiftState(KeyData), WideChar(CharCode)));
|
|
CM_HINTSHOW:
|
|
{$IFNDEF CLR}
|
|
with TCMHintShow(Msg) do
|
|
Result := Integer(HintShow(HintInfo^));
|
|
{$ELSE}
|
|
with TCMHintShow.Create(Msg) do
|
|
begin
|
|
AHintInfo := HintInfo;
|
|
Result := Integer(HintShow(AHintInfo));
|
|
HintInfo := AHintInfo;
|
|
end;
|
|
{$ENDIF !CLR}
|
|
CM_HITTEST:
|
|
with TCMHitTest{$IFDEF CLR}.Create{$ENDIF}(Msg) do
|
|
Result := Integer(HitTest(XPos, YPos));
|
|
CM_MOUSEENTER:
|
|
MouseEnter({$IFDEF CLR}nil{$ELSE}TControl(Msg.LParam){$ENDIF});
|
|
CM_MOUSELEAVE:
|
|
MouseLeave({$IFDEF CLR}nil{$ELSE}TControl(Msg.LParam){$ENDIF});
|
|
CM_VISIBLECHANGED:
|
|
VisibleChanged;
|
|
CM_ENABLEDCHANGED:
|
|
EnabledChanged;
|
|
CM_TEXTCHANGED:
|
|
TextChanged;
|
|
CM_FONTCHANGED:
|
|
FontChanged;
|
|
CM_COLORCHANGED:
|
|
ColorChanged;
|
|
{$IFNDEF CLR}
|
|
CM_FOCUSCHANGED:
|
|
FocusChanged(TWinControl(Msg.LParam));
|
|
{$ENDIF !CLR}
|
|
CM_PARENTFONTCHANGED:
|
|
ParentFontChanged;
|
|
CM_PARENTCOLORCHANGED:
|
|
ParentColorChanged;
|
|
CM_PARENTSHOWHINTCHANGED:
|
|
ParentShowHintChanged;
|
|
CM_CURSORCHANGED:
|
|
CursorChanged;
|
|
CM_SHOWINGCHANGED:
|
|
ShowingChanged;
|
|
CM_SHOWHINTCHANGED:
|
|
ShowHintChanged;
|
|
{$IFNDEF CLR}
|
|
CM_CONTROLLISTCHANGE:
|
|
if Msg.LParam <> 0 then
|
|
ControlsListChanging(TControl(Msg.WParam), True)
|
|
else
|
|
ControlsListChanged(TControl(Msg.WParam), False);
|
|
CM_CONTROLCHANGE:
|
|
if Msg.LParam = 0 then
|
|
ControlsListChanging(TControl(Msg.WParam), False)
|
|
else
|
|
ControlsListChanged(TControl(Msg.WParam), True);
|
|
{$ENDIF !CLR}
|
|
WM_SETFOCUS:
|
|
FocusSet(THandle(Msg.WParam));
|
|
WM_KILLFOCUS:
|
|
FocusKilled(THandle(Msg.WParam));
|
|
WM_SIZE, WM_MOVE:
|
|
begin
|
|
inherited WndProc(Msg);
|
|
BoundsChanged;
|
|
end;
|
|
WM_ERASEBKGND:
|
|
if Msg.WParam <> 0 then
|
|
begin
|
|
IdSaveDC := SaveDC(HDC(Msg.WParam)); // protect DC against Stock-Objects from Canvas
|
|
Canvas := TCanvas.Create;
|
|
try
|
|
Canvas.Handle := HDC(Msg.WParam);
|
|
Msg.Result := Ord(DoEraseBackground(Canvas, Msg.LParam));
|
|
finally
|
|
Canvas.Handle := 0;
|
|
Canvas.Free;
|
|
RestoreDC(HDC(Msg.WParam), IdSaveDC);
|
|
end;
|
|
end
|
|
else
|
|
inherited WndProc(Msg);
|
|
{$IFNDEF DELPHI2007_UP}
|
|
WM_PRINTCLIENT, WM_PRINT: // VCL bug fix
|
|
begin
|
|
IdSaveDC := SaveDC(HDC(Msg.WParam)); // protect DC against changes
|
|
try
|
|
inherited WndProc(Msg);
|
|
finally
|
|
RestoreDC(HDC(Msg.WParam), IdSaveDC);
|
|
end;
|
|
end;
|
|
{$ENDIF ~DELPHI2007_UP}
|
|
WM_GETDLGCODE:
|
|
begin
|
|
inherited WndProc(Msg);
|
|
DlgCodes := [dcNative] + DlgcToDlgCodes(Msg.Result);
|
|
GetDlgCode(DlgCodes);
|
|
if not (dcNative in DlgCodes) then
|
|
Msg.Result := DlgCodesToDlgc(DlgCodes);
|
|
end;
|
|
else
|
|
inherited WndProc(Msg);
|
|
end;
|
|
case Msg.Msg of // precheck message to prevent access violations on released controls
|
|
CM_MOUSEENTER, CM_MOUSELEAVE, WM_KILLFOCUS, WM_SETFOCUS, WM_NCPAINT:
|
|
if DotNetHighlighting then
|
|
HandleDotNetHighlighting(Self, Msg, MouseOver, Color);
|
|
end;
|
|
end;
|
|
end;
|
|
|
|
//============================================================================
|
|
|
|
constructor TJvExCustomListView.Create(AOwner: TComponent);
|
|
begin
|
|
inherited Create(AOwner);
|
|
FHintColor := clDefault;
|
|
end;
|
|
|
|
function TJvExCustomListView.BaseWndProc(Msg: Integer; WParam: Integer = 0; LParam: Longint = 0): Integer;
|
|
var
|
|
Mesg: TMessage;
|
|
begin
|
|
Mesg := CreateWMMessage(Msg, WParam, LParam);
|
|
inherited WndProc(Mesg);
|
|
Result := Mesg.Result;
|
|
end;
|
|
|
|
function TJvExCustomListView.BaseWndProc(Msg: Integer; WParam: Integer; LParam: TControl): Integer;
|
|
var
|
|
Mesg: TMessage;
|
|
begin
|
|
Mesg := CreateWMMessage(Msg, WParam, LParam);
|
|
inherited WndProc(Mesg);
|
|
Result := Mesg.Result;
|
|
end;
|
|
|
|
function TJvExCustomListView.BaseWndProcEx(Msg: Integer; WParam: Integer; var LParam): Integer;
|
|
var
|
|
Mesg: TStructPtrMessage;
|
|
begin
|
|
Mesg := TStructPtrMessage.Create(Msg, WParam, LParam);
|
|
try
|
|
inherited WndProc(Mesg.Msg);
|
|
finally
|
|
Result := Mesg.Msg.Result;
|
|
Mesg.Free;
|
|
end;
|
|
end;
|
|
|
|
procedure TJvExCustomListView.VisibleChanged;
|
|
begin
|
|
BaseWndProc(CM_VISIBLECHANGED);
|
|
end;
|
|
|
|
procedure TJvExCustomListView.EnabledChanged;
|
|
begin
|
|
BaseWndProc(CM_ENABLEDCHANGED);
|
|
end;
|
|
|
|
procedure TJvExCustomListView.TextChanged;
|
|
begin
|
|
BaseWndProc(CM_TEXTCHANGED);
|
|
end;
|
|
|
|
procedure TJvExCustomListView.FontChanged;
|
|
begin
|
|
BaseWndProc(CM_FONTCHANGED);
|
|
end;
|
|
|
|
procedure TJvExCustomListView.ColorChanged;
|
|
begin
|
|
BaseWndProc(CM_COLORCHANGED);
|
|
end;
|
|
|
|
procedure TJvExCustomListView.ParentFontChanged;
|
|
begin
|
|
BaseWndProc(CM_PARENTFONTCHANGED);
|
|
end;
|
|
|
|
procedure TJvExCustomListView.ParentColorChanged;
|
|
begin
|
|
BaseWndProc(CM_PARENTCOLORCHANGED);
|
|
if Assigned(OnParentColorChange) then
|
|
OnParentColorChange(Self);
|
|
end;
|
|
|
|
procedure TJvExCustomListView.ParentShowHintChanged;
|
|
begin
|
|
BaseWndProc(CM_PARENTSHOWHINTCHANGED);
|
|
end;
|
|
|
|
function TJvExCustomListView.WantKey(Key: Integer; Shift: TShiftState; const KeyText: WideString): Boolean;
|
|
begin
|
|
Result := BaseWndProc(CM_DIALOGCHAR, Word(Key), ShiftStateToKeyData(Shift)) <> 0;
|
|
end;
|
|
|
|
function TJvExCustomListView.HitTest(X, Y: Integer): Boolean;
|
|
begin
|
|
Result := BaseWndProc(CM_HITTEST, 0, SmallPointToLong(PointToSmallPoint(Point(X, Y)))) <> 0;
|
|
end;
|
|
|
|
function TJvExCustomListView.HintShow(var HintInfo: THintInfo): Boolean;
|
|
begin
|
|
GetHintColor(HintInfo, Self, FHintColor);
|
|
if FHintWindowClass <> nil then
|
|
HintInfo.HintWindowClass := FHintWindowClass;
|
|
Result := BaseWndProcEx(CM_HINTSHOW, 0, HintInfo) <> 0;
|
|
end;
|
|
|
|
procedure TJvExCustomListView.MouseEnter(AControl: TControl);
|
|
begin
|
|
FMouseOver := True;
|
|
if Assigned(FOnMouseEnter) then
|
|
FOnMouseEnter(Self);
|
|
BaseWndProc(CM_MOUSEENTER, 0, AControl);
|
|
end;
|
|
|
|
procedure TJvExCustomListView.MouseLeave(AControl: TControl);
|
|
begin
|
|
FMouseOver := False;
|
|
BaseWndProc(CM_MOUSELEAVE, 0, AControl);
|
|
if Assigned(FOnMouseLeave) then
|
|
FOnMouseLeave(Self);
|
|
end;
|
|
|
|
{$IFNDEF CLR}
|
|
procedure TJvExCustomListView.FocusChanged(AControl: TWinControl);
|
|
begin
|
|
BaseWndProc(CM_FOCUSCHANGED, 0, AControl);
|
|
end;
|
|
{$ENDIF !CLR}
|
|
|
|
{$IFDEF COMPILER5}
|
|
{$IFNDEF HASAUTOSIZE}
|
|
|
|
procedure TJvExCustomListView.CMSetAutoSize(var Msg: TMessage);
|
|
begin
|
|
SetAutoSize(Msg.WParam <> 0);
|
|
end;
|
|
|
|
procedure TJvExCustomListView.SetAutoSize(Value: Boolean);
|
|
begin
|
|
TOpenControl_SetAutoSize(Self, Value);
|
|
end;
|
|
|
|
{$ENDIF !HASAUTOSIZE}
|
|
{$ENDIF COMPILER5}
|
|
|
|
procedure TJvExCustomListView.BoundsChanged;
|
|
begin
|
|
end;
|
|
|
|
procedure TJvExCustomListView.CursorChanged;
|
|
begin
|
|
BaseWndProc(CM_CURSORCHANGED);
|
|
end;
|
|
|
|
procedure TJvExCustomListView.ShowingChanged;
|
|
begin
|
|
BaseWndProc(CM_SHOWINGCHANGED);
|
|
end;
|
|
|
|
procedure TJvExCustomListView.ShowHintChanged;
|
|
begin
|
|
BaseWndProc(CM_SHOWHINTCHANGED);
|
|
end;
|
|
|
|
{$IFNDEF CLR}
|
|
{ VCL sends CM_CONTROLLISTCHANGE and CM_CONTROLCHANGE in a different order than
|
|
the CLX methods are used. So we must correct it by evaluating "Inserting". }
|
|
procedure TJvExCustomListView.ControlsListChanging(Control: TControl; Inserting: Boolean);
|
|
begin
|
|
if Inserting then
|
|
BaseWndProc(CM_CONTROLLISTCHANGE, Integer(Control), Integer(Inserting))
|
|
else
|
|
BaseWndProc(CM_CONTROLCHANGE, Integer(Control), Integer(Inserting));
|
|
end;
|
|
|
|
procedure TJvExCustomListView.ControlsListChanged(Control: TControl; Inserting: Boolean);
|
|
begin
|
|
if not Inserting then
|
|
BaseWndProc(CM_CONTROLLISTCHANGE, Integer(Control), Integer(Inserting))
|
|
else
|
|
BaseWndProc(CM_CONTROLCHANGE, Integer(Control), Integer(Inserting));
|
|
end;
|
|
{$ENDIF !CLR}
|
|
|
|
procedure TJvExCustomListView.GetDlgCode(var Code: TDlgCodes);
|
|
begin
|
|
end;
|
|
|
|
procedure TJvExCustomListView.FocusSet(PrevWnd: THandle);
|
|
begin
|
|
BaseWndProc(WM_SETFOCUS, Integer(PrevWnd), 0);
|
|
end;
|
|
|
|
procedure TJvExCustomListView.FocusKilled(NextWnd: THandle);
|
|
begin
|
|
BaseWndProc(WM_KILLFOCUS, Integer(NextWnd), 0);
|
|
end;
|
|
|
|
function TJvExCustomListView.DoEraseBackground(Canvas: TCanvas; Param: Integer): Boolean;
|
|
begin
|
|
Result := BaseWndProc(WM_ERASEBKGND, Canvas.Handle, Param) <> 0;
|
|
end;
|
|
|
|
{$IFDEF JVCLThemesEnabledD56}
|
|
function TJvExCustomListView.GetParentBackground: Boolean;
|
|
begin
|
|
Result := JvThemes.GetParentBackground(Self);
|
|
end;
|
|
|
|
procedure TJvExCustomListView.SetParentBackground(Value: Boolean);
|
|
begin
|
|
JvThemes.SetParentBackground(Self, Value);
|
|
end;
|
|
{$ENDIF JVCLThemesEnabledD56}
|
|
|
|
procedure TJvExCustomListView.WndProc(var Msg: TMessage);
|
|
var
|
|
IdSaveDC: Integer;
|
|
DlgCodes: TDlgCodes;
|
|
Canvas: TCanvas;
|
|
{$IFDEF CLR}
|
|
AHintInfo: THintInfo;
|
|
{$ENDIF CLR}
|
|
begin
|
|
if not DispatchIsDesignMsg(Self, Msg) then
|
|
begin
|
|
case Msg.Msg of
|
|
CM_DENYSUBCLASSING:
|
|
{$IFNDEF CLR}
|
|
Msg.Result := Ord(GetInterfaceEntry(IJvDenySubClassing) <> nil);
|
|
{$ELSE}
|
|
Msg.Result := Integer(Supports(Self, IJvDenySubClassing));
|
|
{$ENDIF !CLR}
|
|
CM_DIALOGCHAR:
|
|
with TCMDialogChar{$IFDEF CLR}.Create{$ENDIF}(Msg) do
|
|
Result := Ord(WantKey(CharCode, KeyDataToShiftState(KeyData), WideChar(CharCode)));
|
|
CM_HINTSHOW:
|
|
{$IFNDEF CLR}
|
|
with TCMHintShow(Msg) do
|
|
Result := Integer(HintShow(HintInfo^));
|
|
{$ELSE}
|
|
with TCMHintShow.Create(Msg) do
|
|
begin
|
|
AHintInfo := HintInfo;
|
|
Result := Integer(HintShow(AHintInfo));
|
|
HintInfo := AHintInfo;
|
|
end;
|
|
{$ENDIF !CLR}
|
|
CM_HITTEST:
|
|
with TCMHitTest{$IFDEF CLR}.Create{$ENDIF}(Msg) do
|
|
Result := Integer(HitTest(XPos, YPos));
|
|
CM_MOUSEENTER:
|
|
MouseEnter({$IFDEF CLR}nil{$ELSE}TControl(Msg.LParam){$ENDIF});
|
|
CM_MOUSELEAVE:
|
|
MouseLeave({$IFDEF CLR}nil{$ELSE}TControl(Msg.LParam){$ENDIF});
|
|
CM_VISIBLECHANGED:
|
|
VisibleChanged;
|
|
CM_ENABLEDCHANGED:
|
|
EnabledChanged;
|
|
CM_TEXTCHANGED:
|
|
TextChanged;
|
|
CM_FONTCHANGED:
|
|
FontChanged;
|
|
CM_COLORCHANGED:
|
|
ColorChanged;
|
|
{$IFNDEF CLR}
|
|
CM_FOCUSCHANGED:
|
|
FocusChanged(TWinControl(Msg.LParam));
|
|
{$ENDIF !CLR}
|
|
CM_PARENTFONTCHANGED:
|
|
ParentFontChanged;
|
|
CM_PARENTCOLORCHANGED:
|
|
ParentColorChanged;
|
|
CM_PARENTSHOWHINTCHANGED:
|
|
ParentShowHintChanged;
|
|
CM_CURSORCHANGED:
|
|
CursorChanged;
|
|
CM_SHOWINGCHANGED:
|
|
ShowingChanged;
|
|
CM_SHOWHINTCHANGED:
|
|
ShowHintChanged;
|
|
{$IFNDEF CLR}
|
|
CM_CONTROLLISTCHANGE:
|
|
if Msg.LParam <> 0 then
|
|
ControlsListChanging(TControl(Msg.WParam), True)
|
|
else
|
|
ControlsListChanged(TControl(Msg.WParam), False);
|
|
CM_CONTROLCHANGE:
|
|
if Msg.LParam = 0 then
|
|
ControlsListChanging(TControl(Msg.WParam), False)
|
|
else
|
|
ControlsListChanged(TControl(Msg.WParam), True);
|
|
{$ENDIF !CLR}
|
|
WM_SETFOCUS:
|
|
FocusSet(THandle(Msg.WParam));
|
|
WM_KILLFOCUS:
|
|
FocusKilled(THandle(Msg.WParam));
|
|
WM_SIZE, WM_MOVE:
|
|
begin
|
|
inherited WndProc(Msg);
|
|
BoundsChanged;
|
|
end;
|
|
WM_ERASEBKGND:
|
|
if Msg.WParam <> 0 then
|
|
begin
|
|
IdSaveDC := SaveDC(HDC(Msg.WParam)); // protect DC against Stock-Objects from Canvas
|
|
Canvas := TCanvas.Create;
|
|
try
|
|
Canvas.Handle := HDC(Msg.WParam);
|
|
Msg.Result := Ord(DoEraseBackground(Canvas, Msg.LParam));
|
|
finally
|
|
Canvas.Handle := 0;
|
|
Canvas.Free;
|
|
RestoreDC(HDC(Msg.WParam), IdSaveDC);
|
|
end;
|
|
end
|
|
else
|
|
inherited WndProc(Msg);
|
|
{$IFNDEF DELPHI2007_UP}
|
|
WM_PRINTCLIENT, WM_PRINT: // VCL bug fix
|
|
begin
|
|
IdSaveDC := SaveDC(HDC(Msg.WParam)); // protect DC against changes
|
|
try
|
|
inherited WndProc(Msg);
|
|
finally
|
|
RestoreDC(HDC(Msg.WParam), IdSaveDC);
|
|
end;
|
|
end;
|
|
{$ENDIF ~DELPHI2007_UP}
|
|
WM_GETDLGCODE:
|
|
begin
|
|
inherited WndProc(Msg);
|
|
DlgCodes := [dcNative] + DlgcToDlgCodes(Msg.Result);
|
|
GetDlgCode(DlgCodes);
|
|
if not (dcNative in DlgCodes) then
|
|
Msg.Result := DlgCodesToDlgc(DlgCodes);
|
|
end;
|
|
else
|
|
inherited WndProc(Msg);
|
|
end;
|
|
case Msg.Msg of // precheck message to prevent access violations on released controls
|
|
CM_MOUSEENTER, CM_MOUSELEAVE, WM_KILLFOCUS, WM_SETFOCUS, WM_NCPAINT:
|
|
if DotNetHighlighting then
|
|
HandleDotNetHighlighting(Self, Msg, MouseOver, Color);
|
|
end;
|
|
end;
|
|
end;
|
|
|
|
//============================================================================
|
|
|
|
constructor TJvExListView.Create(AOwner: TComponent);
|
|
begin
|
|
inherited Create(AOwner);
|
|
FHintColor := clDefault;
|
|
end;
|
|
|
|
function TJvExListView.BaseWndProc(Msg: Integer; WParam: Integer = 0; LParam: Longint = 0): Integer;
|
|
var
|
|
Mesg: TMessage;
|
|
begin
|
|
Mesg := CreateWMMessage(Msg, WParam, LParam);
|
|
inherited WndProc(Mesg);
|
|
Result := Mesg.Result;
|
|
end;
|
|
|
|
function TJvExListView.BaseWndProc(Msg: Integer; WParam: Integer; LParam: TControl): Integer;
|
|
var
|
|
Mesg: TMessage;
|
|
begin
|
|
Mesg := CreateWMMessage(Msg, WParam, LParam);
|
|
inherited WndProc(Mesg);
|
|
Result := Mesg.Result;
|
|
end;
|
|
|
|
function TJvExListView.BaseWndProcEx(Msg: Integer; WParam: Integer; var LParam): Integer;
|
|
var
|
|
Mesg: TStructPtrMessage;
|
|
begin
|
|
Mesg := TStructPtrMessage.Create(Msg, WParam, LParam);
|
|
try
|
|
inherited WndProc(Mesg.Msg);
|
|
finally
|
|
Result := Mesg.Msg.Result;
|
|
Mesg.Free;
|
|
end;
|
|
end;
|
|
|
|
procedure TJvExListView.VisibleChanged;
|
|
begin
|
|
BaseWndProc(CM_VISIBLECHANGED);
|
|
end;
|
|
|
|
procedure TJvExListView.EnabledChanged;
|
|
begin
|
|
BaseWndProc(CM_ENABLEDCHANGED);
|
|
end;
|
|
|
|
procedure TJvExListView.TextChanged;
|
|
begin
|
|
BaseWndProc(CM_TEXTCHANGED);
|
|
end;
|
|
|
|
procedure TJvExListView.FontChanged;
|
|
begin
|
|
BaseWndProc(CM_FONTCHANGED);
|
|
end;
|
|
|
|
procedure TJvExListView.ColorChanged;
|
|
begin
|
|
BaseWndProc(CM_COLORCHANGED);
|
|
end;
|
|
|
|
procedure TJvExListView.ParentFontChanged;
|
|
begin
|
|
BaseWndProc(CM_PARENTFONTCHANGED);
|
|
end;
|
|
|
|
procedure TJvExListView.ParentColorChanged;
|
|
begin
|
|
BaseWndProc(CM_PARENTCOLORCHANGED);
|
|
if Assigned(OnParentColorChange) then
|
|
OnParentColorChange(Self);
|
|
end;
|
|
|
|
procedure TJvExListView.ParentShowHintChanged;
|
|
begin
|
|
BaseWndProc(CM_PARENTSHOWHINTCHANGED);
|
|
end;
|
|
|
|
function TJvExListView.WantKey(Key: Integer; Shift: TShiftState; const KeyText: WideString): Boolean;
|
|
begin
|
|
Result := BaseWndProc(CM_DIALOGCHAR, Word(Key), ShiftStateToKeyData(Shift)) <> 0;
|
|
end;
|
|
|
|
function TJvExListView.HitTest(X, Y: Integer): Boolean;
|
|
begin
|
|
Result := BaseWndProc(CM_HITTEST, 0, SmallPointToLong(PointToSmallPoint(Point(X, Y)))) <> 0;
|
|
end;
|
|
|
|
function TJvExListView.HintShow(var HintInfo: THintInfo): Boolean;
|
|
begin
|
|
GetHintColor(HintInfo, Self, FHintColor);
|
|
if FHintWindowClass <> nil then
|
|
HintInfo.HintWindowClass := FHintWindowClass;
|
|
Result := BaseWndProcEx(CM_HINTSHOW, 0, HintInfo) <> 0;
|
|
end;
|
|
|
|
procedure TJvExListView.MouseEnter(AControl: TControl);
|
|
begin
|
|
FMouseOver := True;
|
|
if Assigned(FOnMouseEnter) then
|
|
FOnMouseEnter(Self);
|
|
BaseWndProc(CM_MOUSEENTER, 0, AControl);
|
|
end;
|
|
|
|
procedure TJvExListView.MouseLeave(AControl: TControl);
|
|
begin
|
|
FMouseOver := False;
|
|
BaseWndProc(CM_MOUSELEAVE, 0, AControl);
|
|
if Assigned(FOnMouseLeave) then
|
|
FOnMouseLeave(Self);
|
|
end;
|
|
|
|
{$IFNDEF CLR}
|
|
procedure TJvExListView.FocusChanged(AControl: TWinControl);
|
|
begin
|
|
BaseWndProc(CM_FOCUSCHANGED, 0, AControl);
|
|
end;
|
|
{$ENDIF !CLR}
|
|
|
|
{$IFDEF COMPILER5}
|
|
{$IFNDEF HASAUTOSIZE}
|
|
|
|
procedure TJvExListView.CMSetAutoSize(var Msg: TMessage);
|
|
begin
|
|
SetAutoSize(Msg.WParam <> 0);
|
|
end;
|
|
|
|
procedure TJvExListView.SetAutoSize(Value: Boolean);
|
|
begin
|
|
TOpenControl_SetAutoSize(Self, Value);
|
|
end;
|
|
|
|
{$ENDIF !HASAUTOSIZE}
|
|
{$ENDIF COMPILER5}
|
|
|
|
procedure TJvExListView.BoundsChanged;
|
|
begin
|
|
end;
|
|
|
|
procedure TJvExListView.CursorChanged;
|
|
begin
|
|
BaseWndProc(CM_CURSORCHANGED);
|
|
end;
|
|
|
|
procedure TJvExListView.ShowingChanged;
|
|
begin
|
|
BaseWndProc(CM_SHOWINGCHANGED);
|
|
end;
|
|
|
|
procedure TJvExListView.ShowHintChanged;
|
|
begin
|
|
BaseWndProc(CM_SHOWHINTCHANGED);
|
|
end;
|
|
|
|
{$IFNDEF CLR}
|
|
{ VCL sends CM_CONTROLLISTCHANGE and CM_CONTROLCHANGE in a different order than
|
|
the CLX methods are used. So we must correct it by evaluating "Inserting". }
|
|
procedure TJvExListView.ControlsListChanging(Control: TControl; Inserting: Boolean);
|
|
begin
|
|
if Inserting then
|
|
BaseWndProc(CM_CONTROLLISTCHANGE, Integer(Control), Integer(Inserting))
|
|
else
|
|
BaseWndProc(CM_CONTROLCHANGE, Integer(Control), Integer(Inserting));
|
|
end;
|
|
|
|
procedure TJvExListView.ControlsListChanged(Control: TControl; Inserting: Boolean);
|
|
begin
|
|
if not Inserting then
|
|
BaseWndProc(CM_CONTROLLISTCHANGE, Integer(Control), Integer(Inserting))
|
|
else
|
|
BaseWndProc(CM_CONTROLCHANGE, Integer(Control), Integer(Inserting));
|
|
end;
|
|
{$ENDIF !CLR}
|
|
|
|
procedure TJvExListView.GetDlgCode(var Code: TDlgCodes);
|
|
begin
|
|
end;
|
|
|
|
procedure TJvExListView.FocusSet(PrevWnd: THandle);
|
|
begin
|
|
BaseWndProc(WM_SETFOCUS, Integer(PrevWnd), 0);
|
|
end;
|
|
|
|
procedure TJvExListView.FocusKilled(NextWnd: THandle);
|
|
begin
|
|
BaseWndProc(WM_KILLFOCUS, Integer(NextWnd), 0);
|
|
end;
|
|
|
|
function TJvExListView.DoEraseBackground(Canvas: TCanvas; Param: Integer): Boolean;
|
|
begin
|
|
Result := BaseWndProc(WM_ERASEBKGND, Canvas.Handle, Param) <> 0;
|
|
end;
|
|
|
|
{$IFDEF JVCLThemesEnabledD56}
|
|
function TJvExListView.GetParentBackground: Boolean;
|
|
begin
|
|
Result := JvThemes.GetParentBackground(Self);
|
|
end;
|
|
|
|
procedure TJvExListView.SetParentBackground(Value: Boolean);
|
|
begin
|
|
JvThemes.SetParentBackground(Self, Value);
|
|
end;
|
|
{$ENDIF JVCLThemesEnabledD56}
|
|
|
|
procedure TJvExListView.WndProc(var Msg: TMessage);
|
|
var
|
|
IdSaveDC: Integer;
|
|
DlgCodes: TDlgCodes;
|
|
Canvas: TCanvas;
|
|
{$IFDEF CLR}
|
|
AHintInfo: THintInfo;
|
|
{$ENDIF CLR}
|
|
begin
|
|
if not DispatchIsDesignMsg(Self, Msg) then
|
|
begin
|
|
case Msg.Msg of
|
|
CM_DENYSUBCLASSING:
|
|
{$IFNDEF CLR}
|
|
Msg.Result := Ord(GetInterfaceEntry(IJvDenySubClassing) <> nil);
|
|
{$ELSE}
|
|
Msg.Result := Integer(Supports(Self, IJvDenySubClassing));
|
|
{$ENDIF !CLR}
|
|
CM_DIALOGCHAR:
|
|
with TCMDialogChar{$IFDEF CLR}.Create{$ENDIF}(Msg) do
|
|
Result := Ord(WantKey(CharCode, KeyDataToShiftState(KeyData), WideChar(CharCode)));
|
|
CM_HINTSHOW:
|
|
{$IFNDEF CLR}
|
|
with TCMHintShow(Msg) do
|
|
Result := Integer(HintShow(HintInfo^));
|
|
{$ELSE}
|
|
with TCMHintShow.Create(Msg) do
|
|
begin
|
|
AHintInfo := HintInfo;
|
|
Result := Integer(HintShow(AHintInfo));
|
|
HintInfo := AHintInfo;
|
|
end;
|
|
{$ENDIF !CLR}
|
|
CM_HITTEST:
|
|
with TCMHitTest{$IFDEF CLR}.Create{$ENDIF}(Msg) do
|
|
Result := Integer(HitTest(XPos, YPos));
|
|
CM_MOUSEENTER:
|
|
MouseEnter({$IFDEF CLR}nil{$ELSE}TControl(Msg.LParam){$ENDIF});
|
|
CM_MOUSELEAVE:
|
|
MouseLeave({$IFDEF CLR}nil{$ELSE}TControl(Msg.LParam){$ENDIF});
|
|
CM_VISIBLECHANGED:
|
|
VisibleChanged;
|
|
CM_ENABLEDCHANGED:
|
|
EnabledChanged;
|
|
CM_TEXTCHANGED:
|
|
TextChanged;
|
|
CM_FONTCHANGED:
|
|
FontChanged;
|
|
CM_COLORCHANGED:
|
|
ColorChanged;
|
|
{$IFNDEF CLR}
|
|
CM_FOCUSCHANGED:
|
|
FocusChanged(TWinControl(Msg.LParam));
|
|
{$ENDIF !CLR}
|
|
CM_PARENTFONTCHANGED:
|
|
ParentFontChanged;
|
|
CM_PARENTCOLORCHANGED:
|
|
ParentColorChanged;
|
|
CM_PARENTSHOWHINTCHANGED:
|
|
ParentShowHintChanged;
|
|
CM_CURSORCHANGED:
|
|
CursorChanged;
|
|
CM_SHOWINGCHANGED:
|
|
ShowingChanged;
|
|
CM_SHOWHINTCHANGED:
|
|
ShowHintChanged;
|
|
{$IFNDEF CLR}
|
|
CM_CONTROLLISTCHANGE:
|
|
if Msg.LParam <> 0 then
|
|
ControlsListChanging(TControl(Msg.WParam), True)
|
|
else
|
|
ControlsListChanged(TControl(Msg.WParam), False);
|
|
CM_CONTROLCHANGE:
|
|
if Msg.LParam = 0 then
|
|
ControlsListChanging(TControl(Msg.WParam), False)
|
|
else
|
|
ControlsListChanged(TControl(Msg.WParam), True);
|
|
{$ENDIF !CLR}
|
|
WM_SETFOCUS:
|
|
FocusSet(THandle(Msg.WParam));
|
|
WM_KILLFOCUS:
|
|
FocusKilled(THandle(Msg.WParam));
|
|
WM_SIZE, WM_MOVE:
|
|
begin
|
|
inherited WndProc(Msg);
|
|
BoundsChanged;
|
|
end;
|
|
WM_ERASEBKGND:
|
|
if Msg.WParam <> 0 then
|
|
begin
|
|
IdSaveDC := SaveDC(HDC(Msg.WParam)); // protect DC against Stock-Objects from Canvas
|
|
Canvas := TCanvas.Create;
|
|
try
|
|
Canvas.Handle := HDC(Msg.WParam);
|
|
Msg.Result := Ord(DoEraseBackground(Canvas, Msg.LParam));
|
|
finally
|
|
Canvas.Handle := 0;
|
|
Canvas.Free;
|
|
RestoreDC(HDC(Msg.WParam), IdSaveDC);
|
|
end;
|
|
end
|
|
else
|
|
inherited WndProc(Msg);
|
|
{$IFNDEF DELPHI2007_UP}
|
|
WM_PRINTCLIENT, WM_PRINT: // VCL bug fix
|
|
begin
|
|
IdSaveDC := SaveDC(HDC(Msg.WParam)); // protect DC against changes
|
|
try
|
|
inherited WndProc(Msg);
|
|
finally
|
|
RestoreDC(HDC(Msg.WParam), IdSaveDC);
|
|
end;
|
|
end;
|
|
{$ENDIF ~DELPHI2007_UP}
|
|
WM_GETDLGCODE:
|
|
begin
|
|
inherited WndProc(Msg);
|
|
DlgCodes := [dcNative] + DlgcToDlgCodes(Msg.Result);
|
|
GetDlgCode(DlgCodes);
|
|
if not (dcNative in DlgCodes) then
|
|
Msg.Result := DlgCodesToDlgc(DlgCodes);
|
|
end;
|
|
else
|
|
inherited WndProc(Msg);
|
|
end;
|
|
case Msg.Msg of // precheck message to prevent access violations on released controls
|
|
CM_MOUSEENTER, CM_MOUSELEAVE, WM_KILLFOCUS, WM_SETFOCUS, WM_NCPAINT:
|
|
if DotNetHighlighting then
|
|
HandleDotNetHighlighting(Self, Msg, MouseOver, Color);
|
|
end;
|
|
end;
|
|
end;
|
|
|
|
//============================================================================
|
|
|
|
constructor TJvExCustomTreeView.Create(AOwner: TComponent);
|
|
begin
|
|
inherited Create(AOwner);
|
|
FHintColor := clDefault;
|
|
end;
|
|
|
|
function TJvExCustomTreeView.BaseWndProc(Msg: Integer; WParam: Integer = 0; LParam: Longint = 0): Integer;
|
|
var
|
|
Mesg: TMessage;
|
|
begin
|
|
Mesg := CreateWMMessage(Msg, WParam, LParam);
|
|
inherited WndProc(Mesg);
|
|
Result := Mesg.Result;
|
|
end;
|
|
|
|
function TJvExCustomTreeView.BaseWndProc(Msg: Integer; WParam: Integer; LParam: TControl): Integer;
|
|
var
|
|
Mesg: TMessage;
|
|
begin
|
|
Mesg := CreateWMMessage(Msg, WParam, LParam);
|
|
inherited WndProc(Mesg);
|
|
Result := Mesg.Result;
|
|
end;
|
|
|
|
function TJvExCustomTreeView.BaseWndProcEx(Msg: Integer; WParam: Integer; var LParam): Integer;
|
|
var
|
|
Mesg: TStructPtrMessage;
|
|
begin
|
|
Mesg := TStructPtrMessage.Create(Msg, WParam, LParam);
|
|
try
|
|
inherited WndProc(Mesg.Msg);
|
|
finally
|
|
Result := Mesg.Msg.Result;
|
|
Mesg.Free;
|
|
end;
|
|
end;
|
|
|
|
procedure TJvExCustomTreeView.VisibleChanged;
|
|
begin
|
|
BaseWndProc(CM_VISIBLECHANGED);
|
|
end;
|
|
|
|
procedure TJvExCustomTreeView.EnabledChanged;
|
|
begin
|
|
BaseWndProc(CM_ENABLEDCHANGED);
|
|
end;
|
|
|
|
procedure TJvExCustomTreeView.TextChanged;
|
|
begin
|
|
BaseWndProc(CM_TEXTCHANGED);
|
|
end;
|
|
|
|
procedure TJvExCustomTreeView.FontChanged;
|
|
begin
|
|
BaseWndProc(CM_FONTCHANGED);
|
|
end;
|
|
|
|
procedure TJvExCustomTreeView.ColorChanged;
|
|
begin
|
|
BaseWndProc(CM_COLORCHANGED);
|
|
end;
|
|
|
|
procedure TJvExCustomTreeView.ParentFontChanged;
|
|
begin
|
|
BaseWndProc(CM_PARENTFONTCHANGED);
|
|
end;
|
|
|
|
procedure TJvExCustomTreeView.ParentColorChanged;
|
|
begin
|
|
BaseWndProc(CM_PARENTCOLORCHANGED);
|
|
if Assigned(OnParentColorChange) then
|
|
OnParentColorChange(Self);
|
|
end;
|
|
|
|
procedure TJvExCustomTreeView.ParentShowHintChanged;
|
|
begin
|
|
BaseWndProc(CM_PARENTSHOWHINTCHANGED);
|
|
end;
|
|
|
|
function TJvExCustomTreeView.WantKey(Key: Integer; Shift: TShiftState; const KeyText: WideString): Boolean;
|
|
begin
|
|
Result := BaseWndProc(CM_DIALOGCHAR, Word(Key), ShiftStateToKeyData(Shift)) <> 0;
|
|
end;
|
|
|
|
function TJvExCustomTreeView.HitTest(X, Y: Integer): Boolean;
|
|
begin
|
|
Result := BaseWndProc(CM_HITTEST, 0, SmallPointToLong(PointToSmallPoint(Point(X, Y)))) <> 0;
|
|
end;
|
|
|
|
function TJvExCustomTreeView.HintShow(var HintInfo: THintInfo): Boolean;
|
|
begin
|
|
GetHintColor(HintInfo, Self, FHintColor);
|
|
if FHintWindowClass <> nil then
|
|
HintInfo.HintWindowClass := FHintWindowClass;
|
|
Result := BaseWndProcEx(CM_HINTSHOW, 0, HintInfo) <> 0;
|
|
end;
|
|
|
|
procedure TJvExCustomTreeView.MouseEnter(AControl: TControl);
|
|
begin
|
|
FMouseOver := True;
|
|
if Assigned(FOnMouseEnter) then
|
|
FOnMouseEnter(Self);
|
|
BaseWndProc(CM_MOUSEENTER, 0, AControl);
|
|
end;
|
|
|
|
procedure TJvExCustomTreeView.MouseLeave(AControl: TControl);
|
|
begin
|
|
FMouseOver := False;
|
|
BaseWndProc(CM_MOUSELEAVE, 0, AControl);
|
|
if Assigned(FOnMouseLeave) then
|
|
FOnMouseLeave(Self);
|
|
end;
|
|
|
|
{$IFNDEF CLR}
|
|
procedure TJvExCustomTreeView.FocusChanged(AControl: TWinControl);
|
|
begin
|
|
BaseWndProc(CM_FOCUSCHANGED, 0, AControl);
|
|
end;
|
|
{$ENDIF !CLR}
|
|
|
|
{$IFDEF COMPILER5}
|
|
{$IFNDEF HASAUTOSIZE}
|
|
|
|
procedure TJvExCustomTreeView.CMSetAutoSize(var Msg: TMessage);
|
|
begin
|
|
SetAutoSize(Msg.WParam <> 0);
|
|
end;
|
|
|
|
procedure TJvExCustomTreeView.SetAutoSize(Value: Boolean);
|
|
begin
|
|
TOpenControl_SetAutoSize(Self, Value);
|
|
end;
|
|
|
|
{$ENDIF !HASAUTOSIZE}
|
|
{$ENDIF COMPILER5}
|
|
|
|
procedure TJvExCustomTreeView.BoundsChanged;
|
|
begin
|
|
end;
|
|
|
|
procedure TJvExCustomTreeView.CursorChanged;
|
|
begin
|
|
BaseWndProc(CM_CURSORCHANGED);
|
|
end;
|
|
|
|
procedure TJvExCustomTreeView.ShowingChanged;
|
|
begin
|
|
BaseWndProc(CM_SHOWINGCHANGED);
|
|
end;
|
|
|
|
procedure TJvExCustomTreeView.ShowHintChanged;
|
|
begin
|
|
BaseWndProc(CM_SHOWHINTCHANGED);
|
|
end;
|
|
|
|
{$IFNDEF CLR}
|
|
{ VCL sends CM_CONTROLLISTCHANGE and CM_CONTROLCHANGE in a different order than
|
|
the CLX methods are used. So we must correct it by evaluating "Inserting". }
|
|
procedure TJvExCustomTreeView.ControlsListChanging(Control: TControl; Inserting: Boolean);
|
|
begin
|
|
if Inserting then
|
|
BaseWndProc(CM_CONTROLLISTCHANGE, Integer(Control), Integer(Inserting))
|
|
else
|
|
BaseWndProc(CM_CONTROLCHANGE, Integer(Control), Integer(Inserting));
|
|
end;
|
|
|
|
procedure TJvExCustomTreeView.ControlsListChanged(Control: TControl; Inserting: Boolean);
|
|
begin
|
|
if not Inserting then
|
|
BaseWndProc(CM_CONTROLLISTCHANGE, Integer(Control), Integer(Inserting))
|
|
else
|
|
BaseWndProc(CM_CONTROLCHANGE, Integer(Control), Integer(Inserting));
|
|
end;
|
|
{$ENDIF !CLR}
|
|
|
|
procedure TJvExCustomTreeView.GetDlgCode(var Code: TDlgCodes);
|
|
begin
|
|
end;
|
|
|
|
procedure TJvExCustomTreeView.FocusSet(PrevWnd: THandle);
|
|
begin
|
|
BaseWndProc(WM_SETFOCUS, Integer(PrevWnd), 0);
|
|
end;
|
|
|
|
procedure TJvExCustomTreeView.FocusKilled(NextWnd: THandle);
|
|
begin
|
|
BaseWndProc(WM_KILLFOCUS, Integer(NextWnd), 0);
|
|
end;
|
|
|
|
function TJvExCustomTreeView.DoEraseBackground(Canvas: TCanvas; Param: Integer): Boolean;
|
|
begin
|
|
Result := BaseWndProc(WM_ERASEBKGND, Canvas.Handle, Param) <> 0;
|
|
end;
|
|
|
|
{$IFDEF JVCLThemesEnabledD56}
|
|
function TJvExCustomTreeView.GetParentBackground: Boolean;
|
|
begin
|
|
Result := JvThemes.GetParentBackground(Self);
|
|
end;
|
|
|
|
procedure TJvExCustomTreeView.SetParentBackground(Value: Boolean);
|
|
begin
|
|
JvThemes.SetParentBackground(Self, Value);
|
|
end;
|
|
{$ENDIF JVCLThemesEnabledD56}
|
|
|
|
procedure TJvExCustomTreeView.WndProc(var Msg: TMessage);
|
|
var
|
|
IdSaveDC: Integer;
|
|
DlgCodes: TDlgCodes;
|
|
Canvas: TCanvas;
|
|
{$IFDEF CLR}
|
|
AHintInfo: THintInfo;
|
|
{$ENDIF CLR}
|
|
begin
|
|
if not DispatchIsDesignMsg(Self, Msg) then
|
|
begin
|
|
case Msg.Msg of
|
|
CM_DENYSUBCLASSING:
|
|
{$IFNDEF CLR}
|
|
Msg.Result := Ord(GetInterfaceEntry(IJvDenySubClassing) <> nil);
|
|
{$ELSE}
|
|
Msg.Result := Integer(Supports(Self, IJvDenySubClassing));
|
|
{$ENDIF !CLR}
|
|
CM_DIALOGCHAR:
|
|
with TCMDialogChar{$IFDEF CLR}.Create{$ENDIF}(Msg) do
|
|
Result := Ord(WantKey(CharCode, KeyDataToShiftState(KeyData), WideChar(CharCode)));
|
|
CM_HINTSHOW:
|
|
{$IFNDEF CLR}
|
|
with TCMHintShow(Msg) do
|
|
Result := Integer(HintShow(HintInfo^));
|
|
{$ELSE}
|
|
with TCMHintShow.Create(Msg) do
|
|
begin
|
|
AHintInfo := HintInfo;
|
|
Result := Integer(HintShow(AHintInfo));
|
|
HintInfo := AHintInfo;
|
|
end;
|
|
{$ENDIF !CLR}
|
|
CM_HITTEST:
|
|
with TCMHitTest{$IFDEF CLR}.Create{$ENDIF}(Msg) do
|
|
Result := Integer(HitTest(XPos, YPos));
|
|
CM_MOUSEENTER:
|
|
MouseEnter({$IFDEF CLR}nil{$ELSE}TControl(Msg.LParam){$ENDIF});
|
|
CM_MOUSELEAVE:
|
|
MouseLeave({$IFDEF CLR}nil{$ELSE}TControl(Msg.LParam){$ENDIF});
|
|
CM_VISIBLECHANGED:
|
|
VisibleChanged;
|
|
CM_ENABLEDCHANGED:
|
|
EnabledChanged;
|
|
CM_TEXTCHANGED:
|
|
TextChanged;
|
|
CM_FONTCHANGED:
|
|
FontChanged;
|
|
CM_COLORCHANGED:
|
|
ColorChanged;
|
|
{$IFNDEF CLR}
|
|
CM_FOCUSCHANGED:
|
|
FocusChanged(TWinControl(Msg.LParam));
|
|
{$ENDIF !CLR}
|
|
CM_PARENTFONTCHANGED:
|
|
ParentFontChanged;
|
|
CM_PARENTCOLORCHANGED:
|
|
ParentColorChanged;
|
|
CM_PARENTSHOWHINTCHANGED:
|
|
ParentShowHintChanged;
|
|
CM_CURSORCHANGED:
|
|
CursorChanged;
|
|
CM_SHOWINGCHANGED:
|
|
ShowingChanged;
|
|
CM_SHOWHINTCHANGED:
|
|
ShowHintChanged;
|
|
{$IFNDEF CLR}
|
|
CM_CONTROLLISTCHANGE:
|
|
if Msg.LParam <> 0 then
|
|
ControlsListChanging(TControl(Msg.WParam), True)
|
|
else
|
|
ControlsListChanged(TControl(Msg.WParam), False);
|
|
CM_CONTROLCHANGE:
|
|
if Msg.LParam = 0 then
|
|
ControlsListChanging(TControl(Msg.WParam), False)
|
|
else
|
|
ControlsListChanged(TControl(Msg.WParam), True);
|
|
{$ENDIF !CLR}
|
|
WM_SETFOCUS:
|
|
FocusSet(THandle(Msg.WParam));
|
|
WM_KILLFOCUS:
|
|
FocusKilled(THandle(Msg.WParam));
|
|
WM_SIZE, WM_MOVE:
|
|
begin
|
|
inherited WndProc(Msg);
|
|
BoundsChanged;
|
|
end;
|
|
WM_ERASEBKGND:
|
|
if Msg.WParam <> 0 then
|
|
begin
|
|
IdSaveDC := SaveDC(HDC(Msg.WParam)); // protect DC against Stock-Objects from Canvas
|
|
Canvas := TCanvas.Create;
|
|
try
|
|
Canvas.Handle := HDC(Msg.WParam);
|
|
Msg.Result := Ord(DoEraseBackground(Canvas, Msg.LParam));
|
|
finally
|
|
Canvas.Handle := 0;
|
|
Canvas.Free;
|
|
RestoreDC(HDC(Msg.WParam), IdSaveDC);
|
|
end;
|
|
end
|
|
else
|
|
inherited WndProc(Msg);
|
|
{$IFNDEF DELPHI2007_UP}
|
|
WM_PRINTCLIENT, WM_PRINT: // VCL bug fix
|
|
begin
|
|
IdSaveDC := SaveDC(HDC(Msg.WParam)); // protect DC against changes
|
|
try
|
|
inherited WndProc(Msg);
|
|
finally
|
|
RestoreDC(HDC(Msg.WParam), IdSaveDC);
|
|
end;
|
|
end;
|
|
{$ENDIF ~DELPHI2007_UP}
|
|
WM_GETDLGCODE:
|
|
begin
|
|
inherited WndProc(Msg);
|
|
DlgCodes := [dcNative] + DlgcToDlgCodes(Msg.Result);
|
|
GetDlgCode(DlgCodes);
|
|
if not (dcNative in DlgCodes) then
|
|
Msg.Result := DlgCodesToDlgc(DlgCodes);
|
|
end;
|
|
else
|
|
inherited WndProc(Msg);
|
|
end;
|
|
case Msg.Msg of // precheck message to prevent access violations on released controls
|
|
CM_MOUSEENTER, CM_MOUSELEAVE, WM_KILLFOCUS, WM_SETFOCUS, WM_NCPAINT:
|
|
if DotNetHighlighting then
|
|
HandleDotNetHighlighting(Self, Msg, MouseOver, Color);
|
|
end;
|
|
end;
|
|
end;
|
|
|
|
//============================================================================
|
|
|
|
constructor TJvExTreeView.Create(AOwner: TComponent);
|
|
begin
|
|
inherited Create(AOwner);
|
|
FHintColor := clDefault;
|
|
end;
|
|
|
|
function TJvExTreeView.BaseWndProc(Msg: Integer; WParam: Integer = 0; LParam: Longint = 0): Integer;
|
|
var
|
|
Mesg: TMessage;
|
|
begin
|
|
Mesg := CreateWMMessage(Msg, WParam, LParam);
|
|
inherited WndProc(Mesg);
|
|
Result := Mesg.Result;
|
|
end;
|
|
|
|
function TJvExTreeView.BaseWndProc(Msg: Integer; WParam: Integer; LParam: TControl): Integer;
|
|
var
|
|
Mesg: TMessage;
|
|
begin
|
|
Mesg := CreateWMMessage(Msg, WParam, LParam);
|
|
inherited WndProc(Mesg);
|
|
Result := Mesg.Result;
|
|
end;
|
|
|
|
function TJvExTreeView.BaseWndProcEx(Msg: Integer; WParam: Integer; var LParam): Integer;
|
|
var
|
|
Mesg: TStructPtrMessage;
|
|
begin
|
|
Mesg := TStructPtrMessage.Create(Msg, WParam, LParam);
|
|
try
|
|
inherited WndProc(Mesg.Msg);
|
|
finally
|
|
Result := Mesg.Msg.Result;
|
|
Mesg.Free;
|
|
end;
|
|
end;
|
|
|
|
procedure TJvExTreeView.VisibleChanged;
|
|
begin
|
|
BaseWndProc(CM_VISIBLECHANGED);
|
|
end;
|
|
|
|
procedure TJvExTreeView.EnabledChanged;
|
|
begin
|
|
BaseWndProc(CM_ENABLEDCHANGED);
|
|
end;
|
|
|
|
procedure TJvExTreeView.TextChanged;
|
|
begin
|
|
BaseWndProc(CM_TEXTCHANGED);
|
|
end;
|
|
|
|
procedure TJvExTreeView.FontChanged;
|
|
begin
|
|
BaseWndProc(CM_FONTCHANGED);
|
|
end;
|
|
|
|
procedure TJvExTreeView.ColorChanged;
|
|
begin
|
|
BaseWndProc(CM_COLORCHANGED);
|
|
end;
|
|
|
|
procedure TJvExTreeView.ParentFontChanged;
|
|
begin
|
|
BaseWndProc(CM_PARENTFONTCHANGED);
|
|
end;
|
|
|
|
procedure TJvExTreeView.ParentColorChanged;
|
|
begin
|
|
BaseWndProc(CM_PARENTCOLORCHANGED);
|
|
if Assigned(OnParentColorChange) then
|
|
OnParentColorChange(Self);
|
|
end;
|
|
|
|
procedure TJvExTreeView.ParentShowHintChanged;
|
|
begin
|
|
BaseWndProc(CM_PARENTSHOWHINTCHANGED);
|
|
end;
|
|
|
|
function TJvExTreeView.WantKey(Key: Integer; Shift: TShiftState; const KeyText: WideString): Boolean;
|
|
begin
|
|
Result := BaseWndProc(CM_DIALOGCHAR, Word(Key), ShiftStateToKeyData(Shift)) <> 0;
|
|
end;
|
|
|
|
function TJvExTreeView.HitTest(X, Y: Integer): Boolean;
|
|
begin
|
|
Result := BaseWndProc(CM_HITTEST, 0, SmallPointToLong(PointToSmallPoint(Point(X, Y)))) <> 0;
|
|
end;
|
|
|
|
function TJvExTreeView.HintShow(var HintInfo: THintInfo): Boolean;
|
|
begin
|
|
GetHintColor(HintInfo, Self, FHintColor);
|
|
if FHintWindowClass <> nil then
|
|
HintInfo.HintWindowClass := FHintWindowClass;
|
|
Result := BaseWndProcEx(CM_HINTSHOW, 0, HintInfo) <> 0;
|
|
end;
|
|
|
|
procedure TJvExTreeView.MouseEnter(AControl: TControl);
|
|
begin
|
|
FMouseOver := True;
|
|
if Assigned(FOnMouseEnter) then
|
|
FOnMouseEnter(Self);
|
|
BaseWndProc(CM_MOUSEENTER, 0, AControl);
|
|
end;
|
|
|
|
procedure TJvExTreeView.MouseLeave(AControl: TControl);
|
|
begin
|
|
FMouseOver := False;
|
|
BaseWndProc(CM_MOUSELEAVE, 0, AControl);
|
|
if Assigned(FOnMouseLeave) then
|
|
FOnMouseLeave(Self);
|
|
end;
|
|
|
|
{$IFNDEF CLR}
|
|
procedure TJvExTreeView.FocusChanged(AControl: TWinControl);
|
|
begin
|
|
BaseWndProc(CM_FOCUSCHANGED, 0, AControl);
|
|
end;
|
|
{$ENDIF !CLR}
|
|
|
|
{$IFDEF COMPILER5}
|
|
{$IFNDEF HASAUTOSIZE}
|
|
|
|
procedure TJvExTreeView.CMSetAutoSize(var Msg: TMessage);
|
|
begin
|
|
SetAutoSize(Msg.WParam <> 0);
|
|
end;
|
|
|
|
procedure TJvExTreeView.SetAutoSize(Value: Boolean);
|
|
begin
|
|
TOpenControl_SetAutoSize(Self, Value);
|
|
end;
|
|
|
|
{$ENDIF !HASAUTOSIZE}
|
|
{$ENDIF COMPILER5}
|
|
|
|
procedure TJvExTreeView.BoundsChanged;
|
|
begin
|
|
end;
|
|
|
|
procedure TJvExTreeView.CursorChanged;
|
|
begin
|
|
BaseWndProc(CM_CURSORCHANGED);
|
|
end;
|
|
|
|
procedure TJvExTreeView.ShowingChanged;
|
|
begin
|
|
BaseWndProc(CM_SHOWINGCHANGED);
|
|
end;
|
|
|
|
procedure TJvExTreeView.ShowHintChanged;
|
|
begin
|
|
BaseWndProc(CM_SHOWHINTCHANGED);
|
|
end;
|
|
|
|
{$IFNDEF CLR}
|
|
{ VCL sends CM_CONTROLLISTCHANGE and CM_CONTROLCHANGE in a different order than
|
|
the CLX methods are used. So we must correct it by evaluating "Inserting". }
|
|
procedure TJvExTreeView.ControlsListChanging(Control: TControl; Inserting: Boolean);
|
|
begin
|
|
if Inserting then
|
|
BaseWndProc(CM_CONTROLLISTCHANGE, Integer(Control), Integer(Inserting))
|
|
else
|
|
BaseWndProc(CM_CONTROLCHANGE, Integer(Control), Integer(Inserting));
|
|
end;
|
|
|
|
procedure TJvExTreeView.ControlsListChanged(Control: TControl; Inserting: Boolean);
|
|
begin
|
|
if not Inserting then
|
|
BaseWndProc(CM_CONTROLLISTCHANGE, Integer(Control), Integer(Inserting))
|
|
else
|
|
BaseWndProc(CM_CONTROLCHANGE, Integer(Control), Integer(Inserting));
|
|
end;
|
|
{$ENDIF !CLR}
|
|
|
|
procedure TJvExTreeView.GetDlgCode(var Code: TDlgCodes);
|
|
begin
|
|
end;
|
|
|
|
procedure TJvExTreeView.FocusSet(PrevWnd: THandle);
|
|
begin
|
|
BaseWndProc(WM_SETFOCUS, Integer(PrevWnd), 0);
|
|
end;
|
|
|
|
procedure TJvExTreeView.FocusKilled(NextWnd: THandle);
|
|
begin
|
|
BaseWndProc(WM_KILLFOCUS, Integer(NextWnd), 0);
|
|
end;
|
|
|
|
function TJvExTreeView.DoEraseBackground(Canvas: TCanvas; Param: Integer): Boolean;
|
|
begin
|
|
Result := BaseWndProc(WM_ERASEBKGND, Canvas.Handle, Param) <> 0;
|
|
end;
|
|
|
|
{$IFDEF JVCLThemesEnabledD56}
|
|
function TJvExTreeView.GetParentBackground: Boolean;
|
|
begin
|
|
Result := JvThemes.GetParentBackground(Self);
|
|
end;
|
|
|
|
procedure TJvExTreeView.SetParentBackground(Value: Boolean);
|
|
begin
|
|
JvThemes.SetParentBackground(Self, Value);
|
|
end;
|
|
{$ENDIF JVCLThemesEnabledD56}
|
|
|
|
procedure TJvExTreeView.WndProc(var Msg: TMessage);
|
|
var
|
|
IdSaveDC: Integer;
|
|
DlgCodes: TDlgCodes;
|
|
Canvas: TCanvas;
|
|
{$IFDEF CLR}
|
|
AHintInfo: THintInfo;
|
|
{$ENDIF CLR}
|
|
begin
|
|
if not DispatchIsDesignMsg(Self, Msg) then
|
|
begin
|
|
case Msg.Msg of
|
|
CM_DENYSUBCLASSING:
|
|
{$IFNDEF CLR}
|
|
Msg.Result := Ord(GetInterfaceEntry(IJvDenySubClassing) <> nil);
|
|
{$ELSE}
|
|
Msg.Result := Integer(Supports(Self, IJvDenySubClassing));
|
|
{$ENDIF !CLR}
|
|
CM_DIALOGCHAR:
|
|
with TCMDialogChar{$IFDEF CLR}.Create{$ENDIF}(Msg) do
|
|
Result := Ord(WantKey(CharCode, KeyDataToShiftState(KeyData), WideChar(CharCode)));
|
|
CM_HINTSHOW:
|
|
{$IFNDEF CLR}
|
|
with TCMHintShow(Msg) do
|
|
Result := Integer(HintShow(HintInfo^));
|
|
{$ELSE}
|
|
with TCMHintShow.Create(Msg) do
|
|
begin
|
|
AHintInfo := HintInfo;
|
|
Result := Integer(HintShow(AHintInfo));
|
|
HintInfo := AHintInfo;
|
|
end;
|
|
{$ENDIF !CLR}
|
|
CM_HITTEST:
|
|
with TCMHitTest{$IFDEF CLR}.Create{$ENDIF}(Msg) do
|
|
Result := Integer(HitTest(XPos, YPos));
|
|
CM_MOUSEENTER:
|
|
MouseEnter({$IFDEF CLR}nil{$ELSE}TControl(Msg.LParam){$ENDIF});
|
|
CM_MOUSELEAVE:
|
|
MouseLeave({$IFDEF CLR}nil{$ELSE}TControl(Msg.LParam){$ENDIF});
|
|
CM_VISIBLECHANGED:
|
|
VisibleChanged;
|
|
CM_ENABLEDCHANGED:
|
|
EnabledChanged;
|
|
CM_TEXTCHANGED:
|
|
TextChanged;
|
|
CM_FONTCHANGED:
|
|
FontChanged;
|
|
CM_COLORCHANGED:
|
|
ColorChanged;
|
|
{$IFNDEF CLR}
|
|
CM_FOCUSCHANGED:
|
|
FocusChanged(TWinControl(Msg.LParam));
|
|
{$ENDIF !CLR}
|
|
CM_PARENTFONTCHANGED:
|
|
ParentFontChanged;
|
|
CM_PARENTCOLORCHANGED:
|
|
ParentColorChanged;
|
|
CM_PARENTSHOWHINTCHANGED:
|
|
ParentShowHintChanged;
|
|
CM_CURSORCHANGED:
|
|
CursorChanged;
|
|
CM_SHOWINGCHANGED:
|
|
ShowingChanged;
|
|
CM_SHOWHINTCHANGED:
|
|
ShowHintChanged;
|
|
{$IFNDEF CLR}
|
|
CM_CONTROLLISTCHANGE:
|
|
if Msg.LParam <> 0 then
|
|
ControlsListChanging(TControl(Msg.WParam), True)
|
|
else
|
|
ControlsListChanged(TControl(Msg.WParam), False);
|
|
CM_CONTROLCHANGE:
|
|
if Msg.LParam = 0 then
|
|
ControlsListChanging(TControl(Msg.WParam), False)
|
|
else
|
|
ControlsListChanged(TControl(Msg.WParam), True);
|
|
{$ENDIF !CLR}
|
|
WM_SETFOCUS:
|
|
FocusSet(THandle(Msg.WParam));
|
|
WM_KILLFOCUS:
|
|
FocusKilled(THandle(Msg.WParam));
|
|
WM_SIZE, WM_MOVE:
|
|
begin
|
|
inherited WndProc(Msg);
|
|
BoundsChanged;
|
|
end;
|
|
WM_ERASEBKGND:
|
|
if Msg.WParam <> 0 then
|
|
begin
|
|
IdSaveDC := SaveDC(HDC(Msg.WParam)); // protect DC against Stock-Objects from Canvas
|
|
Canvas := TCanvas.Create;
|
|
try
|
|
Canvas.Handle := HDC(Msg.WParam);
|
|
Msg.Result := Ord(DoEraseBackground(Canvas, Msg.LParam));
|
|
finally
|
|
Canvas.Handle := 0;
|
|
Canvas.Free;
|
|
RestoreDC(HDC(Msg.WParam), IdSaveDC);
|
|
end;
|
|
end
|
|
else
|
|
inherited WndProc(Msg);
|
|
{$IFNDEF DELPHI2007_UP}
|
|
WM_PRINTCLIENT, WM_PRINT: // VCL bug fix
|
|
begin
|
|
IdSaveDC := SaveDC(HDC(Msg.WParam)); // protect DC against changes
|
|
try
|
|
inherited WndProc(Msg);
|
|
finally
|
|
RestoreDC(HDC(Msg.WParam), IdSaveDC);
|
|
end;
|
|
end;
|
|
{$ENDIF ~DELPHI2007_UP}
|
|
WM_GETDLGCODE:
|
|
begin
|
|
inherited WndProc(Msg);
|
|
DlgCodes := [dcNative] + DlgcToDlgCodes(Msg.Result);
|
|
GetDlgCode(DlgCodes);
|
|
if not (dcNative in DlgCodes) then
|
|
Msg.Result := DlgCodesToDlgc(DlgCodes);
|
|
end;
|
|
else
|
|
inherited WndProc(Msg);
|
|
end;
|
|
case Msg.Msg of // precheck message to prevent access violations on released controls
|
|
CM_MOUSEENTER, CM_MOUSELEAVE, WM_KILLFOCUS, WM_SETFOCUS, WM_NCPAINT:
|
|
if DotNetHighlighting then
|
|
HandleDotNetHighlighting(Self, Msg, MouseOver, Color);
|
|
end;
|
|
end;
|
|
end;
|
|
|
|
//============================================================================
|
|
|
|
constructor TJvExTrackBar.Create(AOwner: TComponent);
|
|
begin
|
|
inherited Create(AOwner);
|
|
FHintColor := clDefault;
|
|
end;
|
|
|
|
function TJvExTrackBar.BaseWndProc(Msg: Integer; WParam: Integer = 0; LParam: Longint = 0): Integer;
|
|
var
|
|
Mesg: TMessage;
|
|
begin
|
|
Mesg := CreateWMMessage(Msg, WParam, LParam);
|
|
inherited WndProc(Mesg);
|
|
Result := Mesg.Result;
|
|
end;
|
|
|
|
function TJvExTrackBar.BaseWndProc(Msg: Integer; WParam: Integer; LParam: TControl): Integer;
|
|
var
|
|
Mesg: TMessage;
|
|
begin
|
|
Mesg := CreateWMMessage(Msg, WParam, LParam);
|
|
inherited WndProc(Mesg);
|
|
Result := Mesg.Result;
|
|
end;
|
|
|
|
function TJvExTrackBar.BaseWndProcEx(Msg: Integer; WParam: Integer; var LParam): Integer;
|
|
var
|
|
Mesg: TStructPtrMessage;
|
|
begin
|
|
Mesg := TStructPtrMessage.Create(Msg, WParam, LParam);
|
|
try
|
|
inherited WndProc(Mesg.Msg);
|
|
finally
|
|
Result := Mesg.Msg.Result;
|
|
Mesg.Free;
|
|
end;
|
|
end;
|
|
|
|
procedure TJvExTrackBar.VisibleChanged;
|
|
begin
|
|
BaseWndProc(CM_VISIBLECHANGED);
|
|
end;
|
|
|
|
procedure TJvExTrackBar.EnabledChanged;
|
|
begin
|
|
BaseWndProc(CM_ENABLEDCHANGED);
|
|
end;
|
|
|
|
procedure TJvExTrackBar.TextChanged;
|
|
begin
|
|
BaseWndProc(CM_TEXTCHANGED);
|
|
end;
|
|
|
|
procedure TJvExTrackBar.FontChanged;
|
|
begin
|
|
BaseWndProc(CM_FONTCHANGED);
|
|
end;
|
|
|
|
procedure TJvExTrackBar.ColorChanged;
|
|
begin
|
|
BaseWndProc(CM_COLORCHANGED);
|
|
end;
|
|
|
|
procedure TJvExTrackBar.ParentFontChanged;
|
|
begin
|
|
BaseWndProc(CM_PARENTFONTCHANGED);
|
|
end;
|
|
|
|
procedure TJvExTrackBar.ParentColorChanged;
|
|
begin
|
|
BaseWndProc(CM_PARENTCOLORCHANGED);
|
|
if Assigned(OnParentColorChange) then
|
|
OnParentColorChange(Self);
|
|
end;
|
|
|
|
procedure TJvExTrackBar.ParentShowHintChanged;
|
|
begin
|
|
BaseWndProc(CM_PARENTSHOWHINTCHANGED);
|
|
end;
|
|
|
|
function TJvExTrackBar.WantKey(Key: Integer; Shift: TShiftState; const KeyText: WideString): Boolean;
|
|
begin
|
|
Result := BaseWndProc(CM_DIALOGCHAR, Word(Key), ShiftStateToKeyData(Shift)) <> 0;
|
|
end;
|
|
|
|
function TJvExTrackBar.HitTest(X, Y: Integer): Boolean;
|
|
begin
|
|
Result := BaseWndProc(CM_HITTEST, 0, SmallPointToLong(PointToSmallPoint(Point(X, Y)))) <> 0;
|
|
end;
|
|
|
|
function TJvExTrackBar.HintShow(var HintInfo: THintInfo): Boolean;
|
|
begin
|
|
GetHintColor(HintInfo, Self, FHintColor);
|
|
if FHintWindowClass <> nil then
|
|
HintInfo.HintWindowClass := FHintWindowClass;
|
|
Result := BaseWndProcEx(CM_HINTSHOW, 0, HintInfo) <> 0;
|
|
end;
|
|
|
|
procedure TJvExTrackBar.MouseEnter(AControl: TControl);
|
|
begin
|
|
FMouseOver := True;
|
|
if Assigned(FOnMouseEnter) then
|
|
FOnMouseEnter(Self);
|
|
BaseWndProc(CM_MOUSEENTER, 0, AControl);
|
|
end;
|
|
|
|
procedure TJvExTrackBar.MouseLeave(AControl: TControl);
|
|
begin
|
|
FMouseOver := False;
|
|
BaseWndProc(CM_MOUSELEAVE, 0, AControl);
|
|
if Assigned(FOnMouseLeave) then
|
|
FOnMouseLeave(Self);
|
|
end;
|
|
|
|
{$IFNDEF CLR}
|
|
procedure TJvExTrackBar.FocusChanged(AControl: TWinControl);
|
|
begin
|
|
BaseWndProc(CM_FOCUSCHANGED, 0, AControl);
|
|
end;
|
|
{$ENDIF !CLR}
|
|
|
|
{$IFDEF COMPILER5}
|
|
{$IFNDEF HASAUTOSIZE}
|
|
|
|
procedure TJvExTrackBar.CMSetAutoSize(var Msg: TMessage);
|
|
begin
|
|
SetAutoSize(Msg.WParam <> 0);
|
|
end;
|
|
|
|
procedure TJvExTrackBar.SetAutoSize(Value: Boolean);
|
|
begin
|
|
TOpenControl_SetAutoSize(Self, Value);
|
|
end;
|
|
|
|
{$ENDIF !HASAUTOSIZE}
|
|
{$ENDIF COMPILER5}
|
|
|
|
procedure TJvExTrackBar.BoundsChanged;
|
|
begin
|
|
end;
|
|
|
|
procedure TJvExTrackBar.CursorChanged;
|
|
begin
|
|
BaseWndProc(CM_CURSORCHANGED);
|
|
end;
|
|
|
|
procedure TJvExTrackBar.ShowingChanged;
|
|
begin
|
|
BaseWndProc(CM_SHOWINGCHANGED);
|
|
end;
|
|
|
|
procedure TJvExTrackBar.ShowHintChanged;
|
|
begin
|
|
BaseWndProc(CM_SHOWHINTCHANGED);
|
|
end;
|
|
|
|
{$IFNDEF CLR}
|
|
{ VCL sends CM_CONTROLLISTCHANGE and CM_CONTROLCHANGE in a different order than
|
|
the CLX methods are used. So we must correct it by evaluating "Inserting". }
|
|
procedure TJvExTrackBar.ControlsListChanging(Control: TControl; Inserting: Boolean);
|
|
begin
|
|
if Inserting then
|
|
BaseWndProc(CM_CONTROLLISTCHANGE, Integer(Control), Integer(Inserting))
|
|
else
|
|
BaseWndProc(CM_CONTROLCHANGE, Integer(Control), Integer(Inserting));
|
|
end;
|
|
|
|
procedure TJvExTrackBar.ControlsListChanged(Control: TControl; Inserting: Boolean);
|
|
begin
|
|
if not Inserting then
|
|
BaseWndProc(CM_CONTROLLISTCHANGE, Integer(Control), Integer(Inserting))
|
|
else
|
|
BaseWndProc(CM_CONTROLCHANGE, Integer(Control), Integer(Inserting));
|
|
end;
|
|
{$ENDIF !CLR}
|
|
|
|
procedure TJvExTrackBar.GetDlgCode(var Code: TDlgCodes);
|
|
begin
|
|
end;
|
|
|
|
procedure TJvExTrackBar.FocusSet(PrevWnd: THandle);
|
|
begin
|
|
BaseWndProc(WM_SETFOCUS, Integer(PrevWnd), 0);
|
|
end;
|
|
|
|
procedure TJvExTrackBar.FocusKilled(NextWnd: THandle);
|
|
begin
|
|
BaseWndProc(WM_KILLFOCUS, Integer(NextWnd), 0);
|
|
end;
|
|
|
|
function TJvExTrackBar.DoEraseBackground(Canvas: TCanvas; Param: Integer): Boolean;
|
|
begin
|
|
Result := BaseWndProc(WM_ERASEBKGND, Canvas.Handle, Param) <> 0;
|
|
end;
|
|
|
|
{$IFDEF JVCLThemesEnabledD56}
|
|
function TJvExTrackBar.GetParentBackground: Boolean;
|
|
begin
|
|
Result := JvThemes.GetParentBackground(Self);
|
|
end;
|
|
|
|
procedure TJvExTrackBar.SetParentBackground(Value: Boolean);
|
|
begin
|
|
JvThemes.SetParentBackground(Self, Value);
|
|
end;
|
|
{$ENDIF JVCLThemesEnabledD56}
|
|
|
|
procedure TJvExTrackBar.WndProc(var Msg: TMessage);
|
|
var
|
|
IdSaveDC: Integer;
|
|
DlgCodes: TDlgCodes;
|
|
Canvas: TCanvas;
|
|
{$IFDEF CLR}
|
|
AHintInfo: THintInfo;
|
|
{$ENDIF CLR}
|
|
begin
|
|
if not DispatchIsDesignMsg(Self, Msg) then
|
|
begin
|
|
case Msg.Msg of
|
|
CM_DENYSUBCLASSING:
|
|
{$IFNDEF CLR}
|
|
Msg.Result := Ord(GetInterfaceEntry(IJvDenySubClassing) <> nil);
|
|
{$ELSE}
|
|
Msg.Result := Integer(Supports(Self, IJvDenySubClassing));
|
|
{$ENDIF !CLR}
|
|
CM_DIALOGCHAR:
|
|
with TCMDialogChar{$IFDEF CLR}.Create{$ENDIF}(Msg) do
|
|
Result := Ord(WantKey(CharCode, KeyDataToShiftState(KeyData), WideChar(CharCode)));
|
|
CM_HINTSHOW:
|
|
{$IFNDEF CLR}
|
|
with TCMHintShow(Msg) do
|
|
Result := Integer(HintShow(HintInfo^));
|
|
{$ELSE}
|
|
with TCMHintShow.Create(Msg) do
|
|
begin
|
|
AHintInfo := HintInfo;
|
|
Result := Integer(HintShow(AHintInfo));
|
|
HintInfo := AHintInfo;
|
|
end;
|
|
{$ENDIF !CLR}
|
|
CM_HITTEST:
|
|
with TCMHitTest{$IFDEF CLR}.Create{$ENDIF}(Msg) do
|
|
Result := Integer(HitTest(XPos, YPos));
|
|
CM_MOUSEENTER:
|
|
MouseEnter({$IFDEF CLR}nil{$ELSE}TControl(Msg.LParam){$ENDIF});
|
|
CM_MOUSELEAVE:
|
|
MouseLeave({$IFDEF CLR}nil{$ELSE}TControl(Msg.LParam){$ENDIF});
|
|
CM_VISIBLECHANGED:
|
|
VisibleChanged;
|
|
CM_ENABLEDCHANGED:
|
|
EnabledChanged;
|
|
CM_TEXTCHANGED:
|
|
TextChanged;
|
|
CM_FONTCHANGED:
|
|
FontChanged;
|
|
CM_COLORCHANGED:
|
|
ColorChanged;
|
|
{$IFNDEF CLR}
|
|
CM_FOCUSCHANGED:
|
|
FocusChanged(TWinControl(Msg.LParam));
|
|
{$ENDIF !CLR}
|
|
CM_PARENTFONTCHANGED:
|
|
ParentFontChanged;
|
|
CM_PARENTCOLORCHANGED:
|
|
ParentColorChanged;
|
|
CM_PARENTSHOWHINTCHANGED:
|
|
ParentShowHintChanged;
|
|
CM_CURSORCHANGED:
|
|
CursorChanged;
|
|
CM_SHOWINGCHANGED:
|
|
ShowingChanged;
|
|
CM_SHOWHINTCHANGED:
|
|
ShowHintChanged;
|
|
{$IFNDEF CLR}
|
|
CM_CONTROLLISTCHANGE:
|
|
if Msg.LParam <> 0 then
|
|
ControlsListChanging(TControl(Msg.WParam), True)
|
|
else
|
|
ControlsListChanged(TControl(Msg.WParam), False);
|
|
CM_CONTROLCHANGE:
|
|
if Msg.LParam = 0 then
|
|
ControlsListChanging(TControl(Msg.WParam), False)
|
|
else
|
|
ControlsListChanged(TControl(Msg.WParam), True);
|
|
{$ENDIF !CLR}
|
|
WM_SETFOCUS:
|
|
FocusSet(THandle(Msg.WParam));
|
|
WM_KILLFOCUS:
|
|
FocusKilled(THandle(Msg.WParam));
|
|
WM_SIZE, WM_MOVE:
|
|
begin
|
|
inherited WndProc(Msg);
|
|
BoundsChanged;
|
|
end;
|
|
WM_ERASEBKGND:
|
|
if Msg.WParam <> 0 then
|
|
begin
|
|
IdSaveDC := SaveDC(HDC(Msg.WParam)); // protect DC against Stock-Objects from Canvas
|
|
Canvas := TCanvas.Create;
|
|
try
|
|
Canvas.Handle := HDC(Msg.WParam);
|
|
Msg.Result := Ord(DoEraseBackground(Canvas, Msg.LParam));
|
|
finally
|
|
Canvas.Handle := 0;
|
|
Canvas.Free;
|
|
RestoreDC(HDC(Msg.WParam), IdSaveDC);
|
|
end;
|
|
end
|
|
else
|
|
inherited WndProc(Msg);
|
|
{$IFNDEF DELPHI2007_UP}
|
|
WM_PRINTCLIENT, WM_PRINT: // VCL bug fix
|
|
begin
|
|
IdSaveDC := SaveDC(HDC(Msg.WParam)); // protect DC against changes
|
|
try
|
|
inherited WndProc(Msg);
|
|
finally
|
|
RestoreDC(HDC(Msg.WParam), IdSaveDC);
|
|
end;
|
|
end;
|
|
{$ENDIF ~DELPHI2007_UP}
|
|
WM_GETDLGCODE:
|
|
begin
|
|
inherited WndProc(Msg);
|
|
DlgCodes := [dcNative] + DlgcToDlgCodes(Msg.Result);
|
|
GetDlgCode(DlgCodes);
|
|
if not (dcNative in DlgCodes) then
|
|
Msg.Result := DlgCodesToDlgc(DlgCodes);
|
|
end;
|
|
else
|
|
inherited WndProc(Msg);
|
|
end;
|
|
case Msg.Msg of // precheck message to prevent access violations on released controls
|
|
CM_MOUSEENTER, CM_MOUSELEAVE, WM_KILLFOCUS, WM_SETFOCUS, WM_NCPAINT:
|
|
if DotNetHighlighting then
|
|
HandleDotNetHighlighting(Self, Msg, MouseOver, Color);
|
|
end;
|
|
end;
|
|
end;
|
|
|
|
//============================================================================
|
|
|
|
constructor TJvExAnimate.Create(AOwner: TComponent);
|
|
begin
|
|
inherited Create(AOwner);
|
|
FHintColor := clDefault;
|
|
end;
|
|
|
|
function TJvExAnimate.BaseWndProc(Msg: Integer; WParam: Integer = 0; LParam: Longint = 0): Integer;
|
|
var
|
|
Mesg: TMessage;
|
|
begin
|
|
Mesg := CreateWMMessage(Msg, WParam, LParam);
|
|
inherited WndProc(Mesg);
|
|
Result := Mesg.Result;
|
|
end;
|
|
|
|
function TJvExAnimate.BaseWndProc(Msg: Integer; WParam: Integer; LParam: TControl): Integer;
|
|
var
|
|
Mesg: TMessage;
|
|
begin
|
|
Mesg := CreateWMMessage(Msg, WParam, LParam);
|
|
inherited WndProc(Mesg);
|
|
Result := Mesg.Result;
|
|
end;
|
|
|
|
function TJvExAnimate.BaseWndProcEx(Msg: Integer; WParam: Integer; var LParam): Integer;
|
|
var
|
|
Mesg: TStructPtrMessage;
|
|
begin
|
|
Mesg := TStructPtrMessage.Create(Msg, WParam, LParam);
|
|
try
|
|
inherited WndProc(Mesg.Msg);
|
|
finally
|
|
Result := Mesg.Msg.Result;
|
|
Mesg.Free;
|
|
end;
|
|
end;
|
|
|
|
procedure TJvExAnimate.VisibleChanged;
|
|
begin
|
|
BaseWndProc(CM_VISIBLECHANGED);
|
|
end;
|
|
|
|
procedure TJvExAnimate.EnabledChanged;
|
|
begin
|
|
BaseWndProc(CM_ENABLEDCHANGED);
|
|
end;
|
|
|
|
procedure TJvExAnimate.TextChanged;
|
|
begin
|
|
BaseWndProc(CM_TEXTCHANGED);
|
|
end;
|
|
|
|
procedure TJvExAnimate.FontChanged;
|
|
begin
|
|
BaseWndProc(CM_FONTCHANGED);
|
|
end;
|
|
|
|
procedure TJvExAnimate.ColorChanged;
|
|
begin
|
|
BaseWndProc(CM_COLORCHANGED);
|
|
end;
|
|
|
|
procedure TJvExAnimate.ParentFontChanged;
|
|
begin
|
|
BaseWndProc(CM_PARENTFONTCHANGED);
|
|
end;
|
|
|
|
procedure TJvExAnimate.ParentColorChanged;
|
|
begin
|
|
BaseWndProc(CM_PARENTCOLORCHANGED);
|
|
if Assigned(OnParentColorChange) then
|
|
OnParentColorChange(Self);
|
|
end;
|
|
|
|
procedure TJvExAnimate.ParentShowHintChanged;
|
|
begin
|
|
BaseWndProc(CM_PARENTSHOWHINTCHANGED);
|
|
end;
|
|
|
|
function TJvExAnimate.WantKey(Key: Integer; Shift: TShiftState; const KeyText: WideString): Boolean;
|
|
begin
|
|
Result := BaseWndProc(CM_DIALOGCHAR, Word(Key), ShiftStateToKeyData(Shift)) <> 0;
|
|
end;
|
|
|
|
function TJvExAnimate.HitTest(X, Y: Integer): Boolean;
|
|
begin
|
|
Result := BaseWndProc(CM_HITTEST, 0, SmallPointToLong(PointToSmallPoint(Point(X, Y)))) <> 0;
|
|
end;
|
|
|
|
function TJvExAnimate.HintShow(var HintInfo: THintInfo): Boolean;
|
|
begin
|
|
GetHintColor(HintInfo, Self, FHintColor);
|
|
if FHintWindowClass <> nil then
|
|
HintInfo.HintWindowClass := FHintWindowClass;
|
|
Result := BaseWndProcEx(CM_HINTSHOW, 0, HintInfo) <> 0;
|
|
end;
|
|
|
|
procedure TJvExAnimate.MouseEnter(AControl: TControl);
|
|
begin
|
|
FMouseOver := True;
|
|
if Assigned(FOnMouseEnter) then
|
|
FOnMouseEnter(Self);
|
|
BaseWndProc(CM_MOUSEENTER, 0, AControl);
|
|
end;
|
|
|
|
procedure TJvExAnimate.MouseLeave(AControl: TControl);
|
|
begin
|
|
FMouseOver := False;
|
|
BaseWndProc(CM_MOUSELEAVE, 0, AControl);
|
|
if Assigned(FOnMouseLeave) then
|
|
FOnMouseLeave(Self);
|
|
end;
|
|
|
|
{$IFNDEF CLR}
|
|
procedure TJvExAnimate.FocusChanged(AControl: TWinControl);
|
|
begin
|
|
BaseWndProc(CM_FOCUSCHANGED, 0, AControl);
|
|
end;
|
|
{$ENDIF !CLR}
|
|
|
|
{$IFDEF COMPILER5}
|
|
{$IFNDEF HASAUTOSIZE}
|
|
|
|
procedure TJvExAnimate.CMSetAutoSize(var Msg: TMessage);
|
|
begin
|
|
SetAutoSize(Msg.WParam <> 0);
|
|
end;
|
|
|
|
procedure TJvExAnimate.SetAutoSize(Value: Boolean);
|
|
begin
|
|
TOpenControl_SetAutoSize(Self, Value);
|
|
end;
|
|
|
|
{$ENDIF !HASAUTOSIZE}
|
|
{$ENDIF COMPILER5}
|
|
|
|
procedure TJvExAnimate.BoundsChanged;
|
|
begin
|
|
end;
|
|
|
|
procedure TJvExAnimate.CursorChanged;
|
|
begin
|
|
BaseWndProc(CM_CURSORCHANGED);
|
|
end;
|
|
|
|
procedure TJvExAnimate.ShowingChanged;
|
|
begin
|
|
BaseWndProc(CM_SHOWINGCHANGED);
|
|
end;
|
|
|
|
procedure TJvExAnimate.ShowHintChanged;
|
|
begin
|
|
BaseWndProc(CM_SHOWHINTCHANGED);
|
|
end;
|
|
|
|
{$IFNDEF CLR}
|
|
{ VCL sends CM_CONTROLLISTCHANGE and CM_CONTROLCHANGE in a different order than
|
|
the CLX methods are used. So we must correct it by evaluating "Inserting". }
|
|
procedure TJvExAnimate.ControlsListChanging(Control: TControl; Inserting: Boolean);
|
|
begin
|
|
if Inserting then
|
|
BaseWndProc(CM_CONTROLLISTCHANGE, Integer(Control), Integer(Inserting))
|
|
else
|
|
BaseWndProc(CM_CONTROLCHANGE, Integer(Control), Integer(Inserting));
|
|
end;
|
|
|
|
procedure TJvExAnimate.ControlsListChanged(Control: TControl; Inserting: Boolean);
|
|
begin
|
|
if not Inserting then
|
|
BaseWndProc(CM_CONTROLLISTCHANGE, Integer(Control), Integer(Inserting))
|
|
else
|
|
BaseWndProc(CM_CONTROLCHANGE, Integer(Control), Integer(Inserting));
|
|
end;
|
|
{$ENDIF !CLR}
|
|
|
|
procedure TJvExAnimate.GetDlgCode(var Code: TDlgCodes);
|
|
begin
|
|
end;
|
|
|
|
procedure TJvExAnimate.FocusSet(PrevWnd: THandle);
|
|
begin
|
|
BaseWndProc(WM_SETFOCUS, Integer(PrevWnd), 0);
|
|
end;
|
|
|
|
procedure TJvExAnimate.FocusKilled(NextWnd: THandle);
|
|
begin
|
|
BaseWndProc(WM_KILLFOCUS, Integer(NextWnd), 0);
|
|
end;
|
|
|
|
function TJvExAnimate.DoEraseBackground(Canvas: TCanvas; Param: Integer): Boolean;
|
|
begin
|
|
Result := BaseWndProc(WM_ERASEBKGND, Canvas.Handle, Param) <> 0;
|
|
end;
|
|
|
|
{$IFDEF JVCLThemesEnabledD56}
|
|
function TJvExAnimate.GetParentBackground: Boolean;
|
|
begin
|
|
Result := JvThemes.GetParentBackground(Self);
|
|
end;
|
|
|
|
procedure TJvExAnimate.SetParentBackground(Value: Boolean);
|
|
begin
|
|
JvThemes.SetParentBackground(Self, Value);
|
|
end;
|
|
{$ENDIF JVCLThemesEnabledD56}
|
|
|
|
procedure TJvExAnimate.WndProc(var Msg: TMessage);
|
|
var
|
|
IdSaveDC: Integer;
|
|
DlgCodes: TDlgCodes;
|
|
Canvas: TCanvas;
|
|
{$IFDEF CLR}
|
|
AHintInfo: THintInfo;
|
|
{$ENDIF CLR}
|
|
begin
|
|
if not DispatchIsDesignMsg(Self, Msg) then
|
|
begin
|
|
case Msg.Msg of
|
|
CM_DENYSUBCLASSING:
|
|
{$IFNDEF CLR}
|
|
Msg.Result := Ord(GetInterfaceEntry(IJvDenySubClassing) <> nil);
|
|
{$ELSE}
|
|
Msg.Result := Integer(Supports(Self, IJvDenySubClassing));
|
|
{$ENDIF !CLR}
|
|
CM_DIALOGCHAR:
|
|
with TCMDialogChar{$IFDEF CLR}.Create{$ENDIF}(Msg) do
|
|
Result := Ord(WantKey(CharCode, KeyDataToShiftState(KeyData), WideChar(CharCode)));
|
|
CM_HINTSHOW:
|
|
{$IFNDEF CLR}
|
|
with TCMHintShow(Msg) do
|
|
Result := Integer(HintShow(HintInfo^));
|
|
{$ELSE}
|
|
with TCMHintShow.Create(Msg) do
|
|
begin
|
|
AHintInfo := HintInfo;
|
|
Result := Integer(HintShow(AHintInfo));
|
|
HintInfo := AHintInfo;
|
|
end;
|
|
{$ENDIF !CLR}
|
|
CM_HITTEST:
|
|
with TCMHitTest{$IFDEF CLR}.Create{$ENDIF}(Msg) do
|
|
Result := Integer(HitTest(XPos, YPos));
|
|
CM_MOUSEENTER:
|
|
MouseEnter({$IFDEF CLR}nil{$ELSE}TControl(Msg.LParam){$ENDIF});
|
|
CM_MOUSELEAVE:
|
|
MouseLeave({$IFDEF CLR}nil{$ELSE}TControl(Msg.LParam){$ENDIF});
|
|
CM_VISIBLECHANGED:
|
|
VisibleChanged;
|
|
CM_ENABLEDCHANGED:
|
|
EnabledChanged;
|
|
CM_TEXTCHANGED:
|
|
TextChanged;
|
|
CM_FONTCHANGED:
|
|
FontChanged;
|
|
CM_COLORCHANGED:
|
|
ColorChanged;
|
|
{$IFNDEF CLR}
|
|
CM_FOCUSCHANGED:
|
|
FocusChanged(TWinControl(Msg.LParam));
|
|
{$ENDIF !CLR}
|
|
CM_PARENTFONTCHANGED:
|
|
ParentFontChanged;
|
|
CM_PARENTCOLORCHANGED:
|
|
ParentColorChanged;
|
|
CM_PARENTSHOWHINTCHANGED:
|
|
ParentShowHintChanged;
|
|
CM_CURSORCHANGED:
|
|
CursorChanged;
|
|
CM_SHOWINGCHANGED:
|
|
ShowingChanged;
|
|
CM_SHOWHINTCHANGED:
|
|
ShowHintChanged;
|
|
{$IFNDEF CLR}
|
|
CM_CONTROLLISTCHANGE:
|
|
if Msg.LParam <> 0 then
|
|
ControlsListChanging(TControl(Msg.WParam), True)
|
|
else
|
|
ControlsListChanged(TControl(Msg.WParam), False);
|
|
CM_CONTROLCHANGE:
|
|
if Msg.LParam = 0 then
|
|
ControlsListChanging(TControl(Msg.WParam), False)
|
|
else
|
|
ControlsListChanged(TControl(Msg.WParam), True);
|
|
{$ENDIF !CLR}
|
|
WM_SETFOCUS:
|
|
FocusSet(THandle(Msg.WParam));
|
|
WM_KILLFOCUS:
|
|
FocusKilled(THandle(Msg.WParam));
|
|
WM_SIZE, WM_MOVE:
|
|
begin
|
|
inherited WndProc(Msg);
|
|
BoundsChanged;
|
|
end;
|
|
WM_ERASEBKGND:
|
|
if Msg.WParam <> 0 then
|
|
begin
|
|
IdSaveDC := SaveDC(HDC(Msg.WParam)); // protect DC against Stock-Objects from Canvas
|
|
Canvas := TCanvas.Create;
|
|
try
|
|
Canvas.Handle := HDC(Msg.WParam);
|
|
Msg.Result := Ord(DoEraseBackground(Canvas, Msg.LParam));
|
|
finally
|
|
Canvas.Handle := 0;
|
|
Canvas.Free;
|
|
RestoreDC(HDC(Msg.WParam), IdSaveDC);
|
|
end;
|
|
end
|
|
else
|
|
inherited WndProc(Msg);
|
|
{$IFNDEF DELPHI2007_UP}
|
|
WM_PRINTCLIENT, WM_PRINT: // VCL bug fix
|
|
begin
|
|
IdSaveDC := SaveDC(HDC(Msg.WParam)); // protect DC against changes
|
|
try
|
|
inherited WndProc(Msg);
|
|
finally
|
|
RestoreDC(HDC(Msg.WParam), IdSaveDC);
|
|
end;
|
|
end;
|
|
{$ENDIF ~DELPHI2007_UP}
|
|
WM_GETDLGCODE:
|
|
begin
|
|
inherited WndProc(Msg);
|
|
DlgCodes := [dcNative] + DlgcToDlgCodes(Msg.Result);
|
|
GetDlgCode(DlgCodes);
|
|
if not (dcNative in DlgCodes) then
|
|
Msg.Result := DlgCodesToDlgc(DlgCodes);
|
|
end;
|
|
else
|
|
inherited WndProc(Msg);
|
|
end;
|
|
case Msg.Msg of // precheck message to prevent access violations on released controls
|
|
CM_MOUSEENTER, CM_MOUSELEAVE, WM_KILLFOCUS, WM_SETFOCUS, WM_NCPAINT:
|
|
if DotNetHighlighting then
|
|
HandleDotNetHighlighting(Self, Msg, MouseOver, Color);
|
|
end;
|
|
end;
|
|
end;
|
|
|
|
//============================================================================
|
|
|
|
constructor TJvExCoolBar.Create(AOwner: TComponent);
|
|
begin
|
|
inherited Create(AOwner);
|
|
FHintColor := clDefault;
|
|
end;
|
|
|
|
function TJvExCoolBar.BaseWndProc(Msg: Integer; WParam: Integer = 0; LParam: Longint = 0): Integer;
|
|
var
|
|
Mesg: TMessage;
|
|
begin
|
|
Mesg := CreateWMMessage(Msg, WParam, LParam);
|
|
inherited WndProc(Mesg);
|
|
Result := Mesg.Result;
|
|
end;
|
|
|
|
function TJvExCoolBar.BaseWndProc(Msg: Integer; WParam: Integer; LParam: TControl): Integer;
|
|
var
|
|
Mesg: TMessage;
|
|
begin
|
|
Mesg := CreateWMMessage(Msg, WParam, LParam);
|
|
inherited WndProc(Mesg);
|
|
Result := Mesg.Result;
|
|
end;
|
|
|
|
function TJvExCoolBar.BaseWndProcEx(Msg: Integer; WParam: Integer; var LParam): Integer;
|
|
var
|
|
Mesg: TStructPtrMessage;
|
|
begin
|
|
Mesg := TStructPtrMessage.Create(Msg, WParam, LParam);
|
|
try
|
|
inherited WndProc(Mesg.Msg);
|
|
finally
|
|
Result := Mesg.Msg.Result;
|
|
Mesg.Free;
|
|
end;
|
|
end;
|
|
|
|
procedure TJvExCoolBar.VisibleChanged;
|
|
begin
|
|
BaseWndProc(CM_VISIBLECHANGED);
|
|
end;
|
|
|
|
procedure TJvExCoolBar.EnabledChanged;
|
|
begin
|
|
BaseWndProc(CM_ENABLEDCHANGED);
|
|
end;
|
|
|
|
procedure TJvExCoolBar.TextChanged;
|
|
begin
|
|
BaseWndProc(CM_TEXTCHANGED);
|
|
end;
|
|
|
|
procedure TJvExCoolBar.FontChanged;
|
|
begin
|
|
BaseWndProc(CM_FONTCHANGED);
|
|
end;
|
|
|
|
procedure TJvExCoolBar.ColorChanged;
|
|
begin
|
|
BaseWndProc(CM_COLORCHANGED);
|
|
end;
|
|
|
|
procedure TJvExCoolBar.ParentFontChanged;
|
|
begin
|
|
BaseWndProc(CM_PARENTFONTCHANGED);
|
|
end;
|
|
|
|
procedure TJvExCoolBar.ParentColorChanged;
|
|
begin
|
|
BaseWndProc(CM_PARENTCOLORCHANGED);
|
|
if Assigned(OnParentColorChange) then
|
|
OnParentColorChange(Self);
|
|
end;
|
|
|
|
procedure TJvExCoolBar.ParentShowHintChanged;
|
|
begin
|
|
BaseWndProc(CM_PARENTSHOWHINTCHANGED);
|
|
end;
|
|
|
|
function TJvExCoolBar.WantKey(Key: Integer; Shift: TShiftState; const KeyText: WideString): Boolean;
|
|
begin
|
|
Result := BaseWndProc(CM_DIALOGCHAR, Word(Key), ShiftStateToKeyData(Shift)) <> 0;
|
|
end;
|
|
|
|
function TJvExCoolBar.HitTest(X, Y: Integer): Boolean;
|
|
begin
|
|
Result := BaseWndProc(CM_HITTEST, 0, SmallPointToLong(PointToSmallPoint(Point(X, Y)))) <> 0;
|
|
end;
|
|
|
|
function TJvExCoolBar.HintShow(var HintInfo: THintInfo): Boolean;
|
|
begin
|
|
GetHintColor(HintInfo, Self, FHintColor);
|
|
if FHintWindowClass <> nil then
|
|
HintInfo.HintWindowClass := FHintWindowClass;
|
|
Result := BaseWndProcEx(CM_HINTSHOW, 0, HintInfo) <> 0;
|
|
end;
|
|
|
|
procedure TJvExCoolBar.MouseEnter(AControl: TControl);
|
|
begin
|
|
FMouseOver := True;
|
|
if Assigned(FOnMouseEnter) then
|
|
FOnMouseEnter(Self);
|
|
BaseWndProc(CM_MOUSEENTER, 0, AControl);
|
|
end;
|
|
|
|
procedure TJvExCoolBar.MouseLeave(AControl: TControl);
|
|
begin
|
|
FMouseOver := False;
|
|
BaseWndProc(CM_MOUSELEAVE, 0, AControl);
|
|
if Assigned(FOnMouseLeave) then
|
|
FOnMouseLeave(Self);
|
|
end;
|
|
|
|
{$IFNDEF CLR}
|
|
procedure TJvExCoolBar.FocusChanged(AControl: TWinControl);
|
|
begin
|
|
BaseWndProc(CM_FOCUSCHANGED, 0, AControl);
|
|
end;
|
|
{$ENDIF !CLR}
|
|
|
|
{$IFDEF COMPILER5}
|
|
{$IFNDEF HASAUTOSIZE}
|
|
|
|
procedure TJvExCoolBar.CMSetAutoSize(var Msg: TMessage);
|
|
begin
|
|
SetAutoSize(Msg.WParam <> 0);
|
|
end;
|
|
|
|
procedure TJvExCoolBar.SetAutoSize(Value: Boolean);
|
|
begin
|
|
TOpenControl_SetAutoSize(Self, Value);
|
|
end;
|
|
|
|
{$ENDIF !HASAUTOSIZE}
|
|
{$ENDIF COMPILER5}
|
|
|
|
procedure TJvExCoolBar.BoundsChanged;
|
|
begin
|
|
end;
|
|
|
|
procedure TJvExCoolBar.CursorChanged;
|
|
begin
|
|
BaseWndProc(CM_CURSORCHANGED);
|
|
end;
|
|
|
|
procedure TJvExCoolBar.ShowingChanged;
|
|
begin
|
|
BaseWndProc(CM_SHOWINGCHANGED);
|
|
end;
|
|
|
|
procedure TJvExCoolBar.ShowHintChanged;
|
|
begin
|
|
BaseWndProc(CM_SHOWHINTCHANGED);
|
|
end;
|
|
|
|
{$IFNDEF CLR}
|
|
{ VCL sends CM_CONTROLLISTCHANGE and CM_CONTROLCHANGE in a different order than
|
|
the CLX methods are used. So we must correct it by evaluating "Inserting". }
|
|
procedure TJvExCoolBar.ControlsListChanging(Control: TControl; Inserting: Boolean);
|
|
begin
|
|
if Inserting then
|
|
BaseWndProc(CM_CONTROLLISTCHANGE, Integer(Control), Integer(Inserting))
|
|
else
|
|
BaseWndProc(CM_CONTROLCHANGE, Integer(Control), Integer(Inserting));
|
|
end;
|
|
|
|
procedure TJvExCoolBar.ControlsListChanged(Control: TControl; Inserting: Boolean);
|
|
begin
|
|
if not Inserting then
|
|
BaseWndProc(CM_CONTROLLISTCHANGE, Integer(Control), Integer(Inserting))
|
|
else
|
|
BaseWndProc(CM_CONTROLCHANGE, Integer(Control), Integer(Inserting));
|
|
end;
|
|
{$ENDIF !CLR}
|
|
|
|
procedure TJvExCoolBar.GetDlgCode(var Code: TDlgCodes);
|
|
begin
|
|
end;
|
|
|
|
procedure TJvExCoolBar.FocusSet(PrevWnd: THandle);
|
|
begin
|
|
BaseWndProc(WM_SETFOCUS, Integer(PrevWnd), 0);
|
|
end;
|
|
|
|
procedure TJvExCoolBar.FocusKilled(NextWnd: THandle);
|
|
begin
|
|
BaseWndProc(WM_KILLFOCUS, Integer(NextWnd), 0);
|
|
end;
|
|
|
|
function TJvExCoolBar.DoEraseBackground(Canvas: TCanvas; Param: Integer): Boolean;
|
|
begin
|
|
Result := BaseWndProc(WM_ERASEBKGND, Canvas.Handle, Param) <> 0;
|
|
end;
|
|
|
|
{$IFDEF JVCLThemesEnabledD56}
|
|
function TJvExCoolBar.GetParentBackground: Boolean;
|
|
begin
|
|
Result := JvThemes.GetParentBackground(Self);
|
|
end;
|
|
|
|
procedure TJvExCoolBar.SetParentBackground(Value: Boolean);
|
|
begin
|
|
JvThemes.SetParentBackground(Self, Value);
|
|
end;
|
|
{$ENDIF JVCLThemesEnabledD56}
|
|
|
|
procedure TJvExCoolBar.WndProc(var Msg: TMessage);
|
|
var
|
|
IdSaveDC: Integer;
|
|
DlgCodes: TDlgCodes;
|
|
Canvas: TCanvas;
|
|
{$IFDEF CLR}
|
|
AHintInfo: THintInfo;
|
|
{$ENDIF CLR}
|
|
begin
|
|
if not DispatchIsDesignMsg(Self, Msg) then
|
|
begin
|
|
case Msg.Msg of
|
|
CM_DENYSUBCLASSING:
|
|
{$IFNDEF CLR}
|
|
Msg.Result := Ord(GetInterfaceEntry(IJvDenySubClassing) <> nil);
|
|
{$ELSE}
|
|
Msg.Result := Integer(Supports(Self, IJvDenySubClassing));
|
|
{$ENDIF !CLR}
|
|
CM_DIALOGCHAR:
|
|
with TCMDialogChar{$IFDEF CLR}.Create{$ENDIF}(Msg) do
|
|
Result := Ord(WantKey(CharCode, KeyDataToShiftState(KeyData), WideChar(CharCode)));
|
|
CM_HINTSHOW:
|
|
{$IFNDEF CLR}
|
|
with TCMHintShow(Msg) do
|
|
Result := Integer(HintShow(HintInfo^));
|
|
{$ELSE}
|
|
with TCMHintShow.Create(Msg) do
|
|
begin
|
|
AHintInfo := HintInfo;
|
|
Result := Integer(HintShow(AHintInfo));
|
|
HintInfo := AHintInfo;
|
|
end;
|
|
{$ENDIF !CLR}
|
|
CM_HITTEST:
|
|
with TCMHitTest{$IFDEF CLR}.Create{$ENDIF}(Msg) do
|
|
Result := Integer(HitTest(XPos, YPos));
|
|
CM_MOUSEENTER:
|
|
MouseEnter({$IFDEF CLR}nil{$ELSE}TControl(Msg.LParam){$ENDIF});
|
|
CM_MOUSELEAVE:
|
|
MouseLeave({$IFDEF CLR}nil{$ELSE}TControl(Msg.LParam){$ENDIF});
|
|
CM_VISIBLECHANGED:
|
|
VisibleChanged;
|
|
CM_ENABLEDCHANGED:
|
|
EnabledChanged;
|
|
CM_TEXTCHANGED:
|
|
TextChanged;
|
|
CM_FONTCHANGED:
|
|
FontChanged;
|
|
CM_COLORCHANGED:
|
|
ColorChanged;
|
|
{$IFNDEF CLR}
|
|
CM_FOCUSCHANGED:
|
|
FocusChanged(TWinControl(Msg.LParam));
|
|
{$ENDIF !CLR}
|
|
CM_PARENTFONTCHANGED:
|
|
ParentFontChanged;
|
|
CM_PARENTCOLORCHANGED:
|
|
ParentColorChanged;
|
|
CM_PARENTSHOWHINTCHANGED:
|
|
ParentShowHintChanged;
|
|
CM_CURSORCHANGED:
|
|
CursorChanged;
|
|
CM_SHOWINGCHANGED:
|
|
ShowingChanged;
|
|
CM_SHOWHINTCHANGED:
|
|
ShowHintChanged;
|
|
{$IFNDEF CLR}
|
|
CM_CONTROLLISTCHANGE:
|
|
if Msg.LParam <> 0 then
|
|
ControlsListChanging(TControl(Msg.WParam), True)
|
|
else
|
|
ControlsListChanged(TControl(Msg.WParam), False);
|
|
CM_CONTROLCHANGE:
|
|
if Msg.LParam = 0 then
|
|
ControlsListChanging(TControl(Msg.WParam), False)
|
|
else
|
|
ControlsListChanged(TControl(Msg.WParam), True);
|
|
{$ENDIF !CLR}
|
|
WM_SETFOCUS:
|
|
FocusSet(THandle(Msg.WParam));
|
|
WM_KILLFOCUS:
|
|
FocusKilled(THandle(Msg.WParam));
|
|
WM_SIZE, WM_MOVE:
|
|
begin
|
|
inherited WndProc(Msg);
|
|
BoundsChanged;
|
|
end;
|
|
WM_ERASEBKGND:
|
|
if Msg.WParam <> 0 then
|
|
begin
|
|
IdSaveDC := SaveDC(HDC(Msg.WParam)); // protect DC against Stock-Objects from Canvas
|
|
Canvas := TCanvas.Create;
|
|
try
|
|
Canvas.Handle := HDC(Msg.WParam);
|
|
Msg.Result := Ord(DoEraseBackground(Canvas, Msg.LParam));
|
|
finally
|
|
Canvas.Handle := 0;
|
|
Canvas.Free;
|
|
RestoreDC(HDC(Msg.WParam), IdSaveDC);
|
|
end;
|
|
end
|
|
else
|
|
inherited WndProc(Msg);
|
|
{$IFNDEF DELPHI2007_UP}
|
|
WM_PRINTCLIENT, WM_PRINT: // VCL bug fix
|
|
begin
|
|
IdSaveDC := SaveDC(HDC(Msg.WParam)); // protect DC against changes
|
|
try
|
|
inherited WndProc(Msg);
|
|
finally
|
|
RestoreDC(HDC(Msg.WParam), IdSaveDC);
|
|
end;
|
|
end;
|
|
{$ENDIF ~DELPHI2007_UP}
|
|
WM_GETDLGCODE:
|
|
begin
|
|
inherited WndProc(Msg);
|
|
DlgCodes := [dcNative] + DlgcToDlgCodes(Msg.Result);
|
|
GetDlgCode(DlgCodes);
|
|
if not (dcNative in DlgCodes) then
|
|
Msg.Result := DlgCodesToDlgc(DlgCodes);
|
|
end;
|
|
else
|
|
inherited WndProc(Msg);
|
|
end;
|
|
case Msg.Msg of // precheck message to prevent access violations on released controls
|
|
CM_MOUSEENTER, CM_MOUSELEAVE, WM_KILLFOCUS, WM_SETFOCUS, WM_NCPAINT:
|
|
if DotNetHighlighting then
|
|
HandleDotNetHighlighting(Self, Msg, MouseOver, Color);
|
|
end;
|
|
end;
|
|
end;
|
|
|
|
//============================================================================
|
|
|
|
constructor TJvExCommonCalendar.Create(AOwner: TComponent);
|
|
begin
|
|
inherited Create(AOwner);
|
|
FHintColor := clDefault;
|
|
end;
|
|
|
|
function TJvExCommonCalendar.BaseWndProc(Msg: Integer; WParam: Integer = 0; LParam: Longint = 0): Integer;
|
|
var
|
|
Mesg: TMessage;
|
|
begin
|
|
Mesg := CreateWMMessage(Msg, WParam, LParam);
|
|
inherited WndProc(Mesg);
|
|
Result := Mesg.Result;
|
|
end;
|
|
|
|
function TJvExCommonCalendar.BaseWndProc(Msg: Integer; WParam: Integer; LParam: TControl): Integer;
|
|
var
|
|
Mesg: TMessage;
|
|
begin
|
|
Mesg := CreateWMMessage(Msg, WParam, LParam);
|
|
inherited WndProc(Mesg);
|
|
Result := Mesg.Result;
|
|
end;
|
|
|
|
function TJvExCommonCalendar.BaseWndProcEx(Msg: Integer; WParam: Integer; var LParam): Integer;
|
|
var
|
|
Mesg: TStructPtrMessage;
|
|
begin
|
|
Mesg := TStructPtrMessage.Create(Msg, WParam, LParam);
|
|
try
|
|
inherited WndProc(Mesg.Msg);
|
|
finally
|
|
Result := Mesg.Msg.Result;
|
|
Mesg.Free;
|
|
end;
|
|
end;
|
|
|
|
procedure TJvExCommonCalendar.VisibleChanged;
|
|
begin
|
|
BaseWndProc(CM_VISIBLECHANGED);
|
|
end;
|
|
|
|
procedure TJvExCommonCalendar.EnabledChanged;
|
|
begin
|
|
BaseWndProc(CM_ENABLEDCHANGED);
|
|
end;
|
|
|
|
procedure TJvExCommonCalendar.TextChanged;
|
|
begin
|
|
BaseWndProc(CM_TEXTCHANGED);
|
|
end;
|
|
|
|
procedure TJvExCommonCalendar.FontChanged;
|
|
begin
|
|
BaseWndProc(CM_FONTCHANGED);
|
|
end;
|
|
|
|
procedure TJvExCommonCalendar.ColorChanged;
|
|
begin
|
|
BaseWndProc(CM_COLORCHANGED);
|
|
end;
|
|
|
|
procedure TJvExCommonCalendar.ParentFontChanged;
|
|
begin
|
|
BaseWndProc(CM_PARENTFONTCHANGED);
|
|
end;
|
|
|
|
procedure TJvExCommonCalendar.ParentColorChanged;
|
|
begin
|
|
BaseWndProc(CM_PARENTCOLORCHANGED);
|
|
if Assigned(OnParentColorChange) then
|
|
OnParentColorChange(Self);
|
|
end;
|
|
|
|
procedure TJvExCommonCalendar.ParentShowHintChanged;
|
|
begin
|
|
BaseWndProc(CM_PARENTSHOWHINTCHANGED);
|
|
end;
|
|
|
|
function TJvExCommonCalendar.WantKey(Key: Integer; Shift: TShiftState; const KeyText: WideString): Boolean;
|
|
begin
|
|
Result := BaseWndProc(CM_DIALOGCHAR, Word(Key), ShiftStateToKeyData(Shift)) <> 0;
|
|
end;
|
|
|
|
function TJvExCommonCalendar.HitTest(X, Y: Integer): Boolean;
|
|
begin
|
|
Result := BaseWndProc(CM_HITTEST, 0, SmallPointToLong(PointToSmallPoint(Point(X, Y)))) <> 0;
|
|
end;
|
|
|
|
function TJvExCommonCalendar.HintShow(var HintInfo: THintInfo): Boolean;
|
|
begin
|
|
GetHintColor(HintInfo, Self, FHintColor);
|
|
if FHintWindowClass <> nil then
|
|
HintInfo.HintWindowClass := FHintWindowClass;
|
|
Result := BaseWndProcEx(CM_HINTSHOW, 0, HintInfo) <> 0;
|
|
end;
|
|
|
|
procedure TJvExCommonCalendar.MouseEnter(AControl: TControl);
|
|
begin
|
|
FMouseOver := True;
|
|
if Assigned(FOnMouseEnter) then
|
|
FOnMouseEnter(Self);
|
|
BaseWndProc(CM_MOUSEENTER, 0, AControl);
|
|
end;
|
|
|
|
procedure TJvExCommonCalendar.MouseLeave(AControl: TControl);
|
|
begin
|
|
FMouseOver := False;
|
|
BaseWndProc(CM_MOUSELEAVE, 0, AControl);
|
|
if Assigned(FOnMouseLeave) then
|
|
FOnMouseLeave(Self);
|
|
end;
|
|
|
|
{$IFNDEF CLR}
|
|
procedure TJvExCommonCalendar.FocusChanged(AControl: TWinControl);
|
|
begin
|
|
BaseWndProc(CM_FOCUSCHANGED, 0, AControl);
|
|
end;
|
|
{$ENDIF !CLR}
|
|
|
|
{$IFDEF COMPILER5}
|
|
{$IFNDEF HASAUTOSIZE}
|
|
|
|
procedure TJvExCommonCalendar.CMSetAutoSize(var Msg: TMessage);
|
|
begin
|
|
SetAutoSize(Msg.WParam <> 0);
|
|
end;
|
|
|
|
procedure TJvExCommonCalendar.SetAutoSize(Value: Boolean);
|
|
begin
|
|
TOpenControl_SetAutoSize(Self, Value);
|
|
end;
|
|
|
|
{$ENDIF !HASAUTOSIZE}
|
|
{$ENDIF COMPILER5}
|
|
|
|
procedure TJvExCommonCalendar.BoundsChanged;
|
|
begin
|
|
end;
|
|
|
|
procedure TJvExCommonCalendar.CursorChanged;
|
|
begin
|
|
BaseWndProc(CM_CURSORCHANGED);
|
|
end;
|
|
|
|
procedure TJvExCommonCalendar.ShowingChanged;
|
|
begin
|
|
BaseWndProc(CM_SHOWINGCHANGED);
|
|
end;
|
|
|
|
procedure TJvExCommonCalendar.ShowHintChanged;
|
|
begin
|
|
BaseWndProc(CM_SHOWHINTCHANGED);
|
|
end;
|
|
|
|
{$IFNDEF CLR}
|
|
{ VCL sends CM_CONTROLLISTCHANGE and CM_CONTROLCHANGE in a different order than
|
|
the CLX methods are used. So we must correct it by evaluating "Inserting". }
|
|
procedure TJvExCommonCalendar.ControlsListChanging(Control: TControl; Inserting: Boolean);
|
|
begin
|
|
if Inserting then
|
|
BaseWndProc(CM_CONTROLLISTCHANGE, Integer(Control), Integer(Inserting))
|
|
else
|
|
BaseWndProc(CM_CONTROLCHANGE, Integer(Control), Integer(Inserting));
|
|
end;
|
|
|
|
procedure TJvExCommonCalendar.ControlsListChanged(Control: TControl; Inserting: Boolean);
|
|
begin
|
|
if not Inserting then
|
|
BaseWndProc(CM_CONTROLLISTCHANGE, Integer(Control), Integer(Inserting))
|
|
else
|
|
BaseWndProc(CM_CONTROLCHANGE, Integer(Control), Integer(Inserting));
|
|
end;
|
|
{$ENDIF !CLR}
|
|
|
|
procedure TJvExCommonCalendar.GetDlgCode(var Code: TDlgCodes);
|
|
begin
|
|
end;
|
|
|
|
procedure TJvExCommonCalendar.FocusSet(PrevWnd: THandle);
|
|
begin
|
|
BaseWndProc(WM_SETFOCUS, Integer(PrevWnd), 0);
|
|
end;
|
|
|
|
procedure TJvExCommonCalendar.FocusKilled(NextWnd: THandle);
|
|
begin
|
|
BaseWndProc(WM_KILLFOCUS, Integer(NextWnd), 0);
|
|
end;
|
|
|
|
function TJvExCommonCalendar.DoEraseBackground(Canvas: TCanvas; Param: Integer): Boolean;
|
|
begin
|
|
Result := BaseWndProc(WM_ERASEBKGND, Canvas.Handle, Param) <> 0;
|
|
end;
|
|
|
|
{$IFDEF JVCLThemesEnabledD56}
|
|
function TJvExCommonCalendar.GetParentBackground: Boolean;
|
|
begin
|
|
Result := JvThemes.GetParentBackground(Self);
|
|
end;
|
|
|
|
procedure TJvExCommonCalendar.SetParentBackground(Value: Boolean);
|
|
begin
|
|
JvThemes.SetParentBackground(Self, Value);
|
|
end;
|
|
{$ENDIF JVCLThemesEnabledD56}
|
|
|
|
procedure TJvExCommonCalendar.WndProc(var Msg: TMessage);
|
|
var
|
|
IdSaveDC: Integer;
|
|
DlgCodes: TDlgCodes;
|
|
Canvas: TCanvas;
|
|
{$IFDEF CLR}
|
|
AHintInfo: THintInfo;
|
|
{$ENDIF CLR}
|
|
begin
|
|
if not DispatchIsDesignMsg(Self, Msg) then
|
|
begin
|
|
case Msg.Msg of
|
|
CM_DENYSUBCLASSING:
|
|
{$IFNDEF CLR}
|
|
Msg.Result := Ord(GetInterfaceEntry(IJvDenySubClassing) <> nil);
|
|
{$ELSE}
|
|
Msg.Result := Integer(Supports(Self, IJvDenySubClassing));
|
|
{$ENDIF !CLR}
|
|
CM_DIALOGCHAR:
|
|
with TCMDialogChar{$IFDEF CLR}.Create{$ENDIF}(Msg) do
|
|
Result := Ord(WantKey(CharCode, KeyDataToShiftState(KeyData), WideChar(CharCode)));
|
|
CM_HINTSHOW:
|
|
{$IFNDEF CLR}
|
|
with TCMHintShow(Msg) do
|
|
Result := Integer(HintShow(HintInfo^));
|
|
{$ELSE}
|
|
with TCMHintShow.Create(Msg) do
|
|
begin
|
|
AHintInfo := HintInfo;
|
|
Result := Integer(HintShow(AHintInfo));
|
|
HintInfo := AHintInfo;
|
|
end;
|
|
{$ENDIF !CLR}
|
|
CM_HITTEST:
|
|
with TCMHitTest{$IFDEF CLR}.Create{$ENDIF}(Msg) do
|
|
Result := Integer(HitTest(XPos, YPos));
|
|
CM_MOUSEENTER:
|
|
MouseEnter({$IFDEF CLR}nil{$ELSE}TControl(Msg.LParam){$ENDIF});
|
|
CM_MOUSELEAVE:
|
|
MouseLeave({$IFDEF CLR}nil{$ELSE}TControl(Msg.LParam){$ENDIF});
|
|
CM_VISIBLECHANGED:
|
|
VisibleChanged;
|
|
CM_ENABLEDCHANGED:
|
|
EnabledChanged;
|
|
CM_TEXTCHANGED:
|
|
TextChanged;
|
|
CM_FONTCHANGED:
|
|
FontChanged;
|
|
CM_COLORCHANGED:
|
|
ColorChanged;
|
|
{$IFNDEF CLR}
|
|
CM_FOCUSCHANGED:
|
|
FocusChanged(TWinControl(Msg.LParam));
|
|
{$ENDIF !CLR}
|
|
CM_PARENTFONTCHANGED:
|
|
ParentFontChanged;
|
|
CM_PARENTCOLORCHANGED:
|
|
ParentColorChanged;
|
|
CM_PARENTSHOWHINTCHANGED:
|
|
ParentShowHintChanged;
|
|
CM_CURSORCHANGED:
|
|
CursorChanged;
|
|
CM_SHOWINGCHANGED:
|
|
ShowingChanged;
|
|
CM_SHOWHINTCHANGED:
|
|
ShowHintChanged;
|
|
{$IFNDEF CLR}
|
|
CM_CONTROLLISTCHANGE:
|
|
if Msg.LParam <> 0 then
|
|
ControlsListChanging(TControl(Msg.WParam), True)
|
|
else
|
|
ControlsListChanged(TControl(Msg.WParam), False);
|
|
CM_CONTROLCHANGE:
|
|
if Msg.LParam = 0 then
|
|
ControlsListChanging(TControl(Msg.WParam), False)
|
|
else
|
|
ControlsListChanged(TControl(Msg.WParam), True);
|
|
{$ENDIF !CLR}
|
|
WM_SETFOCUS:
|
|
FocusSet(THandle(Msg.WParam));
|
|
WM_KILLFOCUS:
|
|
FocusKilled(THandle(Msg.WParam));
|
|
WM_SIZE, WM_MOVE:
|
|
begin
|
|
inherited WndProc(Msg);
|
|
BoundsChanged;
|
|
end;
|
|
WM_ERASEBKGND:
|
|
if Msg.WParam <> 0 then
|
|
begin
|
|
IdSaveDC := SaveDC(HDC(Msg.WParam)); // protect DC against Stock-Objects from Canvas
|
|
Canvas := TCanvas.Create;
|
|
try
|
|
Canvas.Handle := HDC(Msg.WParam);
|
|
Msg.Result := Ord(DoEraseBackground(Canvas, Msg.LParam));
|
|
finally
|
|
Canvas.Handle := 0;
|
|
Canvas.Free;
|
|
RestoreDC(HDC(Msg.WParam), IdSaveDC);
|
|
end;
|
|
end
|
|
else
|
|
inherited WndProc(Msg);
|
|
{$IFNDEF DELPHI2007_UP}
|
|
WM_PRINTCLIENT, WM_PRINT: // VCL bug fix
|
|
begin
|
|
IdSaveDC := SaveDC(HDC(Msg.WParam)); // protect DC against changes
|
|
try
|
|
inherited WndProc(Msg);
|
|
finally
|
|
RestoreDC(HDC(Msg.WParam), IdSaveDC);
|
|
end;
|
|
end;
|
|
{$ENDIF ~DELPHI2007_UP}
|
|
WM_GETDLGCODE:
|
|
begin
|
|
inherited WndProc(Msg);
|
|
DlgCodes := [dcNative] + DlgcToDlgCodes(Msg.Result);
|
|
GetDlgCode(DlgCodes);
|
|
if not (dcNative in DlgCodes) then
|
|
Msg.Result := DlgCodesToDlgc(DlgCodes);
|
|
end;
|
|
else
|
|
inherited WndProc(Msg);
|
|
end;
|
|
case Msg.Msg of // precheck message to prevent access violations on released controls
|
|
CM_MOUSEENTER, CM_MOUSELEAVE, WM_KILLFOCUS, WM_SETFOCUS, WM_NCPAINT:
|
|
if DotNetHighlighting then
|
|
HandleDotNetHighlighting(Self, Msg, MouseOver, Color);
|
|
end;
|
|
end;
|
|
end;
|
|
|
|
//============================================================================
|
|
|
|
constructor TJvExMonthCalendar.Create(AOwner: TComponent);
|
|
begin
|
|
inherited Create(AOwner);
|
|
FHintColor := clDefault;
|
|
end;
|
|
|
|
function TJvExMonthCalendar.BaseWndProc(Msg: Integer; WParam: Integer = 0; LParam: Longint = 0): Integer;
|
|
var
|
|
Mesg: TMessage;
|
|
begin
|
|
Mesg := CreateWMMessage(Msg, WParam, LParam);
|
|
inherited WndProc(Mesg);
|
|
Result := Mesg.Result;
|
|
end;
|
|
|
|
function TJvExMonthCalendar.BaseWndProc(Msg: Integer; WParam: Integer; LParam: TControl): Integer;
|
|
var
|
|
Mesg: TMessage;
|
|
begin
|
|
Mesg := CreateWMMessage(Msg, WParam, LParam);
|
|
inherited WndProc(Mesg);
|
|
Result := Mesg.Result;
|
|
end;
|
|
|
|
function TJvExMonthCalendar.BaseWndProcEx(Msg: Integer; WParam: Integer; var LParam): Integer;
|
|
var
|
|
Mesg: TStructPtrMessage;
|
|
begin
|
|
Mesg := TStructPtrMessage.Create(Msg, WParam, LParam);
|
|
try
|
|
inherited WndProc(Mesg.Msg);
|
|
finally
|
|
Result := Mesg.Msg.Result;
|
|
Mesg.Free;
|
|
end;
|
|
end;
|
|
|
|
procedure TJvExMonthCalendar.VisibleChanged;
|
|
begin
|
|
BaseWndProc(CM_VISIBLECHANGED);
|
|
end;
|
|
|
|
procedure TJvExMonthCalendar.EnabledChanged;
|
|
begin
|
|
BaseWndProc(CM_ENABLEDCHANGED);
|
|
end;
|
|
|
|
procedure TJvExMonthCalendar.TextChanged;
|
|
begin
|
|
BaseWndProc(CM_TEXTCHANGED);
|
|
end;
|
|
|
|
procedure TJvExMonthCalendar.FontChanged;
|
|
begin
|
|
BaseWndProc(CM_FONTCHANGED);
|
|
end;
|
|
|
|
procedure TJvExMonthCalendar.ColorChanged;
|
|
begin
|
|
BaseWndProc(CM_COLORCHANGED);
|
|
end;
|
|
|
|
procedure TJvExMonthCalendar.ParentFontChanged;
|
|
begin
|
|
BaseWndProc(CM_PARENTFONTCHANGED);
|
|
end;
|
|
|
|
procedure TJvExMonthCalendar.ParentColorChanged;
|
|
begin
|
|
BaseWndProc(CM_PARENTCOLORCHANGED);
|
|
if Assigned(OnParentColorChange) then
|
|
OnParentColorChange(Self);
|
|
end;
|
|
|
|
procedure TJvExMonthCalendar.ParentShowHintChanged;
|
|
begin
|
|
BaseWndProc(CM_PARENTSHOWHINTCHANGED);
|
|
end;
|
|
|
|
function TJvExMonthCalendar.WantKey(Key: Integer; Shift: TShiftState; const KeyText: WideString): Boolean;
|
|
begin
|
|
Result := BaseWndProc(CM_DIALOGCHAR, Word(Key), ShiftStateToKeyData(Shift)) <> 0;
|
|
end;
|
|
|
|
function TJvExMonthCalendar.HitTest(X, Y: Integer): Boolean;
|
|
begin
|
|
Result := BaseWndProc(CM_HITTEST, 0, SmallPointToLong(PointToSmallPoint(Point(X, Y)))) <> 0;
|
|
end;
|
|
|
|
function TJvExMonthCalendar.HintShow(var HintInfo: THintInfo): Boolean;
|
|
begin
|
|
GetHintColor(HintInfo, Self, FHintColor);
|
|
if FHintWindowClass <> nil then
|
|
HintInfo.HintWindowClass := FHintWindowClass;
|
|
Result := BaseWndProcEx(CM_HINTSHOW, 0, HintInfo) <> 0;
|
|
end;
|
|
|
|
procedure TJvExMonthCalendar.MouseEnter(AControl: TControl);
|
|
begin
|
|
FMouseOver := True;
|
|
if Assigned(FOnMouseEnter) then
|
|
FOnMouseEnter(Self);
|
|
BaseWndProc(CM_MOUSEENTER, 0, AControl);
|
|
end;
|
|
|
|
procedure TJvExMonthCalendar.MouseLeave(AControl: TControl);
|
|
begin
|
|
FMouseOver := False;
|
|
BaseWndProc(CM_MOUSELEAVE, 0, AControl);
|
|
if Assigned(FOnMouseLeave) then
|
|
FOnMouseLeave(Self);
|
|
end;
|
|
|
|
{$IFNDEF CLR}
|
|
procedure TJvExMonthCalendar.FocusChanged(AControl: TWinControl);
|
|
begin
|
|
BaseWndProc(CM_FOCUSCHANGED, 0, AControl);
|
|
end;
|
|
{$ENDIF !CLR}
|
|
|
|
{$IFDEF COMPILER5}
|
|
{$IFNDEF HASAUTOSIZE}
|
|
|
|
procedure TJvExMonthCalendar.CMSetAutoSize(var Msg: TMessage);
|
|
begin
|
|
SetAutoSize(Msg.WParam <> 0);
|
|
end;
|
|
|
|
procedure TJvExMonthCalendar.SetAutoSize(Value: Boolean);
|
|
begin
|
|
TOpenControl_SetAutoSize(Self, Value);
|
|
end;
|
|
|
|
{$ENDIF !HASAUTOSIZE}
|
|
{$ENDIF COMPILER5}
|
|
|
|
procedure TJvExMonthCalendar.BoundsChanged;
|
|
begin
|
|
end;
|
|
|
|
procedure TJvExMonthCalendar.CursorChanged;
|
|
begin
|
|
BaseWndProc(CM_CURSORCHANGED);
|
|
end;
|
|
|
|
procedure TJvExMonthCalendar.ShowingChanged;
|
|
begin
|
|
BaseWndProc(CM_SHOWINGCHANGED);
|
|
end;
|
|
|
|
procedure TJvExMonthCalendar.ShowHintChanged;
|
|
begin
|
|
BaseWndProc(CM_SHOWHINTCHANGED);
|
|
end;
|
|
|
|
{$IFNDEF CLR}
|
|
{ VCL sends CM_CONTROLLISTCHANGE and CM_CONTROLCHANGE in a different order than
|
|
the CLX methods are used. So we must correct it by evaluating "Inserting". }
|
|
procedure TJvExMonthCalendar.ControlsListChanging(Control: TControl; Inserting: Boolean);
|
|
begin
|
|
if Inserting then
|
|
BaseWndProc(CM_CONTROLLISTCHANGE, Integer(Control), Integer(Inserting))
|
|
else
|
|
BaseWndProc(CM_CONTROLCHANGE, Integer(Control), Integer(Inserting));
|
|
end;
|
|
|
|
procedure TJvExMonthCalendar.ControlsListChanged(Control: TControl; Inserting: Boolean);
|
|
begin
|
|
if not Inserting then
|
|
BaseWndProc(CM_CONTROLLISTCHANGE, Integer(Control), Integer(Inserting))
|
|
else
|
|
BaseWndProc(CM_CONTROLCHANGE, Integer(Control), Integer(Inserting));
|
|
end;
|
|
{$ENDIF !CLR}
|
|
|
|
procedure TJvExMonthCalendar.GetDlgCode(var Code: TDlgCodes);
|
|
begin
|
|
end;
|
|
|
|
procedure TJvExMonthCalendar.FocusSet(PrevWnd: THandle);
|
|
begin
|
|
BaseWndProc(WM_SETFOCUS, Integer(PrevWnd), 0);
|
|
end;
|
|
|
|
procedure TJvExMonthCalendar.FocusKilled(NextWnd: THandle);
|
|
begin
|
|
BaseWndProc(WM_KILLFOCUS, Integer(NextWnd), 0);
|
|
end;
|
|
|
|
function TJvExMonthCalendar.DoEraseBackground(Canvas: TCanvas; Param: Integer): Boolean;
|
|
begin
|
|
Result := BaseWndProc(WM_ERASEBKGND, Canvas.Handle, Param) <> 0;
|
|
end;
|
|
|
|
{$IFDEF JVCLThemesEnabledD56}
|
|
function TJvExMonthCalendar.GetParentBackground: Boolean;
|
|
begin
|
|
Result := JvThemes.GetParentBackground(Self);
|
|
end;
|
|
|
|
procedure TJvExMonthCalendar.SetParentBackground(Value: Boolean);
|
|
begin
|
|
JvThemes.SetParentBackground(Self, Value);
|
|
end;
|
|
{$ENDIF JVCLThemesEnabledD56}
|
|
|
|
procedure TJvExMonthCalendar.WndProc(var Msg: TMessage);
|
|
var
|
|
IdSaveDC: Integer;
|
|
DlgCodes: TDlgCodes;
|
|
Canvas: TCanvas;
|
|
{$IFDEF CLR}
|
|
AHintInfo: THintInfo;
|
|
{$ENDIF CLR}
|
|
begin
|
|
if not DispatchIsDesignMsg(Self, Msg) then
|
|
begin
|
|
case Msg.Msg of
|
|
CM_DENYSUBCLASSING:
|
|
{$IFNDEF CLR}
|
|
Msg.Result := Ord(GetInterfaceEntry(IJvDenySubClassing) <> nil);
|
|
{$ELSE}
|
|
Msg.Result := Integer(Supports(Self, IJvDenySubClassing));
|
|
{$ENDIF !CLR}
|
|
CM_DIALOGCHAR:
|
|
with TCMDialogChar{$IFDEF CLR}.Create{$ENDIF}(Msg) do
|
|
Result := Ord(WantKey(CharCode, KeyDataToShiftState(KeyData), WideChar(CharCode)));
|
|
CM_HINTSHOW:
|
|
{$IFNDEF CLR}
|
|
with TCMHintShow(Msg) do
|
|
Result := Integer(HintShow(HintInfo^));
|
|
{$ELSE}
|
|
with TCMHintShow.Create(Msg) do
|
|
begin
|
|
AHintInfo := HintInfo;
|
|
Result := Integer(HintShow(AHintInfo));
|
|
HintInfo := AHintInfo;
|
|
end;
|
|
{$ENDIF !CLR}
|
|
CM_HITTEST:
|
|
with TCMHitTest{$IFDEF CLR}.Create{$ENDIF}(Msg) do
|
|
Result := Integer(HitTest(XPos, YPos));
|
|
CM_MOUSEENTER:
|
|
MouseEnter({$IFDEF CLR}nil{$ELSE}TControl(Msg.LParam){$ENDIF});
|
|
CM_MOUSELEAVE:
|
|
MouseLeave({$IFDEF CLR}nil{$ELSE}TControl(Msg.LParam){$ENDIF});
|
|
CM_VISIBLECHANGED:
|
|
VisibleChanged;
|
|
CM_ENABLEDCHANGED:
|
|
EnabledChanged;
|
|
CM_TEXTCHANGED:
|
|
TextChanged;
|
|
CM_FONTCHANGED:
|
|
FontChanged;
|
|
CM_COLORCHANGED:
|
|
ColorChanged;
|
|
{$IFNDEF CLR}
|
|
CM_FOCUSCHANGED:
|
|
FocusChanged(TWinControl(Msg.LParam));
|
|
{$ENDIF !CLR}
|
|
CM_PARENTFONTCHANGED:
|
|
ParentFontChanged;
|
|
CM_PARENTCOLORCHANGED:
|
|
ParentColorChanged;
|
|
CM_PARENTSHOWHINTCHANGED:
|
|
ParentShowHintChanged;
|
|
CM_CURSORCHANGED:
|
|
CursorChanged;
|
|
CM_SHOWINGCHANGED:
|
|
ShowingChanged;
|
|
CM_SHOWHINTCHANGED:
|
|
ShowHintChanged;
|
|
{$IFNDEF CLR}
|
|
CM_CONTROLLISTCHANGE:
|
|
if Msg.LParam <> 0 then
|
|
ControlsListChanging(TControl(Msg.WParam), True)
|
|
else
|
|
ControlsListChanged(TControl(Msg.WParam), False);
|
|
CM_CONTROLCHANGE:
|
|
if Msg.LParam = 0 then
|
|
ControlsListChanging(TControl(Msg.WParam), False)
|
|
else
|
|
ControlsListChanged(TControl(Msg.WParam), True);
|
|
{$ENDIF !CLR}
|
|
WM_SETFOCUS:
|
|
FocusSet(THandle(Msg.WParam));
|
|
WM_KILLFOCUS:
|
|
FocusKilled(THandle(Msg.WParam));
|
|
WM_SIZE, WM_MOVE:
|
|
begin
|
|
inherited WndProc(Msg);
|
|
BoundsChanged;
|
|
end;
|
|
WM_ERASEBKGND:
|
|
if Msg.WParam <> 0 then
|
|
begin
|
|
IdSaveDC := SaveDC(HDC(Msg.WParam)); // protect DC against Stock-Objects from Canvas
|
|
Canvas := TCanvas.Create;
|
|
try
|
|
Canvas.Handle := HDC(Msg.WParam);
|
|
Msg.Result := Ord(DoEraseBackground(Canvas, Msg.LParam));
|
|
finally
|
|
Canvas.Handle := 0;
|
|
Canvas.Free;
|
|
RestoreDC(HDC(Msg.WParam), IdSaveDC);
|
|
end;
|
|
end
|
|
else
|
|
inherited WndProc(Msg);
|
|
{$IFNDEF DELPHI2007_UP}
|
|
WM_PRINTCLIENT, WM_PRINT: // VCL bug fix
|
|
begin
|
|
IdSaveDC := SaveDC(HDC(Msg.WParam)); // protect DC against changes
|
|
try
|
|
inherited WndProc(Msg);
|
|
finally
|
|
RestoreDC(HDC(Msg.WParam), IdSaveDC);
|
|
end;
|
|
end;
|
|
{$ENDIF ~DELPHI2007_UP}
|
|
WM_GETDLGCODE:
|
|
begin
|
|
inherited WndProc(Msg);
|
|
DlgCodes := [dcNative] + DlgcToDlgCodes(Msg.Result);
|
|
GetDlgCode(DlgCodes);
|
|
if not (dcNative in DlgCodes) then
|
|
Msg.Result := DlgCodesToDlgc(DlgCodes);
|
|
end;
|
|
else
|
|
inherited WndProc(Msg);
|
|
end;
|
|
case Msg.Msg of // precheck message to prevent access violations on released controls
|
|
CM_MOUSEENTER, CM_MOUSELEAVE, WM_KILLFOCUS, WM_SETFOCUS, WM_NCPAINT:
|
|
if DotNetHighlighting then
|
|
HandleDotNetHighlighting(Self, Msg, MouseOver, Color);
|
|
end;
|
|
end;
|
|
end;
|
|
|
|
//============================================================================
|
|
|
|
constructor TJvExCustomHotKey.Create(AOwner: TComponent);
|
|
begin
|
|
inherited Create(AOwner);
|
|
FHintColor := clDefault;
|
|
end;
|
|
|
|
function TJvExCustomHotKey.BaseWndProc(Msg: Integer; WParam: Integer = 0; LParam: Longint = 0): Integer;
|
|
var
|
|
Mesg: TMessage;
|
|
begin
|
|
Mesg := CreateWMMessage(Msg, WParam, LParam);
|
|
inherited WndProc(Mesg);
|
|
Result := Mesg.Result;
|
|
end;
|
|
|
|
function TJvExCustomHotKey.BaseWndProc(Msg: Integer; WParam: Integer; LParam: TControl): Integer;
|
|
var
|
|
Mesg: TMessage;
|
|
begin
|
|
Mesg := CreateWMMessage(Msg, WParam, LParam);
|
|
inherited WndProc(Mesg);
|
|
Result := Mesg.Result;
|
|
end;
|
|
|
|
function TJvExCustomHotKey.BaseWndProcEx(Msg: Integer; WParam: Integer; var LParam): Integer;
|
|
var
|
|
Mesg: TStructPtrMessage;
|
|
begin
|
|
Mesg := TStructPtrMessage.Create(Msg, WParam, LParam);
|
|
try
|
|
inherited WndProc(Mesg.Msg);
|
|
finally
|
|
Result := Mesg.Msg.Result;
|
|
Mesg.Free;
|
|
end;
|
|
end;
|
|
|
|
procedure TJvExCustomHotKey.VisibleChanged;
|
|
begin
|
|
BaseWndProc(CM_VISIBLECHANGED);
|
|
end;
|
|
|
|
procedure TJvExCustomHotKey.EnabledChanged;
|
|
begin
|
|
BaseWndProc(CM_ENABLEDCHANGED);
|
|
end;
|
|
|
|
procedure TJvExCustomHotKey.TextChanged;
|
|
begin
|
|
BaseWndProc(CM_TEXTCHANGED);
|
|
end;
|
|
|
|
procedure TJvExCustomHotKey.FontChanged;
|
|
begin
|
|
BaseWndProc(CM_FONTCHANGED);
|
|
end;
|
|
|
|
procedure TJvExCustomHotKey.ColorChanged;
|
|
begin
|
|
BaseWndProc(CM_COLORCHANGED);
|
|
end;
|
|
|
|
procedure TJvExCustomHotKey.ParentFontChanged;
|
|
begin
|
|
BaseWndProc(CM_PARENTFONTCHANGED);
|
|
end;
|
|
|
|
procedure TJvExCustomHotKey.ParentColorChanged;
|
|
begin
|
|
BaseWndProc(CM_PARENTCOLORCHANGED);
|
|
if Assigned(OnParentColorChange) then
|
|
OnParentColorChange(Self);
|
|
end;
|
|
|
|
procedure TJvExCustomHotKey.ParentShowHintChanged;
|
|
begin
|
|
BaseWndProc(CM_PARENTSHOWHINTCHANGED);
|
|
end;
|
|
|
|
function TJvExCustomHotKey.WantKey(Key: Integer; Shift: TShiftState; const KeyText: WideString): Boolean;
|
|
begin
|
|
Result := BaseWndProc(CM_DIALOGCHAR, Word(Key), ShiftStateToKeyData(Shift)) <> 0;
|
|
end;
|
|
|
|
function TJvExCustomHotKey.HitTest(X, Y: Integer): Boolean;
|
|
begin
|
|
Result := BaseWndProc(CM_HITTEST, 0, SmallPointToLong(PointToSmallPoint(Point(X, Y)))) <> 0;
|
|
end;
|
|
|
|
function TJvExCustomHotKey.HintShow(var HintInfo: THintInfo): Boolean;
|
|
begin
|
|
GetHintColor(HintInfo, Self, FHintColor);
|
|
if FHintWindowClass <> nil then
|
|
HintInfo.HintWindowClass := FHintWindowClass;
|
|
Result := BaseWndProcEx(CM_HINTSHOW, 0, HintInfo) <> 0;
|
|
end;
|
|
|
|
procedure TJvExCustomHotKey.MouseEnter(AControl: TControl);
|
|
begin
|
|
FMouseOver := True;
|
|
if Assigned(FOnMouseEnter) then
|
|
FOnMouseEnter(Self);
|
|
BaseWndProc(CM_MOUSEENTER, 0, AControl);
|
|
end;
|
|
|
|
procedure TJvExCustomHotKey.MouseLeave(AControl: TControl);
|
|
begin
|
|
FMouseOver := False;
|
|
BaseWndProc(CM_MOUSELEAVE, 0, AControl);
|
|
if Assigned(FOnMouseLeave) then
|
|
FOnMouseLeave(Self);
|
|
end;
|
|
|
|
{$IFNDEF CLR}
|
|
procedure TJvExCustomHotKey.FocusChanged(AControl: TWinControl);
|
|
begin
|
|
BaseWndProc(CM_FOCUSCHANGED, 0, AControl);
|
|
end;
|
|
{$ENDIF !CLR}
|
|
|
|
{$IFDEF COMPILER5}
|
|
{$IFNDEF HASAUTOSIZE}
|
|
|
|
procedure TJvExCustomHotKey.CMSetAutoSize(var Msg: TMessage);
|
|
begin
|
|
SetAutoSize(Msg.WParam <> 0);
|
|
end;
|
|
|
|
procedure TJvExCustomHotKey.SetAutoSize(Value: Boolean);
|
|
begin
|
|
TOpenControl_SetAutoSize(Self, Value);
|
|
end;
|
|
|
|
{$ENDIF !HASAUTOSIZE}
|
|
{$ENDIF COMPILER5}
|
|
|
|
procedure TJvExCustomHotKey.BoundsChanged;
|
|
begin
|
|
end;
|
|
|
|
procedure TJvExCustomHotKey.CursorChanged;
|
|
begin
|
|
BaseWndProc(CM_CURSORCHANGED);
|
|
end;
|
|
|
|
procedure TJvExCustomHotKey.ShowingChanged;
|
|
begin
|
|
BaseWndProc(CM_SHOWINGCHANGED);
|
|
end;
|
|
|
|
procedure TJvExCustomHotKey.ShowHintChanged;
|
|
begin
|
|
BaseWndProc(CM_SHOWHINTCHANGED);
|
|
end;
|
|
|
|
{$IFNDEF CLR}
|
|
{ VCL sends CM_CONTROLLISTCHANGE and CM_CONTROLCHANGE in a different order than
|
|
the CLX methods are used. So we must correct it by evaluating "Inserting". }
|
|
procedure TJvExCustomHotKey.ControlsListChanging(Control: TControl; Inserting: Boolean);
|
|
begin
|
|
if Inserting then
|
|
BaseWndProc(CM_CONTROLLISTCHANGE, Integer(Control), Integer(Inserting))
|
|
else
|
|
BaseWndProc(CM_CONTROLCHANGE, Integer(Control), Integer(Inserting));
|
|
end;
|
|
|
|
procedure TJvExCustomHotKey.ControlsListChanged(Control: TControl; Inserting: Boolean);
|
|
begin
|
|
if not Inserting then
|
|
BaseWndProc(CM_CONTROLLISTCHANGE, Integer(Control), Integer(Inserting))
|
|
else
|
|
BaseWndProc(CM_CONTROLCHANGE, Integer(Control), Integer(Inserting));
|
|
end;
|
|
{$ENDIF !CLR}
|
|
|
|
procedure TJvExCustomHotKey.GetDlgCode(var Code: TDlgCodes);
|
|
begin
|
|
end;
|
|
|
|
procedure TJvExCustomHotKey.FocusSet(PrevWnd: THandle);
|
|
begin
|
|
BaseWndProc(WM_SETFOCUS, Integer(PrevWnd), 0);
|
|
end;
|
|
|
|
procedure TJvExCustomHotKey.FocusKilled(NextWnd: THandle);
|
|
begin
|
|
BaseWndProc(WM_KILLFOCUS, Integer(NextWnd), 0);
|
|
end;
|
|
|
|
function TJvExCustomHotKey.DoEraseBackground(Canvas: TCanvas; Param: Integer): Boolean;
|
|
begin
|
|
Result := BaseWndProc(WM_ERASEBKGND, Canvas.Handle, Param) <> 0;
|
|
end;
|
|
|
|
{$IFDEF JVCLThemesEnabledD56}
|
|
function TJvExCustomHotKey.GetParentBackground: Boolean;
|
|
begin
|
|
Result := JvThemes.GetParentBackground(Self);
|
|
end;
|
|
|
|
procedure TJvExCustomHotKey.SetParentBackground(Value: Boolean);
|
|
begin
|
|
JvThemes.SetParentBackground(Self, Value);
|
|
end;
|
|
{$ENDIF JVCLThemesEnabledD56}
|
|
|
|
procedure TJvExCustomHotKey.WndProc(var Msg: TMessage);
|
|
var
|
|
IdSaveDC: Integer;
|
|
DlgCodes: TDlgCodes;
|
|
Canvas: TCanvas;
|
|
{$IFDEF CLR}
|
|
AHintInfo: THintInfo;
|
|
{$ENDIF CLR}
|
|
begin
|
|
if not DispatchIsDesignMsg(Self, Msg) then
|
|
begin
|
|
case Msg.Msg of
|
|
CM_DENYSUBCLASSING:
|
|
{$IFNDEF CLR}
|
|
Msg.Result := Ord(GetInterfaceEntry(IJvDenySubClassing) <> nil);
|
|
{$ELSE}
|
|
Msg.Result := Integer(Supports(Self, IJvDenySubClassing));
|
|
{$ENDIF !CLR}
|
|
CM_DIALOGCHAR:
|
|
with TCMDialogChar{$IFDEF CLR}.Create{$ENDIF}(Msg) do
|
|
Result := Ord(WantKey(CharCode, KeyDataToShiftState(KeyData), WideChar(CharCode)));
|
|
CM_HINTSHOW:
|
|
{$IFNDEF CLR}
|
|
with TCMHintShow(Msg) do
|
|
Result := Integer(HintShow(HintInfo^));
|
|
{$ELSE}
|
|
with TCMHintShow.Create(Msg) do
|
|
begin
|
|
AHintInfo := HintInfo;
|
|
Result := Integer(HintShow(AHintInfo));
|
|
HintInfo := AHintInfo;
|
|
end;
|
|
{$ENDIF !CLR}
|
|
CM_HITTEST:
|
|
with TCMHitTest{$IFDEF CLR}.Create{$ENDIF}(Msg) do
|
|
Result := Integer(HitTest(XPos, YPos));
|
|
CM_MOUSEENTER:
|
|
MouseEnter({$IFDEF CLR}nil{$ELSE}TControl(Msg.LParam){$ENDIF});
|
|
CM_MOUSELEAVE:
|
|
MouseLeave({$IFDEF CLR}nil{$ELSE}TControl(Msg.LParam){$ENDIF});
|
|
CM_VISIBLECHANGED:
|
|
VisibleChanged;
|
|
CM_ENABLEDCHANGED:
|
|
EnabledChanged;
|
|
CM_TEXTCHANGED:
|
|
TextChanged;
|
|
CM_FONTCHANGED:
|
|
FontChanged;
|
|
CM_COLORCHANGED:
|
|
ColorChanged;
|
|
{$IFNDEF CLR}
|
|
CM_FOCUSCHANGED:
|
|
FocusChanged(TWinControl(Msg.LParam));
|
|
{$ENDIF !CLR}
|
|
CM_PARENTFONTCHANGED:
|
|
ParentFontChanged;
|
|
CM_PARENTCOLORCHANGED:
|
|
ParentColorChanged;
|
|
CM_PARENTSHOWHINTCHANGED:
|
|
ParentShowHintChanged;
|
|
CM_CURSORCHANGED:
|
|
CursorChanged;
|
|
CM_SHOWINGCHANGED:
|
|
ShowingChanged;
|
|
CM_SHOWHINTCHANGED:
|
|
ShowHintChanged;
|
|
{$IFNDEF CLR}
|
|
CM_CONTROLLISTCHANGE:
|
|
if Msg.LParam <> 0 then
|
|
ControlsListChanging(TControl(Msg.WParam), True)
|
|
else
|
|
ControlsListChanged(TControl(Msg.WParam), False);
|
|
CM_CONTROLCHANGE:
|
|
if Msg.LParam = 0 then
|
|
ControlsListChanging(TControl(Msg.WParam), False)
|
|
else
|
|
ControlsListChanged(TControl(Msg.WParam), True);
|
|
{$ENDIF !CLR}
|
|
WM_SETFOCUS:
|
|
FocusSet(THandle(Msg.WParam));
|
|
WM_KILLFOCUS:
|
|
FocusKilled(THandle(Msg.WParam));
|
|
WM_SIZE, WM_MOVE:
|
|
begin
|
|
inherited WndProc(Msg);
|
|
BoundsChanged;
|
|
end;
|
|
WM_ERASEBKGND:
|
|
if Msg.WParam <> 0 then
|
|
begin
|
|
IdSaveDC := SaveDC(HDC(Msg.WParam)); // protect DC against Stock-Objects from Canvas
|
|
Canvas := TCanvas.Create;
|
|
try
|
|
Canvas.Handle := HDC(Msg.WParam);
|
|
Msg.Result := Ord(DoEraseBackground(Canvas, Msg.LParam));
|
|
finally
|
|
Canvas.Handle := 0;
|
|
Canvas.Free;
|
|
RestoreDC(HDC(Msg.WParam), IdSaveDC);
|
|
end;
|
|
end
|
|
else
|
|
inherited WndProc(Msg);
|
|
{$IFNDEF DELPHI2007_UP}
|
|
WM_PRINTCLIENT, WM_PRINT: // VCL bug fix
|
|
begin
|
|
IdSaveDC := SaveDC(HDC(Msg.WParam)); // protect DC against changes
|
|
try
|
|
inherited WndProc(Msg);
|
|
finally
|
|
RestoreDC(HDC(Msg.WParam), IdSaveDC);
|
|
end;
|
|
end;
|
|
{$ENDIF ~DELPHI2007_UP}
|
|
WM_GETDLGCODE:
|
|
begin
|
|
inherited WndProc(Msg);
|
|
DlgCodes := [dcNative] + DlgcToDlgCodes(Msg.Result);
|
|
GetDlgCode(DlgCodes);
|
|
if not (dcNative in DlgCodes) then
|
|
Msg.Result := DlgCodesToDlgc(DlgCodes);
|
|
end;
|
|
else
|
|
inherited WndProc(Msg);
|
|
end;
|
|
case Msg.Msg of // precheck message to prevent access violations on released controls
|
|
CM_MOUSEENTER, CM_MOUSELEAVE, WM_KILLFOCUS, WM_SETFOCUS, WM_NCPAINT:
|
|
if DotNetHighlighting then
|
|
HandleDotNetHighlighting(Self, Msg, MouseOver, Color);
|
|
end;
|
|
end;
|
|
end;
|
|
|
|
//============================================================================
|
|
|
|
constructor TJvExHotKey.Create(AOwner: TComponent);
|
|
begin
|
|
inherited Create(AOwner);
|
|
FHintColor := clDefault;
|
|
end;
|
|
|
|
function TJvExHotKey.BaseWndProc(Msg: Integer; WParam: Integer = 0; LParam: Longint = 0): Integer;
|
|
var
|
|
Mesg: TMessage;
|
|
begin
|
|
Mesg := CreateWMMessage(Msg, WParam, LParam);
|
|
inherited WndProc(Mesg);
|
|
Result := Mesg.Result;
|
|
end;
|
|
|
|
function TJvExHotKey.BaseWndProc(Msg: Integer; WParam: Integer; LParam: TControl): Integer;
|
|
var
|
|
Mesg: TMessage;
|
|
begin
|
|
Mesg := CreateWMMessage(Msg, WParam, LParam);
|
|
inherited WndProc(Mesg);
|
|
Result := Mesg.Result;
|
|
end;
|
|
|
|
function TJvExHotKey.BaseWndProcEx(Msg: Integer; WParam: Integer; var LParam): Integer;
|
|
var
|
|
Mesg: TStructPtrMessage;
|
|
begin
|
|
Mesg := TStructPtrMessage.Create(Msg, WParam, LParam);
|
|
try
|
|
inherited WndProc(Mesg.Msg);
|
|
finally
|
|
Result := Mesg.Msg.Result;
|
|
Mesg.Free;
|
|
end;
|
|
end;
|
|
|
|
procedure TJvExHotKey.VisibleChanged;
|
|
begin
|
|
BaseWndProc(CM_VISIBLECHANGED);
|
|
end;
|
|
|
|
procedure TJvExHotKey.EnabledChanged;
|
|
begin
|
|
BaseWndProc(CM_ENABLEDCHANGED);
|
|
end;
|
|
|
|
procedure TJvExHotKey.TextChanged;
|
|
begin
|
|
BaseWndProc(CM_TEXTCHANGED);
|
|
end;
|
|
|
|
procedure TJvExHotKey.FontChanged;
|
|
begin
|
|
BaseWndProc(CM_FONTCHANGED);
|
|
end;
|
|
|
|
procedure TJvExHotKey.ColorChanged;
|
|
begin
|
|
BaseWndProc(CM_COLORCHANGED);
|
|
end;
|
|
|
|
procedure TJvExHotKey.ParentFontChanged;
|
|
begin
|
|
BaseWndProc(CM_PARENTFONTCHANGED);
|
|
end;
|
|
|
|
procedure TJvExHotKey.ParentColorChanged;
|
|
begin
|
|
BaseWndProc(CM_PARENTCOLORCHANGED);
|
|
if Assigned(OnParentColorChange) then
|
|
OnParentColorChange(Self);
|
|
end;
|
|
|
|
procedure TJvExHotKey.ParentShowHintChanged;
|
|
begin
|
|
BaseWndProc(CM_PARENTSHOWHINTCHANGED);
|
|
end;
|
|
|
|
function TJvExHotKey.WantKey(Key: Integer; Shift: TShiftState; const KeyText: WideString): Boolean;
|
|
begin
|
|
Result := BaseWndProc(CM_DIALOGCHAR, Word(Key), ShiftStateToKeyData(Shift)) <> 0;
|
|
end;
|
|
|
|
function TJvExHotKey.HitTest(X, Y: Integer): Boolean;
|
|
begin
|
|
Result := BaseWndProc(CM_HITTEST, 0, SmallPointToLong(PointToSmallPoint(Point(X, Y)))) <> 0;
|
|
end;
|
|
|
|
function TJvExHotKey.HintShow(var HintInfo: THintInfo): Boolean;
|
|
begin
|
|
GetHintColor(HintInfo, Self, FHintColor);
|
|
if FHintWindowClass <> nil then
|
|
HintInfo.HintWindowClass := FHintWindowClass;
|
|
Result := BaseWndProcEx(CM_HINTSHOW, 0, HintInfo) <> 0;
|
|
end;
|
|
|
|
procedure TJvExHotKey.MouseEnter(AControl: TControl);
|
|
begin
|
|
FMouseOver := True;
|
|
if Assigned(FOnMouseEnter) then
|
|
FOnMouseEnter(Self);
|
|
BaseWndProc(CM_MOUSEENTER, 0, AControl);
|
|
end;
|
|
|
|
procedure TJvExHotKey.MouseLeave(AControl: TControl);
|
|
begin
|
|
FMouseOver := False;
|
|
BaseWndProc(CM_MOUSELEAVE, 0, AControl);
|
|
if Assigned(FOnMouseLeave) then
|
|
FOnMouseLeave(Self);
|
|
end;
|
|
|
|
{$IFNDEF CLR}
|
|
procedure TJvExHotKey.FocusChanged(AControl: TWinControl);
|
|
begin
|
|
BaseWndProc(CM_FOCUSCHANGED, 0, AControl);
|
|
end;
|
|
{$ENDIF !CLR}
|
|
|
|
{$IFDEF COMPILER5}
|
|
{$IFNDEF HASAUTOSIZE}
|
|
|
|
procedure TJvExHotKey.CMSetAutoSize(var Msg: TMessage);
|
|
begin
|
|
SetAutoSize(Msg.WParam <> 0);
|
|
end;
|
|
|
|
procedure TJvExHotKey.SetAutoSize(Value: Boolean);
|
|
begin
|
|
TOpenControl_SetAutoSize(Self, Value);
|
|
end;
|
|
|
|
{$ENDIF !HASAUTOSIZE}
|
|
{$ENDIF COMPILER5}
|
|
|
|
procedure TJvExHotKey.BoundsChanged;
|
|
begin
|
|
end;
|
|
|
|
procedure TJvExHotKey.CursorChanged;
|
|
begin
|
|
BaseWndProc(CM_CURSORCHANGED);
|
|
end;
|
|
|
|
procedure TJvExHotKey.ShowingChanged;
|
|
begin
|
|
BaseWndProc(CM_SHOWINGCHANGED);
|
|
end;
|
|
|
|
procedure TJvExHotKey.ShowHintChanged;
|
|
begin
|
|
BaseWndProc(CM_SHOWHINTCHANGED);
|
|
end;
|
|
|
|
{$IFNDEF CLR}
|
|
{ VCL sends CM_CONTROLLISTCHANGE and CM_CONTROLCHANGE in a different order than
|
|
the CLX methods are used. So we must correct it by evaluating "Inserting". }
|
|
procedure TJvExHotKey.ControlsListChanging(Control: TControl; Inserting: Boolean);
|
|
begin
|
|
if Inserting then
|
|
BaseWndProc(CM_CONTROLLISTCHANGE, Integer(Control), Integer(Inserting))
|
|
else
|
|
BaseWndProc(CM_CONTROLCHANGE, Integer(Control), Integer(Inserting));
|
|
end;
|
|
|
|
procedure TJvExHotKey.ControlsListChanged(Control: TControl; Inserting: Boolean);
|
|
begin
|
|
if not Inserting then
|
|
BaseWndProc(CM_CONTROLLISTCHANGE, Integer(Control), Integer(Inserting))
|
|
else
|
|
BaseWndProc(CM_CONTROLCHANGE, Integer(Control), Integer(Inserting));
|
|
end;
|
|
{$ENDIF !CLR}
|
|
|
|
procedure TJvExHotKey.GetDlgCode(var Code: TDlgCodes);
|
|
begin
|
|
end;
|
|
|
|
procedure TJvExHotKey.FocusSet(PrevWnd: THandle);
|
|
begin
|
|
BaseWndProc(WM_SETFOCUS, Integer(PrevWnd), 0);
|
|
end;
|
|
|
|
procedure TJvExHotKey.FocusKilled(NextWnd: THandle);
|
|
begin
|
|
BaseWndProc(WM_KILLFOCUS, Integer(NextWnd), 0);
|
|
end;
|
|
|
|
function TJvExHotKey.DoEraseBackground(Canvas: TCanvas; Param: Integer): Boolean;
|
|
begin
|
|
Result := BaseWndProc(WM_ERASEBKGND, Canvas.Handle, Param) <> 0;
|
|
end;
|
|
|
|
{$IFDEF JVCLThemesEnabledD56}
|
|
function TJvExHotKey.GetParentBackground: Boolean;
|
|
begin
|
|
Result := JvThemes.GetParentBackground(Self);
|
|
end;
|
|
|
|
procedure TJvExHotKey.SetParentBackground(Value: Boolean);
|
|
begin
|
|
JvThemes.SetParentBackground(Self, Value);
|
|
end;
|
|
{$ENDIF JVCLThemesEnabledD56}
|
|
|
|
procedure TJvExHotKey.WndProc(var Msg: TMessage);
|
|
var
|
|
IdSaveDC: Integer;
|
|
DlgCodes: TDlgCodes;
|
|
Canvas: TCanvas;
|
|
{$IFDEF CLR}
|
|
AHintInfo: THintInfo;
|
|
{$ENDIF CLR}
|
|
begin
|
|
if not DispatchIsDesignMsg(Self, Msg) then
|
|
begin
|
|
case Msg.Msg of
|
|
CM_DENYSUBCLASSING:
|
|
{$IFNDEF CLR}
|
|
Msg.Result := Ord(GetInterfaceEntry(IJvDenySubClassing) <> nil);
|
|
{$ELSE}
|
|
Msg.Result := Integer(Supports(Self, IJvDenySubClassing));
|
|
{$ENDIF !CLR}
|
|
CM_DIALOGCHAR:
|
|
with TCMDialogChar{$IFDEF CLR}.Create{$ENDIF}(Msg) do
|
|
Result := Ord(WantKey(CharCode, KeyDataToShiftState(KeyData), WideChar(CharCode)));
|
|
CM_HINTSHOW:
|
|
{$IFNDEF CLR}
|
|
with TCMHintShow(Msg) do
|
|
Result := Integer(HintShow(HintInfo^));
|
|
{$ELSE}
|
|
with TCMHintShow.Create(Msg) do
|
|
begin
|
|
AHintInfo := HintInfo;
|
|
Result := Integer(HintShow(AHintInfo));
|
|
HintInfo := AHintInfo;
|
|
end;
|
|
{$ENDIF !CLR}
|
|
CM_HITTEST:
|
|
with TCMHitTest{$IFDEF CLR}.Create{$ENDIF}(Msg) do
|
|
Result := Integer(HitTest(XPos, YPos));
|
|
CM_MOUSEENTER:
|
|
MouseEnter({$IFDEF CLR}nil{$ELSE}TControl(Msg.LParam){$ENDIF});
|
|
CM_MOUSELEAVE:
|
|
MouseLeave({$IFDEF CLR}nil{$ELSE}TControl(Msg.LParam){$ENDIF});
|
|
CM_VISIBLECHANGED:
|
|
VisibleChanged;
|
|
CM_ENABLEDCHANGED:
|
|
EnabledChanged;
|
|
CM_TEXTCHANGED:
|
|
TextChanged;
|
|
CM_FONTCHANGED:
|
|
FontChanged;
|
|
CM_COLORCHANGED:
|
|
ColorChanged;
|
|
{$IFNDEF CLR}
|
|
CM_FOCUSCHANGED:
|
|
FocusChanged(TWinControl(Msg.LParam));
|
|
{$ENDIF !CLR}
|
|
CM_PARENTFONTCHANGED:
|
|
ParentFontChanged;
|
|
CM_PARENTCOLORCHANGED:
|
|
ParentColorChanged;
|
|
CM_PARENTSHOWHINTCHANGED:
|
|
ParentShowHintChanged;
|
|
CM_CURSORCHANGED:
|
|
CursorChanged;
|
|
CM_SHOWINGCHANGED:
|
|
ShowingChanged;
|
|
CM_SHOWHINTCHANGED:
|
|
ShowHintChanged;
|
|
{$IFNDEF CLR}
|
|
CM_CONTROLLISTCHANGE:
|
|
if Msg.LParam <> 0 then
|
|
ControlsListChanging(TControl(Msg.WParam), True)
|
|
else
|
|
ControlsListChanged(TControl(Msg.WParam), False);
|
|
CM_CONTROLCHANGE:
|
|
if Msg.LParam = 0 then
|
|
ControlsListChanging(TControl(Msg.WParam), False)
|
|
else
|
|
ControlsListChanged(TControl(Msg.WParam), True);
|
|
{$ENDIF !CLR}
|
|
WM_SETFOCUS:
|
|
FocusSet(THandle(Msg.WParam));
|
|
WM_KILLFOCUS:
|
|
FocusKilled(THandle(Msg.WParam));
|
|
WM_SIZE, WM_MOVE:
|
|
begin
|
|
inherited WndProc(Msg);
|
|
BoundsChanged;
|
|
end;
|
|
WM_ERASEBKGND:
|
|
if Msg.WParam <> 0 then
|
|
begin
|
|
IdSaveDC := SaveDC(HDC(Msg.WParam)); // protect DC against Stock-Objects from Canvas
|
|
Canvas := TCanvas.Create;
|
|
try
|
|
Canvas.Handle := HDC(Msg.WParam);
|
|
Msg.Result := Ord(DoEraseBackground(Canvas, Msg.LParam));
|
|
finally
|
|
Canvas.Handle := 0;
|
|
Canvas.Free;
|
|
RestoreDC(HDC(Msg.WParam), IdSaveDC);
|
|
end;
|
|
end
|
|
else
|
|
inherited WndProc(Msg);
|
|
{$IFNDEF DELPHI2007_UP}
|
|
WM_PRINTCLIENT, WM_PRINT: // VCL bug fix
|
|
begin
|
|
IdSaveDC := SaveDC(HDC(Msg.WParam)); // protect DC against changes
|
|
try
|
|
inherited WndProc(Msg);
|
|
finally
|
|
RestoreDC(HDC(Msg.WParam), IdSaveDC);
|
|
end;
|
|
end;
|
|
{$ENDIF ~DELPHI2007_UP}
|
|
WM_GETDLGCODE:
|
|
begin
|
|
inherited WndProc(Msg);
|
|
DlgCodes := [dcNative] + DlgcToDlgCodes(Msg.Result);
|
|
GetDlgCode(DlgCodes);
|
|
if not (dcNative in DlgCodes) then
|
|
Msg.Result := DlgCodesToDlgc(DlgCodes);
|
|
end;
|
|
else
|
|
inherited WndProc(Msg);
|
|
end;
|
|
case Msg.Msg of // precheck message to prevent access violations on released controls
|
|
CM_MOUSEENTER, CM_MOUSELEAVE, WM_KILLFOCUS, WM_SETFOCUS, WM_NCPAINT:
|
|
if DotNetHighlighting then
|
|
HandleDotNetHighlighting(Self, Msg, MouseOver, Color);
|
|
end;
|
|
end;
|
|
end;
|
|
|
|
//============================================================================
|
|
|
|
constructor TJvExCustomUpDown.Create(AOwner: TComponent);
|
|
begin
|
|
inherited Create(AOwner);
|
|
FHintColor := clDefault;
|
|
end;
|
|
|
|
function TJvExCustomUpDown.BaseWndProc(Msg: Integer; WParam: Integer = 0; LParam: Longint = 0): Integer;
|
|
var
|
|
Mesg: TMessage;
|
|
begin
|
|
Mesg := CreateWMMessage(Msg, WParam, LParam);
|
|
inherited WndProc(Mesg);
|
|
Result := Mesg.Result;
|
|
end;
|
|
|
|
function TJvExCustomUpDown.BaseWndProc(Msg: Integer; WParam: Integer; LParam: TControl): Integer;
|
|
var
|
|
Mesg: TMessage;
|
|
begin
|
|
Mesg := CreateWMMessage(Msg, WParam, LParam);
|
|
inherited WndProc(Mesg);
|
|
Result := Mesg.Result;
|
|
end;
|
|
|
|
function TJvExCustomUpDown.BaseWndProcEx(Msg: Integer; WParam: Integer; var LParam): Integer;
|
|
var
|
|
Mesg: TStructPtrMessage;
|
|
begin
|
|
Mesg := TStructPtrMessage.Create(Msg, WParam, LParam);
|
|
try
|
|
inherited WndProc(Mesg.Msg);
|
|
finally
|
|
Result := Mesg.Msg.Result;
|
|
Mesg.Free;
|
|
end;
|
|
end;
|
|
|
|
procedure TJvExCustomUpDown.VisibleChanged;
|
|
begin
|
|
BaseWndProc(CM_VISIBLECHANGED);
|
|
end;
|
|
|
|
procedure TJvExCustomUpDown.EnabledChanged;
|
|
begin
|
|
BaseWndProc(CM_ENABLEDCHANGED);
|
|
end;
|
|
|
|
procedure TJvExCustomUpDown.TextChanged;
|
|
begin
|
|
BaseWndProc(CM_TEXTCHANGED);
|
|
end;
|
|
|
|
procedure TJvExCustomUpDown.FontChanged;
|
|
begin
|
|
BaseWndProc(CM_FONTCHANGED);
|
|
end;
|
|
|
|
procedure TJvExCustomUpDown.ColorChanged;
|
|
begin
|
|
BaseWndProc(CM_COLORCHANGED);
|
|
end;
|
|
|
|
procedure TJvExCustomUpDown.ParentFontChanged;
|
|
begin
|
|
BaseWndProc(CM_PARENTFONTCHANGED);
|
|
end;
|
|
|
|
procedure TJvExCustomUpDown.ParentColorChanged;
|
|
begin
|
|
BaseWndProc(CM_PARENTCOLORCHANGED);
|
|
if Assigned(OnParentColorChange) then
|
|
OnParentColorChange(Self);
|
|
end;
|
|
|
|
procedure TJvExCustomUpDown.ParentShowHintChanged;
|
|
begin
|
|
BaseWndProc(CM_PARENTSHOWHINTCHANGED);
|
|
end;
|
|
|
|
function TJvExCustomUpDown.WantKey(Key: Integer; Shift: TShiftState; const KeyText: WideString): Boolean;
|
|
begin
|
|
Result := BaseWndProc(CM_DIALOGCHAR, Word(Key), ShiftStateToKeyData(Shift)) <> 0;
|
|
end;
|
|
|
|
function TJvExCustomUpDown.HitTest(X, Y: Integer): Boolean;
|
|
begin
|
|
Result := BaseWndProc(CM_HITTEST, 0, SmallPointToLong(PointToSmallPoint(Point(X, Y)))) <> 0;
|
|
end;
|
|
|
|
function TJvExCustomUpDown.HintShow(var HintInfo: THintInfo): Boolean;
|
|
begin
|
|
GetHintColor(HintInfo, Self, FHintColor);
|
|
if FHintWindowClass <> nil then
|
|
HintInfo.HintWindowClass := FHintWindowClass;
|
|
Result := BaseWndProcEx(CM_HINTSHOW, 0, HintInfo) <> 0;
|
|
end;
|
|
|
|
procedure TJvExCustomUpDown.MouseEnter(AControl: TControl);
|
|
begin
|
|
FMouseOver := True;
|
|
if Assigned(FOnMouseEnter) then
|
|
FOnMouseEnter(Self);
|
|
BaseWndProc(CM_MOUSEENTER, 0, AControl);
|
|
end;
|
|
|
|
procedure TJvExCustomUpDown.MouseLeave(AControl: TControl);
|
|
begin
|
|
FMouseOver := False;
|
|
BaseWndProc(CM_MOUSELEAVE, 0, AControl);
|
|
if Assigned(FOnMouseLeave) then
|
|
FOnMouseLeave(Self);
|
|
end;
|
|
|
|
{$IFNDEF CLR}
|
|
procedure TJvExCustomUpDown.FocusChanged(AControl: TWinControl);
|
|
begin
|
|
BaseWndProc(CM_FOCUSCHANGED, 0, AControl);
|
|
end;
|
|
{$ENDIF !CLR}
|
|
|
|
{$IFDEF COMPILER5}
|
|
{$IFNDEF HASAUTOSIZE}
|
|
|
|
procedure TJvExCustomUpDown.CMSetAutoSize(var Msg: TMessage);
|
|
begin
|
|
SetAutoSize(Msg.WParam <> 0);
|
|
end;
|
|
|
|
procedure TJvExCustomUpDown.SetAutoSize(Value: Boolean);
|
|
begin
|
|
TOpenControl_SetAutoSize(Self, Value);
|
|
end;
|
|
|
|
{$ENDIF !HASAUTOSIZE}
|
|
{$ENDIF COMPILER5}
|
|
|
|
procedure TJvExCustomUpDown.BoundsChanged;
|
|
begin
|
|
end;
|
|
|
|
procedure TJvExCustomUpDown.CursorChanged;
|
|
begin
|
|
BaseWndProc(CM_CURSORCHANGED);
|
|
end;
|
|
|
|
procedure TJvExCustomUpDown.ShowingChanged;
|
|
begin
|
|
BaseWndProc(CM_SHOWINGCHANGED);
|
|
end;
|
|
|
|
procedure TJvExCustomUpDown.ShowHintChanged;
|
|
begin
|
|
BaseWndProc(CM_SHOWHINTCHANGED);
|
|
end;
|
|
|
|
{$IFNDEF CLR}
|
|
{ VCL sends CM_CONTROLLISTCHANGE and CM_CONTROLCHANGE in a different order than
|
|
the CLX methods are used. So we must correct it by evaluating "Inserting". }
|
|
procedure TJvExCustomUpDown.ControlsListChanging(Control: TControl; Inserting: Boolean);
|
|
begin
|
|
if Inserting then
|
|
BaseWndProc(CM_CONTROLLISTCHANGE, Integer(Control), Integer(Inserting))
|
|
else
|
|
BaseWndProc(CM_CONTROLCHANGE, Integer(Control), Integer(Inserting));
|
|
end;
|
|
|
|
procedure TJvExCustomUpDown.ControlsListChanged(Control: TControl; Inserting: Boolean);
|
|
begin
|
|
if not Inserting then
|
|
BaseWndProc(CM_CONTROLLISTCHANGE, Integer(Control), Integer(Inserting))
|
|
else
|
|
BaseWndProc(CM_CONTROLCHANGE, Integer(Control), Integer(Inserting));
|
|
end;
|
|
{$ENDIF !CLR}
|
|
|
|
procedure TJvExCustomUpDown.GetDlgCode(var Code: TDlgCodes);
|
|
begin
|
|
end;
|
|
|
|
procedure TJvExCustomUpDown.FocusSet(PrevWnd: THandle);
|
|
begin
|
|
BaseWndProc(WM_SETFOCUS, Integer(PrevWnd), 0);
|
|
end;
|
|
|
|
procedure TJvExCustomUpDown.FocusKilled(NextWnd: THandle);
|
|
begin
|
|
BaseWndProc(WM_KILLFOCUS, Integer(NextWnd), 0);
|
|
end;
|
|
|
|
function TJvExCustomUpDown.DoEraseBackground(Canvas: TCanvas; Param: Integer): Boolean;
|
|
begin
|
|
Result := BaseWndProc(WM_ERASEBKGND, Canvas.Handle, Param) <> 0;
|
|
end;
|
|
|
|
{$IFDEF JVCLThemesEnabledD56}
|
|
function TJvExCustomUpDown.GetParentBackground: Boolean;
|
|
begin
|
|
Result := JvThemes.GetParentBackground(Self);
|
|
end;
|
|
|
|
procedure TJvExCustomUpDown.SetParentBackground(Value: Boolean);
|
|
begin
|
|
JvThemes.SetParentBackground(Self, Value);
|
|
end;
|
|
{$ENDIF JVCLThemesEnabledD56}
|
|
|
|
procedure TJvExCustomUpDown.WndProc(var Msg: TMessage);
|
|
var
|
|
IdSaveDC: Integer;
|
|
DlgCodes: TDlgCodes;
|
|
Canvas: TCanvas;
|
|
{$IFDEF CLR}
|
|
AHintInfo: THintInfo;
|
|
{$ENDIF CLR}
|
|
begin
|
|
if not DispatchIsDesignMsg(Self, Msg) then
|
|
begin
|
|
case Msg.Msg of
|
|
CM_DENYSUBCLASSING:
|
|
{$IFNDEF CLR}
|
|
Msg.Result := Ord(GetInterfaceEntry(IJvDenySubClassing) <> nil);
|
|
{$ELSE}
|
|
Msg.Result := Integer(Supports(Self, IJvDenySubClassing));
|
|
{$ENDIF !CLR}
|
|
CM_DIALOGCHAR:
|
|
with TCMDialogChar{$IFDEF CLR}.Create{$ENDIF}(Msg) do
|
|
Result := Ord(WantKey(CharCode, KeyDataToShiftState(KeyData), WideChar(CharCode)));
|
|
CM_HINTSHOW:
|
|
{$IFNDEF CLR}
|
|
with TCMHintShow(Msg) do
|
|
Result := Integer(HintShow(HintInfo^));
|
|
{$ELSE}
|
|
with TCMHintShow.Create(Msg) do
|
|
begin
|
|
AHintInfo := HintInfo;
|
|
Result := Integer(HintShow(AHintInfo));
|
|
HintInfo := AHintInfo;
|
|
end;
|
|
{$ENDIF !CLR}
|
|
CM_HITTEST:
|
|
with TCMHitTest{$IFDEF CLR}.Create{$ENDIF}(Msg) do
|
|
Result := Integer(HitTest(XPos, YPos));
|
|
CM_MOUSEENTER:
|
|
MouseEnter({$IFDEF CLR}nil{$ELSE}TControl(Msg.LParam){$ENDIF});
|
|
CM_MOUSELEAVE:
|
|
MouseLeave({$IFDEF CLR}nil{$ELSE}TControl(Msg.LParam){$ENDIF});
|
|
CM_VISIBLECHANGED:
|
|
VisibleChanged;
|
|
CM_ENABLEDCHANGED:
|
|
EnabledChanged;
|
|
CM_TEXTCHANGED:
|
|
TextChanged;
|
|
CM_FONTCHANGED:
|
|
FontChanged;
|
|
CM_COLORCHANGED:
|
|
ColorChanged;
|
|
{$IFNDEF CLR}
|
|
CM_FOCUSCHANGED:
|
|
FocusChanged(TWinControl(Msg.LParam));
|
|
{$ENDIF !CLR}
|
|
CM_PARENTFONTCHANGED:
|
|
ParentFontChanged;
|
|
CM_PARENTCOLORCHANGED:
|
|
ParentColorChanged;
|
|
CM_PARENTSHOWHINTCHANGED:
|
|
ParentShowHintChanged;
|
|
CM_CURSORCHANGED:
|
|
CursorChanged;
|
|
CM_SHOWINGCHANGED:
|
|
ShowingChanged;
|
|
CM_SHOWHINTCHANGED:
|
|
ShowHintChanged;
|
|
{$IFNDEF CLR}
|
|
CM_CONTROLLISTCHANGE:
|
|
if Msg.LParam <> 0 then
|
|
ControlsListChanging(TControl(Msg.WParam), True)
|
|
else
|
|
ControlsListChanged(TControl(Msg.WParam), False);
|
|
CM_CONTROLCHANGE:
|
|
if Msg.LParam = 0 then
|
|
ControlsListChanging(TControl(Msg.WParam), False)
|
|
else
|
|
ControlsListChanged(TControl(Msg.WParam), True);
|
|
{$ENDIF !CLR}
|
|
WM_SETFOCUS:
|
|
FocusSet(THandle(Msg.WParam));
|
|
WM_KILLFOCUS:
|
|
FocusKilled(THandle(Msg.WParam));
|
|
WM_SIZE, WM_MOVE:
|
|
begin
|
|
inherited WndProc(Msg);
|
|
BoundsChanged;
|
|
end;
|
|
WM_ERASEBKGND:
|
|
if Msg.WParam <> 0 then
|
|
begin
|
|
IdSaveDC := SaveDC(HDC(Msg.WParam)); // protect DC against Stock-Objects from Canvas
|
|
Canvas := TCanvas.Create;
|
|
try
|
|
Canvas.Handle := HDC(Msg.WParam);
|
|
Msg.Result := Ord(DoEraseBackground(Canvas, Msg.LParam));
|
|
finally
|
|
Canvas.Handle := 0;
|
|
Canvas.Free;
|
|
RestoreDC(HDC(Msg.WParam), IdSaveDC);
|
|
end;
|
|
end
|
|
else
|
|
inherited WndProc(Msg);
|
|
{$IFNDEF DELPHI2007_UP}
|
|
WM_PRINTCLIENT, WM_PRINT: // VCL bug fix
|
|
begin
|
|
IdSaveDC := SaveDC(HDC(Msg.WParam)); // protect DC against changes
|
|
try
|
|
inherited WndProc(Msg);
|
|
finally
|
|
RestoreDC(HDC(Msg.WParam), IdSaveDC);
|
|
end;
|
|
end;
|
|
{$ENDIF ~DELPHI2007_UP}
|
|
WM_GETDLGCODE:
|
|
begin
|
|
inherited WndProc(Msg);
|
|
DlgCodes := [dcNative] + DlgcToDlgCodes(Msg.Result);
|
|
GetDlgCode(DlgCodes);
|
|
if not (dcNative in DlgCodes) then
|
|
Msg.Result := DlgCodesToDlgc(DlgCodes);
|
|
end;
|
|
else
|
|
inherited WndProc(Msg);
|
|
end;
|
|
case Msg.Msg of // precheck message to prevent access violations on released controls
|
|
CM_MOUSEENTER, CM_MOUSELEAVE, WM_KILLFOCUS, WM_SETFOCUS, WM_NCPAINT:
|
|
if DotNetHighlighting then
|
|
HandleDotNetHighlighting(Self, Msg, MouseOver, Color);
|
|
end;
|
|
end;
|
|
end;
|
|
|
|
//============================================================================
|
|
|
|
constructor TJvExUpDown.Create(AOwner: TComponent);
|
|
begin
|
|
inherited Create(AOwner);
|
|
FHintColor := clDefault;
|
|
end;
|
|
|
|
function TJvExUpDown.BaseWndProc(Msg: Integer; WParam: Integer = 0; LParam: Longint = 0): Integer;
|
|
var
|
|
Mesg: TMessage;
|
|
begin
|
|
Mesg := CreateWMMessage(Msg, WParam, LParam);
|
|
inherited WndProc(Mesg);
|
|
Result := Mesg.Result;
|
|
end;
|
|
|
|
function TJvExUpDown.BaseWndProc(Msg: Integer; WParam: Integer; LParam: TControl): Integer;
|
|
var
|
|
Mesg: TMessage;
|
|
begin
|
|
Mesg := CreateWMMessage(Msg, WParam, LParam);
|
|
inherited WndProc(Mesg);
|
|
Result := Mesg.Result;
|
|
end;
|
|
|
|
function TJvExUpDown.BaseWndProcEx(Msg: Integer; WParam: Integer; var LParam): Integer;
|
|
var
|
|
Mesg: TStructPtrMessage;
|
|
begin
|
|
Mesg := TStructPtrMessage.Create(Msg, WParam, LParam);
|
|
try
|
|
inherited WndProc(Mesg.Msg);
|
|
finally
|
|
Result := Mesg.Msg.Result;
|
|
Mesg.Free;
|
|
end;
|
|
end;
|
|
|
|
procedure TJvExUpDown.VisibleChanged;
|
|
begin
|
|
BaseWndProc(CM_VISIBLECHANGED);
|
|
end;
|
|
|
|
procedure TJvExUpDown.EnabledChanged;
|
|
begin
|
|
BaseWndProc(CM_ENABLEDCHANGED);
|
|
end;
|
|
|
|
procedure TJvExUpDown.TextChanged;
|
|
begin
|
|
BaseWndProc(CM_TEXTCHANGED);
|
|
end;
|
|
|
|
procedure TJvExUpDown.FontChanged;
|
|
begin
|
|
BaseWndProc(CM_FONTCHANGED);
|
|
end;
|
|
|
|
procedure TJvExUpDown.ColorChanged;
|
|
begin
|
|
BaseWndProc(CM_COLORCHANGED);
|
|
end;
|
|
|
|
procedure TJvExUpDown.ParentFontChanged;
|
|
begin
|
|
BaseWndProc(CM_PARENTFONTCHANGED);
|
|
end;
|
|
|
|
procedure TJvExUpDown.ParentColorChanged;
|
|
begin
|
|
BaseWndProc(CM_PARENTCOLORCHANGED);
|
|
if Assigned(OnParentColorChange) then
|
|
OnParentColorChange(Self);
|
|
end;
|
|
|
|
procedure TJvExUpDown.ParentShowHintChanged;
|
|
begin
|
|
BaseWndProc(CM_PARENTSHOWHINTCHANGED);
|
|
end;
|
|
|
|
function TJvExUpDown.WantKey(Key: Integer; Shift: TShiftState; const KeyText: WideString): Boolean;
|
|
begin
|
|
Result := BaseWndProc(CM_DIALOGCHAR, Word(Key), ShiftStateToKeyData(Shift)) <> 0;
|
|
end;
|
|
|
|
function TJvExUpDown.HitTest(X, Y: Integer): Boolean;
|
|
begin
|
|
Result := BaseWndProc(CM_HITTEST, 0, SmallPointToLong(PointToSmallPoint(Point(X, Y)))) <> 0;
|
|
end;
|
|
|
|
function TJvExUpDown.HintShow(var HintInfo: THintInfo): Boolean;
|
|
begin
|
|
GetHintColor(HintInfo, Self, FHintColor);
|
|
if FHintWindowClass <> nil then
|
|
HintInfo.HintWindowClass := FHintWindowClass;
|
|
Result := BaseWndProcEx(CM_HINTSHOW, 0, HintInfo) <> 0;
|
|
end;
|
|
|
|
procedure TJvExUpDown.MouseEnter(AControl: TControl);
|
|
begin
|
|
FMouseOver := True;
|
|
if Assigned(FOnMouseEnter) then
|
|
FOnMouseEnter(Self);
|
|
BaseWndProc(CM_MOUSEENTER, 0, AControl);
|
|
end;
|
|
|
|
procedure TJvExUpDown.MouseLeave(AControl: TControl);
|
|
begin
|
|
FMouseOver := False;
|
|
BaseWndProc(CM_MOUSELEAVE, 0, AControl);
|
|
if Assigned(FOnMouseLeave) then
|
|
FOnMouseLeave(Self);
|
|
end;
|
|
|
|
{$IFNDEF CLR}
|
|
procedure TJvExUpDown.FocusChanged(AControl: TWinControl);
|
|
begin
|
|
BaseWndProc(CM_FOCUSCHANGED, 0, AControl);
|
|
end;
|
|
{$ENDIF !CLR}
|
|
|
|
{$IFDEF COMPILER5}
|
|
{$IFNDEF HASAUTOSIZE}
|
|
|
|
procedure TJvExUpDown.CMSetAutoSize(var Msg: TMessage);
|
|
begin
|
|
SetAutoSize(Msg.WParam <> 0);
|
|
end;
|
|
|
|
procedure TJvExUpDown.SetAutoSize(Value: Boolean);
|
|
begin
|
|
TOpenControl_SetAutoSize(Self, Value);
|
|
end;
|
|
|
|
{$ENDIF !HASAUTOSIZE}
|
|
{$ENDIF COMPILER5}
|
|
|
|
procedure TJvExUpDown.BoundsChanged;
|
|
begin
|
|
end;
|
|
|
|
procedure TJvExUpDown.CursorChanged;
|
|
begin
|
|
BaseWndProc(CM_CURSORCHANGED);
|
|
end;
|
|
|
|
procedure TJvExUpDown.ShowingChanged;
|
|
begin
|
|
BaseWndProc(CM_SHOWINGCHANGED);
|
|
end;
|
|
|
|
procedure TJvExUpDown.ShowHintChanged;
|
|
begin
|
|
BaseWndProc(CM_SHOWHINTCHANGED);
|
|
end;
|
|
|
|
{$IFNDEF CLR}
|
|
{ VCL sends CM_CONTROLLISTCHANGE and CM_CONTROLCHANGE in a different order than
|
|
the CLX methods are used. So we must correct it by evaluating "Inserting". }
|
|
procedure TJvExUpDown.ControlsListChanging(Control: TControl; Inserting: Boolean);
|
|
begin
|
|
if Inserting then
|
|
BaseWndProc(CM_CONTROLLISTCHANGE, Integer(Control), Integer(Inserting))
|
|
else
|
|
BaseWndProc(CM_CONTROLCHANGE, Integer(Control), Integer(Inserting));
|
|
end;
|
|
|
|
procedure TJvExUpDown.ControlsListChanged(Control: TControl; Inserting: Boolean);
|
|
begin
|
|
if not Inserting then
|
|
BaseWndProc(CM_CONTROLLISTCHANGE, Integer(Control), Integer(Inserting))
|
|
else
|
|
BaseWndProc(CM_CONTROLCHANGE, Integer(Control), Integer(Inserting));
|
|
end;
|
|
{$ENDIF !CLR}
|
|
|
|
procedure TJvExUpDown.GetDlgCode(var Code: TDlgCodes);
|
|
begin
|
|
end;
|
|
|
|
procedure TJvExUpDown.FocusSet(PrevWnd: THandle);
|
|
begin
|
|
BaseWndProc(WM_SETFOCUS, Integer(PrevWnd), 0);
|
|
end;
|
|
|
|
procedure TJvExUpDown.FocusKilled(NextWnd: THandle);
|
|
begin
|
|
BaseWndProc(WM_KILLFOCUS, Integer(NextWnd), 0);
|
|
end;
|
|
|
|
function TJvExUpDown.DoEraseBackground(Canvas: TCanvas; Param: Integer): Boolean;
|
|
begin
|
|
Result := BaseWndProc(WM_ERASEBKGND, Canvas.Handle, Param) <> 0;
|
|
end;
|
|
|
|
{$IFDEF JVCLThemesEnabledD56}
|
|
function TJvExUpDown.GetParentBackground: Boolean;
|
|
begin
|
|
Result := JvThemes.GetParentBackground(Self);
|
|
end;
|
|
|
|
procedure TJvExUpDown.SetParentBackground(Value: Boolean);
|
|
begin
|
|
JvThemes.SetParentBackground(Self, Value);
|
|
end;
|
|
{$ENDIF JVCLThemesEnabledD56}
|
|
|
|
procedure TJvExUpDown.WndProc(var Msg: TMessage);
|
|
var
|
|
IdSaveDC: Integer;
|
|
DlgCodes: TDlgCodes;
|
|
Canvas: TCanvas;
|
|
{$IFDEF CLR}
|
|
AHintInfo: THintInfo;
|
|
{$ENDIF CLR}
|
|
begin
|
|
if not DispatchIsDesignMsg(Self, Msg) then
|
|
begin
|
|
case Msg.Msg of
|
|
CM_DENYSUBCLASSING:
|
|
{$IFNDEF CLR}
|
|
Msg.Result := Ord(GetInterfaceEntry(IJvDenySubClassing) <> nil);
|
|
{$ELSE}
|
|
Msg.Result := Integer(Supports(Self, IJvDenySubClassing));
|
|
{$ENDIF !CLR}
|
|
CM_DIALOGCHAR:
|
|
with TCMDialogChar{$IFDEF CLR}.Create{$ENDIF}(Msg) do
|
|
Result := Ord(WantKey(CharCode, KeyDataToShiftState(KeyData), WideChar(CharCode)));
|
|
CM_HINTSHOW:
|
|
{$IFNDEF CLR}
|
|
with TCMHintShow(Msg) do
|
|
Result := Integer(HintShow(HintInfo^));
|
|
{$ELSE}
|
|
with TCMHintShow.Create(Msg) do
|
|
begin
|
|
AHintInfo := HintInfo;
|
|
Result := Integer(HintShow(AHintInfo));
|
|
HintInfo := AHintInfo;
|
|
end;
|
|
{$ENDIF !CLR}
|
|
CM_HITTEST:
|
|
with TCMHitTest{$IFDEF CLR}.Create{$ENDIF}(Msg) do
|
|
Result := Integer(HitTest(XPos, YPos));
|
|
CM_MOUSEENTER:
|
|
MouseEnter({$IFDEF CLR}nil{$ELSE}TControl(Msg.LParam){$ENDIF});
|
|
CM_MOUSELEAVE:
|
|
MouseLeave({$IFDEF CLR}nil{$ELSE}TControl(Msg.LParam){$ENDIF});
|
|
CM_VISIBLECHANGED:
|
|
VisibleChanged;
|
|
CM_ENABLEDCHANGED:
|
|
EnabledChanged;
|
|
CM_TEXTCHANGED:
|
|
TextChanged;
|
|
CM_FONTCHANGED:
|
|
FontChanged;
|
|
CM_COLORCHANGED:
|
|
ColorChanged;
|
|
{$IFNDEF CLR}
|
|
CM_FOCUSCHANGED:
|
|
FocusChanged(TWinControl(Msg.LParam));
|
|
{$ENDIF !CLR}
|
|
CM_PARENTFONTCHANGED:
|
|
ParentFontChanged;
|
|
CM_PARENTCOLORCHANGED:
|
|
ParentColorChanged;
|
|
CM_PARENTSHOWHINTCHANGED:
|
|
ParentShowHintChanged;
|
|
CM_CURSORCHANGED:
|
|
CursorChanged;
|
|
CM_SHOWINGCHANGED:
|
|
ShowingChanged;
|
|
CM_SHOWHINTCHANGED:
|
|
ShowHintChanged;
|
|
{$IFNDEF CLR}
|
|
CM_CONTROLLISTCHANGE:
|
|
if Msg.LParam <> 0 then
|
|
ControlsListChanging(TControl(Msg.WParam), True)
|
|
else
|
|
ControlsListChanged(TControl(Msg.WParam), False);
|
|
CM_CONTROLCHANGE:
|
|
if Msg.LParam = 0 then
|
|
ControlsListChanging(TControl(Msg.WParam), False)
|
|
else
|
|
ControlsListChanged(TControl(Msg.WParam), True);
|
|
{$ENDIF !CLR}
|
|
WM_SETFOCUS:
|
|
FocusSet(THandle(Msg.WParam));
|
|
WM_KILLFOCUS:
|
|
FocusKilled(THandle(Msg.WParam));
|
|
WM_SIZE, WM_MOVE:
|
|
begin
|
|
inherited WndProc(Msg);
|
|
BoundsChanged;
|
|
end;
|
|
WM_ERASEBKGND:
|
|
if Msg.WParam <> 0 then
|
|
begin
|
|
IdSaveDC := SaveDC(HDC(Msg.WParam)); // protect DC against Stock-Objects from Canvas
|
|
Canvas := TCanvas.Create;
|
|
try
|
|
Canvas.Handle := HDC(Msg.WParam);
|
|
Msg.Result := Ord(DoEraseBackground(Canvas, Msg.LParam));
|
|
finally
|
|
Canvas.Handle := 0;
|
|
Canvas.Free;
|
|
RestoreDC(HDC(Msg.WParam), IdSaveDC);
|
|
end;
|
|
end
|
|
else
|
|
inherited WndProc(Msg);
|
|
{$IFNDEF DELPHI2007_UP}
|
|
WM_PRINTCLIENT, WM_PRINT: // VCL bug fix
|
|
begin
|
|
IdSaveDC := SaveDC(HDC(Msg.WParam)); // protect DC against changes
|
|
try
|
|
inherited WndProc(Msg);
|
|
finally
|
|
RestoreDC(HDC(Msg.WParam), IdSaveDC);
|
|
end;
|
|
end;
|
|
{$ENDIF ~DELPHI2007_UP}
|
|
WM_GETDLGCODE:
|
|
begin
|
|
inherited WndProc(Msg);
|
|
DlgCodes := [dcNative] + DlgcToDlgCodes(Msg.Result);
|
|
GetDlgCode(DlgCodes);
|
|
if not (dcNative in DlgCodes) then
|
|
Msg.Result := DlgCodesToDlgc(DlgCodes);
|
|
end;
|
|
else
|
|
inherited WndProc(Msg);
|
|
end;
|
|
case Msg.Msg of // precheck message to prevent access violations on released controls
|
|
CM_MOUSEENTER, CM_MOUSELEAVE, WM_KILLFOCUS, WM_SETFOCUS, WM_NCPAINT:
|
|
if DotNetHighlighting then
|
|
HandleDotNetHighlighting(Self, Msg, MouseOver, Color);
|
|
end;
|
|
end;
|
|
end;
|
|
|
|
//============================================================================
|
|
|
|
constructor TJvExDateTimePicker.Create(AOwner: TComponent);
|
|
begin
|
|
inherited Create(AOwner);
|
|
FHintColor := clDefault;
|
|
end;
|
|
|
|
function TJvExDateTimePicker.BaseWndProc(Msg: Integer; WParam: Integer = 0; LParam: Longint = 0): Integer;
|
|
var
|
|
Mesg: TMessage;
|
|
begin
|
|
Mesg := CreateWMMessage(Msg, WParam, LParam);
|
|
inherited WndProc(Mesg);
|
|
Result := Mesg.Result;
|
|
end;
|
|
|
|
function TJvExDateTimePicker.BaseWndProc(Msg: Integer; WParam: Integer; LParam: TControl): Integer;
|
|
var
|
|
Mesg: TMessage;
|
|
begin
|
|
Mesg := CreateWMMessage(Msg, WParam, LParam);
|
|
inherited WndProc(Mesg);
|
|
Result := Mesg.Result;
|
|
end;
|
|
|
|
function TJvExDateTimePicker.BaseWndProcEx(Msg: Integer; WParam: Integer; var LParam): Integer;
|
|
var
|
|
Mesg: TStructPtrMessage;
|
|
begin
|
|
Mesg := TStructPtrMessage.Create(Msg, WParam, LParam);
|
|
try
|
|
inherited WndProc(Mesg.Msg);
|
|
finally
|
|
Result := Mesg.Msg.Result;
|
|
Mesg.Free;
|
|
end;
|
|
end;
|
|
|
|
procedure TJvExDateTimePicker.VisibleChanged;
|
|
begin
|
|
BaseWndProc(CM_VISIBLECHANGED);
|
|
end;
|
|
|
|
procedure TJvExDateTimePicker.EnabledChanged;
|
|
begin
|
|
BaseWndProc(CM_ENABLEDCHANGED);
|
|
end;
|
|
|
|
procedure TJvExDateTimePicker.TextChanged;
|
|
begin
|
|
BaseWndProc(CM_TEXTCHANGED);
|
|
end;
|
|
|
|
procedure TJvExDateTimePicker.FontChanged;
|
|
begin
|
|
BaseWndProc(CM_FONTCHANGED);
|
|
end;
|
|
|
|
procedure TJvExDateTimePicker.ColorChanged;
|
|
begin
|
|
BaseWndProc(CM_COLORCHANGED);
|
|
end;
|
|
|
|
procedure TJvExDateTimePicker.ParentFontChanged;
|
|
begin
|
|
BaseWndProc(CM_PARENTFONTCHANGED);
|
|
end;
|
|
|
|
procedure TJvExDateTimePicker.ParentColorChanged;
|
|
begin
|
|
BaseWndProc(CM_PARENTCOLORCHANGED);
|
|
if Assigned(OnParentColorChange) then
|
|
OnParentColorChange(Self);
|
|
end;
|
|
|
|
procedure TJvExDateTimePicker.ParentShowHintChanged;
|
|
begin
|
|
BaseWndProc(CM_PARENTSHOWHINTCHANGED);
|
|
end;
|
|
|
|
function TJvExDateTimePicker.WantKey(Key: Integer; Shift: TShiftState; const KeyText: WideString): Boolean;
|
|
begin
|
|
Result := BaseWndProc(CM_DIALOGCHAR, Word(Key), ShiftStateToKeyData(Shift)) <> 0;
|
|
end;
|
|
|
|
function TJvExDateTimePicker.HitTest(X, Y: Integer): Boolean;
|
|
begin
|
|
Result := BaseWndProc(CM_HITTEST, 0, SmallPointToLong(PointToSmallPoint(Point(X, Y)))) <> 0;
|
|
end;
|
|
|
|
function TJvExDateTimePicker.HintShow(var HintInfo: THintInfo): Boolean;
|
|
begin
|
|
GetHintColor(HintInfo, Self, FHintColor);
|
|
if FHintWindowClass <> nil then
|
|
HintInfo.HintWindowClass := FHintWindowClass;
|
|
Result := BaseWndProcEx(CM_HINTSHOW, 0, HintInfo) <> 0;
|
|
end;
|
|
|
|
procedure TJvExDateTimePicker.MouseEnter(AControl: TControl);
|
|
begin
|
|
FMouseOver := True;
|
|
if Assigned(FOnMouseEnter) then
|
|
FOnMouseEnter(Self);
|
|
BaseWndProc(CM_MOUSEENTER, 0, AControl);
|
|
end;
|
|
|
|
procedure TJvExDateTimePicker.MouseLeave(AControl: TControl);
|
|
begin
|
|
FMouseOver := False;
|
|
BaseWndProc(CM_MOUSELEAVE, 0, AControl);
|
|
if Assigned(FOnMouseLeave) then
|
|
FOnMouseLeave(Self);
|
|
end;
|
|
|
|
{$IFNDEF CLR}
|
|
procedure TJvExDateTimePicker.FocusChanged(AControl: TWinControl);
|
|
begin
|
|
BaseWndProc(CM_FOCUSCHANGED, 0, AControl);
|
|
end;
|
|
{$ENDIF !CLR}
|
|
|
|
{$IFDEF COMPILER5}
|
|
{$IFNDEF HASAUTOSIZE}
|
|
|
|
procedure TJvExDateTimePicker.CMSetAutoSize(var Msg: TMessage);
|
|
begin
|
|
SetAutoSize(Msg.WParam <> 0);
|
|
end;
|
|
|
|
procedure TJvExDateTimePicker.SetAutoSize(Value: Boolean);
|
|
begin
|
|
TOpenControl_SetAutoSize(Self, Value);
|
|
end;
|
|
|
|
{$ENDIF !HASAUTOSIZE}
|
|
{$ENDIF COMPILER5}
|
|
|
|
procedure TJvExDateTimePicker.BoundsChanged;
|
|
begin
|
|
end;
|
|
|
|
procedure TJvExDateTimePicker.CursorChanged;
|
|
begin
|
|
BaseWndProc(CM_CURSORCHANGED);
|
|
end;
|
|
|
|
procedure TJvExDateTimePicker.ShowingChanged;
|
|
begin
|
|
BaseWndProc(CM_SHOWINGCHANGED);
|
|
end;
|
|
|
|
procedure TJvExDateTimePicker.ShowHintChanged;
|
|
begin
|
|
BaseWndProc(CM_SHOWHINTCHANGED);
|
|
end;
|
|
|
|
{$IFNDEF CLR}
|
|
{ VCL sends CM_CONTROLLISTCHANGE and CM_CONTROLCHANGE in a different order than
|
|
the CLX methods are used. So we must correct it by evaluating "Inserting". }
|
|
procedure TJvExDateTimePicker.ControlsListChanging(Control: TControl; Inserting: Boolean);
|
|
begin
|
|
if Inserting then
|
|
BaseWndProc(CM_CONTROLLISTCHANGE, Integer(Control), Integer(Inserting))
|
|
else
|
|
BaseWndProc(CM_CONTROLCHANGE, Integer(Control), Integer(Inserting));
|
|
end;
|
|
|
|
procedure TJvExDateTimePicker.ControlsListChanged(Control: TControl; Inserting: Boolean);
|
|
begin
|
|
if not Inserting then
|
|
BaseWndProc(CM_CONTROLLISTCHANGE, Integer(Control), Integer(Inserting))
|
|
else
|
|
BaseWndProc(CM_CONTROLCHANGE, Integer(Control), Integer(Inserting));
|
|
end;
|
|
{$ENDIF !CLR}
|
|
|
|
procedure TJvExDateTimePicker.GetDlgCode(var Code: TDlgCodes);
|
|
begin
|
|
end;
|
|
|
|
procedure TJvExDateTimePicker.FocusSet(PrevWnd: THandle);
|
|
begin
|
|
BaseWndProc(WM_SETFOCUS, Integer(PrevWnd), 0);
|
|
end;
|
|
|
|
procedure TJvExDateTimePicker.FocusKilled(NextWnd: THandle);
|
|
begin
|
|
BaseWndProc(WM_KILLFOCUS, Integer(NextWnd), 0);
|
|
end;
|
|
|
|
function TJvExDateTimePicker.DoEraseBackground(Canvas: TCanvas; Param: Integer): Boolean;
|
|
begin
|
|
Result := BaseWndProc(WM_ERASEBKGND, Canvas.Handle, Param) <> 0;
|
|
end;
|
|
|
|
{$IFDEF JVCLThemesEnabledD56}
|
|
function TJvExDateTimePicker.GetParentBackground: Boolean;
|
|
begin
|
|
Result := JvThemes.GetParentBackground(Self);
|
|
end;
|
|
|
|
procedure TJvExDateTimePicker.SetParentBackground(Value: Boolean);
|
|
begin
|
|
JvThemes.SetParentBackground(Self, Value);
|
|
end;
|
|
{$ENDIF JVCLThemesEnabledD56}
|
|
|
|
procedure TJvExDateTimePicker.WndProc(var Msg: TMessage);
|
|
var
|
|
IdSaveDC: Integer;
|
|
DlgCodes: TDlgCodes;
|
|
Canvas: TCanvas;
|
|
{$IFDEF CLR}
|
|
AHintInfo: THintInfo;
|
|
{$ENDIF CLR}
|
|
begin
|
|
if not DispatchIsDesignMsg(Self, Msg) then
|
|
begin
|
|
case Msg.Msg of
|
|
CM_DENYSUBCLASSING:
|
|
{$IFNDEF CLR}
|
|
Msg.Result := Ord(GetInterfaceEntry(IJvDenySubClassing) <> nil);
|
|
{$ELSE}
|
|
Msg.Result := Integer(Supports(Self, IJvDenySubClassing));
|
|
{$ENDIF !CLR}
|
|
CM_DIALOGCHAR:
|
|
with TCMDialogChar{$IFDEF CLR}.Create{$ENDIF}(Msg) do
|
|
Result := Ord(WantKey(CharCode, KeyDataToShiftState(KeyData), WideChar(CharCode)));
|
|
CM_HINTSHOW:
|
|
{$IFNDEF CLR}
|
|
with TCMHintShow(Msg) do
|
|
Result := Integer(HintShow(HintInfo^));
|
|
{$ELSE}
|
|
with TCMHintShow.Create(Msg) do
|
|
begin
|
|
AHintInfo := HintInfo;
|
|
Result := Integer(HintShow(AHintInfo));
|
|
HintInfo := AHintInfo;
|
|
end;
|
|
{$ENDIF !CLR}
|
|
CM_HITTEST:
|
|
with TCMHitTest{$IFDEF CLR}.Create{$ENDIF}(Msg) do
|
|
Result := Integer(HitTest(XPos, YPos));
|
|
CM_MOUSEENTER:
|
|
MouseEnter({$IFDEF CLR}nil{$ELSE}TControl(Msg.LParam){$ENDIF});
|
|
CM_MOUSELEAVE:
|
|
MouseLeave({$IFDEF CLR}nil{$ELSE}TControl(Msg.LParam){$ENDIF});
|
|
CM_VISIBLECHANGED:
|
|
VisibleChanged;
|
|
CM_ENABLEDCHANGED:
|
|
EnabledChanged;
|
|
CM_TEXTCHANGED:
|
|
TextChanged;
|
|
CM_FONTCHANGED:
|
|
FontChanged;
|
|
CM_COLORCHANGED:
|
|
ColorChanged;
|
|
{$IFNDEF CLR}
|
|
CM_FOCUSCHANGED:
|
|
FocusChanged(TWinControl(Msg.LParam));
|
|
{$ENDIF !CLR}
|
|
CM_PARENTFONTCHANGED:
|
|
ParentFontChanged;
|
|
CM_PARENTCOLORCHANGED:
|
|
ParentColorChanged;
|
|
CM_PARENTSHOWHINTCHANGED:
|
|
ParentShowHintChanged;
|
|
CM_CURSORCHANGED:
|
|
CursorChanged;
|
|
CM_SHOWINGCHANGED:
|
|
ShowingChanged;
|
|
CM_SHOWHINTCHANGED:
|
|
ShowHintChanged;
|
|
{$IFNDEF CLR}
|
|
CM_CONTROLLISTCHANGE:
|
|
if Msg.LParam <> 0 then
|
|
ControlsListChanging(TControl(Msg.WParam), True)
|
|
else
|
|
ControlsListChanged(TControl(Msg.WParam), False);
|
|
CM_CONTROLCHANGE:
|
|
if Msg.LParam = 0 then
|
|
ControlsListChanging(TControl(Msg.WParam), False)
|
|
else
|
|
ControlsListChanged(TControl(Msg.WParam), True);
|
|
{$ENDIF !CLR}
|
|
WM_SETFOCUS:
|
|
FocusSet(THandle(Msg.WParam));
|
|
WM_KILLFOCUS:
|
|
FocusKilled(THandle(Msg.WParam));
|
|
WM_SIZE, WM_MOVE:
|
|
begin
|
|
inherited WndProc(Msg);
|
|
BoundsChanged;
|
|
end;
|
|
WM_ERASEBKGND:
|
|
if Msg.WParam <> 0 then
|
|
begin
|
|
IdSaveDC := SaveDC(HDC(Msg.WParam)); // protect DC against Stock-Objects from Canvas
|
|
Canvas := TCanvas.Create;
|
|
try
|
|
Canvas.Handle := HDC(Msg.WParam);
|
|
Msg.Result := Ord(DoEraseBackground(Canvas, Msg.LParam));
|
|
finally
|
|
Canvas.Handle := 0;
|
|
Canvas.Free;
|
|
RestoreDC(HDC(Msg.WParam), IdSaveDC);
|
|
end;
|
|
end
|
|
else
|
|
inherited WndProc(Msg);
|
|
{$IFNDEF DELPHI2007_UP}
|
|
WM_PRINTCLIENT, WM_PRINT: // VCL bug fix
|
|
begin
|
|
IdSaveDC := SaveDC(HDC(Msg.WParam)); // protect DC against changes
|
|
try
|
|
inherited WndProc(Msg);
|
|
finally
|
|
RestoreDC(HDC(Msg.WParam), IdSaveDC);
|
|
end;
|
|
end;
|
|
{$ENDIF ~DELPHI2007_UP}
|
|
WM_GETDLGCODE:
|
|
begin
|
|
inherited WndProc(Msg);
|
|
DlgCodes := [dcNative] + DlgcToDlgCodes(Msg.Result);
|
|
GetDlgCode(DlgCodes);
|
|
if not (dcNative in DlgCodes) then
|
|
Msg.Result := DlgCodesToDlgc(DlgCodes);
|
|
end;
|
|
else
|
|
inherited WndProc(Msg);
|
|
end;
|
|
case Msg.Msg of // precheck message to prevent access violations on released controls
|
|
CM_MOUSEENTER, CM_MOUSELEAVE, WM_KILLFOCUS, WM_SETFOCUS, WM_NCPAINT:
|
|
if DotNetHighlighting then
|
|
HandleDotNetHighlighting(Self, Msg, MouseOver, Color);
|
|
end;
|
|
end;
|
|
end;
|
|
|
|
//============================================================================
|
|
|
|
constructor TJvExProgressBar.Create(AOwner: TComponent);
|
|
begin
|
|
inherited Create(AOwner);
|
|
FHintColor := clDefault;
|
|
end;
|
|
|
|
function TJvExProgressBar.BaseWndProc(Msg: Integer; WParam: Integer = 0; LParam: Longint = 0): Integer;
|
|
var
|
|
Mesg: TMessage;
|
|
begin
|
|
Mesg := CreateWMMessage(Msg, WParam, LParam);
|
|
inherited WndProc(Mesg);
|
|
Result := Mesg.Result;
|
|
end;
|
|
|
|
function TJvExProgressBar.BaseWndProc(Msg: Integer; WParam: Integer; LParam: TControl): Integer;
|
|
var
|
|
Mesg: TMessage;
|
|
begin
|
|
Mesg := CreateWMMessage(Msg, WParam, LParam);
|
|
inherited WndProc(Mesg);
|
|
Result := Mesg.Result;
|
|
end;
|
|
|
|
function TJvExProgressBar.BaseWndProcEx(Msg: Integer; WParam: Integer; var LParam): Integer;
|
|
var
|
|
Mesg: TStructPtrMessage;
|
|
begin
|
|
Mesg := TStructPtrMessage.Create(Msg, WParam, LParam);
|
|
try
|
|
inherited WndProc(Mesg.Msg);
|
|
finally
|
|
Result := Mesg.Msg.Result;
|
|
Mesg.Free;
|
|
end;
|
|
end;
|
|
|
|
procedure TJvExProgressBar.VisibleChanged;
|
|
begin
|
|
BaseWndProc(CM_VISIBLECHANGED);
|
|
end;
|
|
|
|
procedure TJvExProgressBar.EnabledChanged;
|
|
begin
|
|
BaseWndProc(CM_ENABLEDCHANGED);
|
|
end;
|
|
|
|
procedure TJvExProgressBar.TextChanged;
|
|
begin
|
|
BaseWndProc(CM_TEXTCHANGED);
|
|
end;
|
|
|
|
procedure TJvExProgressBar.FontChanged;
|
|
begin
|
|
BaseWndProc(CM_FONTCHANGED);
|
|
end;
|
|
|
|
procedure TJvExProgressBar.ColorChanged;
|
|
begin
|
|
BaseWndProc(CM_COLORCHANGED);
|
|
end;
|
|
|
|
procedure TJvExProgressBar.ParentFontChanged;
|
|
begin
|
|
BaseWndProc(CM_PARENTFONTCHANGED);
|
|
end;
|
|
|
|
procedure TJvExProgressBar.ParentColorChanged;
|
|
begin
|
|
BaseWndProc(CM_PARENTCOLORCHANGED);
|
|
if Assigned(OnParentColorChange) then
|
|
OnParentColorChange(Self);
|
|
end;
|
|
|
|
procedure TJvExProgressBar.ParentShowHintChanged;
|
|
begin
|
|
BaseWndProc(CM_PARENTSHOWHINTCHANGED);
|
|
end;
|
|
|
|
function TJvExProgressBar.WantKey(Key: Integer; Shift: TShiftState; const KeyText: WideString): Boolean;
|
|
begin
|
|
Result := BaseWndProc(CM_DIALOGCHAR, Word(Key), ShiftStateToKeyData(Shift)) <> 0;
|
|
end;
|
|
|
|
function TJvExProgressBar.HitTest(X, Y: Integer): Boolean;
|
|
begin
|
|
Result := BaseWndProc(CM_HITTEST, 0, SmallPointToLong(PointToSmallPoint(Point(X, Y)))) <> 0;
|
|
end;
|
|
|
|
function TJvExProgressBar.HintShow(var HintInfo: THintInfo): Boolean;
|
|
begin
|
|
GetHintColor(HintInfo, Self, FHintColor);
|
|
if FHintWindowClass <> nil then
|
|
HintInfo.HintWindowClass := FHintWindowClass;
|
|
Result := BaseWndProcEx(CM_HINTSHOW, 0, HintInfo) <> 0;
|
|
end;
|
|
|
|
procedure TJvExProgressBar.MouseEnter(AControl: TControl);
|
|
begin
|
|
FMouseOver := True;
|
|
if Assigned(FOnMouseEnter) then
|
|
FOnMouseEnter(Self);
|
|
BaseWndProc(CM_MOUSEENTER, 0, AControl);
|
|
end;
|
|
|
|
procedure TJvExProgressBar.MouseLeave(AControl: TControl);
|
|
begin
|
|
FMouseOver := False;
|
|
BaseWndProc(CM_MOUSELEAVE, 0, AControl);
|
|
if Assigned(FOnMouseLeave) then
|
|
FOnMouseLeave(Self);
|
|
end;
|
|
|
|
{$IFNDEF CLR}
|
|
procedure TJvExProgressBar.FocusChanged(AControl: TWinControl);
|
|
begin
|
|
BaseWndProc(CM_FOCUSCHANGED, 0, AControl);
|
|
end;
|
|
{$ENDIF !CLR}
|
|
|
|
{$IFDEF COMPILER5}
|
|
{$IFNDEF HASAUTOSIZE}
|
|
|
|
procedure TJvExProgressBar.CMSetAutoSize(var Msg: TMessage);
|
|
begin
|
|
SetAutoSize(Msg.WParam <> 0);
|
|
end;
|
|
|
|
procedure TJvExProgressBar.SetAutoSize(Value: Boolean);
|
|
begin
|
|
TOpenControl_SetAutoSize(Self, Value);
|
|
end;
|
|
|
|
{$ENDIF !HASAUTOSIZE}
|
|
{$ENDIF COMPILER5}
|
|
|
|
procedure TJvExProgressBar.BoundsChanged;
|
|
begin
|
|
end;
|
|
|
|
procedure TJvExProgressBar.CursorChanged;
|
|
begin
|
|
BaseWndProc(CM_CURSORCHANGED);
|
|
end;
|
|
|
|
procedure TJvExProgressBar.ShowingChanged;
|
|
begin
|
|
BaseWndProc(CM_SHOWINGCHANGED);
|
|
end;
|
|
|
|
procedure TJvExProgressBar.ShowHintChanged;
|
|
begin
|
|
BaseWndProc(CM_SHOWHINTCHANGED);
|
|
end;
|
|
|
|
{$IFNDEF CLR}
|
|
{ VCL sends CM_CONTROLLISTCHANGE and CM_CONTROLCHANGE in a different order than
|
|
the CLX methods are used. So we must correct it by evaluating "Inserting". }
|
|
procedure TJvExProgressBar.ControlsListChanging(Control: TControl; Inserting: Boolean);
|
|
begin
|
|
if Inserting then
|
|
BaseWndProc(CM_CONTROLLISTCHANGE, Integer(Control), Integer(Inserting))
|
|
else
|
|
BaseWndProc(CM_CONTROLCHANGE, Integer(Control), Integer(Inserting));
|
|
end;
|
|
|
|
procedure TJvExProgressBar.ControlsListChanged(Control: TControl; Inserting: Boolean);
|
|
begin
|
|
if not Inserting then
|
|
BaseWndProc(CM_CONTROLLISTCHANGE, Integer(Control), Integer(Inserting))
|
|
else
|
|
BaseWndProc(CM_CONTROLCHANGE, Integer(Control), Integer(Inserting));
|
|
end;
|
|
{$ENDIF !CLR}
|
|
|
|
procedure TJvExProgressBar.GetDlgCode(var Code: TDlgCodes);
|
|
begin
|
|
end;
|
|
|
|
procedure TJvExProgressBar.FocusSet(PrevWnd: THandle);
|
|
begin
|
|
BaseWndProc(WM_SETFOCUS, Integer(PrevWnd), 0);
|
|
end;
|
|
|
|
procedure TJvExProgressBar.FocusKilled(NextWnd: THandle);
|
|
begin
|
|
BaseWndProc(WM_KILLFOCUS, Integer(NextWnd), 0);
|
|
end;
|
|
|
|
function TJvExProgressBar.DoEraseBackground(Canvas: TCanvas; Param: Integer): Boolean;
|
|
begin
|
|
Result := BaseWndProc(WM_ERASEBKGND, Canvas.Handle, Param) <> 0;
|
|
end;
|
|
|
|
{$IFDEF JVCLThemesEnabledD56}
|
|
function TJvExProgressBar.GetParentBackground: Boolean;
|
|
begin
|
|
Result := JvThemes.GetParentBackground(Self);
|
|
end;
|
|
|
|
procedure TJvExProgressBar.SetParentBackground(Value: Boolean);
|
|
begin
|
|
JvThemes.SetParentBackground(Self, Value);
|
|
end;
|
|
{$ENDIF JVCLThemesEnabledD56}
|
|
|
|
procedure TJvExProgressBar.WndProc(var Msg: TMessage);
|
|
var
|
|
IdSaveDC: Integer;
|
|
DlgCodes: TDlgCodes;
|
|
Canvas: TCanvas;
|
|
{$IFDEF CLR}
|
|
AHintInfo: THintInfo;
|
|
{$ENDIF CLR}
|
|
begin
|
|
if not DispatchIsDesignMsg(Self, Msg) then
|
|
begin
|
|
case Msg.Msg of
|
|
CM_DENYSUBCLASSING:
|
|
{$IFNDEF CLR}
|
|
Msg.Result := Ord(GetInterfaceEntry(IJvDenySubClassing) <> nil);
|
|
{$ELSE}
|
|
Msg.Result := Integer(Supports(Self, IJvDenySubClassing));
|
|
{$ENDIF !CLR}
|
|
CM_DIALOGCHAR:
|
|
with TCMDialogChar{$IFDEF CLR}.Create{$ENDIF}(Msg) do
|
|
Result := Ord(WantKey(CharCode, KeyDataToShiftState(KeyData), WideChar(CharCode)));
|
|
CM_HINTSHOW:
|
|
{$IFNDEF CLR}
|
|
with TCMHintShow(Msg) do
|
|
Result := Integer(HintShow(HintInfo^));
|
|
{$ELSE}
|
|
with TCMHintShow.Create(Msg) do
|
|
begin
|
|
AHintInfo := HintInfo;
|
|
Result := Integer(HintShow(AHintInfo));
|
|
HintInfo := AHintInfo;
|
|
end;
|
|
{$ENDIF !CLR}
|
|
CM_HITTEST:
|
|
with TCMHitTest{$IFDEF CLR}.Create{$ENDIF}(Msg) do
|
|
Result := Integer(HitTest(XPos, YPos));
|
|
CM_MOUSEENTER:
|
|
MouseEnter({$IFDEF CLR}nil{$ELSE}TControl(Msg.LParam){$ENDIF});
|
|
CM_MOUSELEAVE:
|
|
MouseLeave({$IFDEF CLR}nil{$ELSE}TControl(Msg.LParam){$ENDIF});
|
|
CM_VISIBLECHANGED:
|
|
VisibleChanged;
|
|
CM_ENABLEDCHANGED:
|
|
EnabledChanged;
|
|
CM_TEXTCHANGED:
|
|
TextChanged;
|
|
CM_FONTCHANGED:
|
|
FontChanged;
|
|
CM_COLORCHANGED:
|
|
ColorChanged;
|
|
{$IFNDEF CLR}
|
|
CM_FOCUSCHANGED:
|
|
FocusChanged(TWinControl(Msg.LParam));
|
|
{$ENDIF !CLR}
|
|
CM_PARENTFONTCHANGED:
|
|
ParentFontChanged;
|
|
CM_PARENTCOLORCHANGED:
|
|
ParentColorChanged;
|
|
CM_PARENTSHOWHINTCHANGED:
|
|
ParentShowHintChanged;
|
|
CM_CURSORCHANGED:
|
|
CursorChanged;
|
|
CM_SHOWINGCHANGED:
|
|
ShowingChanged;
|
|
CM_SHOWHINTCHANGED:
|
|
ShowHintChanged;
|
|
{$IFNDEF CLR}
|
|
CM_CONTROLLISTCHANGE:
|
|
if Msg.LParam <> 0 then
|
|
ControlsListChanging(TControl(Msg.WParam), True)
|
|
else
|
|
ControlsListChanged(TControl(Msg.WParam), False);
|
|
CM_CONTROLCHANGE:
|
|
if Msg.LParam = 0 then
|
|
ControlsListChanging(TControl(Msg.WParam), False)
|
|
else
|
|
ControlsListChanged(TControl(Msg.WParam), True);
|
|
{$ENDIF !CLR}
|
|
WM_SETFOCUS:
|
|
FocusSet(THandle(Msg.WParam));
|
|
WM_KILLFOCUS:
|
|
FocusKilled(THandle(Msg.WParam));
|
|
WM_SIZE, WM_MOVE:
|
|
begin
|
|
inherited WndProc(Msg);
|
|
BoundsChanged;
|
|
end;
|
|
WM_ERASEBKGND:
|
|
if Msg.WParam <> 0 then
|
|
begin
|
|
IdSaveDC := SaveDC(HDC(Msg.WParam)); // protect DC against Stock-Objects from Canvas
|
|
Canvas := TCanvas.Create;
|
|
try
|
|
Canvas.Handle := HDC(Msg.WParam);
|
|
Msg.Result := Ord(DoEraseBackground(Canvas, Msg.LParam));
|
|
finally
|
|
Canvas.Handle := 0;
|
|
Canvas.Free;
|
|
RestoreDC(HDC(Msg.WParam), IdSaveDC);
|
|
end;
|
|
end
|
|
else
|
|
inherited WndProc(Msg);
|
|
{$IFNDEF DELPHI2007_UP}
|
|
WM_PRINTCLIENT, WM_PRINT: // VCL bug fix
|
|
begin
|
|
IdSaveDC := SaveDC(HDC(Msg.WParam)); // protect DC against changes
|
|
try
|
|
inherited WndProc(Msg);
|
|
finally
|
|
RestoreDC(HDC(Msg.WParam), IdSaveDC);
|
|
end;
|
|
end;
|
|
{$ENDIF ~DELPHI2007_UP}
|
|
WM_GETDLGCODE:
|
|
begin
|
|
inherited WndProc(Msg);
|
|
DlgCodes := [dcNative] + DlgcToDlgCodes(Msg.Result);
|
|
GetDlgCode(DlgCodes);
|
|
if not (dcNative in DlgCodes) then
|
|
Msg.Result := DlgCodesToDlgc(DlgCodes);
|
|
end;
|
|
else
|
|
inherited WndProc(Msg);
|
|
end;
|
|
case Msg.Msg of // precheck message to prevent access violations on released controls
|
|
CM_MOUSEENTER, CM_MOUSELEAVE, WM_KILLFOCUS, WM_SETFOCUS, WM_NCPAINT:
|
|
if DotNetHighlighting then
|
|
HandleDotNetHighlighting(Self, Msg, MouseOver, Color);
|
|
end;
|
|
end;
|
|
end;
|
|
|
|
//============================================================================
|
|
|
|
constructor TJvExPageControl.Create(AOwner: TComponent);
|
|
begin
|
|
inherited Create(AOwner);
|
|
FHintColor := clDefault;
|
|
end;
|
|
|
|
function TJvExPageControl.BaseWndProc(Msg: Integer; WParam: Integer = 0; LParam: Longint = 0): Integer;
|
|
var
|
|
Mesg: TMessage;
|
|
begin
|
|
Mesg := CreateWMMessage(Msg, WParam, LParam);
|
|
inherited WndProc(Mesg);
|
|
Result := Mesg.Result;
|
|
end;
|
|
|
|
function TJvExPageControl.BaseWndProc(Msg: Integer; WParam: Integer; LParam: TControl): Integer;
|
|
var
|
|
Mesg: TMessage;
|
|
begin
|
|
Mesg := CreateWMMessage(Msg, WParam, LParam);
|
|
inherited WndProc(Mesg);
|
|
Result := Mesg.Result;
|
|
end;
|
|
|
|
function TJvExPageControl.BaseWndProcEx(Msg: Integer; WParam: Integer; var LParam): Integer;
|
|
var
|
|
Mesg: TStructPtrMessage;
|
|
begin
|
|
Mesg := TStructPtrMessage.Create(Msg, WParam, LParam);
|
|
try
|
|
inherited WndProc(Mesg.Msg);
|
|
finally
|
|
Result := Mesg.Msg.Result;
|
|
Mesg.Free;
|
|
end;
|
|
end;
|
|
|
|
procedure TJvExPageControl.VisibleChanged;
|
|
begin
|
|
BaseWndProc(CM_VISIBLECHANGED);
|
|
end;
|
|
|
|
procedure TJvExPageControl.EnabledChanged;
|
|
begin
|
|
BaseWndProc(CM_ENABLEDCHANGED);
|
|
end;
|
|
|
|
procedure TJvExPageControl.TextChanged;
|
|
begin
|
|
BaseWndProc(CM_TEXTCHANGED);
|
|
end;
|
|
|
|
procedure TJvExPageControl.FontChanged;
|
|
begin
|
|
BaseWndProc(CM_FONTCHANGED);
|
|
end;
|
|
|
|
procedure TJvExPageControl.ColorChanged;
|
|
begin
|
|
BaseWndProc(CM_COLORCHANGED);
|
|
end;
|
|
|
|
procedure TJvExPageControl.ParentFontChanged;
|
|
begin
|
|
BaseWndProc(CM_PARENTFONTCHANGED);
|
|
end;
|
|
|
|
procedure TJvExPageControl.ParentColorChanged;
|
|
begin
|
|
BaseWndProc(CM_PARENTCOLORCHANGED);
|
|
if Assigned(OnParentColorChange) then
|
|
OnParentColorChange(Self);
|
|
end;
|
|
|
|
procedure TJvExPageControl.ParentShowHintChanged;
|
|
begin
|
|
BaseWndProc(CM_PARENTSHOWHINTCHANGED);
|
|
end;
|
|
|
|
function TJvExPageControl.WantKey(Key: Integer; Shift: TShiftState; const KeyText: WideString): Boolean;
|
|
begin
|
|
Result := BaseWndProc(CM_DIALOGCHAR, Word(Key), ShiftStateToKeyData(Shift)) <> 0;
|
|
end;
|
|
|
|
function TJvExPageControl.HitTest(X, Y: Integer): Boolean;
|
|
begin
|
|
Result := BaseWndProc(CM_HITTEST, 0, SmallPointToLong(PointToSmallPoint(Point(X, Y)))) <> 0;
|
|
end;
|
|
|
|
function TJvExPageControl.HintShow(var HintInfo: THintInfo): Boolean;
|
|
begin
|
|
GetHintColor(HintInfo, Self, FHintColor);
|
|
if FHintWindowClass <> nil then
|
|
HintInfo.HintWindowClass := FHintWindowClass;
|
|
Result := BaseWndProcEx(CM_HINTSHOW, 0, HintInfo) <> 0;
|
|
end;
|
|
|
|
procedure TJvExPageControl.MouseEnter(AControl: TControl);
|
|
begin
|
|
FMouseOver := True;
|
|
if Assigned(FOnMouseEnter) then
|
|
FOnMouseEnter(Self);
|
|
BaseWndProc(CM_MOUSEENTER, 0, AControl);
|
|
end;
|
|
|
|
procedure TJvExPageControl.MouseLeave(AControl: TControl);
|
|
begin
|
|
FMouseOver := False;
|
|
BaseWndProc(CM_MOUSELEAVE, 0, AControl);
|
|
if Assigned(FOnMouseLeave) then
|
|
FOnMouseLeave(Self);
|
|
end;
|
|
|
|
{$IFNDEF CLR}
|
|
procedure TJvExPageControl.FocusChanged(AControl: TWinControl);
|
|
begin
|
|
BaseWndProc(CM_FOCUSCHANGED, 0, AControl);
|
|
end;
|
|
{$ENDIF !CLR}
|
|
|
|
{$IFDEF COMPILER5}
|
|
{$IFNDEF HASAUTOSIZE}
|
|
|
|
procedure TJvExPageControl.CMSetAutoSize(var Msg: TMessage);
|
|
begin
|
|
SetAutoSize(Msg.WParam <> 0);
|
|
end;
|
|
|
|
procedure TJvExPageControl.SetAutoSize(Value: Boolean);
|
|
begin
|
|
TOpenControl_SetAutoSize(Self, Value);
|
|
end;
|
|
|
|
{$ENDIF !HASAUTOSIZE}
|
|
{$ENDIF COMPILER5}
|
|
|
|
procedure TJvExPageControl.BoundsChanged;
|
|
begin
|
|
end;
|
|
|
|
procedure TJvExPageControl.CursorChanged;
|
|
begin
|
|
BaseWndProc(CM_CURSORCHANGED);
|
|
end;
|
|
|
|
procedure TJvExPageControl.ShowingChanged;
|
|
begin
|
|
BaseWndProc(CM_SHOWINGCHANGED);
|
|
end;
|
|
|
|
procedure TJvExPageControl.ShowHintChanged;
|
|
begin
|
|
BaseWndProc(CM_SHOWHINTCHANGED);
|
|
end;
|
|
|
|
{$IFNDEF CLR}
|
|
{ VCL sends CM_CONTROLLISTCHANGE and CM_CONTROLCHANGE in a different order than
|
|
the CLX methods are used. So we must correct it by evaluating "Inserting". }
|
|
procedure TJvExPageControl.ControlsListChanging(Control: TControl; Inserting: Boolean);
|
|
begin
|
|
if Inserting then
|
|
BaseWndProc(CM_CONTROLLISTCHANGE, Integer(Control), Integer(Inserting))
|
|
else
|
|
BaseWndProc(CM_CONTROLCHANGE, Integer(Control), Integer(Inserting));
|
|
end;
|
|
|
|
procedure TJvExPageControl.ControlsListChanged(Control: TControl; Inserting: Boolean);
|
|
begin
|
|
if not Inserting then
|
|
BaseWndProc(CM_CONTROLLISTCHANGE, Integer(Control), Integer(Inserting))
|
|
else
|
|
BaseWndProc(CM_CONTROLCHANGE, Integer(Control), Integer(Inserting));
|
|
end;
|
|
{$ENDIF !CLR}
|
|
|
|
procedure TJvExPageControl.GetDlgCode(var Code: TDlgCodes);
|
|
begin
|
|
end;
|
|
|
|
procedure TJvExPageControl.FocusSet(PrevWnd: THandle);
|
|
begin
|
|
BaseWndProc(WM_SETFOCUS, Integer(PrevWnd), 0);
|
|
end;
|
|
|
|
procedure TJvExPageControl.FocusKilled(NextWnd: THandle);
|
|
begin
|
|
BaseWndProc(WM_KILLFOCUS, Integer(NextWnd), 0);
|
|
end;
|
|
|
|
function TJvExPageControl.DoEraseBackground(Canvas: TCanvas; Param: Integer): Boolean;
|
|
begin
|
|
Result := BaseWndProc(WM_ERASEBKGND, Canvas.Handle, Param) <> 0;
|
|
end;
|
|
|
|
{$IFDEF JVCLThemesEnabledD56}
|
|
function TJvExPageControl.GetParentBackground: Boolean;
|
|
begin
|
|
Result := JvThemes.GetParentBackground(Self);
|
|
end;
|
|
|
|
procedure TJvExPageControl.SetParentBackground(Value: Boolean);
|
|
begin
|
|
JvThemes.SetParentBackground(Self, Value);
|
|
end;
|
|
{$ENDIF JVCLThemesEnabledD56}
|
|
|
|
procedure TJvExPageControl.WndProc(var Msg: TMessage);
|
|
var
|
|
IdSaveDC: Integer;
|
|
DlgCodes: TDlgCodes;
|
|
Canvas: TCanvas;
|
|
{$IFDEF CLR}
|
|
AHintInfo: THintInfo;
|
|
{$ENDIF CLR}
|
|
begin
|
|
if not DispatchIsDesignMsg(Self, Msg) then
|
|
begin
|
|
case Msg.Msg of
|
|
CM_DENYSUBCLASSING:
|
|
{$IFNDEF CLR}
|
|
Msg.Result := Ord(GetInterfaceEntry(IJvDenySubClassing) <> nil);
|
|
{$ELSE}
|
|
Msg.Result := Integer(Supports(Self, IJvDenySubClassing));
|
|
{$ENDIF !CLR}
|
|
CM_DIALOGCHAR:
|
|
with TCMDialogChar{$IFDEF CLR}.Create{$ENDIF}(Msg) do
|
|
Result := Ord(WantKey(CharCode, KeyDataToShiftState(KeyData), WideChar(CharCode)));
|
|
CM_HINTSHOW:
|
|
{$IFNDEF CLR}
|
|
with TCMHintShow(Msg) do
|
|
Result := Integer(HintShow(HintInfo^));
|
|
{$ELSE}
|
|
with TCMHintShow.Create(Msg) do
|
|
begin
|
|
AHintInfo := HintInfo;
|
|
Result := Integer(HintShow(AHintInfo));
|
|
HintInfo := AHintInfo;
|
|
end;
|
|
{$ENDIF !CLR}
|
|
CM_HITTEST:
|
|
with TCMHitTest{$IFDEF CLR}.Create{$ENDIF}(Msg) do
|
|
Result := Integer(HitTest(XPos, YPos));
|
|
CM_MOUSEENTER:
|
|
MouseEnter({$IFDEF CLR}nil{$ELSE}TControl(Msg.LParam){$ENDIF});
|
|
CM_MOUSELEAVE:
|
|
MouseLeave({$IFDEF CLR}nil{$ELSE}TControl(Msg.LParam){$ENDIF});
|
|
CM_VISIBLECHANGED:
|
|
VisibleChanged;
|
|
CM_ENABLEDCHANGED:
|
|
EnabledChanged;
|
|
CM_TEXTCHANGED:
|
|
TextChanged;
|
|
CM_FONTCHANGED:
|
|
FontChanged;
|
|
CM_COLORCHANGED:
|
|
ColorChanged;
|
|
{$IFNDEF CLR}
|
|
CM_FOCUSCHANGED:
|
|
FocusChanged(TWinControl(Msg.LParam));
|
|
{$ENDIF !CLR}
|
|
CM_PARENTFONTCHANGED:
|
|
ParentFontChanged;
|
|
CM_PARENTCOLORCHANGED:
|
|
ParentColorChanged;
|
|
CM_PARENTSHOWHINTCHANGED:
|
|
ParentShowHintChanged;
|
|
CM_CURSORCHANGED:
|
|
CursorChanged;
|
|
CM_SHOWINGCHANGED:
|
|
ShowingChanged;
|
|
CM_SHOWHINTCHANGED:
|
|
ShowHintChanged;
|
|
{$IFNDEF CLR}
|
|
CM_CONTROLLISTCHANGE:
|
|
if Msg.LParam <> 0 then
|
|
ControlsListChanging(TControl(Msg.WParam), True)
|
|
else
|
|
ControlsListChanged(TControl(Msg.WParam), False);
|
|
CM_CONTROLCHANGE:
|
|
if Msg.LParam = 0 then
|
|
ControlsListChanging(TControl(Msg.WParam), False)
|
|
else
|
|
ControlsListChanged(TControl(Msg.WParam), True);
|
|
{$ENDIF !CLR}
|
|
WM_SETFOCUS:
|
|
FocusSet(THandle(Msg.WParam));
|
|
WM_KILLFOCUS:
|
|
FocusKilled(THandle(Msg.WParam));
|
|
WM_SIZE, WM_MOVE:
|
|
begin
|
|
inherited WndProc(Msg);
|
|
BoundsChanged;
|
|
end;
|
|
WM_ERASEBKGND:
|
|
if Msg.WParam <> 0 then
|
|
begin
|
|
IdSaveDC := SaveDC(HDC(Msg.WParam)); // protect DC against Stock-Objects from Canvas
|
|
Canvas := TCanvas.Create;
|
|
try
|
|
Canvas.Handle := HDC(Msg.WParam);
|
|
Msg.Result := Ord(DoEraseBackground(Canvas, Msg.LParam));
|
|
finally
|
|
Canvas.Handle := 0;
|
|
Canvas.Free;
|
|
RestoreDC(HDC(Msg.WParam), IdSaveDC);
|
|
end;
|
|
end
|
|
else
|
|
inherited WndProc(Msg);
|
|
{$IFNDEF DELPHI2007_UP}
|
|
WM_PRINTCLIENT, WM_PRINT: // VCL bug fix
|
|
begin
|
|
IdSaveDC := SaveDC(HDC(Msg.WParam)); // protect DC against changes
|
|
try
|
|
inherited WndProc(Msg);
|
|
finally
|
|
RestoreDC(HDC(Msg.WParam), IdSaveDC);
|
|
end;
|
|
end;
|
|
{$ENDIF ~DELPHI2007_UP}
|
|
WM_GETDLGCODE:
|
|
begin
|
|
inherited WndProc(Msg);
|
|
DlgCodes := [dcNative] + DlgcToDlgCodes(Msg.Result);
|
|
GetDlgCode(DlgCodes);
|
|
if not (dcNative in DlgCodes) then
|
|
Msg.Result := DlgCodesToDlgc(DlgCodes);
|
|
end;
|
|
else
|
|
inherited WndProc(Msg);
|
|
end;
|
|
case Msg.Msg of // precheck message to prevent access violations on released controls
|
|
CM_MOUSEENTER, CM_MOUSELEAVE, WM_KILLFOCUS, WM_SETFOCUS, WM_NCPAINT:
|
|
if DotNetHighlighting then
|
|
HandleDotNetHighlighting(Self, Msg, MouseOver, Color);
|
|
end;
|
|
end;
|
|
end;
|
|
|
|
//============================================================================
|
|
|
|
constructor TJvExPageScroller.Create(AOwner: TComponent);
|
|
begin
|
|
inherited Create(AOwner);
|
|
FHintColor := clDefault;
|
|
end;
|
|
|
|
function TJvExPageScroller.BaseWndProc(Msg: Integer; WParam: Integer = 0; LParam: Longint = 0): Integer;
|
|
var
|
|
Mesg: TMessage;
|
|
begin
|
|
Mesg := CreateWMMessage(Msg, WParam, LParam);
|
|
inherited WndProc(Mesg);
|
|
Result := Mesg.Result;
|
|
end;
|
|
|
|
function TJvExPageScroller.BaseWndProc(Msg: Integer; WParam: Integer; LParam: TControl): Integer;
|
|
var
|
|
Mesg: TMessage;
|
|
begin
|
|
Mesg := CreateWMMessage(Msg, WParam, LParam);
|
|
inherited WndProc(Mesg);
|
|
Result := Mesg.Result;
|
|
end;
|
|
|
|
function TJvExPageScroller.BaseWndProcEx(Msg: Integer; WParam: Integer; var LParam): Integer;
|
|
var
|
|
Mesg: TStructPtrMessage;
|
|
begin
|
|
Mesg := TStructPtrMessage.Create(Msg, WParam, LParam);
|
|
try
|
|
inherited WndProc(Mesg.Msg);
|
|
finally
|
|
Result := Mesg.Msg.Result;
|
|
Mesg.Free;
|
|
end;
|
|
end;
|
|
|
|
procedure TJvExPageScroller.VisibleChanged;
|
|
begin
|
|
BaseWndProc(CM_VISIBLECHANGED);
|
|
end;
|
|
|
|
procedure TJvExPageScroller.EnabledChanged;
|
|
begin
|
|
BaseWndProc(CM_ENABLEDCHANGED);
|
|
end;
|
|
|
|
procedure TJvExPageScroller.TextChanged;
|
|
begin
|
|
BaseWndProc(CM_TEXTCHANGED);
|
|
end;
|
|
|
|
procedure TJvExPageScroller.FontChanged;
|
|
begin
|
|
BaseWndProc(CM_FONTCHANGED);
|
|
end;
|
|
|
|
procedure TJvExPageScroller.ColorChanged;
|
|
begin
|
|
BaseWndProc(CM_COLORCHANGED);
|
|
end;
|
|
|
|
procedure TJvExPageScroller.ParentFontChanged;
|
|
begin
|
|
BaseWndProc(CM_PARENTFONTCHANGED);
|
|
end;
|
|
|
|
procedure TJvExPageScroller.ParentColorChanged;
|
|
begin
|
|
BaseWndProc(CM_PARENTCOLORCHANGED);
|
|
if Assigned(OnParentColorChange) then
|
|
OnParentColorChange(Self);
|
|
end;
|
|
|
|
procedure TJvExPageScroller.ParentShowHintChanged;
|
|
begin
|
|
BaseWndProc(CM_PARENTSHOWHINTCHANGED);
|
|
end;
|
|
|
|
function TJvExPageScroller.WantKey(Key: Integer; Shift: TShiftState; const KeyText: WideString): Boolean;
|
|
begin
|
|
Result := BaseWndProc(CM_DIALOGCHAR, Word(Key), ShiftStateToKeyData(Shift)) <> 0;
|
|
end;
|
|
|
|
function TJvExPageScroller.HitTest(X, Y: Integer): Boolean;
|
|
begin
|
|
Result := BaseWndProc(CM_HITTEST, 0, SmallPointToLong(PointToSmallPoint(Point(X, Y)))) <> 0;
|
|
end;
|
|
|
|
function TJvExPageScroller.HintShow(var HintInfo: THintInfo): Boolean;
|
|
begin
|
|
GetHintColor(HintInfo, Self, FHintColor);
|
|
if FHintWindowClass <> nil then
|
|
HintInfo.HintWindowClass := FHintWindowClass;
|
|
Result := BaseWndProcEx(CM_HINTSHOW, 0, HintInfo) <> 0;
|
|
end;
|
|
|
|
procedure TJvExPageScroller.MouseEnter(AControl: TControl);
|
|
begin
|
|
FMouseOver := True;
|
|
if Assigned(FOnMouseEnter) then
|
|
FOnMouseEnter(Self);
|
|
BaseWndProc(CM_MOUSEENTER, 0, AControl);
|
|
end;
|
|
|
|
procedure TJvExPageScroller.MouseLeave(AControl: TControl);
|
|
begin
|
|
FMouseOver := False;
|
|
BaseWndProc(CM_MOUSELEAVE, 0, AControl);
|
|
if Assigned(FOnMouseLeave) then
|
|
FOnMouseLeave(Self);
|
|
end;
|
|
|
|
{$IFNDEF CLR}
|
|
procedure TJvExPageScroller.FocusChanged(AControl: TWinControl);
|
|
begin
|
|
BaseWndProc(CM_FOCUSCHANGED, 0, AControl);
|
|
end;
|
|
{$ENDIF !CLR}
|
|
|
|
{$IFDEF COMPILER5}
|
|
{$IFNDEF HASAUTOSIZE}
|
|
|
|
procedure TJvExPageScroller.CMSetAutoSize(var Msg: TMessage);
|
|
begin
|
|
SetAutoSize(Msg.WParam <> 0);
|
|
end;
|
|
|
|
procedure TJvExPageScroller.SetAutoSize(Value: Boolean);
|
|
begin
|
|
TOpenControl_SetAutoSize(Self, Value);
|
|
end;
|
|
|
|
{$ENDIF !HASAUTOSIZE}
|
|
{$ENDIF COMPILER5}
|
|
|
|
procedure TJvExPageScroller.BoundsChanged;
|
|
begin
|
|
end;
|
|
|
|
procedure TJvExPageScroller.CursorChanged;
|
|
begin
|
|
BaseWndProc(CM_CURSORCHANGED);
|
|
end;
|
|
|
|
procedure TJvExPageScroller.ShowingChanged;
|
|
begin
|
|
BaseWndProc(CM_SHOWINGCHANGED);
|
|
end;
|
|
|
|
procedure TJvExPageScroller.ShowHintChanged;
|
|
begin
|
|
BaseWndProc(CM_SHOWHINTCHANGED);
|
|
end;
|
|
|
|
{$IFNDEF CLR}
|
|
{ VCL sends CM_CONTROLLISTCHANGE and CM_CONTROLCHANGE in a different order than
|
|
the CLX methods are used. So we must correct it by evaluating "Inserting". }
|
|
procedure TJvExPageScroller.ControlsListChanging(Control: TControl; Inserting: Boolean);
|
|
begin
|
|
if Inserting then
|
|
BaseWndProc(CM_CONTROLLISTCHANGE, Integer(Control), Integer(Inserting))
|
|
else
|
|
BaseWndProc(CM_CONTROLCHANGE, Integer(Control), Integer(Inserting));
|
|
end;
|
|
|
|
procedure TJvExPageScroller.ControlsListChanged(Control: TControl; Inserting: Boolean);
|
|
begin
|
|
if not Inserting then
|
|
BaseWndProc(CM_CONTROLLISTCHANGE, Integer(Control), Integer(Inserting))
|
|
else
|
|
BaseWndProc(CM_CONTROLCHANGE, Integer(Control), Integer(Inserting));
|
|
end;
|
|
{$ENDIF !CLR}
|
|
|
|
procedure TJvExPageScroller.GetDlgCode(var Code: TDlgCodes);
|
|
begin
|
|
end;
|
|
|
|
procedure TJvExPageScroller.FocusSet(PrevWnd: THandle);
|
|
begin
|
|
BaseWndProc(WM_SETFOCUS, Integer(PrevWnd), 0);
|
|
end;
|
|
|
|
procedure TJvExPageScroller.FocusKilled(NextWnd: THandle);
|
|
begin
|
|
BaseWndProc(WM_KILLFOCUS, Integer(NextWnd), 0);
|
|
end;
|
|
|
|
function TJvExPageScroller.DoEraseBackground(Canvas: TCanvas; Param: Integer): Boolean;
|
|
begin
|
|
Result := BaseWndProc(WM_ERASEBKGND, Canvas.Handle, Param) <> 0;
|
|
end;
|
|
|
|
{$IFDEF JVCLThemesEnabledD56}
|
|
function TJvExPageScroller.GetParentBackground: Boolean;
|
|
begin
|
|
Result := JvThemes.GetParentBackground(Self);
|
|
end;
|
|
|
|
procedure TJvExPageScroller.SetParentBackground(Value: Boolean);
|
|
begin
|
|
JvThemes.SetParentBackground(Self, Value);
|
|
end;
|
|
{$ENDIF JVCLThemesEnabledD56}
|
|
|
|
procedure TJvExPageScroller.WndProc(var Msg: TMessage);
|
|
var
|
|
IdSaveDC: Integer;
|
|
DlgCodes: TDlgCodes;
|
|
Canvas: TCanvas;
|
|
{$IFDEF CLR}
|
|
AHintInfo: THintInfo;
|
|
{$ENDIF CLR}
|
|
begin
|
|
if not DispatchIsDesignMsg(Self, Msg) then
|
|
begin
|
|
case Msg.Msg of
|
|
CM_DENYSUBCLASSING:
|
|
{$IFNDEF CLR}
|
|
Msg.Result := Ord(GetInterfaceEntry(IJvDenySubClassing) <> nil);
|
|
{$ELSE}
|
|
Msg.Result := Integer(Supports(Self, IJvDenySubClassing));
|
|
{$ENDIF !CLR}
|
|
CM_DIALOGCHAR:
|
|
with TCMDialogChar{$IFDEF CLR}.Create{$ENDIF}(Msg) do
|
|
Result := Ord(WantKey(CharCode, KeyDataToShiftState(KeyData), WideChar(CharCode)));
|
|
CM_HINTSHOW:
|
|
{$IFNDEF CLR}
|
|
with TCMHintShow(Msg) do
|
|
Result := Integer(HintShow(HintInfo^));
|
|
{$ELSE}
|
|
with TCMHintShow.Create(Msg) do
|
|
begin
|
|
AHintInfo := HintInfo;
|
|
Result := Integer(HintShow(AHintInfo));
|
|
HintInfo := AHintInfo;
|
|
end;
|
|
{$ENDIF !CLR}
|
|
CM_HITTEST:
|
|
with TCMHitTest{$IFDEF CLR}.Create{$ENDIF}(Msg) do
|
|
Result := Integer(HitTest(XPos, YPos));
|
|
CM_MOUSEENTER:
|
|
MouseEnter({$IFDEF CLR}nil{$ELSE}TControl(Msg.LParam){$ENDIF});
|
|
CM_MOUSELEAVE:
|
|
MouseLeave({$IFDEF CLR}nil{$ELSE}TControl(Msg.LParam){$ENDIF});
|
|
CM_VISIBLECHANGED:
|
|
VisibleChanged;
|
|
CM_ENABLEDCHANGED:
|
|
EnabledChanged;
|
|
CM_TEXTCHANGED:
|
|
TextChanged;
|
|
CM_FONTCHANGED:
|
|
FontChanged;
|
|
CM_COLORCHANGED:
|
|
ColorChanged;
|
|
{$IFNDEF CLR}
|
|
CM_FOCUSCHANGED:
|
|
FocusChanged(TWinControl(Msg.LParam));
|
|
{$ENDIF !CLR}
|
|
CM_PARENTFONTCHANGED:
|
|
ParentFontChanged;
|
|
CM_PARENTCOLORCHANGED:
|
|
ParentColorChanged;
|
|
CM_PARENTSHOWHINTCHANGED:
|
|
ParentShowHintChanged;
|
|
CM_CURSORCHANGED:
|
|
CursorChanged;
|
|
CM_SHOWINGCHANGED:
|
|
ShowingChanged;
|
|
CM_SHOWHINTCHANGED:
|
|
ShowHintChanged;
|
|
{$IFNDEF CLR}
|
|
CM_CONTROLLISTCHANGE:
|
|
if Msg.LParam <> 0 then
|
|
ControlsListChanging(TControl(Msg.WParam), True)
|
|
else
|
|
ControlsListChanged(TControl(Msg.WParam), False);
|
|
CM_CONTROLCHANGE:
|
|
if Msg.LParam = 0 then
|
|
ControlsListChanging(TControl(Msg.WParam), False)
|
|
else
|
|
ControlsListChanged(TControl(Msg.WParam), True);
|
|
{$ENDIF !CLR}
|
|
WM_SETFOCUS:
|
|
FocusSet(THandle(Msg.WParam));
|
|
WM_KILLFOCUS:
|
|
FocusKilled(THandle(Msg.WParam));
|
|
WM_SIZE, WM_MOVE:
|
|
begin
|
|
inherited WndProc(Msg);
|
|
BoundsChanged;
|
|
end;
|
|
WM_ERASEBKGND:
|
|
if Msg.WParam <> 0 then
|
|
begin
|
|
IdSaveDC := SaveDC(HDC(Msg.WParam)); // protect DC against Stock-Objects from Canvas
|
|
Canvas := TCanvas.Create;
|
|
try
|
|
Canvas.Handle := HDC(Msg.WParam);
|
|
Msg.Result := Ord(DoEraseBackground(Canvas, Msg.LParam));
|
|
finally
|
|
Canvas.Handle := 0;
|
|
Canvas.Free;
|
|
RestoreDC(HDC(Msg.WParam), IdSaveDC);
|
|
end;
|
|
end
|
|
else
|
|
inherited WndProc(Msg);
|
|
{$IFNDEF DELPHI2007_UP}
|
|
WM_PRINTCLIENT, WM_PRINT: // VCL bug fix
|
|
begin
|
|
IdSaveDC := SaveDC(HDC(Msg.WParam)); // protect DC against changes
|
|
try
|
|
inherited WndProc(Msg);
|
|
finally
|
|
RestoreDC(HDC(Msg.WParam), IdSaveDC);
|
|
end;
|
|
end;
|
|
{$ENDIF ~DELPHI2007_UP}
|
|
WM_GETDLGCODE:
|
|
begin
|
|
inherited WndProc(Msg);
|
|
DlgCodes := [dcNative] + DlgcToDlgCodes(Msg.Result);
|
|
GetDlgCode(DlgCodes);
|
|
if not (dcNative in DlgCodes) then
|
|
Msg.Result := DlgCodesToDlgc(DlgCodes);
|
|
end;
|
|
else
|
|
inherited WndProc(Msg);
|
|
end;
|
|
case Msg.Msg of // precheck message to prevent access violations on released controls
|
|
CM_MOUSEENTER, CM_MOUSELEAVE, WM_KILLFOCUS, WM_SETFOCUS, WM_NCPAINT:
|
|
if DotNetHighlighting then
|
|
HandleDotNetHighlighting(Self, Msg, MouseOver, Color);
|
|
end;
|
|
end;
|
|
end;
|
|
|
|
//============================================================================
|
|
|
|
constructor TJvExCustomTabControl.Create(AOwner: TComponent);
|
|
begin
|
|
inherited Create(AOwner);
|
|
FHintColor := clDefault;
|
|
end;
|
|
|
|
function TJvExCustomTabControl.BaseWndProc(Msg: Integer; WParam: Integer = 0; LParam: Longint = 0): Integer;
|
|
var
|
|
Mesg: TMessage;
|
|
begin
|
|
Mesg := CreateWMMessage(Msg, WParam, LParam);
|
|
inherited WndProc(Mesg);
|
|
Result := Mesg.Result;
|
|
end;
|
|
|
|
function TJvExCustomTabControl.BaseWndProc(Msg: Integer; WParam: Integer; LParam: TControl): Integer;
|
|
var
|
|
Mesg: TMessage;
|
|
begin
|
|
Mesg := CreateWMMessage(Msg, WParam, LParam);
|
|
inherited WndProc(Mesg);
|
|
Result := Mesg.Result;
|
|
end;
|
|
|
|
function TJvExCustomTabControl.BaseWndProcEx(Msg: Integer; WParam: Integer; var LParam): Integer;
|
|
var
|
|
Mesg: TStructPtrMessage;
|
|
begin
|
|
Mesg := TStructPtrMessage.Create(Msg, WParam, LParam);
|
|
try
|
|
inherited WndProc(Mesg.Msg);
|
|
finally
|
|
Result := Mesg.Msg.Result;
|
|
Mesg.Free;
|
|
end;
|
|
end;
|
|
|
|
procedure TJvExCustomTabControl.VisibleChanged;
|
|
begin
|
|
BaseWndProc(CM_VISIBLECHANGED);
|
|
end;
|
|
|
|
procedure TJvExCustomTabControl.EnabledChanged;
|
|
begin
|
|
BaseWndProc(CM_ENABLEDCHANGED);
|
|
end;
|
|
|
|
procedure TJvExCustomTabControl.TextChanged;
|
|
begin
|
|
BaseWndProc(CM_TEXTCHANGED);
|
|
end;
|
|
|
|
procedure TJvExCustomTabControl.FontChanged;
|
|
begin
|
|
BaseWndProc(CM_FONTCHANGED);
|
|
end;
|
|
|
|
procedure TJvExCustomTabControl.ColorChanged;
|
|
begin
|
|
BaseWndProc(CM_COLORCHANGED);
|
|
end;
|
|
|
|
procedure TJvExCustomTabControl.ParentFontChanged;
|
|
begin
|
|
BaseWndProc(CM_PARENTFONTCHANGED);
|
|
end;
|
|
|
|
procedure TJvExCustomTabControl.ParentColorChanged;
|
|
begin
|
|
BaseWndProc(CM_PARENTCOLORCHANGED);
|
|
if Assigned(OnParentColorChange) then
|
|
OnParentColorChange(Self);
|
|
end;
|
|
|
|
procedure TJvExCustomTabControl.ParentShowHintChanged;
|
|
begin
|
|
BaseWndProc(CM_PARENTSHOWHINTCHANGED);
|
|
end;
|
|
|
|
function TJvExCustomTabControl.WantKey(Key: Integer; Shift: TShiftState; const KeyText: WideString): Boolean;
|
|
begin
|
|
Result := BaseWndProc(CM_DIALOGCHAR, Word(Key), ShiftStateToKeyData(Shift)) <> 0;
|
|
end;
|
|
|
|
function TJvExCustomTabControl.HitTest(X, Y: Integer): Boolean;
|
|
begin
|
|
Result := BaseWndProc(CM_HITTEST, 0, SmallPointToLong(PointToSmallPoint(Point(X, Y)))) <> 0;
|
|
end;
|
|
|
|
function TJvExCustomTabControl.HintShow(var HintInfo: THintInfo): Boolean;
|
|
begin
|
|
GetHintColor(HintInfo, Self, FHintColor);
|
|
if FHintWindowClass <> nil then
|
|
HintInfo.HintWindowClass := FHintWindowClass;
|
|
Result := BaseWndProcEx(CM_HINTSHOW, 0, HintInfo) <> 0;
|
|
end;
|
|
|
|
procedure TJvExCustomTabControl.MouseEnter(AControl: TControl);
|
|
begin
|
|
FMouseOver := True;
|
|
if Assigned(FOnMouseEnter) then
|
|
FOnMouseEnter(Self);
|
|
BaseWndProc(CM_MOUSEENTER, 0, AControl);
|
|
end;
|
|
|
|
procedure TJvExCustomTabControl.MouseLeave(AControl: TControl);
|
|
begin
|
|
FMouseOver := False;
|
|
BaseWndProc(CM_MOUSELEAVE, 0, AControl);
|
|
if Assigned(FOnMouseLeave) then
|
|
FOnMouseLeave(Self);
|
|
end;
|
|
|
|
{$IFNDEF CLR}
|
|
procedure TJvExCustomTabControl.FocusChanged(AControl: TWinControl);
|
|
begin
|
|
BaseWndProc(CM_FOCUSCHANGED, 0, AControl);
|
|
end;
|
|
{$ENDIF !CLR}
|
|
|
|
{$IFDEF COMPILER5}
|
|
{$IFNDEF HASAUTOSIZE}
|
|
|
|
procedure TJvExCustomTabControl.CMSetAutoSize(var Msg: TMessage);
|
|
begin
|
|
SetAutoSize(Msg.WParam <> 0);
|
|
end;
|
|
|
|
procedure TJvExCustomTabControl.SetAutoSize(Value: Boolean);
|
|
begin
|
|
TOpenControl_SetAutoSize(Self, Value);
|
|
end;
|
|
|
|
{$ENDIF !HASAUTOSIZE}
|
|
{$ENDIF COMPILER5}
|
|
|
|
procedure TJvExCustomTabControl.BoundsChanged;
|
|
begin
|
|
end;
|
|
|
|
procedure TJvExCustomTabControl.CursorChanged;
|
|
begin
|
|
BaseWndProc(CM_CURSORCHANGED);
|
|
end;
|
|
|
|
procedure TJvExCustomTabControl.ShowingChanged;
|
|
begin
|
|
BaseWndProc(CM_SHOWINGCHANGED);
|
|
end;
|
|
|
|
procedure TJvExCustomTabControl.ShowHintChanged;
|
|
begin
|
|
BaseWndProc(CM_SHOWHINTCHANGED);
|
|
end;
|
|
|
|
{$IFNDEF CLR}
|
|
{ VCL sends CM_CONTROLLISTCHANGE and CM_CONTROLCHANGE in a different order than
|
|
the CLX methods are used. So we must correct it by evaluating "Inserting". }
|
|
procedure TJvExCustomTabControl.ControlsListChanging(Control: TControl; Inserting: Boolean);
|
|
begin
|
|
if Inserting then
|
|
BaseWndProc(CM_CONTROLLISTCHANGE, Integer(Control), Integer(Inserting))
|
|
else
|
|
BaseWndProc(CM_CONTROLCHANGE, Integer(Control), Integer(Inserting));
|
|
end;
|
|
|
|
procedure TJvExCustomTabControl.ControlsListChanged(Control: TControl; Inserting: Boolean);
|
|
begin
|
|
if not Inserting then
|
|
BaseWndProc(CM_CONTROLLISTCHANGE, Integer(Control), Integer(Inserting))
|
|
else
|
|
BaseWndProc(CM_CONTROLCHANGE, Integer(Control), Integer(Inserting));
|
|
end;
|
|
{$ENDIF !CLR}
|
|
|
|
procedure TJvExCustomTabControl.GetDlgCode(var Code: TDlgCodes);
|
|
begin
|
|
end;
|
|
|
|
procedure TJvExCustomTabControl.FocusSet(PrevWnd: THandle);
|
|
begin
|
|
BaseWndProc(WM_SETFOCUS, Integer(PrevWnd), 0);
|
|
end;
|
|
|
|
procedure TJvExCustomTabControl.FocusKilled(NextWnd: THandle);
|
|
begin
|
|
BaseWndProc(WM_KILLFOCUS, Integer(NextWnd), 0);
|
|
end;
|
|
|
|
function TJvExCustomTabControl.DoEraseBackground(Canvas: TCanvas; Param: Integer): Boolean;
|
|
begin
|
|
Result := BaseWndProc(WM_ERASEBKGND, Canvas.Handle, Param) <> 0;
|
|
end;
|
|
|
|
{$IFDEF JVCLThemesEnabledD56}
|
|
function TJvExCustomTabControl.GetParentBackground: Boolean;
|
|
begin
|
|
Result := JvThemes.GetParentBackground(Self);
|
|
end;
|
|
|
|
procedure TJvExCustomTabControl.SetParentBackground(Value: Boolean);
|
|
begin
|
|
JvThemes.SetParentBackground(Self, Value);
|
|
end;
|
|
{$ENDIF JVCLThemesEnabledD56}
|
|
|
|
procedure TJvExCustomTabControl.WndProc(var Msg: TMessage);
|
|
var
|
|
IdSaveDC: Integer;
|
|
DlgCodes: TDlgCodes;
|
|
Canvas: TCanvas;
|
|
{$IFDEF CLR}
|
|
AHintInfo: THintInfo;
|
|
{$ENDIF CLR}
|
|
begin
|
|
if not DispatchIsDesignMsg(Self, Msg) then
|
|
begin
|
|
case Msg.Msg of
|
|
CM_DENYSUBCLASSING:
|
|
{$IFNDEF CLR}
|
|
Msg.Result := Ord(GetInterfaceEntry(IJvDenySubClassing) <> nil);
|
|
{$ELSE}
|
|
Msg.Result := Integer(Supports(Self, IJvDenySubClassing));
|
|
{$ENDIF !CLR}
|
|
CM_DIALOGCHAR:
|
|
with TCMDialogChar{$IFDEF CLR}.Create{$ENDIF}(Msg) do
|
|
Result := Ord(WantKey(CharCode, KeyDataToShiftState(KeyData), WideChar(CharCode)));
|
|
CM_HINTSHOW:
|
|
{$IFNDEF CLR}
|
|
with TCMHintShow(Msg) do
|
|
Result := Integer(HintShow(HintInfo^));
|
|
{$ELSE}
|
|
with TCMHintShow.Create(Msg) do
|
|
begin
|
|
AHintInfo := HintInfo;
|
|
Result := Integer(HintShow(AHintInfo));
|
|
HintInfo := AHintInfo;
|
|
end;
|
|
{$ENDIF !CLR}
|
|
CM_HITTEST:
|
|
with TCMHitTest{$IFDEF CLR}.Create{$ENDIF}(Msg) do
|
|
Result := Integer(HitTest(XPos, YPos));
|
|
CM_MOUSEENTER:
|
|
MouseEnter({$IFDEF CLR}nil{$ELSE}TControl(Msg.LParam){$ENDIF});
|
|
CM_MOUSELEAVE:
|
|
MouseLeave({$IFDEF CLR}nil{$ELSE}TControl(Msg.LParam){$ENDIF});
|
|
CM_VISIBLECHANGED:
|
|
VisibleChanged;
|
|
CM_ENABLEDCHANGED:
|
|
EnabledChanged;
|
|
CM_TEXTCHANGED:
|
|
TextChanged;
|
|
CM_FONTCHANGED:
|
|
FontChanged;
|
|
CM_COLORCHANGED:
|
|
ColorChanged;
|
|
{$IFNDEF CLR}
|
|
CM_FOCUSCHANGED:
|
|
FocusChanged(TWinControl(Msg.LParam));
|
|
{$ENDIF !CLR}
|
|
CM_PARENTFONTCHANGED:
|
|
ParentFontChanged;
|
|
CM_PARENTCOLORCHANGED:
|
|
ParentColorChanged;
|
|
CM_PARENTSHOWHINTCHANGED:
|
|
ParentShowHintChanged;
|
|
CM_CURSORCHANGED:
|
|
CursorChanged;
|
|
CM_SHOWINGCHANGED:
|
|
ShowingChanged;
|
|
CM_SHOWHINTCHANGED:
|
|
ShowHintChanged;
|
|
{$IFNDEF CLR}
|
|
CM_CONTROLLISTCHANGE:
|
|
if Msg.LParam <> 0 then
|
|
ControlsListChanging(TControl(Msg.WParam), True)
|
|
else
|
|
ControlsListChanged(TControl(Msg.WParam), False);
|
|
CM_CONTROLCHANGE:
|
|
if Msg.LParam = 0 then
|
|
ControlsListChanging(TControl(Msg.WParam), False)
|
|
else
|
|
ControlsListChanged(TControl(Msg.WParam), True);
|
|
{$ENDIF !CLR}
|
|
WM_SETFOCUS:
|
|
FocusSet(THandle(Msg.WParam));
|
|
WM_KILLFOCUS:
|
|
FocusKilled(THandle(Msg.WParam));
|
|
WM_SIZE, WM_MOVE:
|
|
begin
|
|
inherited WndProc(Msg);
|
|
BoundsChanged;
|
|
end;
|
|
WM_ERASEBKGND:
|
|
if Msg.WParam <> 0 then
|
|
begin
|
|
IdSaveDC := SaveDC(HDC(Msg.WParam)); // protect DC against Stock-Objects from Canvas
|
|
Canvas := TCanvas.Create;
|
|
try
|
|
Canvas.Handle := HDC(Msg.WParam);
|
|
Msg.Result := Ord(DoEraseBackground(Canvas, Msg.LParam));
|
|
finally
|
|
Canvas.Handle := 0;
|
|
Canvas.Free;
|
|
RestoreDC(HDC(Msg.WParam), IdSaveDC);
|
|
end;
|
|
end
|
|
else
|
|
inherited WndProc(Msg);
|
|
{$IFNDEF DELPHI2007_UP}
|
|
WM_PRINTCLIENT, WM_PRINT: // VCL bug fix
|
|
begin
|
|
IdSaveDC := SaveDC(HDC(Msg.WParam)); // protect DC against changes
|
|
try
|
|
inherited WndProc(Msg);
|
|
finally
|
|
RestoreDC(HDC(Msg.WParam), IdSaveDC);
|
|
end;
|
|
end;
|
|
{$ENDIF ~DELPHI2007_UP}
|
|
WM_GETDLGCODE:
|
|
begin
|
|
inherited WndProc(Msg);
|
|
DlgCodes := [dcNative] + DlgcToDlgCodes(Msg.Result);
|
|
GetDlgCode(DlgCodes);
|
|
if not (dcNative in DlgCodes) then
|
|
Msg.Result := DlgCodesToDlgc(DlgCodes);
|
|
end;
|
|
else
|
|
inherited WndProc(Msg);
|
|
end;
|
|
case Msg.Msg of // precheck message to prevent access violations on released controls
|
|
CM_MOUSEENTER, CM_MOUSELEAVE, WM_KILLFOCUS, WM_SETFOCUS, WM_NCPAINT:
|
|
if DotNetHighlighting then
|
|
HandleDotNetHighlighting(Self, Msg, MouseOver, Color);
|
|
end;
|
|
end;
|
|
end;
|
|
|
|
//============================================================================
|
|
|
|
constructor TJvExTabControl.Create(AOwner: TComponent);
|
|
begin
|
|
inherited Create(AOwner);
|
|
FHintColor := clDefault;
|
|
end;
|
|
|
|
function TJvExTabControl.BaseWndProc(Msg: Integer; WParam: Integer = 0; LParam: Longint = 0): Integer;
|
|
var
|
|
Mesg: TMessage;
|
|
begin
|
|
Mesg := CreateWMMessage(Msg, WParam, LParam);
|
|
inherited WndProc(Mesg);
|
|
Result := Mesg.Result;
|
|
end;
|
|
|
|
function TJvExTabControl.BaseWndProc(Msg: Integer; WParam: Integer; LParam: TControl): Integer;
|
|
var
|
|
Mesg: TMessage;
|
|
begin
|
|
Mesg := CreateWMMessage(Msg, WParam, LParam);
|
|
inherited WndProc(Mesg);
|
|
Result := Mesg.Result;
|
|
end;
|
|
|
|
function TJvExTabControl.BaseWndProcEx(Msg: Integer; WParam: Integer; var LParam): Integer;
|
|
var
|
|
Mesg: TStructPtrMessage;
|
|
begin
|
|
Mesg := TStructPtrMessage.Create(Msg, WParam, LParam);
|
|
try
|
|
inherited WndProc(Mesg.Msg);
|
|
finally
|
|
Result := Mesg.Msg.Result;
|
|
Mesg.Free;
|
|
end;
|
|
end;
|
|
|
|
procedure TJvExTabControl.VisibleChanged;
|
|
begin
|
|
BaseWndProc(CM_VISIBLECHANGED);
|
|
end;
|
|
|
|
procedure TJvExTabControl.EnabledChanged;
|
|
begin
|
|
BaseWndProc(CM_ENABLEDCHANGED);
|
|
end;
|
|
|
|
procedure TJvExTabControl.TextChanged;
|
|
begin
|
|
BaseWndProc(CM_TEXTCHANGED);
|
|
end;
|
|
|
|
procedure TJvExTabControl.FontChanged;
|
|
begin
|
|
BaseWndProc(CM_FONTCHANGED);
|
|
end;
|
|
|
|
procedure TJvExTabControl.ColorChanged;
|
|
begin
|
|
BaseWndProc(CM_COLORCHANGED);
|
|
end;
|
|
|
|
procedure TJvExTabControl.ParentFontChanged;
|
|
begin
|
|
BaseWndProc(CM_PARENTFONTCHANGED);
|
|
end;
|
|
|
|
procedure TJvExTabControl.ParentColorChanged;
|
|
begin
|
|
BaseWndProc(CM_PARENTCOLORCHANGED);
|
|
if Assigned(OnParentColorChange) then
|
|
OnParentColorChange(Self);
|
|
end;
|
|
|
|
procedure TJvExTabControl.ParentShowHintChanged;
|
|
begin
|
|
BaseWndProc(CM_PARENTSHOWHINTCHANGED);
|
|
end;
|
|
|
|
function TJvExTabControl.WantKey(Key: Integer; Shift: TShiftState; const KeyText: WideString): Boolean;
|
|
begin
|
|
Result := BaseWndProc(CM_DIALOGCHAR, Word(Key), ShiftStateToKeyData(Shift)) <> 0;
|
|
end;
|
|
|
|
function TJvExTabControl.HitTest(X, Y: Integer): Boolean;
|
|
begin
|
|
Result := BaseWndProc(CM_HITTEST, 0, SmallPointToLong(PointToSmallPoint(Point(X, Y)))) <> 0;
|
|
end;
|
|
|
|
function TJvExTabControl.HintShow(var HintInfo: THintInfo): Boolean;
|
|
begin
|
|
GetHintColor(HintInfo, Self, FHintColor);
|
|
if FHintWindowClass <> nil then
|
|
HintInfo.HintWindowClass := FHintWindowClass;
|
|
Result := BaseWndProcEx(CM_HINTSHOW, 0, HintInfo) <> 0;
|
|
end;
|
|
|
|
procedure TJvExTabControl.MouseEnter(AControl: TControl);
|
|
begin
|
|
FMouseOver := True;
|
|
if Assigned(FOnMouseEnter) then
|
|
FOnMouseEnter(Self);
|
|
BaseWndProc(CM_MOUSEENTER, 0, AControl);
|
|
end;
|
|
|
|
procedure TJvExTabControl.MouseLeave(AControl: TControl);
|
|
begin
|
|
FMouseOver := False;
|
|
BaseWndProc(CM_MOUSELEAVE, 0, AControl);
|
|
if Assigned(FOnMouseLeave) then
|
|
FOnMouseLeave(Self);
|
|
end;
|
|
|
|
{$IFNDEF CLR}
|
|
procedure TJvExTabControl.FocusChanged(AControl: TWinControl);
|
|
begin
|
|
BaseWndProc(CM_FOCUSCHANGED, 0, AControl);
|
|
end;
|
|
{$ENDIF !CLR}
|
|
|
|
{$IFDEF COMPILER5}
|
|
{$IFNDEF HASAUTOSIZE}
|
|
|
|
procedure TJvExTabControl.CMSetAutoSize(var Msg: TMessage);
|
|
begin
|
|
SetAutoSize(Msg.WParam <> 0);
|
|
end;
|
|
|
|
procedure TJvExTabControl.SetAutoSize(Value: Boolean);
|
|
begin
|
|
TOpenControl_SetAutoSize(Self, Value);
|
|
end;
|
|
|
|
{$ENDIF !HASAUTOSIZE}
|
|
{$ENDIF COMPILER5}
|
|
|
|
procedure TJvExTabControl.BoundsChanged;
|
|
begin
|
|
end;
|
|
|
|
procedure TJvExTabControl.CursorChanged;
|
|
begin
|
|
BaseWndProc(CM_CURSORCHANGED);
|
|
end;
|
|
|
|
procedure TJvExTabControl.ShowingChanged;
|
|
begin
|
|
BaseWndProc(CM_SHOWINGCHANGED);
|
|
end;
|
|
|
|
procedure TJvExTabControl.ShowHintChanged;
|
|
begin
|
|
BaseWndProc(CM_SHOWHINTCHANGED);
|
|
end;
|
|
|
|
{$IFNDEF CLR}
|
|
{ VCL sends CM_CONTROLLISTCHANGE and CM_CONTROLCHANGE in a different order than
|
|
the CLX methods are used. So we must correct it by evaluating "Inserting". }
|
|
procedure TJvExTabControl.ControlsListChanging(Control: TControl; Inserting: Boolean);
|
|
begin
|
|
if Inserting then
|
|
BaseWndProc(CM_CONTROLLISTCHANGE, Integer(Control), Integer(Inserting))
|
|
else
|
|
BaseWndProc(CM_CONTROLCHANGE, Integer(Control), Integer(Inserting));
|
|
end;
|
|
|
|
procedure TJvExTabControl.ControlsListChanged(Control: TControl; Inserting: Boolean);
|
|
begin
|
|
if not Inserting then
|
|
BaseWndProc(CM_CONTROLLISTCHANGE, Integer(Control), Integer(Inserting))
|
|
else
|
|
BaseWndProc(CM_CONTROLCHANGE, Integer(Control), Integer(Inserting));
|
|
end;
|
|
{$ENDIF !CLR}
|
|
|
|
procedure TJvExTabControl.GetDlgCode(var Code: TDlgCodes);
|
|
begin
|
|
end;
|
|
|
|
procedure TJvExTabControl.FocusSet(PrevWnd: THandle);
|
|
begin
|
|
BaseWndProc(WM_SETFOCUS, Integer(PrevWnd), 0);
|
|
end;
|
|
|
|
procedure TJvExTabControl.FocusKilled(NextWnd: THandle);
|
|
begin
|
|
BaseWndProc(WM_KILLFOCUS, Integer(NextWnd), 0);
|
|
end;
|
|
|
|
function TJvExTabControl.DoEraseBackground(Canvas: TCanvas; Param: Integer): Boolean;
|
|
begin
|
|
Result := BaseWndProc(WM_ERASEBKGND, Canvas.Handle, Param) <> 0;
|
|
end;
|
|
|
|
{$IFDEF JVCLThemesEnabledD56}
|
|
function TJvExTabControl.GetParentBackground: Boolean;
|
|
begin
|
|
Result := JvThemes.GetParentBackground(Self);
|
|
end;
|
|
|
|
procedure TJvExTabControl.SetParentBackground(Value: Boolean);
|
|
begin
|
|
JvThemes.SetParentBackground(Self, Value);
|
|
end;
|
|
{$ENDIF JVCLThemesEnabledD56}
|
|
|
|
procedure TJvExTabControl.WndProc(var Msg: TMessage);
|
|
var
|
|
IdSaveDC: Integer;
|
|
DlgCodes: TDlgCodes;
|
|
Canvas: TCanvas;
|
|
{$IFDEF CLR}
|
|
AHintInfo: THintInfo;
|
|
{$ENDIF CLR}
|
|
begin
|
|
if not DispatchIsDesignMsg(Self, Msg) then
|
|
begin
|
|
case Msg.Msg of
|
|
CM_DENYSUBCLASSING:
|
|
{$IFNDEF CLR}
|
|
Msg.Result := Ord(GetInterfaceEntry(IJvDenySubClassing) <> nil);
|
|
{$ELSE}
|
|
Msg.Result := Integer(Supports(Self, IJvDenySubClassing));
|
|
{$ENDIF !CLR}
|
|
CM_DIALOGCHAR:
|
|
with TCMDialogChar{$IFDEF CLR}.Create{$ENDIF}(Msg) do
|
|
Result := Ord(WantKey(CharCode, KeyDataToShiftState(KeyData), WideChar(CharCode)));
|
|
CM_HINTSHOW:
|
|
{$IFNDEF CLR}
|
|
with TCMHintShow(Msg) do
|
|
Result := Integer(HintShow(HintInfo^));
|
|
{$ELSE}
|
|
with TCMHintShow.Create(Msg) do
|
|
begin
|
|
AHintInfo := HintInfo;
|
|
Result := Integer(HintShow(AHintInfo));
|
|
HintInfo := AHintInfo;
|
|
end;
|
|
{$ENDIF !CLR}
|
|
CM_HITTEST:
|
|
with TCMHitTest{$IFDEF CLR}.Create{$ENDIF}(Msg) do
|
|
Result := Integer(HitTest(XPos, YPos));
|
|
CM_MOUSEENTER:
|
|
MouseEnter({$IFDEF CLR}nil{$ELSE}TControl(Msg.LParam){$ENDIF});
|
|
CM_MOUSELEAVE:
|
|
MouseLeave({$IFDEF CLR}nil{$ELSE}TControl(Msg.LParam){$ENDIF});
|
|
CM_VISIBLECHANGED:
|
|
VisibleChanged;
|
|
CM_ENABLEDCHANGED:
|
|
EnabledChanged;
|
|
CM_TEXTCHANGED:
|
|
TextChanged;
|
|
CM_FONTCHANGED:
|
|
FontChanged;
|
|
CM_COLORCHANGED:
|
|
ColorChanged;
|
|
{$IFNDEF CLR}
|
|
CM_FOCUSCHANGED:
|
|
FocusChanged(TWinControl(Msg.LParam));
|
|
{$ENDIF !CLR}
|
|
CM_PARENTFONTCHANGED:
|
|
ParentFontChanged;
|
|
CM_PARENTCOLORCHANGED:
|
|
ParentColorChanged;
|
|
CM_PARENTSHOWHINTCHANGED:
|
|
ParentShowHintChanged;
|
|
CM_CURSORCHANGED:
|
|
CursorChanged;
|
|
CM_SHOWINGCHANGED:
|
|
ShowingChanged;
|
|
CM_SHOWHINTCHANGED:
|
|
ShowHintChanged;
|
|
{$IFNDEF CLR}
|
|
CM_CONTROLLISTCHANGE:
|
|
if Msg.LParam <> 0 then
|
|
ControlsListChanging(TControl(Msg.WParam), True)
|
|
else
|
|
ControlsListChanged(TControl(Msg.WParam), False);
|
|
CM_CONTROLCHANGE:
|
|
if Msg.LParam = 0 then
|
|
ControlsListChanging(TControl(Msg.WParam), False)
|
|
else
|
|
ControlsListChanged(TControl(Msg.WParam), True);
|
|
{$ENDIF !CLR}
|
|
WM_SETFOCUS:
|
|
FocusSet(THandle(Msg.WParam));
|
|
WM_KILLFOCUS:
|
|
FocusKilled(THandle(Msg.WParam));
|
|
WM_SIZE, WM_MOVE:
|
|
begin
|
|
inherited WndProc(Msg);
|
|
BoundsChanged;
|
|
end;
|
|
WM_ERASEBKGND:
|
|
if Msg.WParam <> 0 then
|
|
begin
|
|
IdSaveDC := SaveDC(HDC(Msg.WParam)); // protect DC against Stock-Objects from Canvas
|
|
Canvas := TCanvas.Create;
|
|
try
|
|
Canvas.Handle := HDC(Msg.WParam);
|
|
Msg.Result := Ord(DoEraseBackground(Canvas, Msg.LParam));
|
|
finally
|
|
Canvas.Handle := 0;
|
|
Canvas.Free;
|
|
RestoreDC(HDC(Msg.WParam), IdSaveDC);
|
|
end;
|
|
end
|
|
else
|
|
inherited WndProc(Msg);
|
|
{$IFNDEF DELPHI2007_UP}
|
|
WM_PRINTCLIENT, WM_PRINT: // VCL bug fix
|
|
begin
|
|
IdSaveDC := SaveDC(HDC(Msg.WParam)); // protect DC against changes
|
|
try
|
|
inherited WndProc(Msg);
|
|
finally
|
|
RestoreDC(HDC(Msg.WParam), IdSaveDC);
|
|
end;
|
|
end;
|
|
{$ENDIF ~DELPHI2007_UP}
|
|
WM_GETDLGCODE:
|
|
begin
|
|
inherited WndProc(Msg);
|
|
DlgCodes := [dcNative] + DlgcToDlgCodes(Msg.Result);
|
|
GetDlgCode(DlgCodes);
|
|
if not (dcNative in DlgCodes) then
|
|
Msg.Result := DlgCodesToDlgc(DlgCodes);
|
|
end;
|
|
else
|
|
inherited WndProc(Msg);
|
|
end;
|
|
case Msg.Msg of // precheck message to prevent access violations on released controls
|
|
CM_MOUSEENTER, CM_MOUSELEAVE, WM_KILLFOCUS, WM_SETFOCUS, WM_NCPAINT:
|
|
if DotNetHighlighting then
|
|
HandleDotNetHighlighting(Self, Msg, MouseOver, Color);
|
|
end;
|
|
end;
|
|
end;
|
|
|
|
//============================================================================
|
|
|
|
constructor TJvExTabSheet.Create(AOwner: TComponent);
|
|
begin
|
|
inherited Create(AOwner);
|
|
FHintColor := clDefault;
|
|
end;
|
|
|
|
function TJvExTabSheet.BaseWndProc(Msg: Integer; WParam: Integer = 0; LParam: Longint = 0): Integer;
|
|
var
|
|
Mesg: TMessage;
|
|
begin
|
|
Mesg := CreateWMMessage(Msg, WParam, LParam);
|
|
inherited WndProc(Mesg);
|
|
Result := Mesg.Result;
|
|
end;
|
|
|
|
function TJvExTabSheet.BaseWndProc(Msg: Integer; WParam: Integer; LParam: TControl): Integer;
|
|
var
|
|
Mesg: TMessage;
|
|
begin
|
|
Mesg := CreateWMMessage(Msg, WParam, LParam);
|
|
inherited WndProc(Mesg);
|
|
Result := Mesg.Result;
|
|
end;
|
|
|
|
function TJvExTabSheet.BaseWndProcEx(Msg: Integer; WParam: Integer; var LParam): Integer;
|
|
var
|
|
Mesg: TStructPtrMessage;
|
|
begin
|
|
Mesg := TStructPtrMessage.Create(Msg, WParam, LParam);
|
|
try
|
|
inherited WndProc(Mesg.Msg);
|
|
finally
|
|
Result := Mesg.Msg.Result;
|
|
Mesg.Free;
|
|
end;
|
|
end;
|
|
|
|
procedure TJvExTabSheet.VisibleChanged;
|
|
begin
|
|
BaseWndProc(CM_VISIBLECHANGED);
|
|
end;
|
|
|
|
procedure TJvExTabSheet.EnabledChanged;
|
|
begin
|
|
BaseWndProc(CM_ENABLEDCHANGED);
|
|
end;
|
|
|
|
procedure TJvExTabSheet.TextChanged;
|
|
begin
|
|
BaseWndProc(CM_TEXTCHANGED);
|
|
end;
|
|
|
|
procedure TJvExTabSheet.FontChanged;
|
|
begin
|
|
BaseWndProc(CM_FONTCHANGED);
|
|
end;
|
|
|
|
procedure TJvExTabSheet.ColorChanged;
|
|
begin
|
|
BaseWndProc(CM_COLORCHANGED);
|
|
end;
|
|
|
|
procedure TJvExTabSheet.ParentFontChanged;
|
|
begin
|
|
BaseWndProc(CM_PARENTFONTCHANGED);
|
|
end;
|
|
|
|
procedure TJvExTabSheet.ParentColorChanged;
|
|
begin
|
|
BaseWndProc(CM_PARENTCOLORCHANGED);
|
|
if Assigned(OnParentColorChange) then
|
|
OnParentColorChange(Self);
|
|
end;
|
|
|
|
procedure TJvExTabSheet.ParentShowHintChanged;
|
|
begin
|
|
BaseWndProc(CM_PARENTSHOWHINTCHANGED);
|
|
end;
|
|
|
|
function TJvExTabSheet.WantKey(Key: Integer; Shift: TShiftState; const KeyText: WideString): Boolean;
|
|
begin
|
|
Result := BaseWndProc(CM_DIALOGCHAR, Word(Key), ShiftStateToKeyData(Shift)) <> 0;
|
|
end;
|
|
|
|
function TJvExTabSheet.HitTest(X, Y: Integer): Boolean;
|
|
begin
|
|
Result := BaseWndProc(CM_HITTEST, 0, SmallPointToLong(PointToSmallPoint(Point(X, Y)))) <> 0;
|
|
end;
|
|
|
|
function TJvExTabSheet.HintShow(var HintInfo: THintInfo): Boolean;
|
|
begin
|
|
GetHintColor(HintInfo, Self, FHintColor);
|
|
if FHintWindowClass <> nil then
|
|
HintInfo.HintWindowClass := FHintWindowClass;
|
|
Result := BaseWndProcEx(CM_HINTSHOW, 0, HintInfo) <> 0;
|
|
end;
|
|
|
|
procedure TJvExTabSheet.MouseEnter(AControl: TControl);
|
|
begin
|
|
FMouseOver := True;
|
|
if Assigned(FOnMouseEnter) then
|
|
FOnMouseEnter(Self);
|
|
BaseWndProc(CM_MOUSEENTER, 0, AControl);
|
|
end;
|
|
|
|
procedure TJvExTabSheet.MouseLeave(AControl: TControl);
|
|
begin
|
|
FMouseOver := False;
|
|
BaseWndProc(CM_MOUSELEAVE, 0, AControl);
|
|
if Assigned(FOnMouseLeave) then
|
|
FOnMouseLeave(Self);
|
|
end;
|
|
|
|
{$IFNDEF CLR}
|
|
procedure TJvExTabSheet.FocusChanged(AControl: TWinControl);
|
|
begin
|
|
BaseWndProc(CM_FOCUSCHANGED, 0, AControl);
|
|
end;
|
|
{$ENDIF !CLR}
|
|
|
|
{$IFDEF COMPILER5}
|
|
{$IFNDEF HASAUTOSIZE}
|
|
|
|
procedure TJvExTabSheet.CMSetAutoSize(var Msg: TMessage);
|
|
begin
|
|
SetAutoSize(Msg.WParam <> 0);
|
|
end;
|
|
|
|
procedure TJvExTabSheet.SetAutoSize(Value: Boolean);
|
|
begin
|
|
TOpenControl_SetAutoSize(Self, Value);
|
|
end;
|
|
|
|
{$ENDIF !HASAUTOSIZE}
|
|
{$ENDIF COMPILER5}
|
|
|
|
procedure TJvExTabSheet.BoundsChanged;
|
|
begin
|
|
end;
|
|
|
|
procedure TJvExTabSheet.CursorChanged;
|
|
begin
|
|
BaseWndProc(CM_CURSORCHANGED);
|
|
end;
|
|
|
|
procedure TJvExTabSheet.ShowingChanged;
|
|
begin
|
|
BaseWndProc(CM_SHOWINGCHANGED);
|
|
end;
|
|
|
|
procedure TJvExTabSheet.ShowHintChanged;
|
|
begin
|
|
BaseWndProc(CM_SHOWHINTCHANGED);
|
|
end;
|
|
|
|
{$IFNDEF CLR}
|
|
{ VCL sends CM_CONTROLLISTCHANGE and CM_CONTROLCHANGE in a different order than
|
|
the CLX methods are used. So we must correct it by evaluating "Inserting". }
|
|
procedure TJvExTabSheet.ControlsListChanging(Control: TControl; Inserting: Boolean);
|
|
begin
|
|
if Inserting then
|
|
BaseWndProc(CM_CONTROLLISTCHANGE, Integer(Control), Integer(Inserting))
|
|
else
|
|
BaseWndProc(CM_CONTROLCHANGE, Integer(Control), Integer(Inserting));
|
|
end;
|
|
|
|
procedure TJvExTabSheet.ControlsListChanged(Control: TControl; Inserting: Boolean);
|
|
begin
|
|
if not Inserting then
|
|
BaseWndProc(CM_CONTROLLISTCHANGE, Integer(Control), Integer(Inserting))
|
|
else
|
|
BaseWndProc(CM_CONTROLCHANGE, Integer(Control), Integer(Inserting));
|
|
end;
|
|
{$ENDIF !CLR}
|
|
|
|
procedure TJvExTabSheet.GetDlgCode(var Code: TDlgCodes);
|
|
begin
|
|
end;
|
|
|
|
procedure TJvExTabSheet.FocusSet(PrevWnd: THandle);
|
|
begin
|
|
BaseWndProc(WM_SETFOCUS, Integer(PrevWnd), 0);
|
|
end;
|
|
|
|
procedure TJvExTabSheet.FocusKilled(NextWnd: THandle);
|
|
begin
|
|
BaseWndProc(WM_KILLFOCUS, Integer(NextWnd), 0);
|
|
end;
|
|
|
|
function TJvExTabSheet.DoEraseBackground(Canvas: TCanvas; Param: Integer): Boolean;
|
|
begin
|
|
Result := BaseWndProc(WM_ERASEBKGND, Canvas.Handle, Param) <> 0;
|
|
end;
|
|
|
|
{$IFDEF JVCLThemesEnabledD56}
|
|
function TJvExTabSheet.GetParentBackground: Boolean;
|
|
begin
|
|
Result := JvThemes.GetParentBackground(Self);
|
|
end;
|
|
|
|
procedure TJvExTabSheet.SetParentBackground(Value: Boolean);
|
|
begin
|
|
JvThemes.SetParentBackground(Self, Value);
|
|
end;
|
|
{$ENDIF JVCLThemesEnabledD56}
|
|
|
|
procedure TJvExTabSheet.WndProc(var Msg: TMessage);
|
|
var
|
|
IdSaveDC: Integer;
|
|
DlgCodes: TDlgCodes;
|
|
Canvas: TCanvas;
|
|
{$IFDEF CLR}
|
|
AHintInfo: THintInfo;
|
|
{$ENDIF CLR}
|
|
begin
|
|
if not DispatchIsDesignMsg(Self, Msg) then
|
|
begin
|
|
case Msg.Msg of
|
|
CM_DENYSUBCLASSING:
|
|
{$IFNDEF CLR}
|
|
Msg.Result := Ord(GetInterfaceEntry(IJvDenySubClassing) <> nil);
|
|
{$ELSE}
|
|
Msg.Result := Integer(Supports(Self, IJvDenySubClassing));
|
|
{$ENDIF !CLR}
|
|
CM_DIALOGCHAR:
|
|
with TCMDialogChar{$IFDEF CLR}.Create{$ENDIF}(Msg) do
|
|
Result := Ord(WantKey(CharCode, KeyDataToShiftState(KeyData), WideChar(CharCode)));
|
|
CM_HINTSHOW:
|
|
{$IFNDEF CLR}
|
|
with TCMHintShow(Msg) do
|
|
Result := Integer(HintShow(HintInfo^));
|
|
{$ELSE}
|
|
with TCMHintShow.Create(Msg) do
|
|
begin
|
|
AHintInfo := HintInfo;
|
|
Result := Integer(HintShow(AHintInfo));
|
|
HintInfo := AHintInfo;
|
|
end;
|
|
{$ENDIF !CLR}
|
|
CM_HITTEST:
|
|
with TCMHitTest{$IFDEF CLR}.Create{$ENDIF}(Msg) do
|
|
Result := Integer(HitTest(XPos, YPos));
|
|
CM_MOUSEENTER:
|
|
MouseEnter({$IFDEF CLR}nil{$ELSE}TControl(Msg.LParam){$ENDIF});
|
|
CM_MOUSELEAVE:
|
|
MouseLeave({$IFDEF CLR}nil{$ELSE}TControl(Msg.LParam){$ENDIF});
|
|
CM_VISIBLECHANGED:
|
|
VisibleChanged;
|
|
CM_ENABLEDCHANGED:
|
|
EnabledChanged;
|
|
CM_TEXTCHANGED:
|
|
TextChanged;
|
|
CM_FONTCHANGED:
|
|
FontChanged;
|
|
CM_COLORCHANGED:
|
|
ColorChanged;
|
|
{$IFNDEF CLR}
|
|
CM_FOCUSCHANGED:
|
|
FocusChanged(TWinControl(Msg.LParam));
|
|
{$ENDIF !CLR}
|
|
CM_PARENTFONTCHANGED:
|
|
ParentFontChanged;
|
|
CM_PARENTCOLORCHANGED:
|
|
ParentColorChanged;
|
|
CM_PARENTSHOWHINTCHANGED:
|
|
ParentShowHintChanged;
|
|
CM_CURSORCHANGED:
|
|
CursorChanged;
|
|
CM_SHOWINGCHANGED:
|
|
ShowingChanged;
|
|
CM_SHOWHINTCHANGED:
|
|
ShowHintChanged;
|
|
{$IFNDEF CLR}
|
|
CM_CONTROLLISTCHANGE:
|
|
if Msg.LParam <> 0 then
|
|
ControlsListChanging(TControl(Msg.WParam), True)
|
|
else
|
|
ControlsListChanged(TControl(Msg.WParam), False);
|
|
CM_CONTROLCHANGE:
|
|
if Msg.LParam = 0 then
|
|
ControlsListChanging(TControl(Msg.WParam), False)
|
|
else
|
|
ControlsListChanged(TControl(Msg.WParam), True);
|
|
{$ENDIF !CLR}
|
|
WM_SETFOCUS:
|
|
FocusSet(THandle(Msg.WParam));
|
|
WM_KILLFOCUS:
|
|
FocusKilled(THandle(Msg.WParam));
|
|
WM_SIZE, WM_MOVE:
|
|
begin
|
|
inherited WndProc(Msg);
|
|
BoundsChanged;
|
|
end;
|
|
WM_ERASEBKGND:
|
|
if Msg.WParam <> 0 then
|
|
begin
|
|
IdSaveDC := SaveDC(HDC(Msg.WParam)); // protect DC against Stock-Objects from Canvas
|
|
Canvas := TCanvas.Create;
|
|
try
|
|
Canvas.Handle := HDC(Msg.WParam);
|
|
Msg.Result := Ord(DoEraseBackground(Canvas, Msg.LParam));
|
|
finally
|
|
Canvas.Handle := 0;
|
|
Canvas.Free;
|
|
RestoreDC(HDC(Msg.WParam), IdSaveDC);
|
|
end;
|
|
end
|
|
else
|
|
inherited WndProc(Msg);
|
|
{$IFNDEF DELPHI2007_UP}
|
|
WM_PRINTCLIENT, WM_PRINT: // VCL bug fix
|
|
begin
|
|
IdSaveDC := SaveDC(HDC(Msg.WParam)); // protect DC against changes
|
|
try
|
|
inherited WndProc(Msg);
|
|
finally
|
|
RestoreDC(HDC(Msg.WParam), IdSaveDC);
|
|
end;
|
|
end;
|
|
{$ENDIF ~DELPHI2007_UP}
|
|
WM_GETDLGCODE:
|
|
begin
|
|
inherited WndProc(Msg);
|
|
DlgCodes := [dcNative] + DlgcToDlgCodes(Msg.Result);
|
|
GetDlgCode(DlgCodes);
|
|
if not (dcNative in DlgCodes) then
|
|
Msg.Result := DlgCodesToDlgc(DlgCodes);
|
|
end;
|
|
else
|
|
inherited WndProc(Msg);
|
|
end;
|
|
case Msg.Msg of // precheck message to prevent access violations on released controls
|
|
CM_MOUSEENTER, CM_MOUSELEAVE, WM_KILLFOCUS, WM_SETFOCUS, WM_NCPAINT:
|
|
if DotNetHighlighting then
|
|
HandleDotNetHighlighting(Self, Msg, MouseOver, Color);
|
|
end;
|
|
end;
|
|
end;
|
|
|
|
//============================================================================
|
|
|
|
constructor TJvExToolBar.Create(AOwner: TComponent);
|
|
begin
|
|
inherited Create(AOwner);
|
|
FHintColor := clDefault;
|
|
end;
|
|
|
|
function TJvExToolBar.BaseWndProc(Msg: Integer; WParam: Integer = 0; LParam: Longint = 0): Integer;
|
|
var
|
|
Mesg: TMessage;
|
|
begin
|
|
Mesg := CreateWMMessage(Msg, WParam, LParam);
|
|
inherited WndProc(Mesg);
|
|
Result := Mesg.Result;
|
|
end;
|
|
|
|
function TJvExToolBar.BaseWndProc(Msg: Integer; WParam: Integer; LParam: TControl): Integer;
|
|
var
|
|
Mesg: TMessage;
|
|
begin
|
|
Mesg := CreateWMMessage(Msg, WParam, LParam);
|
|
inherited WndProc(Mesg);
|
|
Result := Mesg.Result;
|
|
end;
|
|
|
|
function TJvExToolBar.BaseWndProcEx(Msg: Integer; WParam: Integer; var LParam): Integer;
|
|
var
|
|
Mesg: TStructPtrMessage;
|
|
begin
|
|
Mesg := TStructPtrMessage.Create(Msg, WParam, LParam);
|
|
try
|
|
inherited WndProc(Mesg.Msg);
|
|
finally
|
|
Result := Mesg.Msg.Result;
|
|
Mesg.Free;
|
|
end;
|
|
end;
|
|
|
|
procedure TJvExToolBar.VisibleChanged;
|
|
begin
|
|
BaseWndProc(CM_VISIBLECHANGED);
|
|
end;
|
|
|
|
procedure TJvExToolBar.EnabledChanged;
|
|
begin
|
|
BaseWndProc(CM_ENABLEDCHANGED);
|
|
end;
|
|
|
|
procedure TJvExToolBar.TextChanged;
|
|
begin
|
|
BaseWndProc(CM_TEXTCHANGED);
|
|
end;
|
|
|
|
procedure TJvExToolBar.FontChanged;
|
|
begin
|
|
BaseWndProc(CM_FONTCHANGED);
|
|
end;
|
|
|
|
procedure TJvExToolBar.ColorChanged;
|
|
begin
|
|
BaseWndProc(CM_COLORCHANGED);
|
|
end;
|
|
|
|
procedure TJvExToolBar.ParentFontChanged;
|
|
begin
|
|
BaseWndProc(CM_PARENTFONTCHANGED);
|
|
end;
|
|
|
|
procedure TJvExToolBar.ParentColorChanged;
|
|
begin
|
|
BaseWndProc(CM_PARENTCOLORCHANGED);
|
|
if Assigned(OnParentColorChange) then
|
|
OnParentColorChange(Self);
|
|
end;
|
|
|
|
procedure TJvExToolBar.ParentShowHintChanged;
|
|
begin
|
|
BaseWndProc(CM_PARENTSHOWHINTCHANGED);
|
|
end;
|
|
|
|
function TJvExToolBar.WantKey(Key: Integer; Shift: TShiftState; const KeyText: WideString): Boolean;
|
|
begin
|
|
Result := BaseWndProc(CM_DIALOGCHAR, Word(Key), ShiftStateToKeyData(Shift)) <> 0;
|
|
end;
|
|
|
|
function TJvExToolBar.HitTest(X, Y: Integer): Boolean;
|
|
begin
|
|
Result := BaseWndProc(CM_HITTEST, 0, SmallPointToLong(PointToSmallPoint(Point(X, Y)))) <> 0;
|
|
end;
|
|
|
|
function TJvExToolBar.HintShow(var HintInfo: THintInfo): Boolean;
|
|
begin
|
|
GetHintColor(HintInfo, Self, FHintColor);
|
|
if FHintWindowClass <> nil then
|
|
HintInfo.HintWindowClass := FHintWindowClass;
|
|
Result := BaseWndProcEx(CM_HINTSHOW, 0, HintInfo) <> 0;
|
|
end;
|
|
|
|
procedure TJvExToolBar.MouseEnter(AControl: TControl);
|
|
begin
|
|
FMouseOver := True;
|
|
if Assigned(FOnMouseEnter) then
|
|
FOnMouseEnter(Self);
|
|
BaseWndProc(CM_MOUSEENTER, 0, AControl);
|
|
end;
|
|
|
|
procedure TJvExToolBar.MouseLeave(AControl: TControl);
|
|
begin
|
|
FMouseOver := False;
|
|
BaseWndProc(CM_MOUSELEAVE, 0, AControl);
|
|
if Assigned(FOnMouseLeave) then
|
|
FOnMouseLeave(Self);
|
|
end;
|
|
|
|
{$IFNDEF CLR}
|
|
procedure TJvExToolBar.FocusChanged(AControl: TWinControl);
|
|
begin
|
|
BaseWndProc(CM_FOCUSCHANGED, 0, AControl);
|
|
end;
|
|
{$ENDIF !CLR}
|
|
|
|
{$IFDEF COMPILER5}
|
|
{$IFNDEF HASAUTOSIZE}
|
|
|
|
procedure TJvExToolBar.CMSetAutoSize(var Msg: TMessage);
|
|
begin
|
|
SetAutoSize(Msg.WParam <> 0);
|
|
end;
|
|
|
|
procedure TJvExToolBar.SetAutoSize(Value: Boolean);
|
|
begin
|
|
TOpenControl_SetAutoSize(Self, Value);
|
|
end;
|
|
|
|
{$ENDIF !HASAUTOSIZE}
|
|
{$ENDIF COMPILER5}
|
|
|
|
procedure TJvExToolBar.BoundsChanged;
|
|
begin
|
|
end;
|
|
|
|
procedure TJvExToolBar.CursorChanged;
|
|
begin
|
|
BaseWndProc(CM_CURSORCHANGED);
|
|
end;
|
|
|
|
procedure TJvExToolBar.ShowingChanged;
|
|
begin
|
|
BaseWndProc(CM_SHOWINGCHANGED);
|
|
end;
|
|
|
|
procedure TJvExToolBar.ShowHintChanged;
|
|
begin
|
|
BaseWndProc(CM_SHOWHINTCHANGED);
|
|
end;
|
|
|
|
{$IFNDEF CLR}
|
|
{ VCL sends CM_CONTROLLISTCHANGE and CM_CONTROLCHANGE in a different order than
|
|
the CLX methods are used. So we must correct it by evaluating "Inserting". }
|
|
procedure TJvExToolBar.ControlsListChanging(Control: TControl; Inserting: Boolean);
|
|
begin
|
|
if Inserting then
|
|
BaseWndProc(CM_CONTROLLISTCHANGE, Integer(Control), Integer(Inserting))
|
|
else
|
|
BaseWndProc(CM_CONTROLCHANGE, Integer(Control), Integer(Inserting));
|
|
end;
|
|
|
|
procedure TJvExToolBar.ControlsListChanged(Control: TControl; Inserting: Boolean);
|
|
begin
|
|
if not Inserting then
|
|
BaseWndProc(CM_CONTROLLISTCHANGE, Integer(Control), Integer(Inserting))
|
|
else
|
|
BaseWndProc(CM_CONTROLCHANGE, Integer(Control), Integer(Inserting));
|
|
end;
|
|
{$ENDIF !CLR}
|
|
|
|
procedure TJvExToolBar.GetDlgCode(var Code: TDlgCodes);
|
|
begin
|
|
end;
|
|
|
|
procedure TJvExToolBar.FocusSet(PrevWnd: THandle);
|
|
begin
|
|
BaseWndProc(WM_SETFOCUS, Integer(PrevWnd), 0);
|
|
end;
|
|
|
|
procedure TJvExToolBar.FocusKilled(NextWnd: THandle);
|
|
begin
|
|
BaseWndProc(WM_KILLFOCUS, Integer(NextWnd), 0);
|
|
end;
|
|
|
|
function TJvExToolBar.DoEraseBackground(Canvas: TCanvas; Param: Integer): Boolean;
|
|
begin
|
|
Result := BaseWndProc(WM_ERASEBKGND, Canvas.Handle, Param) <> 0;
|
|
end;
|
|
|
|
{$IFDEF JVCLThemesEnabledD56}
|
|
function TJvExToolBar.GetParentBackground: Boolean;
|
|
begin
|
|
Result := JvThemes.GetParentBackground(Self);
|
|
end;
|
|
|
|
procedure TJvExToolBar.SetParentBackground(Value: Boolean);
|
|
begin
|
|
JvThemes.SetParentBackground(Self, Value);
|
|
end;
|
|
{$ENDIF JVCLThemesEnabledD56}
|
|
|
|
procedure TJvExToolBar.WndProc(var Msg: TMessage);
|
|
var
|
|
IdSaveDC: Integer;
|
|
DlgCodes: TDlgCodes;
|
|
Canvas: TCanvas;
|
|
{$IFDEF CLR}
|
|
AHintInfo: THintInfo;
|
|
{$ENDIF CLR}
|
|
begin
|
|
if not DispatchIsDesignMsg(Self, Msg) then
|
|
begin
|
|
case Msg.Msg of
|
|
CM_DENYSUBCLASSING:
|
|
{$IFNDEF CLR}
|
|
Msg.Result := Ord(GetInterfaceEntry(IJvDenySubClassing) <> nil);
|
|
{$ELSE}
|
|
Msg.Result := Integer(Supports(Self, IJvDenySubClassing));
|
|
{$ENDIF !CLR}
|
|
CM_DIALOGCHAR:
|
|
with TCMDialogChar{$IFDEF CLR}.Create{$ENDIF}(Msg) do
|
|
Result := Ord(WantKey(CharCode, KeyDataToShiftState(KeyData), WideChar(CharCode)));
|
|
CM_HINTSHOW:
|
|
{$IFNDEF CLR}
|
|
with TCMHintShow(Msg) do
|
|
Result := Integer(HintShow(HintInfo^));
|
|
{$ELSE}
|
|
with TCMHintShow.Create(Msg) do
|
|
begin
|
|
AHintInfo := HintInfo;
|
|
Result := Integer(HintShow(AHintInfo));
|
|
HintInfo := AHintInfo;
|
|
end;
|
|
{$ENDIF !CLR}
|
|
CM_HITTEST:
|
|
with TCMHitTest{$IFDEF CLR}.Create{$ENDIF}(Msg) do
|
|
Result := Integer(HitTest(XPos, YPos));
|
|
CM_MOUSEENTER:
|
|
MouseEnter({$IFDEF CLR}nil{$ELSE}TControl(Msg.LParam){$ENDIF});
|
|
CM_MOUSELEAVE:
|
|
MouseLeave({$IFDEF CLR}nil{$ELSE}TControl(Msg.LParam){$ENDIF});
|
|
CM_VISIBLECHANGED:
|
|
VisibleChanged;
|
|
CM_ENABLEDCHANGED:
|
|
EnabledChanged;
|
|
CM_TEXTCHANGED:
|
|
TextChanged;
|
|
CM_FONTCHANGED:
|
|
FontChanged;
|
|
CM_COLORCHANGED:
|
|
ColorChanged;
|
|
{$IFNDEF CLR}
|
|
CM_FOCUSCHANGED:
|
|
FocusChanged(TWinControl(Msg.LParam));
|
|
{$ENDIF !CLR}
|
|
CM_PARENTFONTCHANGED:
|
|
ParentFontChanged;
|
|
CM_PARENTCOLORCHANGED:
|
|
ParentColorChanged;
|
|
CM_PARENTSHOWHINTCHANGED:
|
|
ParentShowHintChanged;
|
|
CM_CURSORCHANGED:
|
|
CursorChanged;
|
|
CM_SHOWINGCHANGED:
|
|
ShowingChanged;
|
|
CM_SHOWHINTCHANGED:
|
|
ShowHintChanged;
|
|
{$IFNDEF CLR}
|
|
CM_CONTROLLISTCHANGE:
|
|
if Msg.LParam <> 0 then
|
|
ControlsListChanging(TControl(Msg.WParam), True)
|
|
else
|
|
ControlsListChanged(TControl(Msg.WParam), False);
|
|
CM_CONTROLCHANGE:
|
|
if Msg.LParam = 0 then
|
|
ControlsListChanging(TControl(Msg.WParam), False)
|
|
else
|
|
ControlsListChanged(TControl(Msg.WParam), True);
|
|
{$ENDIF !CLR}
|
|
WM_SETFOCUS:
|
|
FocusSet(THandle(Msg.WParam));
|
|
WM_KILLFOCUS:
|
|
FocusKilled(THandle(Msg.WParam));
|
|
WM_SIZE, WM_MOVE:
|
|
begin
|
|
inherited WndProc(Msg);
|
|
BoundsChanged;
|
|
end;
|
|
WM_ERASEBKGND:
|
|
if Msg.WParam <> 0 then
|
|
begin
|
|
IdSaveDC := SaveDC(HDC(Msg.WParam)); // protect DC against Stock-Objects from Canvas
|
|
Canvas := TCanvas.Create;
|
|
try
|
|
Canvas.Handle := HDC(Msg.WParam);
|
|
Msg.Result := Ord(DoEraseBackground(Canvas, Msg.LParam));
|
|
finally
|
|
Canvas.Handle := 0;
|
|
Canvas.Free;
|
|
RestoreDC(HDC(Msg.WParam), IdSaveDC);
|
|
end;
|
|
end
|
|
else
|
|
inherited WndProc(Msg);
|
|
{$IFNDEF DELPHI2007_UP}
|
|
WM_PRINTCLIENT, WM_PRINT: // VCL bug fix
|
|
begin
|
|
IdSaveDC := SaveDC(HDC(Msg.WParam)); // protect DC against changes
|
|
try
|
|
inherited WndProc(Msg);
|
|
finally
|
|
RestoreDC(HDC(Msg.WParam), IdSaveDC);
|
|
end;
|
|
end;
|
|
{$ENDIF ~DELPHI2007_UP}
|
|
WM_GETDLGCODE:
|
|
begin
|
|
inherited WndProc(Msg);
|
|
DlgCodes := [dcNative] + DlgcToDlgCodes(Msg.Result);
|
|
GetDlgCode(DlgCodes);
|
|
if not (dcNative in DlgCodes) then
|
|
Msg.Result := DlgCodesToDlgc(DlgCodes);
|
|
end;
|
|
else
|
|
inherited WndProc(Msg);
|
|
end;
|
|
case Msg.Msg of // precheck message to prevent access violations on released controls
|
|
CM_MOUSEENTER, CM_MOUSELEAVE, WM_KILLFOCUS, WM_SETFOCUS, WM_NCPAINT:
|
|
if DotNetHighlighting then
|
|
HandleDotNetHighlighting(Self, Msg, MouseOver, Color);
|
|
end;
|
|
end;
|
|
end;
|
|
|
|
//============================================================================
|
|
|
|
constructor TJvExStatusBar.Create(AOwner: TComponent);
|
|
begin
|
|
inherited Create(AOwner);
|
|
FHintColor := clDefault;
|
|
end;
|
|
|
|
function TJvExStatusBar.BaseWndProc(Msg: Integer; WParam: Integer = 0; LParam: Longint = 0): Integer;
|
|
var
|
|
Mesg: TMessage;
|
|
begin
|
|
Mesg := CreateWMMessage(Msg, WParam, LParam);
|
|
inherited WndProc(Mesg);
|
|
Result := Mesg.Result;
|
|
end;
|
|
|
|
function TJvExStatusBar.BaseWndProc(Msg: Integer; WParam: Integer; LParam: TControl): Integer;
|
|
var
|
|
Mesg: TMessage;
|
|
begin
|
|
Mesg := CreateWMMessage(Msg, WParam, LParam);
|
|
inherited WndProc(Mesg);
|
|
Result := Mesg.Result;
|
|
end;
|
|
|
|
function TJvExStatusBar.BaseWndProcEx(Msg: Integer; WParam: Integer; var LParam): Integer;
|
|
var
|
|
Mesg: TStructPtrMessage;
|
|
begin
|
|
Mesg := TStructPtrMessage.Create(Msg, WParam, LParam);
|
|
try
|
|
inherited WndProc(Mesg.Msg);
|
|
finally
|
|
Result := Mesg.Msg.Result;
|
|
Mesg.Free;
|
|
end;
|
|
end;
|
|
|
|
procedure TJvExStatusBar.VisibleChanged;
|
|
begin
|
|
BaseWndProc(CM_VISIBLECHANGED);
|
|
end;
|
|
|
|
procedure TJvExStatusBar.EnabledChanged;
|
|
begin
|
|
BaseWndProc(CM_ENABLEDCHANGED);
|
|
end;
|
|
|
|
procedure TJvExStatusBar.TextChanged;
|
|
begin
|
|
BaseWndProc(CM_TEXTCHANGED);
|
|
end;
|
|
|
|
procedure TJvExStatusBar.FontChanged;
|
|
begin
|
|
BaseWndProc(CM_FONTCHANGED);
|
|
end;
|
|
|
|
procedure TJvExStatusBar.ColorChanged;
|
|
begin
|
|
BaseWndProc(CM_COLORCHANGED);
|
|
end;
|
|
|
|
procedure TJvExStatusBar.ParentFontChanged;
|
|
begin
|
|
BaseWndProc(CM_PARENTFONTCHANGED);
|
|
end;
|
|
|
|
procedure TJvExStatusBar.ParentColorChanged;
|
|
begin
|
|
BaseWndProc(CM_PARENTCOLORCHANGED);
|
|
if Assigned(OnParentColorChange) then
|
|
OnParentColorChange(Self);
|
|
end;
|
|
|
|
procedure TJvExStatusBar.ParentShowHintChanged;
|
|
begin
|
|
BaseWndProc(CM_PARENTSHOWHINTCHANGED);
|
|
end;
|
|
|
|
function TJvExStatusBar.WantKey(Key: Integer; Shift: TShiftState; const KeyText: WideString): Boolean;
|
|
begin
|
|
Result := BaseWndProc(CM_DIALOGCHAR, Word(Key), ShiftStateToKeyData(Shift)) <> 0;
|
|
end;
|
|
|
|
function TJvExStatusBar.HitTest(X, Y: Integer): Boolean;
|
|
begin
|
|
Result := BaseWndProc(CM_HITTEST, 0, SmallPointToLong(PointToSmallPoint(Point(X, Y)))) <> 0;
|
|
end;
|
|
|
|
function TJvExStatusBar.HintShow(var HintInfo: THintInfo): Boolean;
|
|
begin
|
|
GetHintColor(HintInfo, Self, FHintColor);
|
|
if FHintWindowClass <> nil then
|
|
HintInfo.HintWindowClass := FHintWindowClass;
|
|
Result := BaseWndProcEx(CM_HINTSHOW, 0, HintInfo) <> 0;
|
|
end;
|
|
|
|
procedure TJvExStatusBar.MouseEnter(AControl: TControl);
|
|
begin
|
|
FMouseOver := True;
|
|
if Assigned(FOnMouseEnter) then
|
|
FOnMouseEnter(Self);
|
|
BaseWndProc(CM_MOUSEENTER, 0, AControl);
|
|
end;
|
|
|
|
procedure TJvExStatusBar.MouseLeave(AControl: TControl);
|
|
begin
|
|
FMouseOver := False;
|
|
BaseWndProc(CM_MOUSELEAVE, 0, AControl);
|
|
if Assigned(FOnMouseLeave) then
|
|
FOnMouseLeave(Self);
|
|
end;
|
|
|
|
{$IFNDEF CLR}
|
|
procedure TJvExStatusBar.FocusChanged(AControl: TWinControl);
|
|
begin
|
|
BaseWndProc(CM_FOCUSCHANGED, 0, AControl);
|
|
end;
|
|
{$ENDIF !CLR}
|
|
|
|
{$IFDEF COMPILER5}
|
|
{$IFNDEF HASAUTOSIZE}
|
|
|
|
procedure TJvExStatusBar.CMSetAutoSize(var Msg: TMessage);
|
|
begin
|
|
SetAutoSize(Msg.WParam <> 0);
|
|
end;
|
|
|
|
procedure TJvExStatusBar.SetAutoSize(Value: Boolean);
|
|
begin
|
|
TOpenControl_SetAutoSize(Self, Value);
|
|
end;
|
|
|
|
{$ENDIF !HASAUTOSIZE}
|
|
{$ENDIF COMPILER5}
|
|
|
|
procedure TJvExStatusBar.BoundsChanged;
|
|
begin
|
|
end;
|
|
|
|
procedure TJvExStatusBar.CursorChanged;
|
|
begin
|
|
BaseWndProc(CM_CURSORCHANGED);
|
|
end;
|
|
|
|
procedure TJvExStatusBar.ShowingChanged;
|
|
begin
|
|
BaseWndProc(CM_SHOWINGCHANGED);
|
|
end;
|
|
|
|
procedure TJvExStatusBar.ShowHintChanged;
|
|
begin
|
|
BaseWndProc(CM_SHOWHINTCHANGED);
|
|
end;
|
|
|
|
{$IFNDEF CLR}
|
|
{ VCL sends CM_CONTROLLISTCHANGE and CM_CONTROLCHANGE in a different order than
|
|
the CLX methods are used. So we must correct it by evaluating "Inserting". }
|
|
procedure TJvExStatusBar.ControlsListChanging(Control: TControl; Inserting: Boolean);
|
|
begin
|
|
if Inserting then
|
|
BaseWndProc(CM_CONTROLLISTCHANGE, Integer(Control), Integer(Inserting))
|
|
else
|
|
BaseWndProc(CM_CONTROLCHANGE, Integer(Control), Integer(Inserting));
|
|
end;
|
|
|
|
procedure TJvExStatusBar.ControlsListChanged(Control: TControl; Inserting: Boolean);
|
|
begin
|
|
if not Inserting then
|
|
BaseWndProc(CM_CONTROLLISTCHANGE, Integer(Control), Integer(Inserting))
|
|
else
|
|
BaseWndProc(CM_CONTROLCHANGE, Integer(Control), Integer(Inserting));
|
|
end;
|
|
{$ENDIF !CLR}
|
|
|
|
procedure TJvExStatusBar.GetDlgCode(var Code: TDlgCodes);
|
|
begin
|
|
end;
|
|
|
|
procedure TJvExStatusBar.FocusSet(PrevWnd: THandle);
|
|
begin
|
|
BaseWndProc(WM_SETFOCUS, Integer(PrevWnd), 0);
|
|
end;
|
|
|
|
procedure TJvExStatusBar.FocusKilled(NextWnd: THandle);
|
|
begin
|
|
BaseWndProc(WM_KILLFOCUS, Integer(NextWnd), 0);
|
|
end;
|
|
|
|
function TJvExStatusBar.DoEraseBackground(Canvas: TCanvas; Param: Integer): Boolean;
|
|
begin
|
|
Result := BaseWndProc(WM_ERASEBKGND, Canvas.Handle, Param) <> 0;
|
|
end;
|
|
|
|
{$IFDEF JVCLThemesEnabledD56}
|
|
function TJvExStatusBar.GetParentBackground: Boolean;
|
|
begin
|
|
Result := JvThemes.GetParentBackground(Self);
|
|
end;
|
|
|
|
procedure TJvExStatusBar.SetParentBackground(Value: Boolean);
|
|
begin
|
|
JvThemes.SetParentBackground(Self, Value);
|
|
end;
|
|
{$ENDIF JVCLThemesEnabledD56}
|
|
|
|
procedure TJvExStatusBar.WndProc(var Msg: TMessage);
|
|
var
|
|
IdSaveDC: Integer;
|
|
DlgCodes: TDlgCodes;
|
|
Canvas: TCanvas;
|
|
{$IFDEF CLR}
|
|
AHintInfo: THintInfo;
|
|
{$ENDIF CLR}
|
|
begin
|
|
if not DispatchIsDesignMsg(Self, Msg) then
|
|
begin
|
|
case Msg.Msg of
|
|
CM_DENYSUBCLASSING:
|
|
{$IFNDEF CLR}
|
|
Msg.Result := Ord(GetInterfaceEntry(IJvDenySubClassing) <> nil);
|
|
{$ELSE}
|
|
Msg.Result := Integer(Supports(Self, IJvDenySubClassing));
|
|
{$ENDIF !CLR}
|
|
CM_DIALOGCHAR:
|
|
with TCMDialogChar{$IFDEF CLR}.Create{$ENDIF}(Msg) do
|
|
Result := Ord(WantKey(CharCode, KeyDataToShiftState(KeyData), WideChar(CharCode)));
|
|
CM_HINTSHOW:
|
|
{$IFNDEF CLR}
|
|
with TCMHintShow(Msg) do
|
|
Result := Integer(HintShow(HintInfo^));
|
|
{$ELSE}
|
|
with TCMHintShow.Create(Msg) do
|
|
begin
|
|
AHintInfo := HintInfo;
|
|
Result := Integer(HintShow(AHintInfo));
|
|
HintInfo := AHintInfo;
|
|
end;
|
|
{$ENDIF !CLR}
|
|
CM_HITTEST:
|
|
with TCMHitTest{$IFDEF CLR}.Create{$ENDIF}(Msg) do
|
|
Result := Integer(HitTest(XPos, YPos));
|
|
CM_MOUSEENTER:
|
|
MouseEnter({$IFDEF CLR}nil{$ELSE}TControl(Msg.LParam){$ENDIF});
|
|
CM_MOUSELEAVE:
|
|
MouseLeave({$IFDEF CLR}nil{$ELSE}TControl(Msg.LParam){$ENDIF});
|
|
CM_VISIBLECHANGED:
|
|
VisibleChanged;
|
|
CM_ENABLEDCHANGED:
|
|
EnabledChanged;
|
|
CM_TEXTCHANGED:
|
|
TextChanged;
|
|
CM_FONTCHANGED:
|
|
FontChanged;
|
|
CM_COLORCHANGED:
|
|
ColorChanged;
|
|
{$IFNDEF CLR}
|
|
CM_FOCUSCHANGED:
|
|
FocusChanged(TWinControl(Msg.LParam));
|
|
{$ENDIF !CLR}
|
|
CM_PARENTFONTCHANGED:
|
|
ParentFontChanged;
|
|
CM_PARENTCOLORCHANGED:
|
|
ParentColorChanged;
|
|
CM_PARENTSHOWHINTCHANGED:
|
|
ParentShowHintChanged;
|
|
CM_CURSORCHANGED:
|
|
CursorChanged;
|
|
CM_SHOWINGCHANGED:
|
|
ShowingChanged;
|
|
CM_SHOWHINTCHANGED:
|
|
ShowHintChanged;
|
|
{$IFNDEF CLR}
|
|
CM_CONTROLLISTCHANGE:
|
|
if Msg.LParam <> 0 then
|
|
ControlsListChanging(TControl(Msg.WParam), True)
|
|
else
|
|
ControlsListChanged(TControl(Msg.WParam), False);
|
|
CM_CONTROLCHANGE:
|
|
if Msg.LParam = 0 then
|
|
ControlsListChanging(TControl(Msg.WParam), False)
|
|
else
|
|
ControlsListChanged(TControl(Msg.WParam), True);
|
|
{$ENDIF !CLR}
|
|
WM_SETFOCUS:
|
|
FocusSet(THandle(Msg.WParam));
|
|
WM_KILLFOCUS:
|
|
FocusKilled(THandle(Msg.WParam));
|
|
WM_SIZE, WM_MOVE:
|
|
begin
|
|
inherited WndProc(Msg);
|
|
BoundsChanged;
|
|
end;
|
|
WM_ERASEBKGND:
|
|
if Msg.WParam <> 0 then
|
|
begin
|
|
IdSaveDC := SaveDC(HDC(Msg.WParam)); // protect DC against Stock-Objects from Canvas
|
|
Canvas := TCanvas.Create;
|
|
try
|
|
Canvas.Handle := HDC(Msg.WParam);
|
|
Msg.Result := Ord(DoEraseBackground(Canvas, Msg.LParam));
|
|
finally
|
|
Canvas.Handle := 0;
|
|
Canvas.Free;
|
|
RestoreDC(HDC(Msg.WParam), IdSaveDC);
|
|
end;
|
|
end
|
|
else
|
|
inherited WndProc(Msg);
|
|
{$IFNDEF DELPHI2007_UP}
|
|
WM_PRINTCLIENT, WM_PRINT: // VCL bug fix
|
|
begin
|
|
IdSaveDC := SaveDC(HDC(Msg.WParam)); // protect DC against changes
|
|
try
|
|
inherited WndProc(Msg);
|
|
finally
|
|
RestoreDC(HDC(Msg.WParam), IdSaveDC);
|
|
end;
|
|
end;
|
|
{$ENDIF ~DELPHI2007_UP}
|
|
WM_GETDLGCODE:
|
|
begin
|
|
inherited WndProc(Msg);
|
|
DlgCodes := [dcNative] + DlgcToDlgCodes(Msg.Result);
|
|
GetDlgCode(DlgCodes);
|
|
if not (dcNative in DlgCodes) then
|
|
Msg.Result := DlgCodesToDlgc(DlgCodes);
|
|
end;
|
|
else
|
|
inherited WndProc(Msg);
|
|
end;
|
|
case Msg.Msg of // precheck message to prevent access violations on released controls
|
|
CM_MOUSEENTER, CM_MOUSELEAVE, WM_KILLFOCUS, WM_SETFOCUS, WM_NCPAINT:
|
|
if DotNetHighlighting then
|
|
HandleDotNetHighlighting(Self, Msg, MouseOver, Color);
|
|
end;
|
|
end;
|
|
end;
|
|
|
|
//============================================================================
|
|
|
|
constructor TJvExToolButton.Create(AOwner: TComponent);
|
|
begin
|
|
inherited Create(AOwner);
|
|
FHintColor := clDefault;
|
|
end;
|
|
|
|
function TJvExToolButton.BaseWndProc(Msg: Integer; WParam: Integer = 0; LParam: Longint = 0): Integer;
|
|
var
|
|
Mesg: TMessage;
|
|
begin
|
|
Mesg := CreateWMMessage(Msg, WParam, LParam);
|
|
inherited WndProc(Mesg);
|
|
Result := Mesg.Result;
|
|
end;
|
|
|
|
function TJvExToolButton.BaseWndProc(Msg: Integer; WParam: Integer; LParam: TControl): Integer;
|
|
var
|
|
Mesg: TMessage;
|
|
begin
|
|
Mesg := CreateWMMessage(Msg, WParam, LParam);
|
|
inherited WndProc(Mesg);
|
|
Result := Mesg.Result;
|
|
end;
|
|
|
|
function TJvExToolButton.BaseWndProcEx(Msg: Integer; WParam: Integer; var LParam): Integer;
|
|
var
|
|
Mesg: TStructPtrMessage;
|
|
begin
|
|
Mesg := TStructPtrMessage.Create(Msg, WParam, LParam);
|
|
try
|
|
inherited WndProc(Mesg.Msg);
|
|
finally
|
|
Result := Mesg.Msg.Result;
|
|
Mesg.Free;
|
|
end;
|
|
end;
|
|
|
|
procedure TJvExToolButton.VisibleChanged;
|
|
begin
|
|
BaseWndProc(CM_VISIBLECHANGED);
|
|
end;
|
|
|
|
procedure TJvExToolButton.EnabledChanged;
|
|
begin
|
|
BaseWndProc(CM_ENABLEDCHANGED);
|
|
end;
|
|
|
|
procedure TJvExToolButton.TextChanged;
|
|
begin
|
|
BaseWndProc(CM_TEXTCHANGED);
|
|
end;
|
|
|
|
procedure TJvExToolButton.FontChanged;
|
|
begin
|
|
BaseWndProc(CM_FONTCHANGED);
|
|
end;
|
|
|
|
procedure TJvExToolButton.ColorChanged;
|
|
begin
|
|
BaseWndProc(CM_COLORCHANGED);
|
|
end;
|
|
|
|
procedure TJvExToolButton.ParentFontChanged;
|
|
begin
|
|
BaseWndProc(CM_PARENTFONTCHANGED);
|
|
end;
|
|
|
|
procedure TJvExToolButton.ParentColorChanged;
|
|
begin
|
|
BaseWndProc(CM_PARENTCOLORCHANGED);
|
|
if Assigned(OnParentColorChange) then
|
|
OnParentColorChange(Self);
|
|
end;
|
|
|
|
procedure TJvExToolButton.ParentShowHintChanged;
|
|
begin
|
|
BaseWndProc(CM_PARENTSHOWHINTCHANGED);
|
|
end;
|
|
|
|
function TJvExToolButton.WantKey(Key: Integer; Shift: TShiftState; const KeyText: WideString): Boolean;
|
|
begin
|
|
Result := BaseWndProc(CM_DIALOGCHAR, Word(Key), ShiftStateToKeyData(Shift)) <> 0;
|
|
end;
|
|
|
|
function TJvExToolButton.HitTest(X, Y: Integer): Boolean;
|
|
begin
|
|
Result := BaseWndProc(CM_HITTEST, 0, SmallPointToLong(PointToSmallPoint(Point(X, Y)))) <> 0;
|
|
end;
|
|
|
|
function TJvExToolButton.HintShow(var HintInfo: THintInfo): Boolean;
|
|
begin
|
|
GetHintColor(HintInfo, Self, FHintColor);
|
|
if FHintWindowClass <> nil then
|
|
HintInfo.HintWindowClass := FHintWindowClass;
|
|
Result := BaseWndProcEx(CM_HINTSHOW, 0, HintInfo) <> 0;
|
|
end;
|
|
|
|
procedure TJvExToolButton.MouseEnter(AControl: TControl);
|
|
begin
|
|
FMouseOver := True;
|
|
if Assigned(FOnMouseEnter) then
|
|
FOnMouseEnter(Self);
|
|
BaseWndProc(CM_MOUSEENTER, 0, AControl);
|
|
end;
|
|
|
|
procedure TJvExToolButton.MouseLeave(AControl: TControl);
|
|
begin
|
|
FMouseOver := False;
|
|
BaseWndProc(CM_MOUSELEAVE, 0, AControl);
|
|
if Assigned(FOnMouseLeave) then
|
|
FOnMouseLeave(Self);
|
|
end;
|
|
|
|
{$IFNDEF CLR}
|
|
procedure TJvExToolButton.FocusChanged(AControl: TWinControl);
|
|
begin
|
|
BaseWndProc(CM_FOCUSCHANGED, 0, AControl);
|
|
end;
|
|
{$ENDIF !CLR}
|
|
|
|
{$IFDEF COMPILER5}
|
|
{$IFNDEF HASAUTOSIZE}
|
|
|
|
procedure TJvExToolButton.CMSetAutoSize(var Msg: TMessage);
|
|
begin
|
|
SetAutoSize(Msg.WParam <> 0);
|
|
end;
|
|
|
|
procedure TJvExToolButton.SetAutoSize(Value: Boolean);
|
|
begin
|
|
TOpenControl_SetAutoSize(Self, Value);
|
|
end;
|
|
|
|
{$ENDIF !HASAUTOSIZE}
|
|
{$ENDIF COMPILER5}
|
|
|
|
procedure TJvExToolButton.WndProc(var Msg: TMessage);
|
|
{$IFDEF CLR}
|
|
var
|
|
AHintInfo: THintInfo;
|
|
{$ENDIF CLR}
|
|
begin
|
|
if not DispatchIsDesignMsg(Self, Msg) then
|
|
case Msg.Msg of
|
|
CM_DENYSUBCLASSING:
|
|
{$IFNDEF CLR}
|
|
Msg.Result := Ord(GetInterfaceEntry(IJvDenySubClassing) <> nil);
|
|
{$ELSE}
|
|
Msg.Result := Integer(Supports(Self, IJvDenySubClassing));
|
|
{$ENDIF !CLR}
|
|
CM_DIALOGCHAR:
|
|
with TCMDialogChar{$IFDEF CLR}.Create{$ENDIF}(Msg) do
|
|
Result := Ord(WantKey(CharCode, KeyDataToShiftState(KeyData), WideChar(CharCode)));
|
|
CM_HINTSHOW:
|
|
{$IFNDEF CLR}
|
|
with TCMHintShow(Msg) do
|
|
Result := Integer(HintShow(HintInfo^));
|
|
{$ELSE}
|
|
with TCMHintShow.Create(Msg) do
|
|
begin
|
|
AHintInfo := HintInfo;
|
|
Result := Integer(HintShow(AHintInfo));
|
|
HintInfo := AHintInfo;
|
|
end;
|
|
{$ENDIF !CLR}
|
|
CM_HITTEST:
|
|
with TCMHitTest{$IFDEF CLR}.Create{$ENDIF}(Msg) do
|
|
Result := Integer(HitTest(XPos, YPos));
|
|
CM_MOUSEENTER:
|
|
MouseEnter({$IFDEF CLR}nil{$ELSE}TControl(Msg.LParam){$ENDIF});
|
|
CM_MOUSELEAVE:
|
|
MouseLeave({$IFDEF CLR}nil{$ELSE}TControl(Msg.LParam){$ENDIF});
|
|
CM_VISIBLECHANGED:
|
|
VisibleChanged;
|
|
CM_ENABLEDCHANGED:
|
|
EnabledChanged;
|
|
CM_TEXTCHANGED:
|
|
TextChanged;
|
|
CM_FONTCHANGED:
|
|
FontChanged;
|
|
CM_COLORCHANGED:
|
|
ColorChanged;
|
|
{$IFNDEF CLR}
|
|
CM_FOCUSCHANGED:
|
|
FocusChanged(TWinControl(Msg.LParam));
|
|
{$ENDIF !CLR}
|
|
CM_PARENTFONTCHANGED:
|
|
ParentFontChanged;
|
|
CM_PARENTCOLORCHANGED:
|
|
ParentColorChanged;
|
|
CM_PARENTSHOWHINTCHANGED:
|
|
ParentShowHintChanged;
|
|
else
|
|
inherited WndProc(Msg);
|
|
end;
|
|
end;
|
|
|
|
//============================================================================
|
|
|
|
{$IFDEF UNITVERSIONING}
|
|
initialization
|
|
RegisterUnitVersion(HInstance, UnitVersioning);
|
|
|
|
finalization
|
|
UnregisterUnitVersion(HInstance);
|
|
{$ENDIF UNITVERSIONING}
|
|
|
|
end.
|