【delphi开源代码栏目提醒】:网学会员为广大网友收集整理了,frmBook.pas,希望对大家有所帮助!
unit frmBook;
interface
uses
Classes, SysUtils, IWAppForm, IWApplication, IWColor, IWTypes, Controls,
IWVCLBaseControl, IWBaseControl, IWBaseHTMLControl, IWControl, IWCompLabel,
IWDBStdCtrls, IWGrids, IWDBGrids, jpeg, IWExtCtrls, IWCompEdit, IWCompMemo,
IW
HTMLControls, frmChapters;
type
TiwfChapters = class(TIWAppForm)
iwlBookName: TIWLabel;
dgrdChapters: TIWDBGrid;
IWImage1: TIWImage;
Label2: TIWLabel;
dbedtChapterName: TIWDBEdit;
IWLabel1: TIWLabel;
IWDBEdit1: TIWDBEdit;
IWLabel2: TIWLabel;
iwdbtCPNO: TIWDBEdit;
IWLabel3: TIWLabel;
IWDBEdit3: TIWDBEdit;
IWLabel4: TIWLabel;
IWDBMemo1: TIWDBMemo;
IWDBNavigator1: TIWDBNavigator;
IWLabel5: TIWLabel;
IWDBEdit4: TIWDBEdit;
IWLink1: TIWLink;
procedure dgrdChaptersColumns1Click(ASender: TObject; const AValue: string);
procedure IWLink1Click(Sender: TObject);
procedure dgrdChaptersRenderCell(ACell: TIWGridCell; const ARow,
AColumn: Integer);
private
bChapters :TiwfmChapters;
public
procedure SetTitle(const sBookName : string);
end;
implementation
uses Graphics, UserSessionUnit, ServerController;
{$R *.dfm}
procedure TiwfChapters.dgrdChaptersColumns1Click(ASender: TObject;
const AValue: string);
begin
UserSession.GoChapter(AValue, StrToInt(iwdbtCPNO.Text));
if (not Assigned(bChapters)) then
bChapters := TiwfmChapters.Create(WebApplication);
bChapters.SetTitle(dbedtChapterName.Caption);
bChapters.Show;
end;
procedure TiwfChapters.dgrdChaptersRenderCell(ACell: TIWGridCell; const ARow,
AColumn: Integer);
begin
// -1 is Footer Row
if ARow = -1 then
begin
ACell.BGColor := clSilver;
if AColumn = 0 then
begin
ACell.Font.Color := clRed;
ACell.Text := ' 一共有 : ' + IntToStr(dgrdChapters.RecordCount) + '章节';
end;
end
else
begin
if dgrdChapters.RowIsCurrent then begin
ACell.BGColor := clYellow;
end;
end;
end;
procedure TiwfChapters.IWLink1Click(Sender: TObject);
begin
Hide;
end;
procedure TiwfChapters.SetTitle(const sBookName: string);
begin
Self.iwlBookName.Caption := sBookName;
UserSession.OpenChaptersTable;
end;
end.