Source code of file oscpmwin_v0.4.1.745/sqllog.pas from the
osCommerce Product Manager for Windows.
0000: {%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
0001: osCommerce Product Manager for Windows (oscpmwin).
0002: Copyright �2003-2006 by Mario A. Valdez-Ramirez.
0003:
0004: You can contact Mario A. Valdez-Ramirez
0005: by email at mario@mariovaldez.org or paper mail at
0006: Olmos 809, San Nicolas, NL. 66495, Mexico.
0007:
0008: This program is free software; you can redistribute it and/or modify
0009: it under the terms of the GNU General Public SQLLog as published by
0010: the Free Software Foundation; either version 2 of the SQLLog, or (at
0011: your option) any later version.
0012:
0013: This program is distributed in the hope that it will be useful, but
0014: WITHOUT ANY WARRANTY; without even the implied warranty of
0015: MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
0016: General Public SQLLog for more details.
0017:
0018: You should have received a copy of the GNU General Public SQLLog
0019: along with this program; if not, write to the Free Software
0020: Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
0021: %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%}
0022: unit sqllog;
0023:
0024: interface
0025:
0026: uses
0027: SysUtils, Forms, StdCtrls, Buttons, Classes, Controls, ComCtrls;
0028:
0029: type
0030: Topm_Form_SQLLog = class(TForm)
0031: opm_Memo_SQLLog: TMemo;
0032: opm_BitBtn_SQLLogOk: TBitBtn;
0033: opm_BitBtn_SQLLogClear: TBitBtn;
0034: opm_StatusBar_PEdit: TStatusBar;
0035: procedure FormCreate(Sender: TObject);
0036: procedure FormShow(Sender: TObject);
0037: procedure FormClose(Sender: TObject; var Action: TCloseAction);
0038: procedure opm_BitBtn_SQLLogClearClick(Sender: TObject);
0039: private
0040: { Private declarations }
0041: public
0042: end;
0043:
0044: var
0045: opm_Form_SQLLog: Topm_Form_SQLLog;
0046:
0047: implementation
0048:
0049: uses gnugettext, oscpmdata, network;
0050:
0051: {$R *.dfm}
0052:
0053:
0054: {%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%}
0055: {%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%}
0056: procedure Topm_Form_SQLLog.FormCreate(Sender: TObject);
0057: begin
0058: TranslateComponent (self);
0059: end;
0060:
0061:
0062:
0063: {%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%}
0064: {%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%}
0065: procedure Topm_Form_SQLLog.FormShow(Sender: TObject);
0066: begin
0067: TRY
0068: opm_Memo_SQLLog.Lines.LoadFromFile (ExtractFilePath (Application.Exename) + opmC_DebugFile);
0069: EXCEPT
0070: opm_Memo_SQLLog.Clear;
0071: END;
0072: opm_Form_SQLLog.Caption := _('SQL query log') + ' (' + INTTOSTR (opm_Memo_SQLLog.Lines.Count) + ' ' + _('lines') + ')';
0073: end;
0074:
0075:
0076: {%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%}
0077: {%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%}
0078: procedure Topm_Form_SQLLog.FormClose(Sender: TObject; var Action: TCloseAction);
0079: begin
0080: opm_Memo_SQLLog.Clear;
0081: end;
0082:
0083:
0084: {%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%}
0085: {%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%}
0086: procedure Topm_Form_SQLLog.opm_BitBtn_SQLLogClearClick(Sender: TObject);
0087: begin
0088: PRopm_ResetLog;
0089: TRY
0090: opm_Memo_SQLLog.Lines.LoadFromFile (ExtractFilePath (Application.Exename) + opmC_DebugFile);
0091: EXCEPT
0092: opm_Memo_SQLLog.Clear;
0093: END;
0094: opm_Form_SQLLog.Caption := _('SQL query log') + ' (' + INTTOSTR (opm_Memo_SQLLog.Lines.Count) + ' ' + _('lines') + ')';
0095: end;
0096:
0097: end.