Разработка технологии создания дистанционных курсов на примере курса "Администрирование DB2", страница 47

    procedure Set_PrintScale(Value: TxPrintScale); safecall;

    procedure Set_Scaled(Value: WordBool); safecall;

    procedure Set_ScreenSnap(Value: WordBool); safecall;

    procedure Set_SnapBuffer(Value: Integer); safecall;

    procedure Set_Visible(Value: WordBool); safecall;

  public

    { Public declarations }

    procedure Initialize; override;

  published

    property tries:integer read ftries write SetTies;

  end;

implementation

{$R *.DFM}

{ TSQLFormX }

procedure TSQLFormX.SetTies(tr:integer);

begin

 ftries:=tr;

 Label5.Caption:=IntToStr(ftries);

end;

procedure TSQLFormX.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_SQLFormXPage); }

end;

procedure TSQLFormX.EventSinkChanged(const EventSink: IUnknown);

begin

  FEvents := EventSink as ISQLFormXEvents;

  inherited EventSinkChanged(EventSink);

end;

procedure TSQLFormX.Initialize;

begin

  inherited Initialize;

  OnActivate := ActivateEvent;

  OnClick := ClickEvent;

  OnCreate := CreateEvent;

  OnDblClick := DblClickEvent;

  OnDeactivate := DeactivateEvent;

  OnDestroy := DestroyEvent;

  OnKeyPress := KeyPressEvent;

  OnPaint := PaintEvent;

end;

function TSQLFormX.Get_Active: WordBool;

begin

  Result := Active;

end;

function TSQLFormX.Get_AlignDisabled: WordBool;

begin

  Result := AlignDisabled;

end;

function TSQLFormX.Get_AutoScroll: WordBool;

begin

  Result := AutoScroll;

end;

function TSQLFormX.Get_AutoSize: WordBool;

begin

  Result := AutoSize;

end;

function TSQLFormX.Get_AxBorderStyle: TxActiveFormBorderStyle;

begin

  Result := Ord(AxBorderStyle);

end;

function TSQLFormX.Get_Caption: WideString;

begin

  Result := WideString(Caption);

end;

function TSQLFormX.Get_Color: OLE_COLOR;

begin

  Result := OLE_COLOR(Color);

end;

function TSQLFormX.Get_DoubleBuffered: WordBool;

begin

  Result := DoubleBuffered;

end;

function TSQLFormX.Get_DropTarget: WordBool;

begin

  Result := DropTarget;

end;

function TSQLFormX.Get_Enabled: WordBool;

begin

  Result := Enabled;

end;

function TSQLFormX.Get_Font: IFontDisp;

begin

  GetOleFont(Font, Result);

end;

function TSQLFormX.Get_HelpFile: WideString;

begin

  Result := WideString(HelpFile);

end;

function TSQLFormX.Get_KeyPreview: WordBool;

begin

  Result := KeyPreview;

end;

function TSQLFormX.Get_PixelsPerInch: Integer;

begin

  Result := PixelsPerInch;

end;

function TSQLFormX.Get_PrintScale: TxPrintScale;

begin

  Result := Ord(PrintScale);

end;

function TSQLFormX.Get_Scaled: WordBool;

begin

  Result := Scaled;

end;

function TSQLFormX.Get_ScreenSnap: WordBool;

begin

  Result := ScreenSnap;

end;

function TSQLFormX.Get_SnapBuffer: Integer;

begin

  Result := SnapBuffer;

end;

function TSQLFormX.Get_Visible: WordBool;

begin

  Result := Visible;

end;

function TSQLFormX.Get_VisibleDockClientCount: Integer;

begin

  Result := VisibleDockClientCount;

end;

procedure TSQLFormX._Set_Font(var Value: IFontDisp);

begin

  SetOleFont(Font, Value);

end;

procedure TSQLFormX.ActivateEvent(Sender: TObject);

begin

  if FEvents <> nil then FEvents.OnActivate;

end;

procedure TSQLFormX.ClickEvent(Sender: TObject);

begin

  if FEvents <> nil then FEvents.OnClick;

end;

procedure TSQLFormX.CreateEvent(Sender: TObject);

begin

  if FEvents <> nil then FEvents.OnCreate;

end;

procedure TSQLFormX.DblClickEvent(Sender: TObject);

begin

  if FEvents <> nil then FEvents.OnDblClick;

end;

procedure TSQLFormX.DeactivateEvent(Sender: TObject);

begin

  if FEvents <> nil then FEvents.OnDeactivate;

end;

procedure TSQLFormX.DestroyEvent(Sender: TObject);

begin

  if FEvents <> nil then FEvents.OnDestroy;

end;

procedure TSQLFormX.KeyPressEvent(Sender: TObject; var Key: Char);

var

  TempKey: Smallint;

begin

  TempKey := Smallint(Key);

  if FEvents <> nil then FEvents.OnKeyPress(TempKey);