Ignore:
Timestamp:
Apr 19, 2010, 5:24:20 PM (14 years ago)
Author:
Kevin Toppenberg
Message:

Fixed Text Object Parameters

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cprs/branches/tmg-cprs/CPRS-Chart/Options/fOptions.pas

    r735 r738  
    77  Windows, SysUtils, Classes, Graphics, Forms, Controls, StdCtrls,
    88  Buttons, ComCtrls, ExtCtrls, ORCtrls, OrFn, Dialogs, ORDtTmRng, fBAOptionsDiagnoses,
    9   uBAGlobals, TntStdCtrls, DKLang, jpeg, inifiles;
     9  uBAGlobals, TntStdCtrls, DKLang, jpeg, inifiles, uConst, StrUtils;
    1010
    1111//kt added 6/29/07 ------------------
     
    139139    cboTransMethod: TComboBox;
    140140    Label3: TLabel;
    141     Edit1: TEdit;
     141    editDropboxLocation: TEdit;
    142142    Label4: TLabel;
    143143    BitBtn1: TBitBtn;
     
    145145    cbEnableScanning: TCheckBox;
    146146    Label5: TLabel;
    147     Edit2: TEdit;
     147    editScannedLocation: TEdit;
    148148    BitBtn2: TBitBtn;
    149149    Label6: TLabel;
     
    188188    procedure lbSkinsKeyPress(Sender: TObject; var Key: Char);
    189189    procedure btnDisableSkinClick(Sender: TObject);
    190     procedure cbSkinAtStartupClick(Sender: TObject);  //kt added 6/29/07
     190    procedure cbSkinAtStartupClick(Sender: TObject);
     191    procedure cboTransMethodChange(Sender: TObject);
     192    procedure cbEnableImagesClick(Sender: TObject);
     193    procedure editDropboxLocationChange(Sender: TObject);
     194    procedure cbEnableScanningClick(Sender: TObject);
     195    procedure editScannedLocationChange(Sender: TObject);
     196    procedure edtPolFreqChange(Sender: TObject);
     197    procedure BitBtn1Click(Sender: TObject);
     198    procedure BitBtn2Click(Sender: TObject);  //kt added 6/29/07
    191199  private
    192200    { Private declarations }
    193201    FdirtyNotifications: boolean;  // used to determine edit changes to Notifications
     202    FdirtyImageSettings: boolean;  // used to determine edit changes to Image Settings
    194203    FdirtyOrderChecks: boolean;    // used to determine edit changes to Order Checks
    195204    FdirtyOtherStuff: boolean;     // used to determine edit changes to misc settings
     
    201210    procedure Offset(var topnum: integer; topoffset: integer; var leftnum: integer; leftoffset: integer);
    202211    procedure LoadNotifications;
     212    procedure LoadImageSettings;
    203213    procedure LoadOrderChecks;
    204214    procedure ApplyNotifications;
    205215    procedure ApplyOrderChecks;
    206216    procedure ApplyOtherStuff;
     217    procedure ApplyImageSettings;
    207218    procedure CheckApply;
    208219    procedure LoadListView(aListView: TListView; aList: TStrings);
    209220    procedure ChangeOnOff(aListView: TListView; aListItem: TListItem);
     221    function BrowseDialog(const Title: string; const Flag: integer): string;
    210222  public
    211223    { Public declarations }
     
    228240    ShellAPI, //kt 9/8/08
    229241    uTMGOptions, //kt 2/10/10
     242    UploadImages, fImages, //elh 04/15/10
     243    ShlObj,  //elh 04/15/10
    230244    ORNet, //allows access to RPCBrokerV
    231245    TntForms, TntSystem, TntSysUtils;
     
    346360    LoadNotifications;
    347361    LoadOrderChecks;
     362    LoadImageSettings;
     363    FdirtyImageSettings := false;
    348364    FdirtyNotifications := false;
    349365    FdirtyOrderChecks := false;
     
    469485    if FdirtyNotifications then
    470486      ApplyNotifications;
     487    if FdirtyImageSettings then
     488      ApplyImageSettings;
    471489    if FdirtyOrderChecks then
    472490      ApplyOrderChecks;
     
    493511    btnSurrogate.Hint := surrogateinfo;
    494512    LabelSurrogate(surrogateinfo, lblNotificationsSurrogateText);
     513  end;
     514
     515  procedure TfrmOptions.LoadImageSettings;
     516  begin
     517     cbEnableImages.Checked := uTMGOptions.ReadBool('EnableImages',false);
     518     cboTransMethod.ItemIndex :=  uTMGOptions.ReadInteger('ImageTransferMethod',0);
     519     editDropboxLocation.text := uTMGOptions.ReadString('Dropbox directory','');
     520     cbEnableScanning.Checked := uTMGOptions.ReadBool('Scan Enabled',false);
     521     editScannedLocation.text := uTMGOptions.ReadString('Pol Directory','');
     522     edtPolFreq.text := IntToStr(uTMGOptions.ReadInteger('Pol Interval (milliseconds)',0));
     523
     524     cbEnableScanningClick(self);
     525     cboTransMethodChange(self);
    495526  end;
    496527
     
    531562  end;
    532563
     564  procedure TfrmOptions.ApplyImageSettings;
     565  begin
     566     uTMGOptions.WriteBool('EnableImages',cbEnableImages.Checked);
     567     frmFrame.SetATabVisibility(CT_IMAGES, cbEnableImages.Checked, 'Images');
     568
     569     uTMGOptions.WriteInteger('ImageTransferMethod',cboTransMethod.itemindex);
     570     if cboTransMethod.text = 'Dropbox Transfer' then begin
     571        frmImages.UseDropBox := True;
     572     end else begin
     573        frmImages.UseDropBox := False;
     574     end;
     575
     576     uTMGOptions.WriteString('Dropbox directory',editDropboxLocation.text);
     577     frmImages.DropBoxDir := editDropboxLocation.text;
     578
     579     uTMGOptions.WriteBool('Scan Enabled',cbEnableScanning.Checked);
     580
     581     uTMGOptions.WriteString('Pol Directory',editScannedLocation.text);
     582     UploadForm.FScanDir := editScannedLocation.text;
     583
     584     uTMGOptions.WriteInteger('Pol Interval (milliseconds)',StrToInt(edtPolFreq.text));
     585     UploadForm.PolInterval := StrToInt(edtPolFreq.text);
     586
     587     FdirtyImageSettings := false;
     588  end;
     589
    533590  procedure TfrmOptions.ApplyOrderChecks;
    534591  // save Order Check changes
     
    572629  // determine if Apply button is enabled
    573630  begin
    574     btnApply.Enabled :=  FdirtyOrderChecks or FdirtyNotifications or FdirtyOtherStuff;
     631    btnApply.Enabled :=  FdirtyImageSettings or FdirtyOrderChecks or FdirtyNotifications or FdirtyOtherStuff;
    575632  end;
    576633
     
    9611018  end;
    9621019
     1020procedure TfrmOptions.cboTransMethodChange(Sender: TObject);
     1021begin
     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;
     1029    FdirtyImageSettings := true;
     1030    CheckApply;
     1031end;
     1032
     1033procedure TfrmOptions.cbEnableImagesClick(Sender: TObject);
     1034begin
     1035   FdirtyImageSettings := true;
     1036   CheckApply;
     1037end;
     1038
     1039procedure TfrmOptions.editDropboxLocationChange(Sender: TObject);
     1040begin
     1041   FdirtyImageSettings := true;
     1042   CheckApply;
     1043end;
     1044
     1045procedure TfrmOptions.cbEnableScanningClick(Sender: TObject);
     1046begin
     1047   editScannedLocation.enabled := cbEnableScanning.checked;
     1048   bitbtn2.enabled := cbEnableScanning.checked;
     1049   edtPolFreq.enabled := cbEnableScanning.checked;
     1050   FdirtyImageSettings := true;
     1051   CheckApply;
     1052end;
     1053
     1054procedure TfrmOptions.editScannedLocationChange(Sender: TObject);
     1055begin
     1056   FdirtyImageSettings := true;
     1057   CheckApply;
     1058end;
     1059
     1060procedure TfrmOptions.edtPolFreqChange(Sender: TObject);
     1061begin
     1062   FdirtyImageSettings := true;
     1063   CheckApply;
     1064end;
     1065
     1066procedure TfrmOptions.BitBtn1Click(Sender: TObject);
     1067var
     1068   sFolder: string;
     1069begin
     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;
     1078end;
     1079
     1080function TfrmOptions.BrowseDialog(const Title: string; const Flag: integer): string;
     1081var
     1082  lpItemID : PItemIDList;
     1083  BrowseInfo : TBrowseInfo;
     1084  DisplayName : array[0..MAX_PATH] of char;
     1085  TempPath : array[0..MAX_PATH] of char;
     1086begin
     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;
     1101end;
     1102
     1103
     1104procedure TfrmOptions.BitBtn2Click(Sender: TObject);
     1105var
     1106   sFolder: string;
     1107begin
     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;
     1116end;
     1117
    9631118end.
    9641119
Note: See TracChangeset for help on using the changeset viewer.