Source code of file oscpmwin_v0.4.1.683/config.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 config;
0023:   
0024:   interface
0025:   
0026:   uses
0027:     SysUtils, Classes, Graphics, Controls, Forms,
0028:     Dialogs, StdCtrls, Buttons, Spin, ExtCtrls, ComCtrls, FR_DSet,
0029:     FR_Desgn, FR_Class;
0030:   
0031:   type
0032:     Topm_Form_Config = class(TForm)
0033:       opm_BitBtn_ConfigOk: TBitBtn;
0034:       opm_BitBtn_ConfigCancel: TBitBtn;
0035:       opm_PageControl_Config: TPageControl;
0036:       opm_TabSheet_ConfigGeneral: TTabSheet;
0037:       opm_TabSheet_ConfigUI: TTabSheet;
0038:       opm_GroupBox_inter: TGroupBox;
0039:       Bevel4: TBevel;
0040:       opm_CheckBox_ConfigRemember: TCheckBox;
0041:       opm_CheckBox_ConfigHotTrack: TCheckBox;
0042:       opm_CheckBox_ConfigAutoload: TCheckBox;
0043:       opm_CheckBox_ConfigDragDrop: TCheckBox;
0044:       opm_CheckBox_ConfigTooltips: TCheckBox;
0045:       opm_CheckBox_ConfigSilent: TCheckBox;
0046:       opm_TabSheet_ConfigImg: TTabSheet;
0047:       opm_GroupBox_ImgConv: TGroupBox;
0048:       opm_CheckBox_ConfigResizeImg: TCheckBox;
0049:       opm_Label_ConfigImgResize: TLabel;
0050:       opm_SpinEdit_ConfigImgX: TSpinEdit;
0051:       opm_SpinEdit_ConfigImgY: TSpinEdit;
0052:       opm_Label_ConfigImgXSymbol: TLabel;
0053:       opm_SpinEdit_ConfigImgQ: TSpinEdit;
0054:       opm_Label_ConfigImgJPEGQuality: TLabel;
0055:       opm_OpenDialog_ConfigINI: TOpenDialog;
0056:       opm_SaveDialog_ConfigINI: TSaveDialog;
0057:       opm_GroupBox_inter2: TGroupBox;
0058:       opm_BitBtn_ConfigReset: TBitBtn;
0059:       Bevel2: TBevel;
0060:       opm_CheckBox_ConfigDragUps: TCheckBox;
0061:       opm_CheckBox_ConfigConfirmDels: TCheckBox;
0062:       opm_CheckBox_ConfigConfirmDrag: TCheckBox;
0063:       opm_CheckBox_ConfigConfirmMods: TCheckBox;
0064:       opm_CheckBox_ConfigConfirmUps: TCheckBox;
0065:       opm_CheckBox_ConfigAutoDownImg: TCheckBox;
0066:       opm_CheckBox_ConfigNoCacheImg: TCheckBox;
0067:       Bevel1: TBevel;
0068:       opm_CheckBox_ConfigConfirmExit: TCheckBox;
0069:       opm_CheckBox_ConfigConfirmImgDels: TCheckBox;
0070:       opm_Label_ConfigJPEGQCategory: TLabel;
0071:       opm_TabSheet_ConfigMods: TTabSheet;
0072:       opm_CheckBox_ConfigPaddingImg: TCheckBox;
0073:       opm_CheckBox_ConfigKeepARImg: TCheckBox;
0074:       opm_BitBtn_ConfigColSel: TBitBtn;
0075:       opm_Panel_ConfigColSel: TPanel;
0076:       opm_GroupBox_INI: TGroupBox;
0077:       opm_BitBtn_ConfigLoadINI: TBitBtn;
0078:       opm_BitBtn_ConfigSaveINI: TBitBtn;
0079:       opm_TabSheet_ConfigUI2: TTabSheet;
0080:       opm_GroupBox_Lang: TGroupBox;
0081:       opm_Label_ConfigUILang: TLabel;
0082:       opm_ComboBox_ConfigUILang: TComboBox;
0083:       opm_Label_ConfigUILangDesc: TLabel;
0084:       Bevel3: TBevel;
0085:       opm_FontDialog_Config: TFontDialog;
0086:       opm_GroupBox_Font: TGroupBox;
0087:       opm_BitBtn_ConfigFont: TBitBtn;
0088:       opm_Label_ConfigFontDetails: TLabel;
0089:       opm_TabSheet_ConfigDBDetail: TTabSheet;
0090:       opm_GroupBox_DBDetails: TGroupBox;
0091:       opm_Label_ConfigDBTable01: TLabel;
0092:       opm_Edit_ConfigDBTable01: TEdit;
0093:       opm_Edit_ConfigDBTable02: TEdit;
0094:       opm_Label_ConfigDBTable02: TLabel;
0095:       opm_Edit_ConfigDBTable04: TEdit;
0096:       opm_Label_ConfigDBTable04: TLabel;
0097:       opm_Edit_ConfigDBTable03: TEdit;
0098:       opm_Label_ConfigDBTable03: TLabel;
0099:       opm_Label_ConfigDBTable05: TLabel;
0100:       opm_Edit_ConfigDBTable05: TEdit;
0101:       opm_Label_ConfigDBTable06: TLabel;
0102:       opm_Edit_ConfigDBTable06: TEdit;
0103:       opm_Label_ConfigDBTable07: TLabel;
0104:       opm_Edit_ConfigDBTable07: TEdit;
0105:       opm_Label_ConfigDBTable08: TLabel;
0106:       opm_Edit_ConfigDBTable08: TEdit;
0107:       opm_Label_ConfigDBTable09: TLabel;
0108:       opm_Edit_ConfigDBTable09: TEdit;
0109:       opm_Label_ConfigDBTable10: TLabel;
0110:       opm_Edit_ConfigDBTable10: TEdit;
0111:       opm_Label_ConfigDBTable11: TLabel;
0112:       opm_Edit_ConfigDBTable11: TEdit;
0113:       opm_Label_ConfigDBTable13: TLabel;
0114:       opm_Edit_ConfigDBTable13: TEdit;
0115:       opm_BitBtn_ConfigDBReset: TBitBtn;
0116:       opm_Label_ConfigDBTablesDesc: TLabel;
0117:       opm_CheckBox_ConfigAllowZeroPrice: TCheckBox;
0118:       opm_CheckBox_ConfigWBDebug: TCheckBox;
0119:       opm_CheckBox_ConfigAllowNegativeQuantity: TCheckBox;
0120:       opm_TabSheet_ConfigReports: TTabSheet;
0121:       opm_GroupBox_Reports: TGroupBox;
0122:       opm_GroupBox_Clipboard: TGroupBox;
0123:       opm_Label_Config_ClipMaxChars: TLabel;
0124:       opm_SpinEdit_Config_ClipColSize: TSpinEdit;
0125:       opm_BitBtn_ConfigReportEdit: TBitBtn;
0126:       opm_ListBox_ConfigReports: TListBox;
0127:       opm_CheckBox_ConfigPRNDirectPrint: TCheckBox;
0128:       opm_frReport_Config: TfrReport;
0129:       opm_frDesigner_Config: TfrDesigner;
0130:       opm_frUserDataset_Config: TfrUserDataset;
0131:       opm_BitBtn_ConfigReportPreview: TBitBtn;
0132:       opm_CheckBox_ConfigAllowEditImageName: TCheckBox;
0133:       opm_Label_ConfigModConnWait: TLabel;
0134:       opm_SpinEdit_ConfigModConnWait: TSpinEdit;
0135:       opm_Label_ConfigModConnRetries: TLabel;
0136:       opm_SpinEdit_ConfigModConnRetries: TSpinEdit;
0137:       opm_OpenDialog_ConfigMod: TOpenDialog;
0138:       opm_GroupBox_Modules: TGroupBox;
0139:       opm_BitBtn_ConfigModDel: TBitBtn;
0140:       opm_ListBox_ConfigMods: TListBox;
0141:       opm_BitBtn_ConfigModEdit: TBitBtn;
0142:       opm_Label_ConfigDBTable14: TLabel;
0143:       opm_Edit_ConfigDBTable14: TEdit;
0144:       opm_BitBtn_ConfigModAdd: TBitBtn;
0145:       opm_TabSheet_ConfigNet: TTabSheet;
0146:       opm_GroupBox_HTTP: TGroupBox;
0147:       opm_Label_ConfigPHost: TLabel;
0148:       opm_Label_ConfigPPort: TLabel;
0149:       opm_ComboBox_ConfigProxyHost: TComboBox;
0150:       opm_SpinEdit_ConfigProxyPort: TSpinEdit;
0151:       opm_BitBtn_ConfigProxyIE: TBitBtn;
0152:       opm_CheckBox_ConfigUseProxy: TCheckBox;
0153:       opm_ComboBox_ConfigProxyApply: TComboBox;
0154:       opm_GroupBox_HTTPGen: TGroupBox;
0155:       opm_Label_ConfigETABase: TLabel;
0156:       opm_ComboBox_ConfigETABase: TComboBox;
0157:       opm_Label_ConfigUploadURL: TLabel;
0158:       opm_ComboBox_ConfigUploadURL: TComboBox;
0159:       opm_Label_ConfigHTTPConnWait: TLabel;
0160:       opm_SpinEdit_ConfigHTTPConnWait: TSpinEdit;
0161:       opm_GroupBox_Img: TGroupBox;
0162:       opm_ComboBox_ConfigImgURL: TComboBox;
0163:       opm_Label_ConfigImageURL: TLabel;
0164:       opm_CheckBox_ConfigStripes: TCheckBox;
0165:       opm_CheckBox_ConfigCacheIList: TCheckBox;
0166:       opm_Edit_ConfigPDFAuthor: TEdit;
0167:       opm_Label_ConfigPDFAuthor: TLabel;
0168:       opm_ComboBox_ConfigUsername: TComboBox;
0169:       opm_Label_ConfigUsername: TLabel;
0170:       opm_Label_ConfigPassword: TLabel;
0171:       opm_Edit_ConfigPassword: TEdit;
0172:       opm_CheckBox_ConfigStorePass: TCheckBox;
0173:       opm_CheckBox_ConfigDBDebugLog: TCheckBox;
0174:       opm_SpinEdit_ConfigHTTPConnRetries: TSpinEdit;
0175:       opm_Label_ConfigHTTPConnRetries: TLabel;
0176:       opm_CheckBox_ConfigHTTPCompress: TCheckBox;
0177:       opm_CheckBox_ConfigCenterImage: TCheckBox;
0178:       procedure FormShow(Sender: TObject);
0179:       procedure opm_BitBtn_ConfigOkClick(Sender: TObject);
0180:       procedure FormCreate(Sender: TObject);
0181:       procedure opm_BitBtn_ConfigResetClick(Sender: TObject);
0182:       procedure opm_CheckBox_ConfigResizeImgClick(Sender: TObject);
0183:       procedure opm_BitBtn_ConfigSaveINIClick(Sender: TObject);
0184:       procedure opm_BitBtn_ConfigLoadINIClick(Sender: TObject);
0185:       procedure opm_SpinEdit_ConfigImgQChange(Sender: TObject);
0186:       procedure opm_BitBtn_ConfigModDelClick(Sender: TObject);
0187:       procedure opm_ListBox_ConfigModsClick(Sender: TObject);
0188:       procedure opm_BitBtn_ConfigColSelClick(Sender: TObject);
0189:       procedure opm_BitBtn_ConfigProxyIEClick(Sender: TObject);
0190:       procedure opm_BitBtn_ConfigFontClick(Sender: TObject);
0191:       procedure opm_CheckBox_ConfigUseProxyClick(Sender: TObject);
0192:       procedure opm_BitBtn_ConfigDBResetClick(Sender: TObject);
0193:       procedure opm_ListBox_ConfigReportsClick(Sender: TObject);
0194:       procedure opm_BitBtn_ConfigReportEditClick(Sender: TObject);
0195:       procedure opm_frReport_ConfigGetValue (const ParName: String; var ParValue: Variant);
0196:       procedure opm_frUserDataset_ConfigCheckEOF(Sender: TObject; var Eof: Boolean);
0197:       procedure opm_BitBtn_ConfigReportPreviewClick(Sender: TObject);
0198:       procedure opm_BitBtn_ConfigModEditClick(Sender: TObject);
0199:       procedure opm_ListBox_ConfigModsDblClick(Sender: TObject);
0200:       procedure opm_ListBox_ConfigReportsDblClick(Sender: TObject);
0201:       procedure opm_BitBtn_ConfigModAddClick(Sender: TObject);
0202:     private
0203:       PROCEDURE PRopm_ControlToVars;
0204:       procedure PRopm_VarsToControls;
0205:       PROCEDURE opm_PRRefresh_ModuleList (LastIndex : INTEGER);
0206:       PROCEDURE opm_PRRefresh_ReportList (LastIndex : INTEGER);
0207:     public
0208:     end;
0209:   
0210:   var
0211:     opm_Form_Config: Topm_Form_Config;
0212:   
0213:   implementation
0214:   
0215:   {$R *.dfm}
0216:   
0217:   Uses gnugettext, oscpmdata, regconfig, attention, imageman, modules, dataman,
0218:        colorsel, network, configmod;
0219:   
0220:   
0221:   
0222:   {%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%}
0223:   {%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%}
0224:   procedure Topm_Form_Config.PRopm_VarsToControls;
0225:   VAR
0226:     UILang : LONGINT;
0227:   begin
0228:     opm_Edit_ConfigPDFAuthor.Text := opmG_PDFAuthor;
0229:     opm_Edit_ConfigDBTable01.Text := opmG_DBTable_Categories;
0230:     opm_Edit_ConfigDBTable02.Text := opmG_DBTable_Manufacturers;
0231:     opm_Edit_ConfigDBTable03.Text := opmG_DBTable_Languages;
0232:     opm_Edit_ConfigDBTable04.Text := opmG_DBTable_Products;
0233:     opm_Edit_ConfigDBTable05.Text := opmG_DBTable_Specials;
0234:     opm_Edit_ConfigDBTable06.Text := opmG_DBTable_ProductsDescription;
0235:     opm_Edit_ConfigDBTable07.Text := opmG_DBTable_TaxClass;
0236:     opm_Edit_ConfigDBTable08.Text := opmG_DBTable_Currencies;
0237:     opm_Edit_ConfigDBTable09.Text := opmG_DBTable_Configuration;
0238:     opm_Edit_ConfigDBTable10.Text := opmG_DBTable_ProductsToCategories;
0239:     opm_Edit_ConfigDBTable11.Text := opmG_DBTable_CategoriesDescription;
0240:     opm_Edit_ConfigDBTable13.Text := opmG_DBTable_TaxRates;
0241:     opm_Edit_ConfigDBTable14.Text := opmG_DBTable_ManufacturersInfo;
0242:     opm_ComboBox_ConfigUsername.Text := opmG_DBUsername;
0243:     opm_ComboBox_ConfigImgURL.Text := opmG_WBImgURL;
0244:     opm_ComboBox_ConfigUploadURL.Text := opmG_WBUploadURL;
0245:     opm_ComboBox_ConfigUsername.Items := opmG_PastUsername_BoxList;
0246:     opm_ComboBox_ConfigImgURL.Items := opmG_PastImgURL_BoxList;
0247:     opm_ComboBox_ConfigUploadURL.Items := opmG_PastUploadURL_BoxList;
0248:     opm_ComboBox_ConfigProxyHost.Items := opmG_PastProxy_BoxList;
0249:     opm_ComboBox_ConfigProxyHost.Text := opmG_WBProxyHost;
0250:     opm_Edit_ConfigPassword.Text := opmG_DBPassword;
0251:     opm_ComboBox_ConfigETABase.Text := INTTOSTR (opmG_ETABase) + ' kbps';
0252:     opm_SpinEdit_ConfigProxyPort.Value := opmG_WBProxyPort;
0253:     opm_SpinEdit_ConfigModConnWait.Value := opmG_ModConnWait;
0254:     opm_SpinEdit_ConfigHTTPConnWait.Value := opmG_HTTPConnWait;
0255:     opm_SpinEdit_ConfigModConnRetries.Value := opmG_ModConnRetries;
0256:     opm_SpinEdit_ConfigHTTPConnRetries.Value := opmG_HTTPConnRetries;
0257:     opm_SpinEdit_ConfigImgX.Value := opmG_WBImgX;
0258:     opm_SpinEdit_ConfigImgY.Value := opmG_WBImgY;
0259:     opm_SpinEdit_ConfigImgQ.Value := opmG_WBImgQ;
0260:     opm_Label_ConfigJPEGQCategory.Caption := FNopm_QualityExplain (opmG_WBImgQ);
0261:     opm_Panel_ConfigColSel.Color := FNopm_DecColorToColor (opmG_WBPaddingColor);
0262:     opm_Panel_ConfigColSel.Caption := FNopm_ColorToRGB (opm_Panel_ConfigColSel.Color);
0263:     opm_PageControl_Config.ActivePageIndex := 0;
0264:     opm_CheckBox_ConfigHotTrack.Checked := (opmG_UIHotTracking > 0);
0265:     opm_CheckBox_ConfigRemember.Checked := (opmG_UIRememberDisplay > 0);
0266:     opm_CheckBox_ConfigAutoload.Checked := (opmG_UIClickLoad > 0);
0267:     opm_CheckBox_ConfigDragDrop.Checked := (opmG_UIDragDrop > 0);
0268:     opm_CheckBox_ConfigDragUps.Checked := (opmG_UIImgDragDrop > 0);
0269:     opm_CheckBox_ConfigTooltips.Checked := (opmG_UIToolTips > 0);
0270:     opm_CheckBox_ConfigStripes.Checked := (opmG_UIStripes > 0);
0271:     opm_CheckBox_ConfigCacheIList.Checked := (opmG_UICacheIList > 0);
0272:     opm_CheckBox_ConfigUseProxy.Checked := (opmG_UseProxy > 0);
0273:     opm_ComboBox_ConfigProxyApply.ItemIndex := opmG_ProxyApply;
0274:     opm_CheckBox_ConfigStorePass.Checked := (opmG_DBStorePass > 0);
0275:     opm_CheckBox_ConfigSilent.Checked := (opmG_UISilent > 0);
0276:     opm_CheckBox_ConfigSilent.Enabled := (FNopm_CheckSound = TRUE);
0277:     opm_CheckBox_ConfigConfirmDels.Checked := (opmG_UIConfirmDels > 0);
0278:     opm_CheckBox_ConfigConfirmDrag.Checked := (opmG_UIConfirmDrag > 0);
0279:     opm_CheckBox_ConfigConfirmMods.Checked := (opmG_UIConfirmMods > 0);
0280:     opm_CheckBox_ConfigAllowZeroPrice.Checked := (opmG_UIAllowZeroPrice > 0);
0281:     opm_CheckBox_ConfigAllowEditImageName.Checked := (opmG_UIAllowEditImageName > 0);
0282:     opm_CheckBox_ConfigAllowNegativeQuantity.Checked := (opmG_UIAllowNegativeQuantity > 0);
0283:     opm_CheckBox_ConfigAutoDownImg.Checked := (opmG_UIAutoDownImg > 0);
0284:     opm_FontDialog_Config.Font.Name := opmG_UIFontName;
0285:     opm_FontDialog_Config.Font.Height := opmG_UIFontHeight;
0286:     opm_FontDialog_Config.Font.Charset := opmG_UIFontCharset;
0287:     opm_FontDialog_Config.Font.Style := opmC_DefaultFontStyle;
0288:     opm_Label_ConfigFontDetails.Font := opm_FontDialog_Config.Font;
0289:     opm_Label_ConfigFontDetails.Caption := opmG_UIFontName + ', ' +
0290:                                            INTTOSTR (ROUND ((opmG_UIFontHeight * -72) / opm_FontDialog_Config.Font.PixelsPerInch)) + ', ' +
0291:                                            opmG_CharsetList [opmG_UIFontCharset];
0292:     opm_SpinEdit_Config_ClipColSize.Value := opmG_Clip_ColSize;
0293:     opm_CheckBox_ConfigPRNDirectPrint.Checked := (opmG_PRNDirectPrint > 0);
0294:     opm_CheckBox_ConfigNoCacheImg.Checked := (opmG_WBNoCacheImg > 0);
0295:     opm_CheckBox_ConfigResizeImg.Checked := (opmG_WBResizeImg > 0);
0296:     opm_CheckBox_ConfigPaddingImg.Checked := (opmG_WBPaddingImg > 0);
0297:     opm_CheckBox_ConfigKeepARImg.Checked := (opmG_WBKeepARImg > 0);
0298:     opm_CheckBox_ConfigConfirmExit.Checked := (opmG_UIConfirmExit > 0);
0299:     opm_CheckBox_ConfigCenterImage.Checked := (opmG_UICenterImage > 0);
0300:     opm_CheckBox_ConfigDBDebugLog.Checked := (opmG_DBDebugLog > 0);
0301:     opm_CheckBox_ConfigHTTPCompress.Checked := (opmG_HTTPCompress > 0);
0302:     opm_CheckBox_ConfigWBDebug.Checked := (opmG_UIWBDebug > 0);
0303:     IF (opm_ComboBox_ConfigUILang.Items.Count > 0) THEN
0304:       FOR UILang := 0 TO opm_ComboBox_ConfigUILang.Items.Count DO
0305:         IF (ANSIPOS ('(' + opmG_UIGUILang + ')', opm_ComboBox_ConfigUILang.Items[UILang]) > 0) THEN
0306:           BEGIN
0307:             opm_ComboBox_ConfigUILang.ItemIndex := UILang;
0308:             BREAK;
0309:           END;
0310:   end;
0311:   
0312:   
0313:   {%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%}
0314:   {%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%}
0315:   PROCEDURE Topm_Form_Config.FormShow(Sender: TObject);
0316:   BEGIN
0317:     opm_Form_Config.Caption := _('Settings of ') + opmC_AppShortName;
0318:     opm_ComboBox_ConfigUILang.Items.Clear;
0319:     DefaultInstance.GetListOfLanguages ('default', opm_ComboBox_ConfigUILang.Items);
0320:     opm_ComboBox_ConfigUILang.Sorted := TRUE;
0321:     IF (opm_ComboBox_ConfigUILang.Items.Count > 0) THEN
0322:       BEGIN
0323:         DefaultInstance.BindtextdomainToFile ('isotolanguagenames', ExtractFilePath (Application.Exename) + 'locale/isotolanguagenames.mo');
0324:         DefaultInstance.TranslateProperties (opm_ComboBox_ConfigUILang, 'isotolanguagenames');
0325:         opm_ComboBox_ConfigUILang.Enabled := TRUE;
0326:       END
0327:     ELSE
0328:       opm_ComboBox_ConfigUILang.Enabled := FALSE;
0329:     opm_Label_ConfigUILangDesc.Caption := _('Do you want to contribute with a translation in your native language?') + #13#10 +
0330:                                           _('It is very easy, and you don''t have to be a programmer to do it.') + #13#10 +
0331:                                           _('Please visit the website for more information.');
0332:     PRopm_VarsToControls;
0333:     opm_Label_ConfigImgResize.Enabled := opm_CheckBox_ConfigResizeImg.Checked;
0334:     opm_CheckBox_ConfigPaddingImg.Enabled := opm_CheckBox_ConfigResizeImg.Checked;
0335:     opm_CheckBox_ConfigKeepARImg.Enabled := opm_CheckBox_ConfigResizeImg.Checked;
0336:     opm_SpinEdit_ConfigImgX.Enabled := opm_CheckBox_ConfigResizeImg.Checked;
0337:     opm_SpinEdit_ConfigImgY.Enabled := opm_CheckBox_ConfigResizeImg.Checked;
0338:     opm_Panel_ConfigColSel.Enabled := opm_CheckBox_ConfigResizeImg.Checked;
0339:     opm_BitBtn_ConfigColSel.Enabled := opm_CheckBox_ConfigResizeImg.Checked;
0340:     opm_SpinEdit_ConfigImgQ.Enabled := opm_CheckBox_ConfigResizeImg.Checked;
0341:     opm_Label_ConfigImgJPEGQuality.Enabled := opm_CheckBox_ConfigResizeImg.Checked;
0342:     opm_Label_ConfigJPEGQCategory.Enabled := opm_CheckBox_ConfigResizeImg.Checked;
0343:     opm_ComboBox_ConfigProxyApply.Enabled := opm_CheckBox_ConfigUseProxy.Checked;
0344:     opm_ComboBox_ConfigProxyHost.Enabled := opm_CheckBox_ConfigUseProxy.Checked;
0345:     opm_SpinEdit_ConfigProxyPort.Enabled := opm_CheckBox_ConfigUseProxy.Checked;
0346:     opm_BitBtn_ConfigProxyIE.Enabled := opm_CheckBox_ConfigUseProxy.Checked;
0347:     opm_Label_ConfigPHost.Enabled := opm_CheckBox_ConfigUseProxy.Checked;
0348:     opm_Label_ConfigPPort.Enabled := opm_CheckBox_ConfigUseProxy.Checked;
0349:     opm_BitBtn_ConfigModDel.Enabled := FALSE;
0350:     opm_BitBtn_ConfigModEdit.Enabled := FALSE;
0351:     opm_PRRefresh_ModuleList (-1);
0352:     opm_ListBox_ConfigMods.ScrollWidth := ROUND (opm_ListBox_ConfigMods.Width * 1.5);
0353:     opm_BitBtn_ConfigReportEdit.Enabled := FALSE;
0354:     opm_BitBtn_ConfigReportPreview.Enabled := FALSE;
0355:     opm_PRRefresh_ReportList (-1);
0356:     opm_ListBox_ConfigReports.ScrollWidth := ROUND (opm_ListBox_ConfigReports.Width * 1.5);
0357:     opm_Label_ConfigDBTable01.Caption := opmC_Def_DBTable_Categories;
0358:     opm_Label_ConfigDBTable02.Caption := opmC_Def_DBTable_Manufacturers;
0359:     opm_Label_ConfigDBTable03.Caption := opmC_Def_DBTable_Languages;
0360:     opm_Label_ConfigDBTable04.Caption := opmC_Def_DBTable_Products;
0361:     opm_Label_ConfigDBTable05.Caption := opmC_Def_DBTable_Specials;
0362:     opm_Label_ConfigDBTable06.Caption := opmC_Def_DBTable_ProductsDescription;
0363:     opm_Label_ConfigDBTable07.Caption := opmC_Def_DBTable_TaxClass;
0364:     opm_Label_ConfigDBTable08.Caption := opmC_Def_DBTable_Currencies;
0365:     opm_Label_ConfigDBTable09.Caption := opmC_Def_DBTable_Configuration;
0366:     opm_Label_ConfigDBTable10.Caption := opmC_Def_DBTable_ProductsToCategories;
0367:     opm_Label_ConfigDBTable11.Caption := opmC_Def_DBTable_CategoriesDescription;
0368:     opm_Label_ConfigDBTable13.Caption := opmC_Def_DBTable_TaxRates;
0369:     opm_Label_ConfigDBTable14.Caption := opmC_Def_DBTable_ManufacturersInfo;
0370:   END;
0371:   
0372:   
0373:   
0374:   {%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%}
0375:   {%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%}
0376:   PROCEDURE Topm_Form_Config.PRopm_ControlToVars;
0377:   VAR
0378:     LangUIStr : STRING;
0379:   BEGIN
0380:     opmG_PDFAuthor := TRIM (opm_Edit_ConfigPDFAuthor.Text);
0381:     opmG_DBTable_Categories := TRIM (opm_Edit_ConfigDBTable01.Text);
0382:     opmG_DBTable_Manufacturers := TRIM (opm_Edit_ConfigDBTable02.Text);
0383:     opmG_DBTable_Languages := TRIM (opm_Edit_ConfigDBTable03.Text);
0384:     opmG_DBTable_Products := TRIM (opm_Edit_ConfigDBTable04.Text);
0385:     opmG_DBTable_Specials := TRIM (opm_Edit_ConfigDBTable05.Text);
0386:     opmG_DBTable_ProductsDescription := TRIM (opm_Edit_ConfigDBTable06.Text);
0387:     opmG_DBTable_TaxClass := TRIM (opm_Edit_ConfigDBTable07.Text);
0388:     opmG_DBTable_Currencies := TRIM (opm_Edit_ConfigDBTable08.Text);
0389:     opmG_DBTable_Configuration := TRIM (opm_Edit_ConfigDBTable09.Text);
0390:     opmG_DBTable_ProductsToCategories := TRIM (opm_Edit_ConfigDBTable10.Text);
0391:     opmG_DBTable_CategoriesDescription := TRIM (opm_Edit_ConfigDBTable11.Text);
0392:     opmG_DBTable_TaxRates := TRIM (opm_Edit_ConfigDBTable13.Text);
0393:     opmG_DBTable_ManufacturersInfo := TRIM (opm_Edit_ConfigDBTable14.Text);
0394:     opmG_DBUsername := TRIM (opm_ComboBox_ConfigUsername.Text);
0395:     opmG_DBPassword := TRIM (opm_Edit_ConfigPassword.Text);
0396:     opmG_WBImgURL := FNopm_FixURL (opm_ComboBox_ConfigImgURL.Text);
0397:     opmG_WBUploadURL := FNopm_FixURL (opm_ComboBox_ConfigUploadURL.Text);
0398:     opmG_WBProxyHost := FNopm_CleanHostName (opm_ComboBox_ConfigProxyHost.Text);
0399:     IF (opmG_WBImgURL[LENGTH (opmG_WBImgURL)] <> '/') THEN opmG_WBImgURL := opmG_WBImgURL + '/';
0400:     opmG_ETABase := FNopm_StrToInt (opm_ComboBox_ConfigETABase.Text);
0401:     opmG_WBProxyPort := ABS (opm_SpinEdit_ConfigProxyPort.Value);
0402:     opmG_ModConnWait := ABS (ROUND ((opm_SpinEdit_ConfigModConnWait.Value + 1) / opmC_MiliSecIncrement) * opmC_MiliSecIncrement);
0403:     opmG_HTTPConnWait := ABS (ROUND ((opm_SpinEdit_ConfigHTTPConnWait.Value + 1) / opmC_MiliSecIncrement) * opmC_MiliSecIncrement);
0404:     opmG_ModConnRetries := ABS (opm_SpinEdit_ConfigModConnRetries.Value);
0405:     opmG_HTTPConnRetries := ABS (opm_SpinEdit_ConfigHTTPConnRetries.Value);
0406:     opmG_WBImgX := ABS (opm_SpinEdit_ConfigImgX.Value);
0407:     opmG_WBImgY := ABS (opm_SpinEdit_ConfigImgY.Value);
0408:     opmG_WBImgQ := ABS (opm_SpinEdit_ConfigImgQ.Value);
0409:     IF (opm_CheckBox_ConfigHotTrack.Checked = TRUE) THEN opmG_UIHotTracking := 1 ELSE opmG_UIHotTracking := 0;
0410:     IF (opm_CheckBox_ConfigRemember.Checked = TRUE) THEN opmG_UIRememberDisplay := 1 ELSE opmG_UIRememberDisplay := 0;
0411:     IF (opm_CheckBox_ConfigAutoload.Checked = TRUE) THEN opmG_UIClickLoad := 1 ELSE opmG_UIClickLoad := 0;
0412:     IF (opm_CheckBox_ConfigDragDrop.Checked = TRUE) THEN opmG_UIDragDrop := 1 ELSE opmG_UIDragDrop := 0;
0413:     IF (opm_CheckBox_ConfigDragUps.Checked = TRUE) THEN opmG_UIImgDragDrop := 1 ELSE opmG_UIImgDragDrop := 0;
0414:     IF (opm_CheckBox_ConfigToolTips.Checked = TRUE) THEN opmG_UIToolTips := 1 ELSE opmG_UIToolTips := 0;
0415:     IF (opm_CheckBox_ConfigStripes.Checked = TRUE) THEN opmG_UIStripes := 1 ELSE opmG_UIStripes := 0;
0416:     IF (opm_CheckBox_ConfigCacheIList.Checked = TRUE) THEN opmG_UICacheIList := 1 ELSE opmG_UICacheIList := 0;
0417:     IF (opm_CheckBox_ConfigUseProxy.Checked = TRUE) THEN opmG_UseProxy := 1 ELSE opmG_UseProxy := 0;
0418:     IF (opm_ComboBox_ConfigProxyApply.ItemIndex >= 0) THEN opmG_ProxyApply := opm_ComboBox_ConfigProxyApply.ItemIndex ELSE opmG_ProxyApply := opmC_Def_ProxyApply; 
0419:     IF (opm_CheckBox_ConfigStorePass.Checked = TRUE) THEN opmG_DBStorePass := 1 ELSE opmG_DBStorePass := 0;
0420:     IF (opm_CheckBox_ConfigSilent.Checked = TRUE) THEN opmG_UISilent := 1 ELSE opmG_UISilent := 0;
0421:     IF (opm_CheckBox_ConfigConfirmDels.Checked = TRUE) THEN opmG_UIConfirmDels := 1 ELSE opmG_UIConfirmDels := 0;
0422:     IF (opm_CheckBox_ConfigConfirmDrag.Checked = TRUE) THEN opmG_UIConfirmDrag := 1 ELSE opmG_UIConfirmDrag := 0;
0423:     IF (opm_CheckBox_ConfigConfirmMods.Checked = TRUE) THEN opmG_UIConfirmMods := 1 ELSE opmG_UIConfirmMods := 0;
0424:     IF (opm_CheckBox_ConfigAllowZeroPrice.Checked = TRUE) THEN opmG_UIAllowZeroPrice := 1 ELSE opmG_UIAllowZeroPrice := 0;
0425:     IF (opm_CheckBox_ConfigAllowEditImageName.Checked = TRUE) THEN opmG_UIAllowEditImageName := 1 ELSE opmG_UIAllowEditImageName := 0;
0426:     IF (opm_CheckBox_ConfigAllowNegativeQuantity.Checked = TRUE) THEN opmG_UIAllowNegativeQuantity := 1 ELSE opmG_UIAllowNegativeQuantity := 0;
0427:     IF (opm_CheckBox_ConfigAutoDownImg.Checked = TRUE) THEN opmG_UIAutoDownImg := 1 ELSE opmG_UIAutoDownImg := 0;
0428:     opmG_UIFontName := opm_FontDialog_Config.Font.Name;
0429:     opmG_UIFontHeight := opm_FontDialog_Config.Font.Height;
0430:     opmG_UIFontCharset := opm_FontDialog_Config.Font.Charset;
0431:     opmG_Clip_ColSize := ABS (opm_SpinEdit_Config_ClipColSize.Value);
0432:     IF (opm_CheckBox_ConfigPRNDirectPrint.Checked = TRUE) THEN opmG_PRNDirectPrint := 1 ELSE opmG_PRNDirectPrint := 0;
0433:     IF (opm_CheckBox_ConfigNoCacheImg.Checked = TRUE) THEN opmG_WBNoCacheImg := 1 ELSE opmG_WBNoCacheImg := 0;
0434:     IF (opm_CheckBox_ConfigResizeImg.Checked = TRUE) THEN opmG_WBResizeImg := 1 ELSE opmG_WBResizeImg := 0;
0435:     IF (opm_CheckBox_ConfigPaddingImg.Checked = TRUE) THEN opmG_WBPaddingImg := 1 ELSE opmG_WBPaddingImg := 0;
0436:     IF (opm_CheckBox_ConfigKeepARImg.Checked = TRUE) THEN opmG_WBKeepARImg := 1 ELSE opmG_WBKeepARImg := 0;
0437:     IF (opm_CheckBox_ConfigConfirmExit.Checked = TRUE) THEN opmG_UIConfirmExit := 1 ELSE opmG_UIConfirmExit := 0;
0438:     IF (opm_CheckBox_ConfigCenterImage.Checked = TRUE) THEN opmG_UICenterImage := 1 ELSE opmG_UICenterImage := 0;
0439:     IF (opm_CheckBox_ConfigDBDebugLog.Checked = TRUE) THEN opmG_DBDebugLog := 1 ELSE opmG_DBDebugLog := 0;
0440:     IF (opm_CheckBox_ConfigHTTPCompress.Checked = TRUE) THEN opmG_HTTPCompress := 1 ELSE opmG_HTTPCompress := 0;
0441:     IF (opm_CheckBox_ConfigWBDebug.Checked = TRUE) THEN opmG_UIWBDebug := 1 ELSE opmG_UIWBDebug := 0;
0442:     LangUIStr := opm_ComboBox_ConfigUILang.Items[opm_ComboBox_ConfigUILang.ItemIndex];
0443:     IF (opm_ComboBox_ConfigUILang.Items.Count > 0) THEN
0444:       opmG_UIGUILang := COPY (LangUIStr, ANSIPOS ('(', LangUIStr) + 1, ANSIPOS (')', LangUIStr) - ANSIPOS ('(', LangUIStr) - 1)
0445:     ELSE
0446:       opmG_UIGUILang := opmC_Def_GUILang;
0447:   END;
0448:   
0449:   
0450:   {%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%}
0451:   {%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%}
0452:   procedure Topm_Form_Config.opm_BitBtn_ConfigOkClick(Sender: TObject);
0453:   begin
0454:     PRopm_ControlToVars;
0455:     PRReg_WriteSetting ('OSCETABase', INTTOSTR (opmG_ETABase), opmC_RegistryKey, opmC_RKConfig);
0456:     PRReg_WriteSetting ('OSCPDFAuthor', opmG_PDFAuthor, opmC_RegistryKey, opmC_RKConfig);
0457:     PRReg_WriteSetting ('OSCTable01', opmG_DBTable_Categories, opmC_RegistryKey, opmC_RKConfig);
0458:     PRReg_WriteSetting ('OSCTable02', opmG_DBTable_Manufacturers, opmC_RegistryKey, opmC_RKConfig);
0459:     PRReg_WriteSetting ('OSCTable03', opmG_DBTable_Languages, opmC_RegistryKey, opmC_RKConfig);
0460:     PRReg_WriteSetting ('OSCTable04', opmG_DBTable_Products, opmC_RegistryKey, opmC_RKConfig);
0461:     PRReg_WriteSetting ('OSCTable05', opmG_DBTable_Specials, opmC_RegistryKey, opmC_RKConfig);
0462:     PRReg_WriteSetting ('OSCTable06', opmG_DBTable_ProductsDescription, opmC_RegistryKey, opmC_RKConfig);
0463:     PRReg_WriteSetting ('OSCTable07', opmG_DBTable_TaxClass, opmC_RegistryKey, opmC_RKConfig);
0464:     PRReg_WriteSetting ('OSCTable08', opmG_DBTable_Currencies, opmC_RegistryKey, opmC_RKConfig);
0465:     PRReg_WriteSetting ('OSCTable09', opmG_DBTable_Configuration, opmC_RegistryKey, opmC_RKConfig);
0466:     PRReg_WriteSetting ('OSCTable10', opmG_DBTable_ProductsToCategories, opmC_RegistryKey, opmC_RKConfig);
0467:     PRReg_WriteSetting ('OSCTable11', opmG_DBTable_CategoriesDescription, opmC_RegistryKey, opmC_RKConfig);
0468:     PRReg_WriteSetting ('OSCTable13', opmG_DBTable_TaxRates, opmC_RegistryKey, opmC_RKConfig);
0469:     PRReg_WriteSetting ('OSCTable14', opmG_DBTable_ManufacturersInfo, opmC_RegistryKey, opmC_RKConfig);
0470:     PRReg_WriteSetting ('OSCUsername', opmG_DBUsername, opmC_RegistryKey, opmC_RKConfig);
0471:     IF (opmG_DBStorePass > 0) THEN
0472:       PRReg_WriteSetting ('OSCPassword', opmG_DBPassword, opmC_RegistryKey, opmC_RKConfig)
0473:     ELSE
0474:       PRReg_WriteSetting ('OSCPassword', '', opmC_RegistryKey, opmC_RKConfig);
0475:     PRReg_WriteSetting ('OSCImgURL', opmG_WBImgURL, opmC_RegistryKey, opmC_RKConfig);
0476:     PRReg_WriteSetting ('OSCUploadURL', opmG_WBUploadURL, opmC_RegistryKey, opmC_RKConfig);
0477:     PRReg_WriteSetting ('OSCProxyHost', opmG_WBProxyHost, opmC_RegistryKey, opmC_RKConfig);
0478:     PRReg_WriteSetting ('OSCProxyPort', IntToStr (opmG_WBProxyPort), opmC_RegistryKey, opmC_RKConfig);
0479:     PRReg_WriteSetting ('OSCModConnWait', IntToStr (opmG_ModConnWait), opmC_RegistryKey, opmC_RKConfig);
0480:     PRReg_WriteSetting ('OSCHTTPConnWait', IntToStr (opmG_HTTPConnWait), opmC_RegistryKey, opmC_RKConfig);
0481:     PRReg_WriteSetting ('OSCModConnRetries', IntToStr (opmG_ModConnRetries), opmC_RegistryKey, opmC_RKConfig);
0482:     PRReg_WriteSetting ('OSCHTTPConnRetries', IntToStr (opmG_HTTPConnRetries), opmC_RegistryKey, opmC_RKConfig);
0483:     PRReg_WriteSetting ('OSCImgX', IntToStr (opmG_WBImgX), opmC_RegistryKey, opmC_RKConfig);
0484:     PRReg_WriteSetting ('OSCImgY', IntToStr (opmG_WBImgY), opmC_RegistryKey, opmC_RKConfig);
0485:     PRReg_WriteSetting ('OSCImgQ', IntToStr (opmG_WBImgQ), opmC_RegistryKey, opmC_RKConfig);
0486:     PRReg_WriteSetting ('OSCPaddingColor', IntToStr (opmG_WBPaddingColor), opmC_RegistryKey, opmC_RKConfig);
0487:     PRReg_WriteSetting ('OSCHotTracking', IntToStr (opmG_UIHotTracking), opmC_RegistryKey, opmC_RKConfig);
0488:     PRReg_WriteSetting ('OSCAutoLoad', IntToStr (opmG_UIClickLoad), opmC_RegistryKey, opmC_RKConfig);
0489:     PRReg_WriteSetting ('OSCDragDrop', IntToStr (opmG_UIDragDrop), opmC_RegistryKey, opmC_RKConfig);
0490:     PRReg_WriteSetting ('OSCImgDragDrop', IntToStr (opmG_UIImgDragDrop), opmC_RegistryKey, opmC_RKConfig);
0491:     PRReg_WriteSetting ('OSCToolTips', IntToStr (opmG_UIToolTips), opmC_RegistryKey, opmC_RKConfig);
0492:     PRReg_WriteSetting ('OSCStripes', IntToStr (opmG_UIStripes), opmC_RegistryKey, opmC_RKConfig);
0493:     PRReg_WriteSetting ('OSCCacheIList', IntToStr (opmG_UICacheIList), opmC_RegistryKey, opmC_RKConfig);
0494:     PRReg_WriteSetting ('OSCUseProxy', IntToStr (opmG_UseProxy), opmC_RegistryKey, opmC_RKConfig);
0495:     PRReg_WriteSetting ('OSCProxyApply', IntToStr (opmG_ProxyApply), opmC_RegistryKey, opmC_RKConfig);
0496:     PRReg_WriteSetting ('OSCStorePass', IntToStr (opmG_DBStorePass), opmC_RegistryKey, opmC_RKConfig);
0497:     PRReg_WriteSetting ('OSCSilent', IntToStr (opmG_UISilent), opmC_RegistryKey, opmC_RKConfig);
0498:     PRReg_WriteSetting ('OSCConfirmDels', IntToStr (opmG_UIConfirmDels), opmC_RegistryKey, opmC_RKConfig);
0499:     PRReg_WriteSetting ('OSCConfirmDrag', IntToStr (opmG_UIConfirmDrag), opmC_RegistryKey, opmC_RKConfig);
0500:     PRReg_WriteSetting ('OSCConfirmMods', IntToStr (opmG_UIConfirmMods), opmC_RegistryKey, opmC_RKConfig);
0501:     PRReg_WriteSetting ('OSCAllowZeroPrice', IntToStr (opmG_UIAllowZeroPrice), opmC_RegistryKey, opmC_RKConfig);
0502:     PRReg_WriteSetting ('OSCAllowEditImageName', IntToStr (opmG_UIAllowEditImageName), opmC_RegistryKey, opmC_RKConfig);
0503:     PRReg_WriteSetting ('OSCAllowNegativeQuantity', IntToStr (opmG_UIAllowNegativeQuantity), opmC_RegistryKey, opmC_RKConfig);
0504:     PRReg_WriteSetting ('OSCAutoDownImg', IntToStr (opmG_UIAutoDownImg), opmC_RegistryKey, opmC_RKConfig);
0505:     PRReg_WriteSetting ('UIFontName', opmG_UIFontName, opmC_RegistryKey, opmC_RKVisual);
0506:     PRReg_WriteSetting ('UIFontHeight', INTTOSTR (opmG_UIFontHeight), opmC_RegistryKey, opmC_RKVisual);
0507:     PRReg_WriteSetting ('UIFontCharset', INTTOSTR (opmG_UIFontCharset), opmC_RegistryKey, opmC_RKVisual);
0508:     PRReg_WriteSetting ('Clip_ColSize', IntToStr (opmG_Clip_ColSize), opmC_RegistryKey, opmC_RKVisual);
0509:     PRReg_WriteSetting ('PRNDirectPrint', IntToStr (opmG_PRNDirectPrint), opmC_RegistryKey, opmC_RKVisual);
0510:     PRReg_WriteSetting ('PastAvailDate', INTTOSTR (opmG_Past_PAvailDate), opmC_RegistryKey, opmC_RKVisual);
0511:     PRReg_WriteSetting ('PastManufacturer', INTTOSTR (opmG_Past_PManufacturer), opmC_RegistryKey, opmC_RKVisual);
0512:     PRReg_WriteSetting ('PastTaxClass', INTTOSTR (opmG_Past_PTaxClass), opmC_RegistryKey, opmC_RKVisual);
0513:     PRReg_WriteSetting ('PastImageDir', opmG_Past_PImageDir, opmC_RegistryKey, opmC_RKVisual);
0514:     PRReg_WriteSetting ('OSCNoCacheImg', IntToStr (opmG_WBNoCacheImg), opmC_RegistryKey, opmC_RKConfig);
0515:     PRReg_WriteSetting ('OSCResizeImg', IntToStr (opmG_WBResizeImg), opmC_RegistryKey, opmC_RKConfig);
0516:     PRReg_WriteSetting ('OSCPaddingImg', IntToStr (opmG_WBPaddingImg), opmC_RegistryKey, opmC_RKConfig);
0517:     PRReg_WriteSetting ('OSCKeepARImg', IntToStr (opmG_WBKeepARImg), opmC_RegistryKey, opmC_RKConfig);
0518:     PRReg_WriteSetting ('OSCConfirmExit', IntToStr (opmG_UIConfirmExit), opmC_RegistryKey, opmC_RKConfig);
0519:     PRReg_WriteSetting ('OSCCenterImage', IntToStr (opmG_UICenterImage), opmC_RegistryKey, opmC_RKConfig);
0520:     PRReg_WriteSetting ('OSCDBDebugLog', IntToStr (opmG_DBDebugLog), opmC_RegistryKey, opmC_RKConfig);
0521:     PRReg_WriteSetting ('OSCHTTPCompress', IntToStr (opmG_HTTPCompress), opmC_RegistryKey, opmC_RKConfig);
0522:     PRReg_WriteSetting ('OSCWBDebug', IntToStr (opmG_UIWBDebug), opmC_RegistryKey, opmC_RKConfig);
0523:     PRReg_WriteSetting ('OSCRememberPosition', IntToStr (opmG_UIRememberDisplay), opmC_RegistryKey, opmC_RKConfig);
0524:     PRReg_WritePastList ('Username', opmC_RegistryKey, opmC_RKServers, opmG_DBUsername, opmG_PastUsername_BoxList, opmC_MaxPast_Usernames);
0525:     PRReg_WritePastList ('ImgURL', opmC_RegistryKey, opmC_RKServers, opmG_WBImgURL, opmG_PastImgURL_BoxList, opmC_MaxPast_ImgURL);
0526:     PRReg_WritePastList ('UploadURL', opmC_RegistryKey, opmC_RKServers, opmG_WBUploadURL, opmG_PastUploadURL_BoxList, opmC_MaxPast_UploadURL);
0527:     PRReg_WritePastList ('Proxy', opmC_RegistryKey, opmC_RKServers, opmG_WBProxyHost, opmG_PastProxy_BoxList, opmC_MaxPast_Proxy);
0528:   end;
0529:   
0530:   {%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%}
0531:   {%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%}
0532:   procedure Topm_Form_Config.FormCreate(Sender: TObject);
0533:   begin
0534:     opm_SpinEdit_ConfigProxyPort.MinValue := opmC_Min_ProxyPort;
0535:     opm_SpinEdit_ConfigProxyPort.MaxValue := opmC_Max_ProxyPort;
0536:     opm_SpinEdit_ConfigModConnWait.MinValue := opmC_Min_ModConnWait;
0537:     opm_SpinEdit_ConfigModConnWait.MaxValue := opmC_Max_ModConnWait;
0538:     opm_SpinEdit_ConfigModConnWait.Increment := opmC_MiliSecIncrement;
0539:     opm_SpinEdit_ConfigHTTPConnWait.MinValue := opmC_Min_HTTPConnWait;
0540:     opm_SpinEdit_ConfigHTTPConnWait.MaxValue := opmC_Max_HTTPConnWait;
0541:     opm_SpinEdit_ConfigHTTPConnWait.Increment := opmC_MiliSecIncrement;
0542:     opm_SpinEdit_ConfigModConnRetries.MinValue := opmC_Min_ModConnRetries;
0543:     opm_SpinEdit_ConfigModConnRetries.MaxValue := opmC_Max_ModConnRetries;
0544:     opm_SpinEdit_ConfigHTTPConnRetries.MinValue := opmC_Min_HTTPConnRetries;
0545:     opm_SpinEdit_ConfigHTTPConnRetries.MaxValue := opmC_Max_HTTPConnRetries;
0546:     opm_SpinEdit_ConfigImgX.MinValue := opmC_Min_ImgX;
0547:     opm_SpinEdit_ConfigImgX.MaxValue := opmC_Max_ImgX;
0548:     opm_SpinEdit_ConfigImgY.MinValue := opmC_Min_ImgY;
0549:     opm_SpinEdit_ConfigImgY.MaxValue := opmC_Max_ImgY;
0550:     opm_SpinEdit_ConfigImgQ.MinValue := opmC_Min_ImgQ;
0551:     opm_SpinEdit_ConfigImgQ.MaxValue := opmC_Max_ImgQ;
0552:     opm_ComboBox_ConfigETABase.Items.Text := opmC_ETABitrates;
0553:     opm_ComboBox_ConfigProxyApply.Items.Text := _('For all web connections') + #13#10 + _('For OSCPM script only') + #13#10 + _('To check updates only') + #13#10;
0554:     opm_Edit_ConfigPassword.PasswordChar := opmC_PasswordChar;
0555:     opm_FontDialog_Config.MinFontSize := opmC_Min_FontHeight;
0556:     opm_FontDialog_Config.MaxFontSize := opmC_Max_FontHeight;
0557:     opm_SpinEdit_Config_ClipColSize.MinValue := opmC_Min_Clip_ColSize;
0558:     opm_SpinEdit_Config_ClipColSize.MaxValue := opmC_Max_Clip_ColSize;
0559:     IF (opmG_UIHotTracking > 0) THEN
0560:       opm_PageControl_Config.HotTrack := TRUE
0561:     ELSE
0562:       opm_PageControl_Config.HotTrack := FALSE;
0563:     TranslateComponent (self);
0564:   end;
0565:   
0566:   {%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%}
0567:   {%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%}
0568:   procedure Topm_Form_Config.opm_BitBtn_ConfigResetClick(Sender: TObject);
0569:   begin
0570:     opm_CheckBox_ConfigHotTrack.Checked := (opmC_Def_HotTracking > 0);
0571:     opm_CheckBox_ConfigRemember.Checked := (opmC_Def_RememberDisplay > 0);
0572:     opm_CheckBox_ConfigAutoload.Checked := (opmC_Def_AutoLoad > 0);
0573:     opm_CheckBox_ConfigDragDrop.Checked := (opmC_Def_DragDrop > 0);
0574:     opm_CheckBox_ConfigDragUps.Checked := (opmC_Def_ImgDragDrop > 0);
0575:     opm_CheckBox_ConfigTooltips.Checked := (opmC_Def_Tooltips > 0);
0576:     opm_CheckBox_ConfigStripes.Checked := (opmC_Def_Stripes > 0);
0577:     opm_CheckBox_ConfigCacheIList.Checked := (opmC_Def_CacheIList > 0);
0578:     opm_CheckBox_ConfigConfirmDels.Checked := (opmC_Def_ConfirmDels > 0);
0579:     opm_CheckBox_ConfigConfirmDrag.Checked := (opmC_Def_ConfirmDrag > 0);
0580:     opm_CheckBox_ConfigConfirmMods.Checked := (opmC_Def_ConfirmMods > 0);
0581:     opm_CheckBox_ConfigAllowZeroPrice.Checked := (opmC_Def_AllowZeroPrice > 0);
0582:     opm_CheckBox_ConfigAllowEditImageName.Checked := (opmC_Def_AllowEditImageName > 0);
0583:     opm_CheckBox_ConfigAllowNegativeQuantity.Checked := (opmC_Def_AllowNegativeQuantity > 0);
0584:     opm_CheckBox_ConfigAutoDownImg.Checked := (opmC_Def_AutoDownImg > 0);
0585:     opm_CheckBox_ConfigNoCacheImg.Checked := (opmC_Def_NoCacheImg > 0);
0586:     opm_CheckBox_ConfigConfirmExit.Checked := (opmC_Def_ConfirmExit > 0);
0587:     opm_CheckBox_ConfigCenterImage.Checked := (opmC_Def_CenterImage > 0);
0588:     opm_CheckBox_ConfigDBDebugLog.Checked := (opmC_Def_DBDebugLog > 0);
0589:     opm_CheckBox_ConfigHTTPCompress.Checked := (opmC_Def_HTTPCompress > 0);
0590:     opm_CheckBox_ConfigWBDebug.Checked := (opmC_Def_WBDebug > 0);
0591:   end;
0592:   
0593:   {%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%}
0594:   {%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%}
0595:   procedure Topm_Form_Config.opm_CheckBox_ConfigResizeImgClick (Sender: TObject);
0596:   begin
0597:     opm_Label_ConfigImgResize.Enabled := opm_CheckBox_ConfigResizeImg.Checked;
0598:     opm_CheckBox_ConfigPaddingImg.Enabled := opm_CheckBox_ConfigResizeImg.Checked;
0599:     opm_CheckBox_ConfigKeepARImg.Enabled := opm_CheckBox_ConfigResizeImg.Checked;
0600:     opm_SpinEdit_ConfigImgX.Enabled := opm_CheckBox_ConfigResizeImg.Checked;
0601:     opm_SpinEdit_ConfigImgY.Enabled := opm_CheckBox_ConfigResizeImg.Checked;
0602:     opm_Panel_ConfigColSel.Enabled := opm_CheckBox_ConfigResizeImg.Checked;
0603:     opm_BitBtn_ConfigColSel.Enabled := opm_CheckBox_ConfigResizeImg.Checked;
0604:     opm_SpinEdit_ConfigImgQ.Enabled := opm_CheckBox_ConfigResizeImg.Checked;
0605:     opm_Label_ConfigImgJPEGQuality.Enabled := opm_CheckBox_ConfigResizeImg.Checked;
0606:     opm_Label_ConfigJPEGQCategory.Enabled := opm_CheckBox_ConfigResizeImg.Checked;
0607:   end;
0608:   
0609:   {%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%}
0610:   {%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%}
0611:   procedure Topm_Form_Config.opm_BitBtn_ConfigSaveINIClick(Sender: TObject);
0612:   begin
0613:     opm_SaveDialog_ConfigINI.DefaultExt := opmC_Def_SaveINIExt;
0614:     opm_SaveDialog_ConfigINI.FileName := opmC_Def_SaveINIFilename;
0615:     opm_SaveDialog_ConfigINI.Filter := _('Configuration files') + ' (' + opmC_Def_SaveINIFilter + ')|' + opmC_Def_SaveINIFilter + '|' + _('All files (*.*)');
0616:     opm_SaveDialog_ConfigINI.Title := _('Saving configuration file...');
0617:     opm_SaveDialog_ConfigINI.InitialDir := ExtractFilePath (Application.Exename);
0618:     IF (opm_SaveDialog_ConfigINI.Execute = TRUE) THEN
0619:       BEGIN
0620:         PRopm_ControlToVars;
0621:         PRINI_WriteSetting ('OSCETABase', INTTOSTR (opmG_ETABase), opm_SaveDialog_ConfigINI.FileName, opmC_RKConfig);
0622:         PRINI_WriteSetting ('OSCPDFAuthor', opmG_PDFAuthor, opm_SaveDialog_ConfigINI.FileName, opmC_RKConfig);
0623:         PRINI_WriteSetting ('OSCTable01', opmG_DBTable_Categories, opm_SaveDialog_ConfigINI.FileName, opmC_RKConfig);
0624:         PRINI_WriteSetting ('OSCTable02', opmG_DBTable_Manufacturers, opm_SaveDialog_ConfigINI.FileName, opmC_RKConfig);
0625:         PRINI_WriteSetting ('OSCTable03', opmG_DBTable_Languages, opm_SaveDialog_ConfigINI.FileName, opmC_RKConfig);
0626:         PRINI_WriteSetting ('OSCTable04', opmG_DBTable_Products, opm_SaveDialog_ConfigINI.FileName, opmC_RKConfig);
0627:         PRINI_WriteSetting ('OSCTable05', opmG_DBTable_Specials, opm_SaveDialog_ConfigINI.FileName, opmC_RKConfig);
0628:         PRINI_WriteSetting ('OSCTable06', opmG_DBTable_ProductsDescription, opm_SaveDialog_ConfigINI.FileName, opmC_RKConfig);
0629:         PRINI_WriteSetting ('OSCTable07', opmG_DBTable_TaxClass, opm_SaveDialog_ConfigINI.FileName, opmC_RKConfig);
0630:         PRINI_WriteSetting ('OSCTable08', opmG_DBTable_Currencies, opm_SaveDialog_ConfigINI.FileName, opmC_RKConfig);
0631:         PRINI_WriteSetting ('OSCTable09', opmG_DBTable_Configuration, opm_SaveDialog_ConfigINI.FileName, opmC_RKConfig);
0632:         PRINI_WriteSetting ('OSCTable10', opmG_DBTable_ProductsToCategories, opm_SaveDialog_ConfigINI.FileName, opmC_RKConfig);
0633:         PRINI_WriteSetting ('OSCTable11', opmG_DBTable_CategoriesDescription, opm_SaveDialog_ConfigINI.FileName, opmC_RKConfig);
0634:         PRINI_WriteSetting ('OSCTable13', opmG_DBTable_TaxRates, opm_SaveDialog_ConfigINI.FileName, opmC_RKConfig);
0635:         PRINI_WriteSetting ('OSCTable14', opmG_DBTable_ManufacturersInfo, opm_SaveDialog_ConfigINI.FileName, opmC_RKConfig);
0636:         PRINI_WriteSetting ('OSCUsername', opmG_DBUsername, opm_SaveDialog_ConfigINI.FileName, opmC_RKConfig);
0637:         IF (opmG_DBStorePass > 0) THEN
0638:           PRINI_WriteSetting ('OSCPassword', opmG_DBPassword, opm_SaveDialog_ConfigINI.FileName, opmC_RKConfig)
0639:         ELSE
0640:           PRINI_WriteSetting ('OSCPassword', '', opm_SaveDialog_ConfigINI.FileName, opmC_RKConfig);
0641:         PRINI_WriteSetting ('OSCImgURL', opmG_WBImgURL, opm_SaveDialog_ConfigINI.FileName, opmC_RKConfig);
0642:         PRINI_WriteSetting ('OSCUploadURL', opmG_WBUploadURL, opm_SaveDialog_ConfigINI.FileName, opmC_RKConfig);
0643:         PRINI_WriteSetting ('OSCProxyHost', opmG_WBProxyHost, opm_SaveDialog_ConfigINI.FileName, opmC_RKConfig);
0644:         PRINI_WriteSetting ('OSCProxyPort', IntToStr (opmG_WBProxyPort), opm_SaveDialog_ConfigINI.FileName, opmC_RKConfig);
0645:         PRINI_WriteSetting ('OSCModConnWait', IntToStr (opmG_ModConnWait), opm_SaveDialog_ConfigINI.FileName, opmC_RKConfig);
0646:         PRINI_WriteSetting ('OSCHTTPConnWait', IntToStr (opmG_HTTPConnWait), opm_SaveDialog_ConfigINI.FileName, opmC_RKConfig);
0647:         PRINI_WriteSetting ('OSCModConnRetries', IntToStr (opmG_ModConnRetries), opm_SaveDialog_ConfigINI.FileName, opmC_RKConfig);
0648:         PRINI_WriteSetting ('OSCHTTPConnRetries', IntToStr (opmG_HTTPConnRetries), opm_SaveDialog_ConfigINI.FileName, opmC_RKConfig);
0649:         PRINI_WriteSetting ('OSCImgX', IntToStr (opmG_WBImgX), opm_SaveDialog_ConfigINI.FileName, opmC_RKConfig);
0650:         PRINI_WriteSetting ('OSCImgY', IntToStr (opmG_WBImgY), opm_SaveDialog_ConfigINI.FileName, opmC_RKConfig);
0651:         PRINI_WriteSetting ('OSCImgQ', IntToStr (opmG_WBImgQ), opm_SaveDialog_ConfigINI.FileName, opmC_RKConfig);
0652:         PRINI_WriteSetting ('OSCPaddingColor', IntToStr (opmG_WBPaddingColor), opm_SaveDialog_ConfigINI.FileName, opmC_RKConfig);
0653:         PRINI_WriteSetting ('OSCHotTracking', IntToStr (opmG_UIHotTracking), opm_SaveDialog_ConfigINI.FileName, opmC_RKConfig);
0654:         PRINI_WriteSetting ('OSCAutoLoad', IntToStr (opmG_UIClickLoad), opm_SaveDialog_ConfigINI.FileName, opmC_RKConfig);
0655:         PRINI_WriteSetting ('OSCDragDrop', IntToStr (opmG_UIDragDrop), opm_SaveDialog_ConfigINI.FileName, opmC_RKConfig);
0656:         PRINI_WriteSetting ('OSCImgDragDrop', IntToStr (opmG_UIImgDragDrop), opm_SaveDialog_ConfigINI.FileName, opmC_RKConfig);
0657:         PRINI_WriteSetting ('OSCToolTips', IntToStr (opmG_UIToolTips), opm_SaveDialog_ConfigINI.FileName, opmC_RKConfig);
0658:         PRINI_WriteSetting ('OSCStripes', IntToStr (opmG_UIStripes), opm_SaveDialog_ConfigINI.FileName, opmC_RKConfig);
0659:         PRINI_WriteSetting ('OSCCacheIList', IntToStr (opmG_UICacheIList), opm_SaveDialog_ConfigINI.FileName, opmC_RKConfig);
0660:         PRINI_WriteSetting ('OSCUseProxy', IntToStr (opmG_UseProxy), opm_SaveDialog_ConfigINI.FileName, opmC_RKConfig);
0661:         PRINI_WriteSetting ('OSCProxyApply', IntToStr (opmG_ProxyApply), opm_SaveDialog_ConfigINI.FileName, opmC_RKConfig);
0662:         PRINI_WriteSetting ('OSCStorePass', IntToStr (opmG_DBStorePass), opm_SaveDialog_ConfigINI.FileName, opmC_RKConfig);
0663:         PRINI_WriteSetting ('OSCSilent', IntToStr (opmG_UISilent), opm_SaveDialog_ConfigINI.FileName, opmC_RKConfig);
0664:         PRINI_WriteSetting ('OSCConfirmDels', IntToStr (opmG_UIConfirmDels), opm_SaveDialog_ConfigINI.FileName, opmC_RKConfig);
0665:         PRINI_WriteSetting ('OSCConfirmDrag', IntToStr (opmG_UIConfirmDrag), opm_SaveDialog_ConfigINI.FileName, opmC_RKConfig);
0666:         PRINI_WriteSetting ('OSCConfirmMods', IntToStr (opmG_UIConfirmMods), opm_SaveDialog_ConfigINI.FileName, opmC_RKConfig);
0667:         PRINI_WriteSetting ('OSCAllowZeroPrice', IntToStr (opmG_UIAllowZeroPrice), opm_SaveDialog_ConfigINI.FileName, opmC_RKConfig);
0668:         PRINI_WriteSetting ('OSCAllowEditImageName', IntToStr (opmG_UIAllowEditImageName), opm_SaveDialog_ConfigINI.FileName, opmC_RKConfig);
0669:         PRINI_WriteSetting ('OSCAllowNegativeQuantity', IntToStr (opmG_UIAllowNegativeQuantity), opm_SaveDialog_ConfigINI.FileName, opmC_RKConfig);
0670:         PRINI_WriteSetting ('OSCAutoDownImg', IntToStr (opmG_UIAutoDownImg), opm_SaveDialog_ConfigINI.FileName, opmC_RKConfig);
0671:         PRINI_WriteSetting ('UIFontName', opmG_UIFontName, opm_SaveDialog_ConfigINI.FileName, opmC_RKVisual);
0672:         PRINI_WriteSetting ('UIFontHeight', INTTOSTR (opmG_UIFontHeight), opm_SaveDialog_ConfigINI.FileName, opmC_RKVisual);
0673:         PRINI_WriteSetting ('UIFontCharset', INTTOSTR (opmG_UIFontCharset), opm_SaveDialog_ConfigINI.FileName, opmC_RKVisual);
0674:         PRINI_WriteSetting ('Clip_ColSize', IntToStr (opmG_PRNDirectPrint), opm_SaveDialog_ConfigINI.FileName, opmC_RKVisual);
0675:         PRINI_WriteSetting ('PRNDirectPrint', IntToStr (opmG_PRNDirectPrint), opm_SaveDialog_ConfigINI.FileName, opmC_RKVisual);
0676:         PRINI_WriteSetting ('PastAvailDate', INTTOSTR (opmG_Past_PAvailDate), opm_SaveDialog_ConfigINI.FileName, opmC_RKVisual);
0677:         PRINI_WriteSetting ('PastManufacturer', INTTOSTR (opmG_Past_PManufacturer), opm_SaveDialog_ConfigINI.FileName, opmC_RKVisual);
0678:         PRINI_WriteSetting ('PastTaxClass', INTTOSTR (opmG_Past_PTaxClass), opm_SaveDialog_ConfigINI.FileName, opmC_RKVisual);
0679:         PRINI_WriteSetting ('PastImageDir', opmG_Past_PImageDir, opm_SaveDialog_ConfigINI.FileName, opmC_RKVisual);
0680:         PRINI_WriteSetting ('OSCNoCacheImg', IntToStr (opmG_WBNoCacheImg), opm_SaveDialog_ConfigINI.FileName, opmC_RKConfig);
0681:         PRINI_WriteSetting ('OSCResizeImg', IntToStr (opmG_WBResizeImg), opm_SaveDialog_ConfigINI.FileName, opmC_RKConfig);
0682:         PRINI_WriteSetting ('OSCPaddingImg', IntToStr (opmG_WBPaddingImg), opm_SaveDialog_ConfigINI.FileName, opmC_RKConfig);
0683:         PRINI_WriteSetting ('OSCKeepARImg', IntToStr (opmG_WBKeepARImg), opm_SaveDialog_ConfigINI.FileName, opmC_RKConfig);
0684:         PRINI_WriteSetting ('OSCConfirmExit', IntToStr (opmG_UIConfirmExit), opm_SaveDialog_ConfigINI.FileName, opmC_RKConfig);
0685:         PRINI_WriteSetting ('OSCCenterImage', IntToStr (opmG_UICenterImage), opm_SaveDialog_ConfigINI.FileName, opmC_RKConfig);
0686:         PRINI_WriteSetting ('OSCDBDebugLog', IntToStr (opmG_DBDebugLog), opm_SaveDialog_ConfigINI.FileName, opmC_RKConfig);
0687:         PRINI_WriteSetting ('OSCHTTPCompress', IntToStr (opmG_HTTPCompress), opm_SaveDialog_ConfigINI.FileName, opmC_RKConfig);
0688:         PRINI_WriteSetting ('OSCWBDebug', IntToStr (opmG_UIWBDebug), opm_SaveDialog_ConfigINI.FileName, opmC_RKConfig);
0689:         PRINI_WriteSetting ('OSCRememberPosition', IntToStr (opmG_UIRememberDisplay), opm_SaveDialog_ConfigINI.FileName, opmC_RKConfig);
0690:       END;
0691:   end;
0692:   
0693:   {%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%}
0694:   {%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%}
0695:   procedure Topm_Form_Config.opm_BitBtn_ConfigLoadINIClick(Sender: TObject);
0696:   begin
0697:     opm_OpenDialog_ConfigINI.DefaultExt := opmC_Def_LoadINIExt;
0698:     opm_OpenDialog_ConfigINI.FileName := '';
0699:     opm_OpenDialog_ConfigINI.Filter := _('Configuration files') + ' (' + opmC_Def_LoadINIFilter + ')|' + opmC_Def_LoadINIFilter + '|' + _('All files (*.*)');
0700:     opm_OpenDialog_ConfigINI.Title := _('Loading configuration file...');
0701:     opm_OpenDialog_ConfigINI.InitialDir := ExtractFilePath (Application.Exename);
0702:     IF (opm_OpenDialog_ConfigINI.Execute = TRUE) THEN
0703:       BEGIN
0704:         opmG_ETABase := FNopm_StrToInt (FNINI_ReadSetting ('OSCETABase', opmC_Def_ETABase, opm_OpenDialog_ConfigINI.FileName, opmC_RKConfig));
0705:         opmG_PDFAuthor := FNINI_ReadSetting ('OSCPDFAuthor', opmC_Def_PDFAuthor, opm_OpenDialog_ConfigINI.FileName, opmC_RKConfig);
0706:         opmG_DBTable_Categories := FNINI_ReadSetting ('OSCTable01', opmC_Def_DBTable_Categories, opm_OpenDialog_ConfigINI.FileName, opmC_RKConfig);
0707:         opmG_DBTable_Manufacturers := FNINI_ReadSetting ('OSCTable02', opmC_Def_DBTable_Manufacturers, opm_OpenDialog_ConfigINI.FileName, opmC_RKConfig);
0708:         opmG_DBTable_Languages := FNINI_ReadSetting ('OSCTable03', opmC_Def_DBTable_Languages, opm_OpenDialog_ConfigINI.FileName, opmC_RKConfig);
0709:         opmG_DBTable_Products := FNINI_ReadSetting ('OSCTable04', opmC_Def_DBTable_Products, opm_OpenDialog_ConfigINI.FileName, opmC_RKConfig);
0710:         opmG_DBTable_Specials := FNINI_ReadSetting ('OSCTable05', opmC_Def_DBTable_Specials, opm_OpenDialog_ConfigINI.FileName, opmC_RKConfig);
0711:         opmG_DBTable_ProductsDescription := FNINI_ReadSetting ('OSCTable06', opmC_Def_DBTable_ProductsDescription, opm_OpenDialog_ConfigINI.FileName, opmC_RKConfig);
0712:         opmG_DBTable_TaxClass := FNINI_ReadSetting ('OSCTable07', opmC_Def_DBTable_TaxClass, opm_OpenDialog_ConfigINI.FileName, opmC_RKConfig);
0713:         opmG_DBTable_Currencies := FNINI_ReadSetting ('OSCTable08', opmC_Def_DBTable_Currencies, opm_OpenDialog_ConfigINI.FileName, opmC_RKConfig);
0714:         opmG_DBTable_Configuration := FNINI_ReadSetting ('OSCTable09', opmC_Def_DBTable_Configuration, opm_OpenDialog_ConfigINI.FileName, opmC_RKConfig);
0715:         opmG_DBTable_ProductsToCategories := FNINI_ReadSetting ('OSCTable10', opmC_Def_DBTable_ProductsToCategories, opm_OpenDialog_ConfigINI.FileName, opmC_RKConfig);
0716:         opmG_DBTable_CategoriesDescription := FNINI_ReadSetting ('OSCTable11', opmC_Def_DBTable_CategoriesDescription, opm_OpenDialog_ConfigINI.FileName, opmC_RKConfig);
0717:         opmG_DBTable_TaxRates := FNINI_ReadSetting ('OSCTable13', opmC_Def_DBTable_TaxRates, opm_OpenDialog_ConfigINI.FileName, opmC_RKConfig);
0718:         opmG_DBTable_ManufacturersInfo := FNINI_ReadSetting ('OSCTable14', opmC_Def_DBTable_ManufacturersInfo, opm_OpenDialog_ConfigINI.FileName, opmC_RKConfig);
0719:         opmG_DBUsername := FNINI_ReadSetting ('OSCUsername', opmC_Def_Username, opm_OpenDialog_ConfigINI.FileName, opmC_RKConfig);
0720:         opmG_DBPassword := FNINI_ReadSetting ('OSCPassword', opmC_Def_Password, opm_OpenDialog_ConfigINI.FileName, opmC_RKConfig);
0721:         opmG_WBImgURL := FNINI_ReadSetting ('OSCImgURL', opmC_Def_ImgURL, opm_OpenDialog_ConfigINI.FileName, opmC_RKConfig);
0722:         opmG_WBUploadURL := FNINI_ReadSetting ('OSCUploadURL', opmC_Def_UploadURL, opm_OpenDialog_ConfigINI.FileName, opmC_RKConfig);
0723:         opmG_WBProxyHost := FNopm_CleanHostName (FNINI_ReadSetting ('OSCProxyHost', opmC_Def_ProxyHost, opm_OpenDialog_ConfigINI.FileName, opmC_RKConfig));
0724:         opmG_WBProxyPort := FNopm_StrToInt (FNINI_ReadSetting ('OSCProxyPort', INTTOSTR (opmC_Def_ProxyPort), opm_OpenDialog_ConfigINI.FileName, opmC_RKConfig));
0725:         opmG_ModConnWait := FNopm_StrToInt (FNINI_ReadSetting ('OSCModConnWait', INTTOSTR (opmC_Def_ModConnWait), opm_OpenDialog_ConfigINI.FileName, opmC_RKConfig));
0726:         opmG_HTTPConnWait := FNopm_StrToInt (FNINI_ReadSetting ('OSCHTTPConnWait', INTTOSTR (opmC_Def_HTTPConnWait), opm_OpenDialog_ConfigINI.FileName, opmC_RKConfig));
0727:         opmG_ModConnRetries := FNopm_StrToInt (FNINI_ReadSetting ('OSCModConnRetries', INTTOSTR (opmC_Def_ModConnRetries), opm_OpenDialog_ConfigINI.FileName, opmC_RKConfig));
0728:         opmG_HTTPConnRetries := FNopm_StrToInt (FNINI_ReadSetting ('OSCHTTPConnRetries', INTTOSTR (opmC_Def_HTTPConnRetries), opm_OpenDialog_ConfigINI.FileName, opmC_RKConfig));
0729:         opmG_WBImgX := FNopm_StrToInt (FNINI_ReadSetting ('OSCImgX', INTTOSTR (opmC_Def_ImgX), opm_OpenDialog_ConfigINI.FileName, opmC_RKConfig));
0730:         opmG_WBImgY := FNopm_StrToInt (FNINI_ReadSetting ('OSCImgY', INTTOSTR (opmC_Def_ImgY), opm_OpenDialog_ConfigINI.FileName, opmC_RKConfig));
0731:         opmG_WBImgQ := FNopm_StrToInt (FNINI_ReadSetting ('OSCImgQ', INTTOSTR (opmC_Def_ImgQ), opm_OpenDialog_ConfigINI.FileName, opmC_RKConfig));
0732:         opmG_WBPaddingColor := FNopm_StrToInt (FNINI_ReadSetting ('OSCPaddingColor', INTTOSTR (opmC_Def_PaddingColor), opm_OpenDialog_ConfigINI.FileName, opmC_RKConfig));
0733:         IF (opmG_WBImgURL[LENGTH (opmG_WBImgURL)] <> '/') THEN opmG_WBImgURL := opmG_WBImgURL + '/';
0734:         opmG_UIHotTracking := FNopm_StrToInt (FNINI_ReadSetting ('OSCHotTracking', INTTOSTR (opmC_Def_HotTracking), opm_OpenDialog_ConfigINI.FileName, opmC_RKConfig));
0735:         opmG_UIClickLoad := FNopm_StrToInt (FNINI_ReadSetting ('OSCAutoLoad', INTTOSTR (opmC_Def_AutoLoad), opm_OpenDialog_ConfigINI.FileName, opmC_RKConfig));
0736:         opmG_UIDragDrop := FNopm_StrToInt (FNINI_ReadSetting ('OSCDragDrop', INTTOSTR (opmC_Def_DragDrop), opm_OpenDialog_ConfigINI.FileName, opmC_RKConfig));
0737:         opmG_UIImgDragDrop := FNopm_StrToInt (FNINI_ReadSetting ('OSCImgDragDrop', INTTOSTR (opmC_Def_ImgDragDrop), opm_OpenDialog_ConfigINI.FileName, opmC_RKConfig));
0738:         opmG_UIToolTips := FNopm_StrToInt (FNINI_ReadSetting ('OSCToolTips', INTTOSTR (opmC_Def_ToolTips), opm_OpenDialog_ConfigINI.FileName, opmC_RKConfig));
0739:         opmG_UIStripes := FNopm_StrToInt (FNINI_ReadSetting ('OSCStripes', INTTOSTR (opmC_Def_Stripes), opm_OpenDialog_ConfigINI.FileName, opmC_RKConfig));
0740:         opmG_UICacheIList := FNopm_StrToInt (FNINI_ReadSetting ('OSCCacheIList', INTTOSTR (opmC_Def_CacheIList), opm_OpenDialog_ConfigINI.FileName, opmC_RKConfig));
0741:         opmG_UseProxy := FNopm_StrToInt (FNINI_ReadSetting ('OSCUseProxy', INTTOSTR (opmC_Def_UseProxy), opm_OpenDialog_ConfigINI.FileName, opmC_RKConfig));
0742:         opmG_ProxyApply := FNopm_StrToInt (FNINI_ReadSetting ('OSCProxyApply', INTTOSTR (opmC_Def_ProxyApply), opm_OpenDialog_ConfigINI.FileName, opmC_RKConfig));
0743:         opmG_DBStorePass := FNopm_StrToInt (FNINI_ReadSetting ('OSCStorePass', INTTOSTR (opmC_Def_StorePass), opm_OpenDialog_ConfigINI.FileName, opmC_RKConfig));
0744:         opmG_UISilent := FNopm_StrToInt (FNINI_ReadSetting ('OSCSilent', INTTOSTR (opmC_Def_Silent), opm_OpenDialog_ConfigINI.FileName, opmC_RKConfig));
0745:         opmG_UIConfirmDels := FNopm_StrToInt (FNINI_ReadSetting ('OSCConfirmDels', INTTOSTR (opmC_Def_ConfirmDels), opm_OpenDialog_ConfigINI.FileName, opmC_RKConfig));
0746:         opmG_UIConfirmDrag := FNopm_StrToInt (FNINI_ReadSetting ('OSCConfirmDrag', INTTOSTR (opmC_Def_ConfirmDrag), opm_OpenDialog_ConfigINI.FileName, opmC_RKConfig));
0747:         opmG_UIConfirmMods := FNopm_StrToInt (FNINI_ReadSetting ('OSCConfirmMods', INTTOSTR (opmC_Def_ConfirmMods), opm_OpenDialog_ConfigINI.FileName, opmC_RKConfig));
0748:         opmG_UIAllowZeroPrice := FNopm_StrToInt (FNINI_ReadSetting ('OSCAllowZeroPrice', INTTOSTR (opmC_Def_AllowZeroPrice), opm_OpenDialog_ConfigINI.FileName, opmC_RKConfig));
0749:         opmG_UIAllowEditImageName := FNopm_StrToInt (FNINI_ReadSetting ('OSCAllowEditImageName', INTTOSTR (opmC_Def_AllowEditImageName), opm_OpenDialog_ConfigINI.FileName, opmC_RKConfig));
0750:         opmG_UIAllowNegativeQuantity := FNopm_StrToInt (FNINI_ReadSetting ('OSCAllowNegativeQuantity', INTTOSTR (opmC_Def_AllowNegativeQuantity), opm_OpenDialog_ConfigINI.FileName, opmC_RKConfig));
0751:         opmG_UIAutoDownImg := FNopm_StrToInt (FNINI_ReadSetting ('OSCAutoDownImg', INTTOSTR (opmC_Def_AutoDownImg), opm_OpenDialog_ConfigINI.FileName, opmC_RKConfig));
0752:         opmG_UIFontName := FNReg_ReadSetting ('UIFontName', opmC_DefaultFont, opmC_RegistryKey, opmC_RKVisual);
0753:         opmG_UIFontHeight := FNopm_StrToInt (FNReg_ReadSetting ('UIFontHeight', INTTOSTR (opmC_DefaultFontHeight), opmC_RegistryKey, opmC_RKVisual));
0754:         opmG_UIFontCharset := FNopm_StrToInt (FNReg_ReadSetting ('UIFontCharset', INTTOSTR (opmC_DefaultFontCharset), opmC_RegistryKey, opmC_RKVisual));
0755:         opmG_Clip_ColSize := FNopm_StrToInt (FNReg_ReadSetting ('Clip_ColSize', INTTOSTR (opmC_Def_Clip_ColSize), opmC_RegistryKey, opmC_RKVisual));
0756:         opmG_PRNDirectPrint := FNopm_StrToInt (FNReg_ReadSetting ('PRNDirectPrint', INTTOSTR (opmC_Def_PRNDirectPrint), opmC_RegistryKey, opmC_RKVisual));
0757:         opmG_Past_PAvailDate := FNopm_StrToInt (FNReg_ReadSetting ('PastAvailDate', INTTOSTR (opmC_Def_Past_PAvailDate), opmC_RegistryKey, opmC_RKVisual));
0758:         opmG_Past_PManufacturer := FNopm_StrToInt (FNReg_ReadSetting ('PastManufacturer', INTTOSTR (opmC_Def_Past_PManufacturer), opmC_RegistryKey, opmC_RKVisual));
0759:         opmG_Past_PTaxClass := FNopm_StrToInt (FNReg_ReadSetting ('PastTaxClass', INTTOSTR (opmC_Def_Past_PTaxClass), opmC_RegistryKey, opmC_RKVisual));
0760:         opmG_Past_PImageDir := FNReg_ReadSetting ('PastImageDir', opmC_Def_Past_PImageDir, opmC_RegistryKey, opmC_RKVisual);
0761:         opmG_WBNoCacheImg := FNopm_StrToInt (FNINI_ReadSetting ('OSCNoCacheImg', INTTOSTR (opmC_Def_NoCacheImg), opm_OpenDialog_ConfigINI.FileName, opmC_RKConfig));
0762:         opmG_WBResizeImg := FNopm_StrToInt (FNINI_ReadSetting ('OSCResizeImg', INTTOSTR (opmC_Def_ResizeImg), opm_OpenDialog_ConfigINI.FileName, opmC_RKConfig));
0763:         opmG_WBPaddingImg := FNopm_StrToInt (FNINI_ReadSetting ('OSCPaddingImg', INTTOSTR (opmC_Def_PaddingImg), opm_OpenDialog_ConfigINI.FileName, opmC_RKConfig));
0764:         opmG_WBKeepARImg := FNopm_StrToInt (FNINI_ReadSetting ('OSCKeepARImg', INTTOSTR (opmC_Def_KeepARImg), opm_OpenDialog_ConfigINI.FileName, opmC_RKConfig));
0765:         opmG_UIConfirmExit := FNopm_StrToInt (FNINI_ReadSetting ('OSCConfirmExit', INTTOSTR (opmC_Def_ConfirmExit), opm_OpenDialog_ConfigINI.FileName, opmC_RKConfig));
0766:         opmG_UICenterImage := FNopm_StrToInt (FNINI_ReadSetting ('OSCCenterImage', INTTOSTR (opmC_Def_CenterImage), opm_OpenDialog_ConfigINI.FileName, opmC_RKConfig));
0767:         opmG_DBDebugLog := FNopm_StrToInt (FNINI_ReadSetting ('OSCDBDebugLog', INTTOSTR (opmC_Def_DBDebugLog), opm_OpenDialog_ConfigINI.FileName, opmC_RKConfig));
0768:         opmG_HTTPCompress := FNopm_StrToInt (FNINI_ReadSetting ('OSCHTTPCompress', INTTOSTR (opmC_Def_HTTPCompress), opm_OpenDialog_ConfigINI.FileName, opmC_RKConfig));
0769:         opmG_UIWBDebug := FNopm_StrToInt (FNINI_ReadSetting ('OSCWBDebug', INTTOSTR (opmC_Def_WBDebug), opm_OpenDialog_ConfigINI.FileName, opmC_RKConfig));
0770:         opmG_UIGUILang := FNINI_ReadSetting ('OSCGUILang', opmC_Def_GUILang, opm_OpenDialog_ConfigINI.FileName, opmC_RKConfig);
0771:         IF (FNopm_CheckLanguage (opmG_UIGUILang) = FALSE) THEN opmG_UIGUILang := opmC_Def_GUILang;
0772:         opmG_UIRememberDisplay := FNopm_StrToInt (FNINI_ReadSetting ('OSCRememberPosition', INTTOSTR (opmC_Def_RememberDisplay), opm_OpenDialog_ConfigINI.FileName, opmC_RKConfig));
0773:         PRopm_VarsToControls;
0774:       END;
0775:   end;
0776:   
0777:   
0778:   
0779:   {%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%}
0780:   {%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%}
0781:   procedure Topm_Form_Config.opm_SpinEdit_ConfigImgQChange (Sender: TObject);
0782:   begin
0783:     opm_Label_ConfigJPEGQCategory.Caption := FNopm_QualityExplain (opm_SpinEdit_ConfigImgQ.Value);
0784:   end;
0785:   
0786:   
0787:   
0788:   {%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%}
0789:   {%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%}
0790:   PROCEDURE Topm_Form_Config.opm_PRRefresh_ModuleList (LastIndex : INTEGER);
0791:   VAR
0792:     ModCounter : LONGINT;
0793:   BEGIN
0794:     opm_PRLoad_ModuleList;
0795:     opm_ListBox_ConfigMods.Items.Clear;
0796:     FOR ModCounter := 0 TO (opm_TotalModules - 1) DO
0797:       opm_ListBox_ConfigMods.Items.Add (opmG_ModuleList[ModCounter].Name);
0798:     IF ((LastIndex + 1) < opm_TotalModules) THEN
0799:       opm_ListBox_ConfigMods.ItemIndex := LastIndex
0800:     ELSE opm_ListBox_ConfigMods.ItemIndex := (opm_TotalModules - 1);
0801:   END;
0802:   
0803:   
0804:   {%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%}
0805:   {%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%}
0806:   procedure Topm_Form_Config.opm_ListBox_ConfigModsClick(Sender: TObject);
0807:   begin
0808:     IF (opm_ListBox_ConfigMods.ItemIndex >= 0) THEN
0809:       BEGIN
0810:         opm_BitBtn_ConfigModDel.Enabled := TRUE;
0811:         opm_BitBtn_ConfigModEdit.Enabled := TRUE;
0812:       END
0813:     ELSE
0814:       BEGIN
0815:         opm_BitBtn_ConfigModDel.Enabled := FALSE;
0816:         opm_BitBtn_ConfigModEdit.Enabled := FALSE;
0817:       END;
0818:   end;
0819:   
0820:   
0821:   
0822:   {%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%}
0823:   {%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%}
0824:   procedure Topm_Form_Config.opm_BitBtn_ConfigColSelClick(Sender: TObject);
0825:   begin
0826:     opm_Form_ColorSel.opmG_ColorChoosed := FNopm_DecColorToColor (opmG_WBPaddingColor);
0827:     IF (opm_Form_ColorSel.ShowModal = mrOk) THEN
0828:       BEGIN
0829:         opmG_WBPaddingColor := opm_Form_ColorSel.opmG_ColorChoosedDec;
0830:         opm_Panel_ConfigColSel.Color := opm_Form_ColorSel.opmG_ColorChoosed;
0831:         opm_Panel_ConfigColSel.Caption := FNopm_ColorToRGB (opm_Panel_ConfigColSel.Color);
0832:       END;
0833:   end;
0834:   
0835:   
0836:   
0837:   {%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%}
0838:   {%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%}
0839:   procedure Topm_Form_Config.opm_BitBtn_ConfigProxyIEClick(Sender: TObject);
0840:   VAR
0841:     PHost : STRING;
0842:     PPort : LONGINT;
0843:   begin
0844:     PRopm_GetIEProxyData (PHost, PPort);
0845:     IF ((PHost <> '') AND (PPort > 0)) THEN
0846:       BEGIN
0847:         opm_ComboBox_ConfigProxyHost.Text := PHost;
0848:         opm_SpinEdit_ConfigProxyPort.Value := PPort;
0849:       END
0850:     ELSE
0851:       FNopm_Message (_('Cannot find the proxy settings automatically.'), mtWarning, [mbOK], opmG_UISilent);
0852:   end;
0853:   
0854:   
0855:   
0856:   {%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%}
0857:   {%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%}
0858:   procedure Topm_Form_Config.opm_BitBtn_ConfigFontClick (Sender: TObject);
0859:   begin
0860:     IF (opm_FontDialog_Config.Execute = TRUE) THEN
0861:       BEGIN
0862:         opm_Label_ConfigFontDetails.Caption := opm_FontDialog_Config.Font.Name + ', ' +
0863:                                                INTTOSTR (ROUND ((opm_FontDialog_Config.Font.Height * -72) / opm_FontDialog_Config.Font.PixelsPerInch)) + ', ' +
0864:                                                opmG_CharsetList [opm_FontDialog_Config.Font.Charset];
0865:         FNopm_Message (_('The font will change until you restart the application.'), mtInformation, [mbOk], opmG_UISilent);
0866:       END
0867:     ELSE
0868:       BEGIN
0869:         opm_FontDialog_Config.Font.Name := opmG_UIFontName;
0870:         opm_FontDialog_Config.Font.Height := opmG_UIFontHeight;
0871:         opm_FontDialog_Config.Font.Charset := opmG_UIFontCharset;
0872:         opm_FontDialog_Config.Font.Style := opmC_DefaultFontStyle;
0873:       END;
0874:   end;
0875:   
0876:   
0877:   
0878:   {%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%}
0879:   {%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%}
0880:   procedure Topm_Form_Config.opm_CheckBox_ConfigUseProxyClick (Sender: TObject);
0881:   begin
0882:     opm_ComboBox_ConfigProxyApply.Enabled := opm_CheckBox_ConfigUseProxy.Checked;
0883:     opm_ComboBox_ConfigProxyHost.Enabled := opm_CheckBox_ConfigUseProxy.Checked;
0884:     opm_SpinEdit_ConfigProxyPort.Enabled := opm_CheckBox_ConfigUseProxy.Checked;
0885:     opm_BitBtn_ConfigProxyIE.Enabled := opm_CheckBox_ConfigUseProxy.Checked;
0886:     opm_Label_ConfigPHost.Enabled := opm_CheckBox_ConfigUseProxy.Checked;
0887:     opm_Label_ConfigPPort.Enabled := opm_CheckBox_ConfigUseProxy.Checked;
0888:   end;
0889:   
0890:   
0891:   
0892:   {%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%}
0893:   {%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%}
0894:   procedure Topm_Form_Config.opm_BitBtn_ConfigDBResetClick(Sender: TObject);
0895:   begin
0896:     opm_Edit_ConfigDBTable01.Text := opmC_Def_DBTable_Categories;
0897:     opm_Edit_ConfigDBTable02.Text := opmC_Def_DBTable_Manufacturers;
0898:     opm_Edit_ConfigDBTable03.Text := opmC_Def_DBTable_Languages;
0899:     opm_Edit_ConfigDBTable04.Text := opmC_Def_DBTable_Products;
0900:     opm_Edit_ConfigDBTable05.Text := opmC_Def_DBTable_Specials;
0901:     opm_Edit_ConfigDBTable06.Text := opmC_Def_DBTable_ProductsDescription;
0902:     opm_Edit_ConfigDBTable07.Text := opmC_Def_DBTable_TaxClass;
0903:     opm_Edit_ConfigDBTable08.Text := opmC_Def_DBTable_Currencies;
0904:     opm_Edit_ConfigDBTable09.Text := opmC_Def_DBTable_Configuration;
0905:     opm_Edit_ConfigDBTable10.Text := opmC_Def_DBTable_ProductsToCategories;
0906:     opm_Edit_ConfigDBTable11.Text := opmC_Def_DBTable_CategoriesDescription;
0907:     opm_Edit_ConfigDBTable13.Text := opmC_Def_DBTable_TaxRates;
0908:     opm_Edit_ConfigDBTable14.Text := opmC_Def_DBTable_ManufacturersInfo;
0909:   end;
0910:   
0911:   
0912:   {%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%}
0913:   {%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%}
0914:   procedure Topm_Form_Config.opm_ListBox_ConfigReportsClick(Sender: TObject);
0915:   begin
0916:     IF (opm_ListBox_ConfigReports.ItemIndex >= 0) THEN
0917:       BEGIN
0918:         opm_BitBtn_ConfigReportEdit.Enabled := TRUE;
0919:         opm_BitBtn_ConfigReportPreview.Enabled := TRUE;
0920:       END
0921:     ELSE
0922:       BEGIN
0923:         opm_BitBtn_ConfigReportEdit.Enabled := FALSE;
0924:         opm_BitBtn_ConfigReportPreview.Enabled := FALSE;
0925:       END;
0926:   end;
0927:   
0928:   
0929:   
0930:   {%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%}
0931:   {%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%}
0932:   procedure Topm_Form_Config.opm_BitBtn_ConfigReportEditClick(Sender: TObject);
0933:   begin
0934:     IF (opm_ListBox_ConfigReports.ItemIndex >= 0) THEN
0935:       BEGIN
0936:         TRY
0937:           opm_frReport_Config.LoadFromFile (ExtractFilePath (Application.Exename) + opmC_DirReports + '/' + opm_ListBox_ConfigReports.Items[opm_ListBox_ConfigReports.ItemIndex]);
0938:           opm_frReport_Config.DesignReport;
0939:         EXCEPT
0940:           ON E : Exception DO
0941:             BEGIN
0942:               FNopm_Message (_('Error while editing report') + #13#10 + E.Message, mtError, [mbOk], opmG_UISilent);
0943:             END;
0944:         END;
0945:         opm_PRRefresh_ReportList (opm_ListBox_ConfigReports.ItemIndex);
0946:       END;
0947:   end;
0948:   
0949:   
0950:   {%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%}
0951:   {%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%}
0952:   PROCEDURE Topm_Form_Config.opm_PRRefresh_ReportList (LastIndex : INTEGER);
0953:   VAR
0954:     DirRecord : TSearchRec;
0955:     RepCount : LONGINT;
0956:   BEGIN
0957:     RepCount := 0;
0958:     opm_ListBox_ConfigReports.Items.Clear;
0959:     IF (SysUtils.FINDFIRST (ExtractFilePath (Application.Exename) + opmC_DirReports + '/' + '*.' + opmC_Def_ReportExt, faAnyFile, DirRecord) = 0) THEN
0960:       BEGIN
0961:         REPEAT
0962:           opm_ListBox_ConfigReports.Items.Add (TRIM (DirRecord.Name));
0963:           INC (RepCount);
0964:         UNTIL (SysUtils.FINDNEXT (DirRecord) <> 0);
0965:         SysUtils.FINDCLOSE (DirRecord);
0966:         IF (LastIndex < RepCount) THEN
0967:           opm_ListBox_ConfigReports.ItemIndex := LastIndex
0968:         ELSE opm_ListBox_ConfigReports.ItemIndex := (RepCount - 1);
0969:       END;
0970:   END;
0971:   
0972:   
0973:   {%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%}
0974:   {%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%}
0975:   procedure Topm_Form_Config.opm_frReport_ConfigGetValue (const ParName: String; var ParValue: Variant);
0976:   begin
0977:     ParValue := _('Test data') + ' ' + INTTOSTR (opm_frUserDataset_Config.RecNo);
0978:   end;
0979:   
0980:   
0981:   
0982:   {%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%}
0983:   {%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%}
0984:   procedure Topm_Form_Config.opm_frUserDataset_ConfigCheckEOF (Sender: TObject; var Eof: Boolean);
0985:   begin
0986:     EOF := (opm_frUserDataset_Config.RecNo > 100);
0987:   end;
0988:   
0989:   
0990:   
0991:   {%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%}
0992:   {%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%}
0993:   procedure Topm_Form_Config.opm_BitBtn_ConfigReportPreviewClick(Sender: TObject);
0994:   begin
0995:     IF (opm_ListBox_ConfigReports.ItemIndex >= 0) THEN
0996:       BEGIN
0997:         TRY
0998:           opm_frReport_Config.LoadFromFile (ExtractFilePath (Application.Exename) + opmC_DirReports + '/' + opm_ListBox_ConfigReports.Items[opm_ListBox_ConfigReports.ItemIndex]);
0999:           opm_frReport_Config.ShowReport;
1000:         EXCEPT
1001:           ON E : Exception DO
1002:             BEGIN
1003:               FNopm_Message (_('Error while editing report') + #13#10 + E.Message, mtError, [mbOk], opmG_UISilent);
1004:             END;
1005:         END;
1006:         opm_PRRefresh_ReportList (opm_ListBox_ConfigReports.ItemIndex);
1007:       END;
1008:   end;
1009:   
1010:   
1011:   {%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%}
1012:   {%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%}
1013:   procedure Topm_Form_Config.opm_BitBtn_ConfigModEditClick(Sender: TObject);
1014:   begin
1015:     IF (opm_ListBox_ConfigMods.ItemIndex >= 0) THEN
1016:       BEGIN
1017:         opm_Form_ConfigMod.MC_Name := TRIM (opm_ListBox_ConfigMods.Items[opm_ListBox_ConfigMods.ItemIndex] + '.' + opmC_Def_ModulesExt);
1018:         opm_Form_ConfigMod.MC_AddEdit := FALSE;
1019:         IF (opm_Form_ConfigMod.ShowModal = mrOK) THEN opm_PRRefresh_ModuleList (opm_ListBox_ConfigMods.ItemIndex);
1020:       END;
1021:   end;
1022:   
1023:   
1024:   {%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%}
1025:   {%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%}
1026:   procedure Topm_Form_Config.opm_BitBtn_ConfigModAddClick(Sender: TObject);
1027:   begin
1028:     opm_Form_ConfigMod.MC_Name := '';
1029:     opm_Form_ConfigMod.MC_AddEdit := TRUE;
1030:     IF (opm_Form_ConfigMod.ShowModal = mrOK) THEN opm_PRRefresh_ModuleList (opm_ListBox_ConfigMods.ItemIndex);
1031:   end;
1032:   
1033:   
1034:   {%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%}
1035:   {%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%}
1036:   procedure Topm_Form_Config.opm_BitBtn_ConfigModDelClick(Sender: TObject);
1037:   begin
1038:     IF (opm_ListBox_ConfigMods.ItemIndex >= 0) THEN
1039:       IF (FNopm_Message (_('Are you sure you want to delete this module configuration?') +
1040:                          ' [' + opm_ListBox_ConfigMods.Items[opm_ListBox_ConfigMods.ItemIndex] + ']', mtConfirmation, [mbYes, mbNo], opmG_UISilent) = mrYes) THEN
1041:         BEGIN
1042:           opm_PRDelete_ModuleData (opm_ListBox_ConfigMods.Items[opm_ListBox_ConfigMods.ItemIndex] + '.' + opmC_Def_ModulesExt);
1043:           opm_PRRefresh_ModuleList (opm_ListBox_ConfigMods.ItemIndex);
1044:         END;
1045:   end;
1046:   
1047:   
1048:   {%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%}
1049:   {%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%}
1050:   procedure Topm_Form_Config.opm_ListBox_ConfigModsDblClick(Sender: TObject);
1051:   begin
1052:     IF (opm_ListBox_ConfigMods.ItemIndex >= 0) THEN
1053:       BEGIN
1054:         opm_Form_ConfigMod.MC_Name := TRIM (opm_ListBox_ConfigMods.Items[opm_ListBox_ConfigMods.ItemIndex] + '.' + opmC_Def_ModulesExt);
1055:         opm_Form_ConfigMod.MC_AddEdit := FALSE;
1056:         IF (opm_Form_ConfigMod.ShowModal = mrOK) THEN opm_PRRefresh_ModuleList (opm_ListBox_ConfigMods.ItemIndex);
1057:       END;
1058:   end;
1059:   
1060:   
1061:   
1062:   
1063:   {%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%}
1064:   {%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%}
1065:   procedure Topm_Form_Config.opm_ListBox_ConfigReportsDblClick(Sender: TObject);
1066:   begin
1067:     IF (opm_ListBox_ConfigReports.ItemIndex >= 0) THEN
1068:       BEGIN
1069:         TRY
1070:           opm_frReport_Config.LoadFromFile (ExtractFilePath (Application.Exename) + opmC_DirReports + '/' + opm_ListBox_ConfigReports.Items[opm_ListBox_ConfigReports.ItemIndex]);
1071:           opm_frReport_Config.DesignReport;
1072:         EXCEPT
1073:           ON E : Exception DO
1074:             BEGIN
1075:               FNopm_Message (_('Error while editing report') + #13#10 + E.Message, mtError, [mbOk], opmG_UISilent);
1076:             END;
1077:         END;
1078:         opm_PRRefresh_ReportList (opm_ListBox_ConfigReports.ItemIndex);
1079:       END;
1080:   end;
1081:   
1082:   
1083:   end.
 
 
NA fum/lmd: 2007.07.15
Copyright ©1994-2024 by Mario A. Valdez-Ramírez.
no siga este enlace / do not follow this link