📄 xcontrol1_tlb.~pas
字号:
// *********************************************************************//
// DispIntf: ICalendarXEvents
// Flags: (4096) Dispatchable
// GUID: {D2ABC20B-0636-4878-8853-D022ADC5F873}
// *********************************************************************//
ICalendarXEvents = dispinterface
['{D2ABC20B-0636-4878-8853-D022ADC5F873}']
procedure OnClick; dispid 201;
procedure OnChange; dispid 202;
procedure OnDblClick; dispid 203;
procedure OnKeyPress(var Key: Smallint); dispid 204;
end;
// *********************************************************************//
// OLE Control Proxy class declaration
// Control Name : TCalendarX
// Help String : CalendarX Control
// Default Interface: ICalendarX
// Def. Intf. DISP? : No
// Event Interface: ICalendarXEvents
// TypeFlags : (38) CanCreate Licensed Control
// *********************************************************************//
TCalendarXOnKeyPress = procedure(ASender: TObject; var Key: Smallint) of object;
TCalendarX = class(TOleControl)
private
FOnClick: TNotifyEvent;
FOnChange: TNotifyEvent;
FOnDblClick: TNotifyEvent;
FOnKeyPress: TCalendarXOnKeyPress;
FIntf: ICalendarX;
function GetControlInterface: ICalendarX;
protected
procedure CreateControl;
procedure InitControlData; override;
public
procedure NextMonth;
procedure NextYear;
procedure PrevMonth;
procedure PrevYear;
procedure UpdateCalendar;
function DrawTextBiDiModeFlagsReadingOnly: Integer;
procedure InitiateAction;
function IsRightToLeft: WordBool;
function UseRightToLeftReading: WordBool;
function UseRightToLeftScrollBar: WordBool;
procedure SetSubComponent(IsSubComponent: WordBool);
procedure AboutBox;
property ControlInterface: ICalendarX read GetControlInterface;
property DefaultInterface: ICalendarX read GetControlInterface;
property CalendarDate: Double index 201 read GetDoubleProp write SetDoubleProp;
property DoubleBuffered: WordBool index 220 read GetWordBoolProp write SetWordBoolProp;
property AlignDisabled: WordBool index 221 read GetWordBoolProp;
property VisibleDockClientCount: Integer index 222 read GetIntegerProp;
published
property Anchors;
property ParentFont;
property TabStop;
property Align;
property ParentShowHint;
property PopupMenu;
property ShowHint;
property TabOrder;
property OnDragDrop;
property OnDragOver;
property OnEndDrag;
property OnEnter;
property OnExit;
property OnStartDrag;
property BorderStyle: TOleEnum index 207 read GetTOleEnumProp write SetTOleEnumProp stored False;
property Color: TColor index -501 read GetTColorProp write SetTColorProp stored False;
property Ctl3D: WordBool index 208 read GetWordBoolProp write SetWordBoolProp stored False;
property Day: Integer index 209 read GetIntegerProp write SetIntegerProp stored False;
property DragCursor: Smallint index 210 read GetSmallintProp write SetSmallintProp stored False;
property DragMode: TOleEnum index 211 read GetTOleEnumProp write SetTOleEnumProp stored False;
property Enabled: WordBool index -514 read GetWordBoolProp write SetWordBoolProp stored False;
property Font: TFont index -512 read GetTFontProp write SetTFontProp stored False;
property GridLineWidth: Integer index 212 read GetIntegerProp write SetIntegerProp stored False;
property Month: Integer index 213 read GetIntegerProp write SetIntegerProp stored False;
property ParentColor: WordBool index 214 read GetWordBoolProp write SetWordBoolProp stored False;
property ReadOnly: WordBool index 215 read GetWordBoolProp write SetWordBoolProp stored False;
property StartOfWeek: Smallint index 216 read GetSmallintProp write SetSmallintProp stored False;
property UseCurrentDate: WordBool index 217 read GetWordBoolProp write SetWordBoolProp stored False;
property Visible: WordBool index 218 read GetWordBoolProp write SetWordBoolProp stored False;
property Year: Integer index 219 read GetIntegerProp write SetIntegerProp stored False;
property OnClick: TNotifyEvent read FOnClick write FOnClick;
property OnChange: TNotifyEvent read FOnChange write FOnChange;
property OnDblClick: TNotifyEvent read FOnDblClick write FOnDblClick;
property OnKeyPress: TCalendarXOnKeyPress read FOnKeyPress write FOnKeyPress;
end;
procedure Register;
resourcestring
dtlServerPage = 'Servers';
dtlOcxPage = 'ActiveX';
implementation
uses ComObj;
procedure TCalendarX.InitControlData;
const
CEventDispIDs: array [0..3] of DWORD = (
$000000C9, $000000CA, $000000CB, $000000CC);
CLicenseKey: array[0..38] of Word = ( $007B, $0035, $0034, $0039, $0043, $0046, $0042, $0041, $0045, $002D, $0041
, $0042, $0042, $0033, $002D, $0034, $0041, $0031, $0032, $002D, $0038
, $0032, $0045, $0034, $002D, $0036, $0041, $0033, $0041, $0038, $0038
, $0034, $0033, $0038, $0039, $0034, $0037, $007D, $0000);
CTFontIDs: array [0..0] of DWORD = (
$FFFFFE00);
CControlData: TControlData2 = (
ClassID: '{A66AC7FA-E831-42D4-9E0F-6CC868262B08}';
EventIID: '{D2ABC20B-0636-4878-8853-D022ADC5F873}';
EventCount: 4;
EventDispIDs: @CEventDispIDs;
LicenseKey: @CLicenseKey;
Flags: $0000000D;
Version: 401;
FontCount: 1;
FontIDs: @CTFontIDs);
begin
ControlData := @CControlData;
TControlData2(CControlData).FirstEventOfs := Cardinal(@@FOnClick) - Cardinal(Self);
end;
procedure TCalendarX.CreateControl;
procedure DoCreate;
begin
FIntf := IUnknown(OleObject) as ICalendarX;
end;
begin
if FIntf = nil then DoCreate;
end;
function TCalendarX.GetControlInterface: ICalendarX;
begin
CreateControl;
Result := FIntf;
end;
procedure TCalendarX.NextMonth;
begin
DefaultInterface.NextMonth;
end;
procedure TCalendarX.NextYear;
begin
DefaultInterface.NextYear;
end;
procedure TCalendarX.PrevMonth;
begin
DefaultInterface.PrevMonth;
end;
procedure TCalendarX.PrevYear;
begin
DefaultInterface.PrevYear;
end;
procedure TCalendarX.UpdateCalendar;
begin
DefaultInterface.UpdateCalendar;
end;
function TCalendarX.DrawTextBiDiModeFlagsReadingOnly: Integer;
begin
Result := DefaultInterface.DrawTextBiDiModeFlagsReadingOnly;
end;
procedure TCalendarX.InitiateAction;
begin
DefaultInterface.InitiateAction;
end;
function TCalendarX.IsRightToLeft: WordBool;
begin
Result := DefaultInterface.IsRightToLeft;
end;
function TCalendarX.UseRightToLeftReading: WordBool;
begin
Result := DefaultInterface.UseRightToLeftReading;
end;
function TCalendarX.UseRightToLeftScrollBar: WordBool;
begin
Result := DefaultInterface.UseRightToLeftScrollBar;
end;
procedure TCalendarX.SetSubComponent(IsSubComponent: WordBool);
begin
DefaultInterface.SetSubComponent(IsSubComponent);
end;
procedure TCalendarX.AboutBox;
begin
DefaultInterface.AboutBox;
end;
procedure Register;
begin
RegisterComponents(dtlOcxPage, [TCalendarX]);
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -