Source code of file oscpmwin/currupd.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 License as published by
0010: the Free Software Foundation; either version 2 of the License, 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 License for more details.
0017:
0018: You should have received a copy of the GNU General Public License
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 currupd;
0023:
0024: interface
0025:
0026: uses
0027: SysUtils, Classes, Graphics, Controls, Forms,
0028: Buttons, ComCtrls, StdCtrls;
0029:
0030: type
0031: Topm_Form_Currupd = class(TForm)
0032: opm_ListView_CurrUpdConfirm: TListView;
0033: opm_BitBtn_CurrUpdConfirm: TBitBtn;
0034: opm_BitBtn_CurrUpdCancel: TBitBtn;
0035: opm_StatusBar_PEdit: TStatusBar;
0036: procedure FormShow(Sender: TObject);
0037: procedure FormCreate(Sender: TObject);
0038: procedure opm_ListView_CurrUpdConfirmCustomDrawItem(
0039: Sender: TCustomListView; Item: TListItem; State: TCustomDrawState;
0040: var DefaultDraw: Boolean);
0041: private
0042: public
0043: end;
0044:
0045: var
0046: opm_Form_Currupd : Topm_Form_Currupd;
0047:
0048:
0049:
0050: implementation
0051:
0052: Uses gnugettext, oscpmdata;
0053:
0054: {$R *.dfm}
0055:
0056:
0057:
0058:
0059:
0060:
0061:
0062: {%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%}
0063: {%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%}
0064: PROCEDURE Topm_Form_Currupd.FormShow (Sender: TObject);
0065: VAR
0066: CurCurr : LONGINT;
0067: CurItem : TListItem;
0068: BEGIN
0069: opm_Form_Currupd.Caption := _('Currency update confirmation');
0070: opm_ListView_CurrUpdConfirm.Items.BeginUpdate;
0071: opm_ListView_CurrUpdConfirm.Items.Clear;
0072: FOR CurCurr := 0 TO (opm_TotalCurrencies - 1) DO
0073: BEGIN
0074: IF (opmG_CurrencyList[CurCurr].Default = FALSE) THEN
0075: BEGIN
0076: CurItem := opm_ListView_CurrUpdConfirm.Items.Add;
0077: IF (opmG_CurrencyList[CurCurr].NewValue = 0) THEN CurItem.ImageIndex := 2
0078: ELSE IF (opmG_CurrencyList[CurCurr].NewValue = -1) THEN CurItem.ImageIndex := 1
0079: ELSE IF (opmG_CurrencyList[CurCurr].Value = opmG_CurrencyList[CurCurr].NewValue) THEN CurItem.ImageIndex := 3
0080: ELSE CurItem.ImageIndex := 4;
0081: CurItem.SubItems.Add (opmG_CurrencyList[CurCurr].Name);
0082: CurItem.SubItems.Add (CURRTOSTR (opmG_CurrencyList[CurCurr].Value));
0083: IF (opmG_CurrencyList[CurCurr].NewValue <= 0) THEN CurItem.SubItems.Add ('???')
0084: ELSE CurItem.SubItems.Add (CURRTOSTR (opmG_CurrencyList[CurCurr].NewValue));
0085: END;
0086: END;
0087: opm_ListView_CurrUpdConfirm.Items.EndUpdate;
0088: END;
0089:
0090:
0091:
0092:
0093: {%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%}
0094: {%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%}
0095: procedure Topm_Form_Currupd.FormCreate(Sender: TObject);
0096: begin
0097: opm_ListView_CurrupdConfirm.Columns.Clear;
0098: opm_ListView_CurrupdConfirm.Checkboxes := FALSE;
0099: opm_ListView_CurrupdConfirm.ReadOnly := TRUE;
0100: opm_ListView_CurrupdConfirm.DoubleBuffered := TRUE;
0101: opm_ListView_CurrupdConfirm.ViewStyle := vsReport;
0102: opm_ListView_CurrupdConfirm.Columns.Add;
0103: opm_ListView_CurrupdConfirm.Columns.Add;
0104: opm_ListView_CurrupdConfirm.Columns.Add;
0105: opm_ListView_CurrupdConfirm.Columns.Add;
0106: opm_ListView_CurrupdConfirm.Columns.Items[0].Caption := '';
0107: opm_ListView_CurrupdConfirm.Columns.Items[1].Caption := _('Currency');
0108: opm_ListView_CurrupdConfirm.Columns.Items[2].Caption := _('Old value');
0109: opm_ListView_CurrupdConfirm.Columns.Items[3].Caption := _('New value');
0110: opm_ListView_CurrupdConfirm.Columns.Items[1].Alignment := opmC_Def_Col20Align;
0111: opm_ListView_CurrupdConfirm.Columns.Items[2].Alignment := opmC_Def_Col21Align;
0112: opm_ListView_CurrupdConfirm.Columns.Items[3].Alignment := opmC_Def_Col22Align;
0113: IF (opmG_UIHotTracking > 0) THEN
0114: BEGIN
0115: opm_ListView_CurrupdConfirm.HotTrack := FALSE;
0116: opm_ListView_CurrupdConfirm.HotTrackStyles := [htHandPoint, htUnderlineHot];
0117: END
0118: ELSE
0119: BEGIN
0120: opm_ListView_CurrupdConfirm.HotTrack := FALSE;
0121: opm_ListView_CurrupdConfirm.HotTrackStyles := [];
0122: END;
0123: IF (opmG_UIRememberDisplay > 0) THEN
0124: BEGIN
0125: opm_ListView_CurrupdConfirm.Column[0].Width := opmG_UICol0X;
0126: opm_ListView_CurrupdConfirm.Column[1].Width := opmG_UICol20X;
0127: opm_ListView_CurrupdConfirm.Column[2].Width := opmG_UICol21X;
0128: opm_ListView_CurrupdConfirm.Column[3].Width := opmG_UICol22X;
0129: END
0130: ELSE
0131: BEGIN
0132: opm_ListView_CurrupdConfirm.Column[0].Width := opmC_Def_Col0X;
0133: opm_ListView_CurrupdConfirm.Column[1].Width := opmC_Def_Col20X;
0134: opm_ListView_CurrupdConfirm.Column[2].Width := opmC_Def_Col21X;
0135: opm_ListView_CurrupdConfirm.Column[3].Width := opmC_Def_Col22X;
0136: END;
0137: TranslateComponent (self);
0138: end;
0139:
0140:
0141:
0142: {%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%}
0143: {%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%}
0144: procedure Topm_Form_Currupd.opm_ListView_CurrUpdConfirmCustomDrawItem (Sender: TCustomListView; Item: TListItem; State: TCustomDrawState; var DefaultDraw: Boolean);
0145: begin
0146: IF ((opmG_UIStripes > 0) AND ODD (Item.Index)) THEN opm_ListView_CurrupdConfirm.Canvas.Brush.Color := opmG_StripeColor ELSE opm_ListView_CurrupdConfirm.Canvas.Brush.Color := clWindow;
0147: end;
0148:
0149: end.