home *** CD-ROM | disk | FTP | other *** search
- unit SpnBImpl;
-
- interface
-
- uses
- Windows, ActiveX, Classes, Controls, Graphics, Menus, Forms, StdCtrls,
- ComServ, StdVCL, AXCtrls, DelC_TLB, Spin;
-
- type
- TSpinButtonX = class(TActiveXControl, ISpinButtonX)
- private
- { Private declarations }
- FDelphiControl: TSpinButton;
- FEvents: ISpinButtonXEvents;
- procedure DownClickEvent(Sender: TObject);
- procedure UpClickEvent(Sender: TObject);
- protected
- { Protected declarations }
- procedure InitializeControl; override;
- procedure EventSinkChanged(const EventSink: IUnknown); override;
- procedure DefinePropertyPages(DefinePropertyPage: TDefinePropertyPage); override;
- function Get_Ctl3D: WordBool; safecall;
- function Get_Cursor: Smallint; safecall;
- function Get_DownNumGlyphs: Smallint; safecall;
- function Get_DragCursor: Smallint; safecall;
- function Get_DragMode: TxDragMode; safecall;
- function Get_Enabled: WordBool; safecall;
- function Get_ParentCtl3D: WordBool; safecall;
- function Get_UpNumGlyphs: Smallint; safecall;
- function Get_Visible: WordBool; safecall;
- procedure AboutBox; safecall;
- procedure Set_Ctl3D(Value: WordBool); safecall;
- procedure Set_Cursor(Value: Smallint); safecall;
- procedure Set_DownNumGlyphs(Value: Smallint); safecall;
- procedure Set_DragCursor(Value: Smallint); safecall;
- procedure Set_DragMode(Value: TxDragMode); safecall;
- procedure Set_Enabled(Value: WordBool); safecall;
- procedure Set_ParentCtl3D(Value: WordBool); safecall;
- procedure Set_UpNumGlyphs(Value: Smallint); safecall;
- procedure Set_Visible(Value: WordBool); safecall;
- end;
-
- implementation
-
- uses About26;
-
- { TSpinButtonX }
-
- procedure TSpinButtonX.InitializeControl;
- begin
- FDelphiControl := Control as TSpinButton;
- FDelphiControl.OnDownClick := DownClickEvent;
- FDelphiControl.OnUpClick := UpClickEvent;
- end;
-
- procedure TSpinButtonX.EventSinkChanged(const EventSink: IUnknown);
- begin
- FEvents := EventSink as ISpinButtonXEvents;
- end;
-
- procedure TSpinButtonX.DefinePropertyPages(DefinePropertyPage: TDefinePropertyPage);
- begin
- { Define property pages here. Property pages are defined by calling
- DefinePropertyPage with the class id of the page. For example,
- DefinePropertyPage(Class_SpinButtonXPage); }
- end;
-
- function TSpinButtonX.Get_Ctl3D: WordBool;
- begin
- Result := FDelphiControl.Ctl3D;
- end;
-
- function TSpinButtonX.Get_Cursor: Smallint;
- begin
- Result := Smallint(FDelphiControl.Cursor);
- end;
-
- function TSpinButtonX.Get_DownNumGlyphs: Smallint;
- begin
- Result := Smallint(FDelphiControl.DownNumGlyphs);
- end;
-
- function TSpinButtonX.Get_DragCursor: Smallint;
- begin
- Result := Smallint(FDelphiControl.DragCursor);
- end;
-
- function TSpinButtonX.Get_DragMode: TxDragMode;
- begin
- Result := Ord(FDelphiControl.DragMode);
- end;
-
- function TSpinButtonX.Get_Enabled: WordBool;
- begin
- Result := FDelphiControl.Enabled;
- end;
-
- function TSpinButtonX.Get_ParentCtl3D: WordBool;
- begin
- Result := FDelphiControl.ParentCtl3D;
- end;
-
- function TSpinButtonX.Get_UpNumGlyphs: Smallint;
- begin
- Result := Smallint(FDelphiControl.UpNumGlyphs);
- end;
-
- function TSpinButtonX.Get_Visible: WordBool;
- begin
- Result := FDelphiControl.Visible;
- end;
-
- procedure TSpinButtonX.AboutBox;
- begin
- ShowSpinButtonXAbout;
- end;
-
- procedure TSpinButtonX.Set_Ctl3D(Value: WordBool);
- begin
- FDelphiControl.Ctl3D := Value;
- end;
-
- procedure TSpinButtonX.Set_Cursor(Value: Smallint);
- begin
- FDelphiControl.Cursor := TCursor(Value);
- end;
-
- procedure TSpinButtonX.Set_DownNumGlyphs(Value: Smallint);
- begin
- FDelphiControl.DownNumGlyphs := TNumGlyphs(Value);
- end;
-
- procedure TSpinButtonX.Set_DragCursor(Value: Smallint);
- begin
- FDelphiControl.DragCursor := TCursor(Value);
- end;
-
- procedure TSpinButtonX.Set_DragMode(Value: TxDragMode);
- begin
- FDelphiControl.DragMode := TDragMode(Value);
- end;
-
- procedure TSpinButtonX.Set_Enabled(Value: WordBool);
- begin
- FDelphiControl.Enabled := Value;
- end;
-
- procedure TSpinButtonX.Set_ParentCtl3D(Value: WordBool);
- begin
- FDelphiControl.ParentCtl3D := Value;
- end;
-
- procedure TSpinButtonX.Set_UpNumGlyphs(Value: Smallint);
- begin
- FDelphiControl.UpNumGlyphs := TNumGlyphs(Value);
- end;
-
- procedure TSpinButtonX.Set_Visible(Value: WordBool);
- begin
- FDelphiControl.Visible := Value;
- end;
-
- procedure TSpinButtonX.DownClickEvent(Sender: TObject);
- begin
- if FEvents <> nil then FEvents.OnDownClick;
- end;
-
- procedure TSpinButtonX.UpClickEvent(Sender: TObject);
- begin
- if FEvents <> nil then FEvents.OnUpClick;
- end;
-
- initialization
- TActiveXControlFactory.Create(
- ComServer,
- TSpinButtonX,
- TSpinButton,
- Class_SpinButtonX,
- 26,
- '{FA7B85FF-9ED7-11D0-AA40-444553540000}',
- 0);
- end.
-