unit U_Settings; interface Uses SysUtils, IniFiles, U_BaseCommon; const IniFile = 'Scs.ini'; const DefNBPath = 'Data\DataBase.gdb'; const DefPMPath = 'Data\ProjectManagerBase.gdb'; function GetDBPath(AGDBMode: TDBKind): String; function GetDefaultIDCompon(AIsLine: Integer): Integer; function GetNDS: Double; function GetNBDisabeEdit(AGDBMode: TDBKind): Boolean; function GetDefNewItemType: Integer; function GetDefCheckState: Boolean; function GetSavedIDList: Integer; implementation function GetDBPath(AGDBMode: TDBKind): String; var ini: TIniFile; begin Result := ''; if FileExists('SCS.ini') then begin ini := TIniFile.Create(extractfilepath(paramstr(0)) + 'Scs.ini'); case AGDBMode of bkNormBase: Result := ini.ReadString('NormBase','Path', DefNBPath); bkProjectManager: Result := ini.ReadString('ProjectManager','Path', DefPMPath); end; ini.Free; end; end; function GetDefaultIDCompon(AIsLine: Integer): Integer; var ini: TIniFile; begin Result := 0; if FileExists('SCS.ini') then begin ini := TIniFile.Create(extractfilepath(paramstr(0)) + 'Scs.ini'); case AIsLine of biFalse: Result := ini.ReadInteger('NormBase', 'DefaultNoLineCompon', 0); biTrue: Result := ini.ReadInteger('NormBase','DefaultLineCompon', 0); end; ini.Free; end; end; function GetNDS: Double; var ini: TIniFile; begin Result := 20; if FileExists('SCS.ini') then begin ini := TIniFile.Create(extractfilepath(paramstr(0)) + 'Scs.ini'); Result := ini.ReadInteger('NormBase', 'NDS', 20); ini.Free; end; end; function GetNBDisabeEdit(AGDBMode: TDBKind): Boolean; var ini: TIniFile; begin Result := false; if FileExists('SCS.ini') then begin ini := TIniFile.Create(extractfilepath(paramstr(0)) + 'Scs.ini'); case AGDBMode of bkNormBase: Result := ini.ReadBool('NormBase', 'Disable Edit', false); bkProjectManager: Result := ini.ReadBool('ProjectManager', 'Disable Edit', false); end; ini.Free; end; end; function GetDefNewItemType: Integer; var ini: TIniFile; begin Result := 0; if FileExists('SCS.ini') then begin ini := TIniFile.Create(extractfilepath(paramstr(0)) + 'Scs.ini'); Result := ini.ReadInteger('ProjectManager', 'DefNewItemType', 0); ini.Free; end; end; function GetDefCheckState: Boolean; var ini: TIniFile; begin Result := true; if FileExists('SCS.ini') then begin ini := TIniFile.Create(extractfilepath(paramstr(0)) + 'Scs.ini'); Result := ini.ReadBool('ProjectManager', 'DefCheckState', true); ini.Free; end; end; function GetSavedIDList: Integer; var ini: TIniFile; begin Result := 0; if FileExists('SCS.ini') then begin ini := TIniFile.Create(extractfilepath(paramstr(0)) + 'Scs.ini'); Result := ini.ReadInteger('ProjectManager', 'SavedList', 0); ini.Free; end; end; end.