home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Chip 1999 January
/
Chip_1999-01_cd.bin
/
zkuste
/
delphi
/
QDB
/
QDBV.ZIP
/
qdbvreg.pas
< prev
next >
Wrap
Pascal/Delphi Source File
|
1998-06-27
|
2KB
|
74 lines
unit qdbvreg;
interface
uses
DsgnIntf;
{ Component editor for TQDBView. Handles the restructuring }
{ of files which contain data. }
type
TQDBViewEditor = class(TComponentEditor)
public
function GetVerb(Index: Integer): string; override;
function GetVerbCount: Integer; override;
procedure ExecuteVerb(Index: Integer); override;
end;
procedure Register;
implementation
uses
SysUtils, Classes, Dialogs, Forms, TypInfo, Controls,
QDBView, RestForm;
{$IFDEF WIN32}
{$R QDBVREG.R32}
{$ELSE}
{$R QDBVREG.R16}
{$ENDIF}
function TQDBViewEditor.GetVerb(Index: Integer): string;
var
FileName: string;
begin
FileName:=(Component as TQDBView).FileName;
Result:='Restructure ' + ExtractFileName(FileName);
end;
function TQDBViewEditor.GetVerbCount: Integer;
begin
if ((Component as TQDBView).FileName = '') or
((Component as TQDBView).Panel = nil) then
Result := 0
else
Result:=1;
end;
procedure TQDBViewEditor.ExecuteVerb(Index: Integer);
var
Form: TRestructureForm;
begin
Form := TRestructureForm.Create(Application);
try
with (Component as TQDBView) do
begin
Form.Caption:='Restructuring ' + ExtractFileName(FileName);
Form.FileName:=FileName;
Form.Panel:=Panel;
Form.ShowModal;
end;
finally
Form.Free;
end;
end;
procedure Register;
begin
RegisterComponents('IHSoftware', [TQDBItem, TQDBView]);
RegisterComponentEditor(TQDBView,TQDBViewEditor);
end;
end.