home *** CD-ROM | disk | FTP | other *** search
- unit PBarImpl;
-
- interface
-
- uses
- Windows, ActiveX, Classes, Controls, Graphics, Menus, Forms, StdCtrls,
- ComServ, StdVCL, AXCtrls, DelC_TLB, ComCtrls;
-
- type
- TProgressBarX = class(TActiveXControl, IProgressBarX)
- private
- { Private declarations }
- FDelphiControl: TProgressBar;
- FEvents: IProgressBarXEvents;
- protected
- { Protected declarations }
- procedure InitializeControl; override;
- procedure EventSinkChanged(const EventSink: IUnknown); override;
- procedure DefinePropertyPages(DefinePropertyPage: TDefinePropertyPage); override;
- function Get_Cursor: Smallint; safecall;
- function Get_DragCursor: Smallint; safecall;
- function Get_DragMode: TxDragMode; safecall;
- function Get_Enabled: WordBool; safecall;
- function Get_Max: Integer; safecall;
- function Get_Min: Integer; safecall;
- function Get_Position: Integer; safecall;
- function Get_Step: Integer; safecall;
- function Get_Visible: WordBool; safecall;
- procedure AboutBox; safecall;
- procedure Set_Cursor(Value: Smallint); safecall;
- procedure Set_DragCursor(Value: Smallint); safecall;
- procedure Set_DragMode(Value: TxDragMode); safecall;
- procedure Set_Enabled(Value: WordBool); safecall;
- procedure Set_Max(Value: Integer); safecall;
- procedure Set_Min(Value: Integer); safecall;
- procedure Set_Position(Value: Integer); safecall;
- procedure Set_Step(Value: Integer); safecall;
- procedure Set_Visible(Value: WordBool); safecall;
- procedure StepBy(Delta: Integer); safecall;
- procedure StepIt; safecall;
- end;
-
- implementation
-
- uses About20;
-
- { TProgressBarX }
-
- procedure TProgressBarX.InitializeControl;
- begin
- FDelphiControl := Control as TProgressBar;
- end;
-
- procedure TProgressBarX.EventSinkChanged(const EventSink: IUnknown);
- begin
- FEvents := EventSink as IProgressBarXEvents;
- end;
-
- procedure TProgressBarX.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_ProgressBarXPage); }
- end;
-
- function TProgressBarX.Get_Cursor: Smallint;
- begin
- Result := Smallint(FDelphiControl.Cursor);
- end;
-
- function TProgressBarX.Get_DragCursor: Smallint;
- begin
- Result := Smallint(FDelphiControl.DragCursor);
- end;
-
- function TProgressBarX.Get_DragMode: TxDragMode;
- begin
- Result := Ord(FDelphiControl.DragMode);
- end;
-
- function TProgressBarX.Get_Enabled: WordBool;
- begin
- Result := FDelphiControl.Enabled;
- end;
-
- function TProgressBarX.Get_Max: Integer;
- begin
- Result := FDelphiControl.Max;
- end;
-
- function TProgressBarX.Get_Min: Integer;
- begin
- Result := FDelphiControl.Min;
- end;
-
- function TProgressBarX.Get_Position: Integer;
- begin
- Result := FDelphiControl.Position;
- end;
-
- function TProgressBarX.Get_Step: Integer;
- begin
- Result := FDelphiControl.Step;
- end;
-
- function TProgressBarX.Get_Visible: WordBool;
- begin
- Result := FDelphiControl.Visible;
- end;
-
- procedure TProgressBarX.AboutBox;
- begin
- ShowProgressBarXAbout;
- end;
-
- procedure TProgressBarX.Set_Cursor(Value: Smallint);
- begin
- FDelphiControl.Cursor := TCursor(Value);
- end;
-
- procedure TProgressBarX.Set_DragCursor(Value: Smallint);
- begin
- FDelphiControl.DragCursor := TCursor(Value);
- end;
-
- procedure TProgressBarX.Set_DragMode(Value: TxDragMode);
- begin
- FDelphiControl.DragMode := TDragMode(Value);
- end;
-
- procedure TProgressBarX.Set_Enabled(Value: WordBool);
- begin
- FDelphiControl.Enabled := Value;
- end;
-
- procedure TProgressBarX.Set_Max(Value: Integer);
- begin
- FDelphiControl.Max := Value;
- end;
-
- procedure TProgressBarX.Set_Min(Value: Integer);
- begin
- FDelphiControl.Min := Value;
- end;
-
- procedure TProgressBarX.Set_Position(Value: Integer);
- begin
- FDelphiControl.Position := Value;
- end;
-
- procedure TProgressBarX.Set_Step(Value: Integer);
- begin
- FDelphiControl.Step := Value;
- end;
-
- procedure TProgressBarX.Set_Visible(Value: WordBool);
- begin
- FDelphiControl.Visible := Value;
- end;
-
- procedure TProgressBarX.StepBy(Delta: Integer);
- begin
-
- end;
-
- procedure TProgressBarX.StepIt;
- begin
- FDelphiControl.StepIt;
- end;
-
- initialization
- TActiveXControlFactory.Create(
- ComServer,
- TProgressBarX,
- TProgressBar,
- Class_ProgressBarX,
- 20,
- '{FA7B84D1-9ED7-11D0-AA40-444553540000}',
- 0);
- end.
-