home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 2001 October
/
Chip_2001-10_cd1.bin
/
zkuste
/
delphi
/
nastroje
/
d23456
/
SPLBASE.ZIP
/
Splbase
/
Activex
/
SplBaseImpl1.pas
< prev
next >
Wrap
Pascal/Delphi Source File
|
2001-07-12
|
10KB
|
368 lines
unit SplBaseImpl1;
interface
uses
Windows, ActiveX, Classes, Controls, Graphics, Menus, Forms, StdCtrls,
ComServ, StdVCL, AXCtrls, SplBaseXControl1_TLB, splx;
type
TSplBaseX = class(TActiveXControl, ISplBaseX)
private
{ Private declarations }
FDelphiControl: tsplx;
FEvents: ISplBaseXEvents;
procedure CreateErrorEvent(Sender: TObject);
procedure OpenErrorEvent(Sender: TObject);
procedure ReadErrorEvent(Sender: TObject);
procedure WriteErrorEvent(Sender: TObject);
protected
{ Protected declarations }
procedure DefinePropertyPages(DefinePropertyPage: TDefinePropertyPage); override;
procedure EventSinkChanged(const EventSink: IUnknown); override;
procedure InitializeControl; override;
function activedb: WordBool; safecall;
function activerec: WordBool; safecall;
function addfield(const recdat: WideString; pos: Integer): WordBool;
safecall;
function addrec(const idx: WideString): WordBool; safecall;
function ClassNameIs(const Name: WideString): WordBool; safecall;
function createspl(const splname: WideString): WordBool; safecall;
function dbempty: WordBool; safecall;
function delrec: WordBool; safecall;
function DrawTextBiDiModeFlags(Flags: Integer): Integer; safecall;
function DrawTextBiDiModeFlagsReadingOnly: Integer; safecall;
function firstrec: WordBool; safecall;
function Get_BiDiMode: TxBiDiMode; safecall;
function Get_CurrentDB: WideString; safecall;
function Get_Cursor: Smallint; safecall;
function Get_DoubleBuffered: WordBool; safecall;
function Get_Enabled: WordBool; safecall;
function Get_ErrorNumber: Integer; safecall;
function Get_ErrorString: WideString; safecall;
function Get_FieldCount: Integer; safecall;
function Get_Reclimit: Integer; safecall;
function Get_Visible: WordBool; safecall;
function GetControlsAlignment: TxAlignment; safecall;
function getfield(pos: Integer): WideString; safecall;
function getrec(const idx: WideString): WordBool; safecall;
function initbase: WordBool; safecall;
function initspl: WordBool; safecall;
function IsRightToLeft: WordBool; safecall;
function lastrec: WordBool; safecall;
function modrec(const idx: WideString): WordBool; safecall;
function nextrec: WordBool; safecall;
function openspl(const splname: WideString): WordBool; safecall;
function prevrec: WordBool; safecall;
function reccount: Integer; safecall;
function releasespl: WordBool; safecall;
function setspl(const spldat: WideString): WordBool; safecall;
function UseRightToLeftAlignment: WordBool; safecall;
function UseRightToLeftReading: WordBool; safecall;
function UseRightToLeftScrollBar: WordBool; safecall;
procedure FlipChildren(AllLevels: WordBool); safecall;
procedure InitiateAction; safecall;
procedure Set_BiDiMode(Value: TxBiDiMode); safecall;
procedure Set_CurrentDB(const Value: WideString); safecall;
procedure Set_Cursor(Value: Smallint); safecall;
procedure Set_DoubleBuffered(Value: WordBool); safecall;
procedure Set_Enabled(Value: WordBool); safecall;
procedure Set_Reclimit(Value: Integer); safecall;
procedure Set_Visible(Value: WordBool); safecall;
end;
implementation
uses ComObj;
{ TSplBaseX }
procedure TSplBaseX.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_SplBaseXPage); }
end;
procedure TSplBaseX.EventSinkChanged(const EventSink: IUnknown);
begin
FEvents := EventSink as ISplBaseXEvents;
end;
procedure TSplBaseX.InitializeControl;
begin
FDelphiControl := Control as tsplx;
FDelphiControl.OnCreateError := CreateErrorEvent;
FDelphiControl.OnOpenError := OpenErrorEvent;
FDelphiControl.OnReadError := ReadErrorEvent;
FDelphiControl.OnWriteError := WriteErrorEvent;
end;
function TSplBaseX.activedb: WordBool;
begin
Result := FDelphiControl.activedb;
end;
function TSplBaseX.activerec: WordBool;
begin
Result := FDelphiControl.activerec;
end;
function TSplBaseX.addfield(const recdat: WideString;
pos: Integer): WordBool;
begin
Result := FDelphiControl.addfield(recdat, pos);
end;
function TSplBaseX.addrec(const idx: WideString): WordBool;
begin
Result := FDelphiControl.addrec(idx);
end;
function TSplBaseX.ClassNameIs(const Name: WideString): WordBool;
begin
Result := FDelphiControl.ClassNameIs(Name);
end;
function TSplBaseX.createspl(const splname: WideString): WordBool;
begin
Result := FDelphiControl.createspl(splname);
end;
function TSplBaseX.dbempty: WordBool;
begin
Result := FDelphiControl.dbempty;
end;
function TSplBaseX.delrec: WordBool;
begin
Result := FDelphiControl.delrec;
end;
function TSplBaseX.DrawTextBiDiModeFlags(Flags: Integer): Integer;
begin
Result := FDelphiControl.DrawTextBiDiModeFlags(Flags);
end;
function TSplBaseX.DrawTextBiDiModeFlagsReadingOnly: Integer;
begin
Result := FDelphiControl.DrawTextBiDiModeFlagsReadingOnly;
end;
function TSplBaseX.firstrec: WordBool;
begin
Result := FDelphiControl.firstrec;
end;
function TSplBaseX.Get_BiDiMode: TxBiDiMode;
begin
Result := Ord(FDelphiControl.BiDiMode);
end;
function TSplBaseX.Get_CurrentDB: WideString;
begin
Result := WideString(FDelphiControl.CurrentDB);
end;
function TSplBaseX.Get_Cursor: Smallint;
begin
Result := Smallint(FDelphiControl.Cursor);
end;
function TSplBaseX.Get_DoubleBuffered: WordBool;
begin
Result := FDelphiControl.DoubleBuffered;
end;
function TSplBaseX.Get_Enabled: WordBool;
begin
Result := FDelphiControl.Enabled;
end;
function TSplBaseX.Get_ErrorNumber: Integer;
begin
Result := FDelphiControl.ErrorNumber;
end;
function TSplBaseX.Get_ErrorString: WideString;
begin
Result := WideString(FDelphiControl.ErrorString);
end;
function TSplBaseX.Get_FieldCount: Integer;
begin
Result := FDelphiControl.FieldCount;
end;
function TSplBaseX.Get_Reclimit: Integer;
begin
Result := FDelphiControl.Reclimit;
end;
function TSplBaseX.Get_Visible: WordBool;
begin
Result := FDelphiControl.Visible;
end;
function TSplBaseX.GetControlsAlignment: TxAlignment;
begin
Result := TxAlignment(FDelphiControl.GetControlsAlignment);
end;
function TSplBaseX.getfield(pos: Integer): WideString;
begin
Result := FDelphiControl.getfield(pos);
end;
function TSplBaseX.getrec(const idx: WideString): WordBool;
begin
Result := FDelphiControl.getrec(idx);
end;
function TSplBaseX.initbase: WordBool;
begin
Result := FDelphiControl.initbase;
end;
function TSplBaseX.initspl: WordBool;
begin
Result := FDelphiControl.initspl;
end;
function TSplBaseX.IsRightToLeft: WordBool;
begin
Result := FDelphiControl.IsRightToLeft;
end;
function TSplBaseX.lastrec: WordBool;
begin
Result := FDelphiControl.lastrec;
end;
function TSplBaseX.modrec(const idx: WideString): WordBool;
begin
Result := FDelphiControl.modrec(idx);
end;
function TSplBaseX.nextrec: WordBool;
begin
Result := FDelphiControl.nextrec;
end;
function TSplBaseX.openspl(const splname: WideString): WordBool;
begin
Result := FDelphiControl.openspl(splname);
end;
function TSplBaseX.prevrec: WordBool;
begin
Result := FDelphiControl.prevrec;
end;
function TSplBaseX.reccount: Integer;
begin
Result := FDelphiControl.reccount;
end;
function TSplBaseX.releasespl: WordBool;
begin
Result := FDelphiControl.releasespl;
end;
function TSplBaseX.setspl(const spldat: WideString): WordBool;
begin
Result := FDelphiControl.setspl(spldat);
end;
function TSplBaseX.UseRightToLeftAlignment: WordBool;
begin
Result := FDelphiControl.UseRightToLeftAlignment;
end;
function TSplBaseX.UseRightToLeftReading: WordBool;
begin
Result := FDelphiControl.UseRightToLeftReading;
end;
function TSplBaseX.UseRightToLeftScrollBar: WordBool;
begin
Result := FDelphiControl.UseRightToLeftScrollBar;
end;
procedure TSplBaseX.FlipChildren(AllLevels: WordBool);
begin
FDelphiControl.FlipChildren(AllLevels);
end;
procedure TSplBaseX.InitiateAction;
begin
FDelphiControl.InitiateAction;
end;
procedure TSplBaseX.Set_BiDiMode(Value: TxBiDiMode);
begin
FDelphiControl.BiDiMode := TBiDiMode(Value);
end;
procedure TSplBaseX.Set_CurrentDB(const Value: WideString);
begin
FDelphiControl.CurrentDB := String(Value);
end;
procedure TSplBaseX.Set_Cursor(Value: Smallint);
begin
FDelphiControl.Cursor := TCursor(Value);
end;
procedure TSplBaseX.Set_DoubleBuffered(Value: WordBool);
begin
FDelphiControl.DoubleBuffered := Value;
end;
procedure TSplBaseX.Set_Enabled(Value: WordBool);
begin
FDelphiControl.Enabled := Value;
end;
procedure TSplBaseX.Set_Reclimit(Value: Integer);
begin
FDelphiControl.Reclimit := Value;
end;
procedure TSplBaseX.Set_Visible(Value: WordBool);
begin
FDelphiControl.Visible := Value;
end;
procedure TSplBaseX.CreateErrorEvent(Sender: TObject);
begin
if FEvents <> nil then FEvents.OnCreateError;
end;
procedure TSplBaseX.OpenErrorEvent(Sender: TObject);
begin
if FEvents <> nil then FEvents.OnOpenError;
end;
procedure TSplBaseX.ReadErrorEvent(Sender: TObject);
begin
if FEvents <> nil then FEvents.OnReadError;
end;
procedure TSplBaseX.WriteErrorEvent(Sender: TObject);
begin
if FEvents <> nil then FEvents.OnWriteError;
end;
initialization
TActiveXControlFactory.Create(
ComServer,
TSplBaseX,
tsplx,
Class_SplBaseX,
1,
'',
0,
tmSingle);
end.