From 9a9db1d08a8c1f7a7de99d914ae79d61b536adbe Mon Sep 17 00:00:00 2001 From: alexs75 Date: Thu, 9 May 2013 05:37:53 +0000 Subject: [PATCH] New component - RxPropStorage git-svn-id: https://svn.code.sf.net/p/lazarus-ccr/svn@2737 8e941d3f-bd1b-0410-a28a-d453659cc2b4 --- components/rx/images/TRxIniPropStorage.png | Bin 0 -> 426 bytes components/rx/images/mk_res.sh | 2 +- components/rx/images/rx.lrs | 20 +++++ components/rx/registerrxtools.pas | 16 ++-- components/rx/rx.lrs | 20 +++++ components/rx/rxapputils.pas | 5 +- components/rx/rxcloseformvalidator.pas | 2 +- components/rx/rxdbgrid.pas | 26 +------ components/rx/rxfileutils.pas | 5 +- components/rx/rxinipropstorage.pas | 82 +++++++++++++++++++++ components/rx/rxnew.lpk | 8 +- components/rx/rxnew.pas | 2 +- components/rx/vclutils.pas | 2 +- 13 files changed, 148 insertions(+), 42 deletions(-) create mode 100644 components/rx/images/TRxIniPropStorage.png create mode 100644 components/rx/rxinipropstorage.pas diff --git a/components/rx/images/TRxIniPropStorage.png b/components/rx/images/TRxIniPropStorage.png new file mode 100644 index 0000000000000000000000000000000000000000..c1766a70d43c02eab70ae3cb9a516c057f4232d8 GIT binary patch literal 426 zcmV;b0agBqP)'#177#243'T'#188#0#210'8 61'#222#166#141#185#172'U'#179#181 + +#163#29#187#236#147#162#184#177#235'?'#137#221#194#173'#'#0#170#234#215'N' + +#156's'#166#148'"M'#191#240#250#242'|U'#1'3'#3#160#25'/'#222'?'#190#225'+' + +#206#210'u'#137#166#137#180'mK'#211'4'#195#188#251'|'#31'b*'#1'wV'#9#132#16#0 + +'?'#204#12#243#152'J'#224#251'k'#237'5'#253#29'_'#9#220'=<'#173#20#152#230'g' + +#247'1'#216#167'g'#154#193#204#8'! "C'#1#151#208#204'9b'#140#184';]'#215#145 + +'s'#198#204'h'#219#22#17'!'#198#8'@J'#169#138#19#145#233'd'#170#234#251#237 + +#198'{B'#8#14'8'#224'"'#226'"r'#214#238#159'K)'#238#238#190#223'nz'#223#244#9 + +#142'w'#212#239#216'G-6'#23#179#248#138'D'#4#17'!'#132#128#187#163#170#149 + +#223#204#136'1RJ'#153#191#154's'#2'9'#231#193'VU,%: '#31#10#156'R'#194#204 + +#170#184')'#22'wQ'#25'%_'#195#170'6'#189#132'E'#2'S'#201#205#172'*'#250'Y' + +#142#219'TU'''#219'p<'#142#215'Uux'#127#220#166#147#2#238#238#165#148'j'#244 + +#162#128#171#234#137#127#204'"'#129#255'0'#251#161#141#127'R'#215'B'#0'D'#196 + +#23#23#236#130#252#183#205'/'#245#161'[H'#1#236'`'#148#0#0#0#0'IEND'#174'B`' + +#130 +]); diff --git a/components/rx/registerrxtools.pas b/components/rx/registerrxtools.pas index ac55787d8..069778a24 100644 --- a/components/rx/registerrxtools.pas +++ b/components/rx/registerrxtools.pas @@ -1,6 +1,6 @@ { RegisterRxTools unit - Copyright (C) 2005-2011 Lagunov Aleksey alexs@hotbox.ru and Lazarus team + Copyright (C) 2005-2013 Lagunov Aleksey alexs@hotbox.ru and Lazarus team original conception from rx library for Delphi (c) This library is free software; you can redistribute it and/or modify it @@ -31,7 +31,7 @@ unit RegisterRxTools; -{$mode objfpc}{$H+} +{$I rx.inc} interface @@ -41,7 +41,8 @@ uses procedure Register; implementation -uses RxSystemServices, RxLogin, RxVersInfo, RxCloseFormValidator; +uses RxSystemServices, RxLogin, RxVersInfo, RxCloseFormValidator, RxIniPropStorage; + const sRxToolsPage = 'RX Tools'; @@ -62,7 +63,12 @@ end; procedure RegisterCloseFormValidator; begin - RegisterComponents('RX Tools',[TRxCloseFormValidator]); + RegisterComponents(sRxToolsPage,[TRxCloseFormValidator]); +end; + +procedure RegisterRxIniPropStorage; +begin + RegisterComponents(sRxToolsPage,[TRxIniPropStorage]); end; procedure Register; @@ -71,7 +77,7 @@ begin RegisterUnit('RxVersInfo', @RegisterRxVersInfo); RegisterUnit('RxSystemServices', @RegisterRxSystemServices); RegisterUnit('RxCloseFormValidator', @RegisterCloseFormValidator); - + RegisterUnit('RxIniPropStorage', @RegisterRxIniPropStorage); end; end. diff --git a/components/rx/rx.lrs b/components/rx/rx.lrs index e19a0f38e..8cca9dd79 100644 --- a/components/rx/rx.lrs +++ b/components/rx/rx.lrs @@ -763,3 +763,23 @@ LazarusResources.Add('TRxCloseFormValidator','PNG',[ +#245#155#252#163'G'#135#136#6#134#250#3'|'#0#10'!sr'#165'GZ'#12#0#0#0#0'IEND' +#174'B`'#130 ]); +LazarusResources.Add('TRxIniPropStorage','PNG',[ + #137'PNG'#13#10#26#10#0#0#0#13'IHDR'#0#0#0#24#0#0#0#24#8#6#0#0#0#224'w='#248#0 + +#0#0#4'sBIT'#8#8#8#8'|'#8'd'#136#0#0#0#9'pHYs'#0#0#14#196#0#0#14#196#1#149'+' + +#14#27#0#0#1'LIDATH'#137#213#148#193'N'#195'0'#12#134'?''}'#27'$'#144#184#240 + +#10#28'9'#240'>'#177#243'T'#188#0#210'8 61'#222#166#141#185#172'U'#179#181 + +#163#29#187#236#147#162#184#177#235'?'#137#221#194#173'#'#0#170#234#215'N' + +#156's'#166#148'"M'#191#240#250#242'|U'#1'3'#3#160#25'/'#222'?'#190#225'+' + +#206#210'u'#137#166#137#180'mK'#211'4'#195#188#251'|'#31'b*'#1'wV'#9#132#16#0 + +'?'#204#12#243#152'J'#224#251'k'#237'5'#253#29'_'#9#220'=<'#173#20#152#230'g' + +#247'1'#216#167'g'#154#193#204#8'! "C'#1#151#208#204'9b'#140#184';]'#215#145 + +'s'#198#204'h'#219#22#17'!'#198#8'@J'#169#138#19#145#233'd'#170#234#251#237 + +#198'{B'#8#14'8'#224'"'#226'"r'#214#238#159'K)'#238#238#190#223'nz'#223#244#9 + +#142'w'#212#239#216'G-6'#23#179#248#138'D'#4#17'!'#132#128#187#163#170#149 + +#223#204#136'1RJ'#153#191#154's'#2'9'#231#193'VU,%: '#31#10#156'R'#194#204 + +#170#184')'#22'wQ'#25'%_'#195#170'6'#189#132'E'#2'S'#201#205#172'*'#250'Y' + +#142#219'TU'''#219'p<'#142#215'Uux'#127#220#166#147#2#238#238#165#148'j'#244 + +#162#128#171#234#137#127#204'"'#129#255'0'#251#161#141#127'R'#215'B'#0'D'#196 + +#23#23#236#130#252#183#205'/'#245#161'[H'#1#236'`'#148#0#0#0#0'IEND'#174'B`' + +#130 +]); diff --git a/components/rx/rxapputils.pas b/components/rx/rxapputils.pas index 52e70a1d1..59c09ef31 100644 --- a/components/rx/rxapputils.pas +++ b/components/rx/rxapputils.pas @@ -113,12 +113,9 @@ begin else begin Result := ExtractFileName(ChangeFileExt(Application.ExeName, '.ini')); -{$IFNDEF WIN32} S:=UTF8ToSys(GetAppConfigDir(false)); - if not DirectoryExists(S) then - mkdir(S); + ForceDirectoriesUTF8(S); Result:=S+Result; -{$ENDIF} end; end; diff --git a/components/rx/rxcloseformvalidator.pas b/components/rx/rxcloseformvalidator.pas index 66a347063..e82c76315 100644 --- a/components/rx/rxcloseformvalidator.pas +++ b/components/rx/rxcloseformvalidator.pas @@ -1,6 +1,6 @@ { RxCloseFormValidator unit - Copyright (C) 2005-2010 Lagunov Aleksey alexs@hotbox.ru and Lazarus team + Copyright (C) 2005-2013 Lagunov Aleksey alexs@hotbox.ru and Lazarus team original conception from rx library for Delphi (c) This library is free software; you can redistribute it and/or modify it diff --git a/components/rx/rxdbgrid.pas b/components/rx/rxdbgrid.pas index 27674f698..6e5e61453 100644 --- a/components/rx/rxdbgrid.pas +++ b/components/rx/rxdbgrid.pas @@ -2467,9 +2467,6 @@ var MLI:TMLCaptionItem; FTitle:TRxColumnTitle; begin -{ CE:=-1; - CB:=Columns.Count;} - for i:=0 to Columns.Count-1 do begin FTitle:=TRxColumnTitle(Columns[i].Title); @@ -2478,32 +2475,11 @@ begin MLI:=FTitle.CaptionLine(j); if MLI.FInvalidDraw<0 then begin - InvalidateRow(0); -{ CE:=Max(CE, i); - while Assigned(MLI.Prior) do - MLI:=MLI.Prior; - CB:=Min(MLI.Col.Index, CB);} + //InvalidateRow(0); exit; end; end; end; -(* - if CE>=CB then - begin - DebugLn('------'); - InvalidateRow(0); -{ for i:=CE downto CB do - begin - DebugLn(['DoTestInvalidCaption', CE, ' ', CB, ' ', i]); - if i = 2 then - begin - - end; - - InvalidateCell(i, 0, true); - end; } - end; -*) end; diff --git a/components/rx/rxfileutils.pas b/components/rx/rxfileutils.pas index cb0260f11..767483f09 100644 --- a/components/rx/rxfileutils.pas +++ b/components/rx/rxfileutils.pas @@ -1,6 +1,6 @@ { rxFileUtils is part of RxFPC library - Copyright (C) 2005-2010 Lagunov Aleksey alexs@hotbox.ru and Lazarus team + Copyright (C) 2005-2013 Lagunov Aleksey alexs@hotbox.ru and Lazarus team original conception from rx library for Delphi (c) This library is free software; you can redistribute it and/or modify it @@ -31,7 +31,7 @@ unit rxFileUtils; -{$mode objfpc}{$H+} +{$I rx.inc} interface @@ -42,6 +42,7 @@ function GetFileOwnerUser(const SearchDomain, FileName:String):String; procedure GetFileOwnerData(const SearchDomain, FileName:String;out UserName, DomainName:string); function NormalizeDirectoryName(const DirName:string):string; function GetUserName:string; + implementation uses {$IFDEF WINDOWS} diff --git a/components/rx/rxinipropstorage.pas b/components/rx/rxinipropstorage.pas new file mode 100644 index 000000000..570af65b3 --- /dev/null +++ b/components/rx/rxinipropstorage.pas @@ -0,0 +1,82 @@ +{ RegisterRxTools unit + + Copyright (C) 2005-2013 Lagunov Aleksey alexs@hotbox.ru and Lazarus team + original conception from rx library for Delphi (c) + + This library is free software; you can redistribute it and/or modify it + under the terms of the GNU Library General Public License as published by + the Free Software Foundation; either version 2 of the License, or (at your + option) any later version with the following modification: + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent modules,and + to copy and distribute the resulting executable under terms of your choice, + provided that you also meet, for each linked independent module, the terms + and conditions of the license of that module. An independent module is a + module which is not derived from or based on this library. If you modify + this library, you may extend this exception to your version of the library, + but you are not obligated to do so. If you do not wish to do so, delete this + exception statement from your version. + + This program is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public License + for more details. + + You should have received a copy of the GNU Library General Public License + along with this library; if not, write to the Free Software Foundation, + Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +} + +unit RxIniPropStorage; + +{$I rx.inc} + +interface + +uses + Classes, SysUtils, LResources, Forms, Controls, Graphics, Dialogs, IniPropStorage; + +type + + { TRxIniPropStorage } + + TRxIniPropStorage = class(TIniPropStorage) + private + FSeparateFiles: boolean; + protected + function GetIniFileName: string; override; + public + { Public declarations } + published + property SeparateFiles:boolean read FSeparateFiles write FSeparateFiles; + end; + +implementation +uses rxapputils, LazUTF8, FileUtil; + +{ TRxIniPropStorage } + +function TRxIniPropStorage.GetIniFileName: string; +var + S:string; +begin + if ExtractFileDir(IniFileName) <> '' then + Result:=IniFileName + else + begin + S:=GetDefaultIniName; + if IniFileName <> '' then + Result:=AppendPathDelim(ExtractFileDir(S)) + IniFileName + else + begin + if FSeparateFiles then + Result:=AppendPathDelim(ExtractFileDir(S)) + RootSection + '.cfg' + else + Result:=S; + end; + end; +end; + +end. diff --git a/components/rx/rxnew.lpk b/components/rx/rxnew.lpk index ed4e849fd..e3d1de25e 100644 --- a/components/rx/rxnew.lpk +++ b/components/rx/rxnew.lpk @@ -26,8 +26,8 @@ Copyright (c) 1998 Master-Bank translate to Lazarus by alexs in 2005 - 2012 "/> - - + + @@ -299,6 +299,10 @@ translate to Lazarus by alexs in 2005 - 2012 + + + + diff --git a/components/rx/rxnew.pas b/components/rx/rxnew.pas index 913713db2..3008ac2a6 100644 --- a/components/rx/rxnew.pas +++ b/components/rx/rxnew.pas @@ -18,7 +18,7 @@ uses RxSystemServices, rxtbrsetup, RxTimeEdit, rxtoolbar, RxVersInfo, RxViewsPanel, rxxpman, seldsfrm, tooledit, vclutils, RxCloseFormValidator, RxHistoryNavigator, ex_rx_bin_datapacket, ex_rx_datapacket, - ex_rx_xml_datapacket, rxsortby, RxMDI, LazarusPackageIntf; + ex_rx_xml_datapacket, rxsortby, RxMDI, RxIniPropStorage, LazarusPackageIntf; implementation diff --git a/components/rx/vclutils.pas b/components/rx/vclutils.pas index c01793587..5c6eb065e 100644 --- a/components/rx/vclutils.pas +++ b/components/rx/vclutils.pas @@ -1,6 +1,6 @@ { vclutils unit - Copyright (C) 2005-2010 Lagunov Aleksey alexs@hotbox.ru + Copyright (C) 2005-2013 Lagunov Aleksey alexs@hotbox.ru original conception from rx library for Delphi (c) This library is free software; you can redistribute it and/or modify it