home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World Komputer 1997 May
/
Pcwk0597.iso
/
borland
/
cb
/
setup
/
cbuilder
/
data.z
/
TEXTLIST.CPP
< prev
next >
Wrap
C/C++ Source or Header
|
1997-02-28
|
2KB
|
56 lines
//----------------------------------------------------------------------------
//Borland C++Builder
//Copyright (c) 1987, 1997 Borland International Inc. All Rights Reserved.
//----------------------------------------------------------------------------
//---------------------------------------------------------------------------
#include <vcl\vcl.h>
#include <vcl\system.hpp>
#pragma hdrstop
#include "TextList.h"
//---------------------------------------------------------------------------
#pragma resource "*.dfm"
TTextRep *TextRep;
//---------------------------------------------------------------------------
__fastcall TTextRep::TTextRep(TComponent* Owner)
: TForm(Owner)
{
}
//---------------------------------------------------------------------------
void __fastcall TTextRep::RepAfterPrint(TObject *Sender)
{
//ShowMessage("Under Contruction");
fclose(aFile);
}
//---------------------------------------------------------------------
void __fastcall TTextRep::RepBeforePrint(bool &PrintReport)
{
TOpenDialog *aOpenDialog = new TOpenDialog(this);
aOpenDialog->Filter ="C++ files (*.CPP)|*.CPP|Text files (*.TXT)|*.TXT";
// aOpenDialog->Options<<ofFileMustExist;
if (!aOpenDialog->Execute())
PrintReport=false;
else {
aFile=fopen((aOpenDialog->FileName).c_str() , "a+");
Rep->ReportTitle=aOpenDialog->FileName;
}
delete aOpenDialog;
}
//---------------------------------------------------------------------
void __fastcall TTextRep::RepNeedData(bool &MoreData)
{
AnsiString Line;
char s[500];
if (!feof(aFile))
{
fgets(s,501,aFile);
Line=AnsiString(s);
QRLabel1->Caption=Line;
MoreData=True;
}
else MoreData=False;
}
//---------------------------------------------------------------------