📄 jvqnavigationpane.pas
字号:
TJvNavIconButton = class(TJvCustomGraphicButton)
private
FChangeLink: TChangeLink;
FImages: TCustomImageList;
FImageIndex: TImageIndex;
FButtonType: TJvNavIconButtonType;
FColors: TJvNavPanelColors;
FStyleManager: TJvNavPaneStyleManager;
FStyleLink: TJvNavStyleLink;
FParentStyleManager: Boolean;
procedure SetImages(const Value: TCustomImageList);
procedure SetImageIndex(const Value: TImageIndex);
procedure DoImagesChange(Sender: TObject);
procedure SetButtonType(const Value: TJvNavIconButtonType);
procedure SetColors(const Value: TJvNavPanelColors);
procedure DoColorsChange(Sender: TObject);
procedure SetStyleManager(const Value: TJvNavPaneStyleManager);
procedure DoStyleChange(Sender: TObject);
procedure ParentStyleManagerChanged(var Msg: TMsgStyleManagerChange); message CM_PARENTSTYLEMANAGERCHANGED;
procedure SetParentStyleManager(const Value: Boolean);
function IsColorsStored: Boolean;
protected
procedure Notification(AComponent: TComponent; Operation: TOperation); override;
procedure Paint; override;
property OnDropDownMenu;
public
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
published
property Action;
property Align;
property AllowAllUp;
property Anchors;
// property Caption;
property Constraints;
property Down;
property DragMode;
property DropDownMenu;
property GroupIndex;
property Enabled;
property Font;
property ParentFont;
property ParentShowHint;
property PopupMenu;
property ShowHint;
property Visible;
property ButtonType: TJvNavIconButtonType read FButtonType write SetButtonType;
property Colors: TJvNavPanelColors read FColors write SetColors stored IsColorsStored;
property Images: TCustomImageList read FImages write SetImages;
property ImageIndex: TImageIndex read FImageIndex write SetImageIndex;
property StyleManager: TJvNavPaneStyleManager read FStyleManager write SetStyleManager;
// (p3) must be published after StyleManager
property ParentStyleManager: Boolean read FParentStyleManager write SetParentStyleManager default True;
property Width default 22;
property Height default 22;
property OnClick;
property OnContextPopup;
property OnDragDrop;
property OnDragOver;
property OnEndDrag;
property OnMouseDown;
property OnMouseMove;
property OnMouseUp;
property OnStartDrag;
end;
TJvNavPanelToolButton = class(TJvCustomGraphicButton)
private
FChangeLink: TChangeLink;
FImages: TCustomImageList;
FImageIndex: TImageIndex;
FButtonType: TJvNavIconButtonType;
FDrawPartialMenuFrame: Boolean;
FTransparentDown: Boolean;
procedure DoImagesChange(Sender: TObject);
procedure SetButtonType(const Value: TJvNavIconButtonType);
procedure SetImageIndex(const Value: TImageIndex);
procedure SetImages(const Value: TCustomImageList);
protected
procedure Notification(AComponent: TComponent; Operation: TOperation); override;
procedure Paint; override;
procedure ActionChange(Sender: TObject; CheckDefaults: Boolean); override;
public
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
property TransparentDown: Boolean read FTransparentDown write FTransparentDown default False;
property DrawPartialMenuFrame: Boolean read FDrawPartialMenuFrame write FDrawPartialMenuFrame default False;
property Images: TCustomImageList read FImages write SetImages;
property ImageIndex: TImageIndex read FImageIndex write SetImageIndex;
property ButtonType: TJvNavIconButtonType read FButtonType write SetButtonType;
property Caption;
end;
TJvNavPanelButton = class(TJvCustomGraphicButton)
private
FImageIndex: TImageIndex;
FImages: TCustomImageList;
FColors: TJvNavPanelColors;
FStyleManager: TJvNavPaneStyleManager;
FStyleLink: TJvNavStyleLink;
FAlignment: TAlignment;
FWordWrap: Boolean;
FParentStyleManager: Boolean;
procedure SetImageIndex(const Value: TImageIndex);
procedure SetImages(const Value: TCustomImageList);
procedure SetColors(const Value: TJvNavPanelColors);
procedure DoColorsChange(Sender: TObject);
procedure SetStyleManager(const Value: TJvNavPaneStyleManager);
procedure DoStyleChange(Sender: TObject);
procedure SetAlignment(const Value: TAlignment);
procedure SetWordWrap(const Value: Boolean);
procedure ParentStyleManagerChanged(var Msg: TMsgStyleManagerChange); message CM_PARENTSTYLEMANAGERCHANGED;
procedure SetParentStyleManager(const Value: Boolean);
function IsColorsStored: Boolean;
protected
procedure Paint; override;
procedure TextChanged; override;
procedure FontChanged; override;
procedure ActionChange(Sender: TObject; CheckDefaults: Boolean); override;
procedure Notification(AComponent: TComponent; Operation: TOperation); override;
function WantKey(Key: Integer; Shift: TShiftState; const KeyText: WideString): Boolean; override;
property Alignment: TAlignment read FAlignment write SetAlignment default taLeftJustify;
property WordWrap: Boolean read FWordWrap write SetWordWrap default False;
public
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
published
property Action;
property Align;
property AllowAllUp;
property Anchors;
property Caption;
property Constraints;
property Down;
property DropDownMenu;
property DragMode;
property Enabled;
property Font;
property GroupIndex;
property HotTrack default True;
property HotTrackFont;
property HotTrackFontOptions;
property ParentFont;
property ParentShowHint;
property PopupMenu;
property ShowHint;
property Visible;
property Width default 125;
property Height default 28;
property Colors: TJvNavPanelColors read FColors write SetColors stored IsColorsStored;
property StyleManager: TJvNavPaneStyleManager read FStyleManager write SetStyleManager;
// (p3) must be published after StyleManager
property ParentStyleManager: Boolean read FParentStyleManager write SetParentStyleManager default True;
property ImageIndex: TImageIndex read FImageIndex write SetImageIndex;
property Images: TCustomImageList read FImages write SetImages;
property OnClick;
property OnContextPopup;
property OnDragDrop;
property OnDragOver;
property OnEndDrag;
property OnMouseDown;
property OnMouseMove;
property OnMouseUp;
property OnStartDrag;
end;
TJvNavPaneBackgroundImage = class(TPersistent)
private
FCenter: Boolean;
FTile: Boolean;
FTransparent: Boolean;
FProportional: Boolean;
FStretch: Boolean;
FDrawing: Boolean;
FPicture: TPicture;
FOnChange: TNotifyEvent;
procedure SetCenter(const Value: Boolean);
procedure SetPicture(const Value: TPicture);
procedure SetProportional(const Value: Boolean);
procedure SetStretch(const Value: Boolean);
procedure SetTile(const Value: Boolean);
procedure SetTransparent(const Value: Boolean);
procedure PictureChanged(Sender: TObject);
protected
procedure DrawImage(Canvas: TCanvas; ARect: TRect); virtual;
procedure Change; virtual;
function CalcRect(ADestRect: TRect): TRect;
public
constructor Create;
destructor Destroy; override;
function HasImage: Boolean;
published
property Picture: TPicture read FPicture write SetPicture;
property Stretch: Boolean read FStretch write SetStretch;
property Proportional: Boolean read FProportional write SetProportional;
property Center: Boolean read FCenter write SetCenter;
property Tile: Boolean read FTile write SetTile;
property Transparent: Boolean read FTransparent write SetTransparent;
property OnChange: TNotifyEvent read FOnChange write FOnChange;
end;
TJvNavPanelPage = class(TJvCustomPage)
private
FNavPanel: TJvNavPanelButton;
FIconButton: TJvNavIconButton;
FOnClick: TNotifyEvent;
FIconPanel: TJvIconPanel;
FStyleManager: TJvNavPaneStyleManager;
FStyleLink: TJvNavStyleLink;
FHeader: TJvNavPanelHeader;
FImageIndex: TImageIndex;
FParentStyleManager: Boolean;
FBackground: TJvNavPaneBackgroundImage;
procedure SetCaption(const Value: TCaption);
procedure SetIconic(const Value: Boolean);
procedure SetImageIndex(const Value: TImageIndex);
function GetCaption: TCaption;
function GetIconic: Boolean;
function GetImageIndex: TImageIndex;
procedure DoButtonClick(Sender: TObject);
function GetHint: string;
procedure SetHint(const Value: string);
procedure SetIconPanel(const Value: TJvIconPanel);
function GetColors: TJvNavPanelColors;
procedure SetColors(const Value: TJvNavPanelColors);
procedure SetStyleManager(const Value: TJvNavPaneStyleManager);
procedure DoStyleChange(Sender: TObject);
procedure SetAutoHeader(const Value: Boolean);
function GetAutoHeader: Boolean;
function GetAlignment: TAlignment;
function GetWordWrap: Boolean;
procedure SetAlignment(const Value: TAlignment);
procedure SetWordWrap(const Value: Boolean);
procedure ParentStyleManagerChanged(var Msg: TMsgStyleManagerChange); message CM_PARENTSTYLEMANAGERCHANGED;
procedure ParentStyleManagerChange(var Msg: TMessage); message CM_PARENTSTYLEMANAGERCHANGE;
procedure SetParentStyleManager(const Value: Boolean);
procedure SetAction(const Value: TBasicAction);
procedure SetBackground(const Value: TJvNavPaneBackgroundImage);
procedure DoBackgroundChange(Sender: TObject);
protected
procedure UpdatePageList;
function GetAction: TBasicAction;
procedure ControlsListChanged(Control: TControl; Inserting: Boolean); override;
procedure SetParent( const AParent: TWinControl); override;
procedure SetPageIndex(Value: Integer); override;
procedure Notification(AComponent: TComponent; Operation: TOperation); override;
property NavPanel: TJvNavPanelButton read FNavPanel;
property IconButton: TJvNavIconButton read FIconButton;
property IconPanel: TJvIconPanel read FIconPanel write SetIconPanel;
property Colors: TJvNavPanelColors read GetColors write SetColors;
property StyleManager: TJvNavPaneStyleManager read FStyleManager write SetStyleManager;
// (p3) must be published after StyleManager
property ParentStyleManager: Boolean read FParentStyleManager write SetParentStyleManager default True;
property Header: TJvNavPanelHeader read FHeader;
property Alignment: TAlignment read GetAlignment write SetAlignment;
property WordWrap: Boolean read GetWordWrap write SetWordWrap;
procedure ActionChange(Sender: TObject; CheckDefaults: Boolean); override;
procedure Paint; override;
public
constructor Create(AOwner: TComponent); override;
destructor Destroy; override;
property AutoHeader: Boolean read GetAutoHeader write SetAutoHeader;
published
property Action: TBasicAction read GetAction write SetAction;
property Background: TJvNavPaneBackgroundImage read FBackground write SetBackground;
property Color default clWindow;
property ParentColor default False;
property Caption: TCaption read GetCaption write SetCaption;
property DragMode;
property Iconic: Boolean read GetIconic write SetIconic default False;
property ImageIndex: TImageIndex read GetImageIndex write SetImageIndex default -1;
property Hint: string read GetHint write SetHint;
property OnClick: TNotifyEvent read FOnClick write FOnClick;
property OnContextPopup;
property OnDragDrop;
property OnDragOver;
property OnEndDrag;
property OnEnter;
property OnExit;
property OnKeyDown;
property OnKeyPress;
property OnKeyUp;
property OnMouseDown;
property OnMouseEnter;
property OnMouseLeave;
property OnMouseMove;
property OnMouseUp;
property OnMouseWheel;
property OnMouseWheelDown;
property OnMouseWheelUp;
property OnResize;
property OnShow;
property OnStartDrag;
end;
TJvCustomNavPaneToolPanel = class;
TJvNavPaneToolButton = class(TCollectionItem)
private
FRealButton: TJvNavPanelToolButton;
procedure SetImageIndex(const Value: TImageIndex);
procedure SetEnabled(const Value: Boolean);
procedure SetAction(const Value: TBasicAction);
procedure SetHint(const Value: string);
function GetAction: TBasicAction;
function GetEnabled: Boolean;
function GetHint: string;
function GetImageIndex: TImageIndex;
public
procedure Assign(Source: TPersistent); override;
constructor Create(Collection: TCollection); override;
destructor Destroy; override;
property Button: TJvNavPanelToolButton read FRealButton;
published
property Action: TBasicAction read GetAction write SetAction;
property Hint: string read GetHint write SetHint;
property ImageIndex: TImageIndex read GetImageIndex write SetImageIndex default -1;
property Enabled: Boolean read GetEnabled write SetEnabled default True;
end;
TJvNavPaneToolButtons = class(TOwnedCollection)
private
FPanel: TJvCustomNavPaneToolPanel;
function GetItem(Index: Integer): TJvNavPaneToolButton;
procedure SetItem(Index: Integer; const Value: TJvNavPaneToolButton);
protected
procedure Update(Item: TCollectionItem); override;
public
constructor Create(AOwner: TJvCustomNavPaneToolPanel);
function Add: TJvNavPaneToolButton;
property Items[Index: Integer]: TJvNavPaneToolButton read GetItem write SetItem; default;
end;
TJvNavPaneToolButtonClick = procedure(Sender: TObject; Index: Integer) of object;
TJvToolPanelHitTestInfo = (phtNowhere, phtAbove, phtBelow, phtToLeft, phtToRight, phtGrabber, phtHeader, phtClient);
TJvToolPanelHitTestInfos = set of TJvToolPanelHitTestInfo;
TJvCustomNavPaneToolPanel = class(TJvCustomControl)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -