home *** CD-ROM | disk | FTP | other *** search
- unit UpDoImpl;
-
- interface
-
- uses
- Windows, ActiveX, Classes, Controls, Graphics, Menus, Forms, StdCtrls,
- ComServ, StdVCL, AXCtrls, DelC_TLB, ComCtrls;
-
- type
- TUpDownX = class(TActiveXControl, IUpDownX)
- private
- { Private declarations }
- FDelphiControl: TUpDown;
- FEvents: IUpDownXEvents;
- procedure ChangingEvent(Sender: TObject; var AllowChange: Boolean);
- procedure ClickEvent(Sender: TObject; Button: TUDBtnType);
- protected
- { Protected declarations }
- procedure InitializeControl; override;
- procedure EventSinkChanged(const EventSink: IUnknown); override;
- procedure DefinePropertyPages(DefinePropertyPage: TDefinePropertyPage); override;
- function Get_AlignButton: TxUDAlignButton; safecall;
- function Get_ArrowKeys: WordBool; safecall;
- function Get_Cursor: Smallint; safecall;
- function Get_Enabled: WordBool; safecall;
- function Get_Increment: Integer; safecall;
- function Get_Max: Smallint; safecall;
- function Get_Min: Smallint; safecall;
- function Get_Orientation: TxUDOrientation; safecall;
- function Get_Position: Smallint; safecall;
- function Get_Thousands: WordBool; safecall;
- function Get_Visible: WordBool; safecall;
- function Get_Wrap: WordBool; safecall;
- procedure AboutBox; safecall;
- procedure Set_AlignButton(Value: TxUDAlignButton); safecall;
- procedure Set_ArrowKeys(Value: WordBool); safecall;
- procedure Set_Cursor(Value: Smallint); safecall;
- procedure Set_Enabled(Value: WordBool); safecall;
- procedure Set_Increment(Value: Integer); safecall;
- procedure Set_Max(Value: Smallint); safecall;
- procedure Set_Min(Value: Smallint); safecall;
- procedure Set_Orientation(Value: TxUDOrientation); safecall;
- procedure Set_Position(Value: Smallint); safecall;
- procedure Set_Thousands(Value: WordBool); safecall;
- procedure Set_Visible(Value: WordBool); safecall;
- procedure Set_Wrap(Value: WordBool); safecall;
- end;
-
- implementation
-
- uses About34;
-
- { TUpDownX }
-
- procedure TUpDownX.InitializeControl;
- begin
- FDelphiControl := Control as TUpDown;
- FDelphiControl.OnChanging := ChangingEvent;
- FDelphiControl.OnClick := ClickEvent;
- end;
-
- procedure TUpDownX.EventSinkChanged(const EventSink: IUnknown);
- begin
- FEvents := EventSink as IUpDownXEvents;
- end;
-
- procedure TUpDownX.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_UpDownXPage); }
- end;
-
- function TUpDownX.Get_AlignButton: TxUDAlignButton;
- begin
- Result := Ord(FDelphiControl.AlignButton);
- end;
-
- function TUpDownX.Get_ArrowKeys: WordBool;
- begin
- Result := FDelphiControl.ArrowKeys;
- end;
-
- function TUpDownX.Get_Cursor: Smallint;
- begin
- Result := Smallint(FDelphiControl.Cursor);
- end;
-
- function TUpDownX.Get_Enabled: WordBool;
- begin
- Result := FDelphiControl.Enabled;
- end;
-
- function TUpDownX.Get_Increment: Integer;
- begin
- Result := FDelphiControl.Increment;
- end;
-
- function TUpDownX.Get_Max: Smallint;
- begin
- Result := FDelphiControl.Max;
- end;
-
- function TUpDownX.Get_Min: Smallint;
- begin
- Result := FDelphiControl.Min;
- end;
-
- function TUpDownX.Get_Orientation: TxUDOrientation;
- begin
- Result := Ord(FDelphiControl.Orientation);
- end;
-
- function TUpDownX.Get_Position: Smallint;
- begin
- Result := FDelphiControl.Position;
- end;
-
- function TUpDownX.Get_Thousands: WordBool;
- begin
- Result := FDelphiControl.Thousands;
- end;
-
- function TUpDownX.Get_Visible: WordBool;
- begin
- Result := FDelphiControl.Visible;
- end;
-
- function TUpDownX.Get_Wrap: WordBool;
- begin
- Result := FDelphiControl.Wrap;
- end;
-
- procedure TUpDownX.AboutBox;
- begin
- ShowUpDownXAbout;
- end;
-
- procedure TUpDownX.Set_AlignButton(Value: TxUDAlignButton);
- begin
- FDelphiControl.AlignButton := TUDAlignButton(Value);
- end;
-
- procedure TUpDownX.Set_ArrowKeys(Value: WordBool);
- begin
- FDelphiControl.ArrowKeys := Value;
- end;
-
- procedure TUpDownX.Set_Cursor(Value: Smallint);
- begin
- FDelphiControl.Cursor := TCursor(Value);
- end;
-
- procedure TUpDownX.Set_Enabled(Value: WordBool);
- begin
- FDelphiControl.Enabled := Value;
- end;
-
- procedure TUpDownX.Set_Increment(Value: Integer);
- begin
- FDelphiControl.Increment := Value;
- end;
-
- procedure TUpDownX.Set_Max(Value: Smallint);
- begin
- FDelphiControl.Max := Value;
- end;
-
- procedure TUpDownX.Set_Min(Value: Smallint);
- begin
- FDelphiControl.Min := Value;
- end;
-
- procedure TUpDownX.Set_Orientation(Value: TxUDOrientation);
- begin
- FDelphiControl.Orientation := TUDOrientation(Value);
- end;
-
- procedure TUpDownX.Set_Position(Value: Smallint);
- begin
- FDelphiControl.Position := Value;
- end;
-
- procedure TUpDownX.Set_Thousands(Value: WordBool);
- begin
- FDelphiControl.Thousands := Value;
- end;
-
- procedure TUpDownX.Set_Visible(Value: WordBool);
- begin
- FDelphiControl.Visible := Value;
- end;
-
- procedure TUpDownX.Set_Wrap(Value: WordBool);
- begin
- FDelphiControl.Wrap := Value;
- end;
-
- procedure TUpDownX.ChangingEvent(Sender: TObject;
- var AllowChange: Boolean);
- var
- TempAllowChange: WordBool;
- begin
- TempAllowChange := WordBool(AllowChange);
- if FEvents <> nil then FEvents.OnChanging(TempAllowChange);
- AllowChange := Boolean(TempAllowChange);
- end;
-
- procedure TUpDownX.ClickEvent(Sender: TObject; Button: TUDBtnType);
- begin
- if FEvents <> nil then FEvents.OnClick(TxUDBtnType(Button));
- end;
-
- initialization
- TActiveXControlFactory.Create(
- ComServer,
- TUpDownX,
- TUpDown,
- Class_UpDownX,
- 34,
- '{FA7B8808-9ED7-11D0-AA40-444553540000}',
- 0);
- end.
-