Changeset 801 for cprs/branches/tmg-cprs/CPRS-Chart/Options
- Timestamp:
- Jun 16, 2010, 8:23:07 PM (15 years ago)
- Location:
- cprs/branches/tmg-cprs/CPRS-Chart/Options
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
cprs/branches/tmg-cprs/CPRS-Chart/Options/fOptions.dfm
r738 r801 1761 1761 Caption = 'Image Retrieval Method' 1762 1762 end 1763 object Label4: TLabel1763 object lblDropBox: TLabel 1764 1764 Left = 16 1765 1765 Top = 104 … … 1768 1768 Caption = 'Dropbox Folder' 1769 1769 end 1770 object Label5: TLabel1770 object lblPollingInterval: TLabel 1771 1771 Left = 15 1772 1772 Top = 231 … … 1775 1775 Caption = 'Polling Interval of Scanned Images Folder' 1776 1776 end 1777 object Label6: TLabel1777 object lblScannedImagesFolder: TLabel 1778 1778 Left = 15 1779 1779 Top = 183 … … 1782 1782 Caption = 'Scanned Images Folder' 1783 1783 end 1784 object Label7: TLabel1784 object lblSeconds: TLabel 1785 1785 Left = 96 1786 1786 Top = 248 … … 1821 1821 OnChange = editDropboxLocationChange 1822 1822 end 1823 object BitBtn1: TBitBtn1823 object btnBrowseDropBox: TBitBtn 1824 1824 Left = 224 1825 1825 Top = 120 … … 1828 1828 Caption = '...' 1829 1829 TabOrder = 3 1830 OnClick = BitBtn1Click1830 OnClick = btnBrowseDropBoxClick 1831 1831 Glyph.Data = { 1832 1832 F6000000424DF600000000000000760000002800000010000000100000000100 … … 1856 1856 OnChange = editScannedLocationChange 1857 1857 end 1858 object BitBtn2: TBitBtn1858 object btnBrowseScannedImages: TBitBtn 1859 1859 Left = 224 1860 1860 Top = 200 … … 1863 1863 Caption = '...' 1864 1864 TabOrder = 6 1865 OnClick = BitBtn2Click1865 OnClick = btnBrowseScannedImagesClick 1866 1866 Glyph.Data = { 1867 1867 F6000000424DF600000000000000760000002800000010000000100000000100 … … 2074 2074 5A00000005004974656D73590000000400546578740006004C6162656C330101 2075 2075 0000005B000000070043617074696F6E0013006564697444726F70626F784C6F 2076 636174696F6E000006004C6162656C3401010000005C00000007004361707469 2077 6F6E00070042697442746E3100000A00646C675069636B446972000010006362 2078 456E61626C655363616E6E696E6701010000005D000000070043617074696F6E 2079 0006004C6162656C3501010000005E000000070043617074696F6E0013006564 2080 69745363616E6E65644C6F636174696F6E0000070042697442746E3200000600 2081 4C6162656C3601010000005F000000070043617074696F6E000A00656474506F 2082 6C46726571000006004C6162656C37010100000060000000070043617074696F 2083 6E00} 2076 636174696F6E00000A006C626C44726F70426F7801010000005C000000070043 2077 617074696F6E00100062746E42726F77736544726F70426F7800000A00646C67 2078 5069636B446972000010006362456E61626C655363616E6E696E670101000000 2079 5D000000070043617074696F6E0012006C626C506F6C6C696E67496E74657276 2080 616C01010000005E000000070043617074696F6E001300656469745363616E6E 2081 65644C6F636174696F6E0000160062746E42726F7773655363616E6E6564496D 2082 61676573000016006C626C5363616E6E6564496D61676573466F6C6465720101 2083 0000005F000000070043617074696F6E000A00656474506F6C4672657100000A 2084 006C626C5365636F6E6473010100000060000000070043617074696F6E00} 2084 2085 end 2085 2086 object dlgPickDir: TOpenDialog -
cprs/branches/tmg-cprs/CPRS-Chart/Options/fOptions.pas
r738 r801 140 140 Label3: TLabel; 141 141 editDropboxLocation: TEdit; 142 Label4: TLabel;143 BitBtn1: TBitBtn;142 lblDropBox: TLabel; 143 btnBrowseDropBox: TBitBtn; 144 144 dlgPickDir: TOpenDialog; 145 145 cbEnableScanning: TCheckBox; 146 Label5: TLabel;146 lblPollingInterval: TLabel; 147 147 editScannedLocation: TEdit; 148 BitBtn2: TBitBtn;149 Label6: TLabel;148 btnBrowseScannedImages: TBitBtn; 149 lblScannedImagesFolder: TLabel; 150 150 edtPolFreq: TEdit; 151 Label7: TLabel;151 lblSeconds: TLabel; 152 152 procedure FormCreate(Sender: TObject); 153 153 procedure FormDestroy(Sender: TObject); … … 195 195 procedure editScannedLocationChange(Sender: TObject); 196 196 procedure edtPolFreqChange(Sender: TObject); 197 procedure BitBtn1Click(Sender: TObject);198 procedure BitBtn2Click(Sender: TObject); //kt added 6/29/07197 procedure btnBrowseDropBoxClick(Sender: TObject); 198 procedure btnBrowseScannedImagesClick(Sender: TObject); //kt added 6/29/07 199 199 private 200 200 { Private declarations } … … 357 357 // initialize form 358 358 var i : integer; //kt added 6/29/07 359 begin 359 j : TImgTransferMethod; 360 begin 361 //kt start mod 362 cboTransMethod.Items.Clear; 363 for j := itmDropbox to itmRPC do cboTransMethod.Items.Add(IMAGE_TRANSFER_METHODS[j]); 364 //kt end mod 360 365 LoadNotifications; 361 366 LoadOrderChecks; 362 LoadImageSettings; 363 FdirtyImageSettings := false; 367 LoadImageSettings; //kt 368 FdirtyImageSettings := false; //kt 364 369 FdirtyNotifications := false; 365 370 FdirtyOrderChecks := false; … … 515 520 procedure TfrmOptions.LoadImageSettings; 516 521 begin 517 cbEnableImages.Checked := uTMGOptions.ReadBool('EnableImages', false);518 cboTransMethod.ItemIndex := uTMGOptions.ReadInteger('ImageTransferMethod', 0);522 cbEnableImages.Checked := uTMGOptions.ReadBool('EnableImages',true); 523 cboTransMethod.ItemIndex := uTMGOptions.ReadInteger('ImageTransferMethod',2); 519 524 editDropboxLocation.text := uTMGOptions.ReadString('Dropbox directory',''); 520 525 cbEnableScanning.Checked := uTMGOptions.ReadBool('Scan Enabled',false); 521 526 editScannedLocation.text := uTMGOptions.ReadString('Pol Directory',''); 522 527 edtPolFreq.text := IntToStr(uTMGOptions.ReadInteger('Pol Interval (milliseconds)',0)); 523 524 528 cbEnableScanningClick(self); 525 529 cboTransMethodChange(self); … … 568 572 569 573 uTMGOptions.WriteInteger('ImageTransferMethod',cboTransMethod.itemindex); 574 frmImages.TransferMethod := TImgTransferMethod(cboTransMethod.itemindex); 575 { 570 576 if cboTransMethod.text = 'Dropbox Transfer' then begin 571 577 frmImages.UseDropBox := True; … … 573 579 frmImages.UseDropBox := False; 574 580 end; 575 581 } 576 582 uTMGOptions.WriteString('Dropbox directory',editDropboxLocation.text); 577 583 frmImages.DropBoxDir := editDropboxLocation.text; … … 1018 1024 end; 1019 1025 1020 procedure TfrmOptions.cboTransMethodChange(Sender: TObject); 1021 begin 1022 if cboTransMethod.text = 'Dropbox Transfer' then begin 1023 editDropboxLocation.enabled := true; 1024 bitbtn1.enabled := true; 1025 end else begin 1026 editDropboxLocation.enabled := false; 1027 bitbtn1.enabled := false; 1028 end; 1026 procedure TfrmOptions.cboTransMethodChange(Sender: TObject); 1027 var Show : boolean; 1028 begin 1029 if cboTransMethod.Text = IMAGE_TRANSFER_METHODS[itmDirect] then begin 1030 MessageDlg('Sorry. Direct file access not yet supported.',mtInformation,[mbOK],0); 1031 cboTransMethod.ItemIndex := -1; 1032 end; 1033 if cboTransMethod.ItemIndex < 0 then begin 1034 cboTransMethod.ItemIndex := ord(itmRPC); 1035 cboTransMethod.Text := IMAGE_TRANSFER_METHODS[itmRPC]; 1036 end; 1037 Show := (cboTransMethod.ItemIndex = ord(itmDropbox)); 1038 editDropboxLocation.Visible := Show; 1039 btnBrowseDropBox.Visible := Show; 1040 lblDropBox.Visible := Show; 1029 1041 FdirtyImageSettings := true; 1030 1042 CheckApply; 1031 end; 1032 1033 procedure TfrmOptions.cbEnableImagesClick(Sender: TObject); 1034 begin 1035 FdirtyImageSettings := true; 1036 CheckApply; 1037 end; 1038 1039 procedure TfrmOptions.editDropboxLocationChange(Sender: TObject); 1040 begin 1041 FdirtyImageSettings := true; 1042 CheckApply; 1043 end; 1044 1045 procedure TfrmOptions.cbEnableScanningClick(Sender: TObject); 1046 begin 1047 editScannedLocation.enabled := cbEnableScanning.checked; 1048 bitbtn2.enabled := cbEnableScanning.checked; 1049 edtPolFreq.enabled := cbEnableScanning.checked; 1050 FdirtyImageSettings := true; 1051 CheckApply; 1052 end; 1053 1054 procedure TfrmOptions.editScannedLocationChange(Sender: TObject); 1055 begin 1056 FdirtyImageSettings := true; 1057 CheckApply; 1058 end; 1059 1060 procedure TfrmOptions.edtPolFreqChange(Sender: TObject); 1061 begin 1062 FdirtyImageSettings := true; 1063 CheckApply; 1064 end; 1065 1066 procedure TfrmOptions.BitBtn1Click(Sender: TObject); 1067 var 1068 sFolder: string; 1069 begin 1070 sFolder := BrowseDialog('Choose a Dropbox folder', BIF_RETURNONLYFSDIRS); 1071 if sFolder <> '' then begin 1072 if rightstr(sFolder,1) = '\' then begin 1073 editDropboxLocation.text := sFolder; 1074 end else begin 1075 editDropboxLocation.text := sFolder + '\'; 1076 end; 1077 end; 1078 end; 1079 1080 function TfrmOptions.BrowseDialog(const Title: string; const Flag: integer): string; 1081 var 1082 lpItemID : PItemIDList; 1083 BrowseInfo : TBrowseInfo; 1084 DisplayName : array[0..MAX_PATH] of char; 1085 TempPath : array[0..MAX_PATH] of char; 1086 begin 1087 Result:=''; 1088 FillChar(BrowseInfo, sizeof(TBrowseInfo), #0); 1089 with BrowseInfo do begin 1090 hwndOwner := Application.Handle; 1091 pszDisplayName := @DisplayName; 1092 lpszTitle := PChar(Title); 1093 ulFlags := Flag; 1094 end; 1095 lpItemID := SHBrowseForFolder(BrowseInfo); 1096 if lpItemId <> nil then begin 1097 SHGetPathFromIDList(lpItemID, TempPath); 1098 Result := TempPath; 1099 GlobalFreePtr(lpItemID); 1100 end; 1101 end; 1102 1103 1104 procedure TfrmOptions.BitBtn2Click(Sender: TObject); 1105 var 1106 sFolder: string; 1107 begin 1108 sFolder := BrowseDialog('Choose a Scanned folder', BIF_RETURNONLYFSDIRS); 1109 if sFolder <> '' then begin 1110 if rightstr(sFolder,1) = '\' then begin 1111 editScannedLocation.text := sFolder; 1112 end else begin 1113 editScannedLocation.text := sFolder + '\'; 1114 end; 1115 end; 1116 end; 1043 end; 1044 1045 procedure TfrmOptions.cbEnableImagesClick(Sender: TObject); 1046 begin 1047 FdirtyImageSettings := true; 1048 CheckApply; 1049 end; 1050 1051 procedure TfrmOptions.editDropboxLocationChange(Sender: TObject); 1052 begin 1053 FdirtyImageSettings := true; 1054 CheckApply; 1055 end; 1056 1057 procedure TfrmOptions.cbEnableScanningClick(Sender: TObject); 1058 begin 1059 editScannedLocation.Visible := cbEnableScanning.checked; 1060 btnBrowseScannedImages.Visible := cbEnableScanning.checked; 1061 edtPolFreq.Visible := cbEnableScanning.checked; 1062 lblScannedImagesFolder.Visible := cbEnableScanning.checked; 1063 lblPollingInterval.Visible := cbEnableScanning.checked; 1064 lblSeconds.Visible := cbEnableScanning.checked; 1065 FdirtyImageSettings := true; 1066 CheckApply; 1067 end; 1068 1069 procedure TfrmOptions.editScannedLocationChange(Sender: TObject); 1070 begin 1071 FdirtyImageSettings := true; 1072 CheckApply; 1073 end; 1074 1075 procedure TfrmOptions.edtPolFreqChange(Sender: TObject); 1076 begin 1077 FdirtyImageSettings := true; 1078 CheckApply; 1079 end; 1080 1081 procedure TfrmOptions.btnBrowseDropBoxClick(Sender: TObject); 1082 var 1083 sFolder: string; 1084 begin 1085 sFolder := BrowseDialog('Choose a Dropbox folder', BIF_RETURNONLYFSDIRS); 1086 if sFolder <> '' then begin 1087 if rightstr(sFolder,1) = '\' then begin 1088 editDropboxLocation.text := sFolder; 1089 end else begin 1090 editDropboxLocation.text := sFolder + '\'; 1091 end; 1092 end; 1093 end; 1094 1095 function TfrmOptions.BrowseDialog(const Title: string; const Flag: integer): string; 1096 var 1097 lpItemID : PItemIDList; 1098 BrowseInfo : TBrowseInfo; 1099 DisplayName : array[0..MAX_PATH] of char; 1100 TempPath : array[0..MAX_PATH] of char; 1101 begin 1102 Result:=''; 1103 FillChar(BrowseInfo, sizeof(TBrowseInfo), #0); 1104 with BrowseInfo do begin 1105 hwndOwner := Application.Handle; 1106 pszDisplayName := @DisplayName; 1107 lpszTitle := PChar(Title); 1108 ulFlags := Flag; 1109 end; 1110 lpItemID := SHBrowseForFolder(BrowseInfo); 1111 if lpItemId <> nil then begin 1112 SHGetPathFromIDList(lpItemID, TempPath); 1113 Result := TempPath; 1114 GlobalFreePtr(lpItemID); 1115 end; 1116 end; 1117 1118 procedure TfrmOptions.btnBrowseScannedImagesClick(Sender: TObject); 1119 var 1120 sFolder: string; 1121 begin 1122 sFolder := BrowseDialog('Choose a Scanned folder', BIF_RETURNONLYFSDIRS); 1123 if sFolder <> '' then begin 1124 if rightstr(sFolder,1) = '\' then begin 1125 editScannedLocation.text := sFolder; 1126 end else begin 1127 editScannedLocation.text := sFolder + '\'; 1128 end; 1129 end; 1130 end; 1117 1131 1118 1132 end.
Note:
See TracChangeset
for help on using the changeset viewer.