RX library lazarus / 5-Lazarus Extra Components ---------------------------------------------------------------------- jack616 · 2013-10-28 14:23 I have a quite large application I wrote about 10 years ago with Delphi-3 c/s that uses the rx library. I currently maintain this with my D3 package but I would really like to update it now into laz/fpc. I see there is an RX library implementation and I have had a quick go at porting over but there is too much that probably wont ever work. My best solution seems to be to re-write the entire app taking out the specialist RX functions and replacing with standard Delphi components that should then port. After this I can "re-upgrade" the app with up to date modifications (better string grids etc) Because I have most functions isolated into units I shouldn't have too complex a problem to cope with but still... Obviously this is quite a lot of work so I thought I'd just ask first if anyone knows a better way to go about this particular issue? TIA ---------------------------------------------------------------------- wp · 2013-10-28 18:57 http://sourceforge.net/p/lazarus-ccr/svn/HEAD/tree/components/rx/ ? ---------------------------------------------------------------------- jack616 · 2013-10-29 14:27 ? ---------------------------------------------------------------------- marcov · 2013-10-29 15:01 I assume that that is a maintained version of the RX components for Lazarus. Might not contain all components though, and not always on all targets.  Sometimes intrinsically unportable components are left out. ---------------------------------------------------------------------- wp · 2013-10-29 16:21 Quote?Sorry for the confusion. You can download the Lazarus version of RX components from this link (click on "trunk" and "Download snapshot"). I once had installed RX in Delphi 4 or so. After having done a test install in Lazarus the component palette looks similar to that, but as marcov said the components probably are not complete. But maybe you give it a try. At least the ccr RX components are actively maintained, the last update of RxDBGrid is from today. ---------------------------------------------------------------------- jack616 · 2013-10-30 13:20 Thanks for explaining. I had a go with the library before posting here but couldn't see an easy way to get it to recognise the old string grid and labels and things (I used RX a lot because it seemed really useful a the time) The best I could do was to delete the components. Renaming them didn't seem to help either. (I have codetyphon installed) I guess I'm asking too much and had better just  knuckle down and get the work done. (If I have missed something please feel free to interupt me anytime!) Thanks though. ---------------------------------------------------------------------- eldonfsr · 2013-11-10 06:10 Compilent error rxlib C:\lazarus\componentes\Rx2.1\rxdbgrid.pas(629,15) Error: There is no method in an ancestor class to be overridden: "TRxDBGrid.GetBufferCount:LongInt;" i download to day. ---------------------------------------------------------------------- wp · 2013-11-10 18:31 I can compile and install the package with fpc 2.7.1. The commonly used fpc 2.6.2, however, fails. ---------------------------------------------------------------------- sin_dragan · 2013-12-26 20:11 Hi, I ve instaled rxnew package from trunk (version 2.6.1.134) on 1.0.8, 2.6.2 everything compiles fine. When I put component RxDBGrid on form, I get access violation. I ve tried to install 2.5.2.134 and 2.4.6 I get same result. When I try to create component from code I get Project raised exception class 'EResNotFound with message: Resource "picDateEdit" not found. Also tooledit.pas at line 851 - External SIGSEGV ---------------------------------------------------------------------- wp · 2013-12-26 20:31 I do get the access violation for RxDBGrid with 1.0.14 / fpc 2.6.2 or with 1.2RC1 / fpc 2.6.2, but do not for Laz trunk / fpc 2.6.2. You should post a report in the bug tracker. ---------------------------------------------------------------------- sin_dragan · 2013-12-26 21:38 Same here, I tried different versions + the 1.1 with 2.7.1, always the same. Thank you, I 'll try the latest trunk and also report this bug. ---------------------------------------------------------------------- sin_dragan · 2013-12-26 22:17 I tried with trunk version 43595 but still it gives me AV when I put RxDBGrid or TDBDateEdit component on form. What revision do you use? ---------------------------------------------------------------------- wp · 2013-12-26 23:59 Just updated to the same revision, no issues. Strange... ---------------------------------------------------------------------- sin_dragan · 2013-12-27 21:44 Strange indeed What version of Rx did you installed, is there any extra steps needed? I see that th CT uses the 2.4.8 version, but with fpc 2.7.1, I need working version with 2.6.2. ---------------------------------------------------------------------- wp · 2013-12-27 23:34 When I compile rxnew the message windows tells me that it's the 2.6.1.134 - it is the version in ccr/components/rx/trunk which I am occasionally updating by using TortoiseSVN. I am just installing the rxnew package, I don't know if it is necessary to install the old rx package as well, but I think I did this some time before (to be found in in Lazarus: Package / Install/uninstall packages / rx1.0) I'm not a specialist for rx, but I'd prefer the later package because the svn log tells me that there have been some recent fixes of RxDBGrid. ---------------------------------------------------------------------- tatamata · 2013-12-28 09:57 Hi, In CodeTyphon Lazarus distribution, there are Rx and RxDBAware packages preinstalled. So, you might try CodeTyphon (current version 4.60) or at least use their Rx package. ---------------------------------------------------------------------- sin_dragan · 2013-12-29 06:02 I tried to my work computer and on Linux Mint 32, still no luck. Instaled CT on Mint and works fine. Tried with 2.4.8 from CodeTyphon and still no luck. I'll finish the project and then compile it on CT. ---------------------------------------------------------------------- BigChimp · 2013-12-29 08:59 Quote from: sin_dragan on December 29, 2013, 07:02:40 amTried with 2.4.8 from CodeTyphon and still no luck. I'm sorry, what is this 2.4.8 you guys keep going on about? Isn't it more useful to quote the SVN revision you're using? (I have the suspicion the CCR guys may not increase the version number for each revision) http://wiki.lazarus.freepascal.org/RXfpc https://lazarus-ccr.svn.sourceforge.net/svnroot/lazarus- ccr/components/rx I've had this on a Laz/FPC trunk for a long  while and the package compiled ok but admittedly haven't really used it. Or am I missing something quite basic? Second: if you hit problems with the RX from CCR on regular Lazarus, I'd think posting a bug report and letting the devs fix the bux will be easier than switching to CodeTyphon??? ---------------------------------------------------------------------- sin_dragan · 2013-12-29 11:02 About 2.4.8, it's the package taken from CT. I posted a bug report 0025465. You made a good point, the goal is to make it usable on versions of Lazarus/FPC. I'll post here if anything changes. ---------------------------------------------------------------------- kjteng · 2013-12-31 14:14 I have got the same problem with ver2.6.1.134 I found that the mainly issue is that the file picDateEdit.lrs is missing. To solve this problem 1. I made the picDateEdit.lrs (attached) and saved it in the ...lazarus\components\rx2 folder; 2. Add the following line in rxdbgrid.pas (some where at line 5459)        {$I picDateEdit.lrs} Now rxlib works on my pc! This is just a quick fix while waiting for the new version. ---------------------------------------------------------------------- sin_dragan · 2013-12-31 14:51 @kjteng Thank you, I followed your instructions and rxdbgrid works okay now. ---------------------------------------------------------------------- BigChimp · 2013-12-31 15:12 Quote from: kjteng on December 31, 2013, 03:14:17 pmThis is just a quick fix while waiting for the new version. Why don't you submit it as a patch? May make the new version get there quicker ---------------------------------------------------------------------- wp · 2013-12-31 15:33 The issue is more subtle than just a missing file because this solution does not explain why the rx lib runs fine with fpc 2.7 without adding "picDateEdit.lrs". I fear this solution is just a workaround. The missing resource is present in "tooledit.res". The author had decided in rev. 2798 to switch from the lazarus resource type "tooledit.lrs" to the Delphi- like resource "tooledit.res". Evidently the older compiler 2.6.x cannot handle this - I think I read somewhere about these changes. Fortunately, this fix runs well also with fpc 2.7 although I had expected something like a "duplicate resource" error. ---------------------------------------------------------------------- taazz · 2013-12-31 19:39 yeah it seems that fpc and pre compiled resources is not a good mix try to break apart the tooledit.res in to its items and build an .rc file which is a text script that instructs the fpc to create a res file andinclude that instead of the res. It should overcome the problem and still use the file resources instead of the memory resource that lrs file use. ---------------------------------------------------------------------- kjteng · 2014-01-01 04:59 Quote from: BigChimp on December 31, 2013, 04:12:45 pmQuote from: kjteng on December 31, 2013, 03:14:17 pmThis is just a quick fix while waiting for the new version. Why don't you submit it as a patch? May make the new version get there quicker Sorry I am new to lazarus and the forum.  How and where can I submt the buts report to? ---------------------------------------------------------------------- kjteng · 2014-01-01 05:10 Quote from: wp on December 31, 2013, 04:33:54 pm.. I fear this solution is just a workaround. The missing resource is present in "tooledit.res". The author had decided in rev. 2798 to switch from the lazarus resource type "tooledit.lrs" to the Delphi- like resource "tooledit.res". Evidently the older compiler 2.6.x cannot handle this - I think I read somewhere about these changes. Fortunately, this fix runs well also with fpc 2.7 although I had expected something like a "duplicate resource" error. Yes, as I mentioned in my earlier reply, this is just a temporary solution. There is no tooledit.lrs in the version I downloaded (svn2974,  there is a tooledit.res instead). Also, I noticed that reference to tooledit.lrs and picDateEdit have been commented with (* *). That is the reason why there is no  "duplicate resource" error. ---------------------------------------------------------------------- BigChimp · 2014-01-01 10:00 Quote from: wp on December 31, 2013, 04:33:54 pmI fear this solution is just a workaround. The missing resource is present in "tooledit.res". The author had decided in rev. 2798 to switch from the lazarus resource type "tooledit.lrs" to the Delphi-like resource "tooledit.res". Evidently the older compiler 2.6.x cannot handle this - I think I read somewhere about these changes. I haven't read that anywhere and used .res resources ok with 2.6.x for a while. Would be interesting to have a reference/bug report for that because it would certainly need to be reported. Can't find anything in the 2.7.x changes either: http://wiki.lazarus.freepascal.org/FPC_New_Features_Trunk http://wiki.lazarus.freepascal.org/User_Changes_Trunk I suspect it's not the compiler that has a problem but Lazarus. Trunk Lazarus switched from .lrs to .res files IIRC (@taazz: it writes out .res files directly, probably using FPC's fcl-res package, without needing a .rc script/external resource compiler). http://wiki.lazarus.freepascal.org/Lazarus_1.4.0_release_notes#IDE_Cha nges Edit: @kjteng: Quote from: sin_dragan on December 29, 2013, 12:02:08 pmI posted a bug report 0025465. You made a good point, the goal is to make it usable on versions of Lazarus/FPC. See that bug report via the bugtracker link, top left of this page. Then look up that bug number: http://bugs.freepascal.org/view.php?id=0025465 ...seems like Dragan Krstevski   already posted your solution! ---------------------------------------------------------------------- wp · 2014-01-01 11:35 Code: [Select]Trunk Lazarus switched from .lrs to .res files IIRC (@taazz: it writes out .res files directly, probably using FPC's fcl- res package, without needing a .rc script/external resource compiler).Yes, you're correct, it is Lazarus, not fpc, your cited reference is the one that I read, but did not find. Since my trunk installation runs on fcp 2.7 I confused the two. Is there a way to use the res file on pre-Laz-1.4 versions to avoid adding the picDateEdit resource twice? ---------------------------------------------------------------------- BigChimp · 2014-01-01 11:43 Quote from: wp on January 01, 2014, 12:35:49 pmIs there a way to use the res file on pre-Laz-1.4 versions to avoid adding the picDateEdit resource twice? That was what I was wondering about, too. No idea, TBH. You could include either the .lrs or the .res based on an {$IF...} construct checking for LCL version, I suppose. (Sorry, don't know the exact name - LCL_VERSION?)... Edit: probably LCL_FULLVERSION, see http://lazarus- ccr.sourceforge.net/docs/lcl/lclversion/index.html ---------------------------------------------------------------------- wp · 2014-01-01 12:02 QuoteYou could include [...] the .lrsI'll try that. But I don't know how to create the lrs out of the res. Any idea? ---------------------------------------------------------------------- BigChimp · 2014-01-01 12:04 Quote from: wp on January 01, 2014, 01:02:56 pmQuoteYou could include [...] the .lrsI'll try that. But I don't know how to create the lrs out of the res. Any idea? Wasn't it posted here already? http://forum.lazarus.freepascal.org/index.php/topic,22463.msg137366.ht ml#msg137366 ---------------------------------------------------------------------- wp · 2014-01-01 18:37 Here is a solution that I am happier with. I'll post the modifications as a patch to bugtracker, but for a short-term modification copy the files in the attached zip to the source files of your rxnew installation. Some details (nothing to change - everything is included already in the zip): I cannot compile rxnew with the default defines in rx.inc. Deactivating the define "RX_USE_LCL_DEVEL" fixes this. Using XN Resource Editor, I extracted the picDateEdit image from "tooledit.res" (it's only this one), and recreated the "tooledit.lrs". If you had applied kjteng's patch from above, it has to be undone by removing the line "{$I picDateEdit.lrs}" at the end of rxdbgrid.pas.In "tooledit.pas", the line "{$R tooledit.res}" has to be removed, and immediately before the final "end." the following lines have to be added Code: [Select]initialization   {$I tooledit.lrs} Unfortunately I had lots of trouble getting this solution to run. Finally I found out that the virtual procedure "GetDefaultGlyph" introduced by TCustomEditButton (in lcl/EditBtn.pas) is not overridden by TCustomRxDateButton and still returns nil. To fix this, add the following procedure to unit "tooledit.pas":Code: [Select]function TCustomRxDateEdit.GetDefaultGlyph: TBitmap; var   ResName: String; begin   NumGlyphs := 2;  // the picDateEdit file contains two glyphs   ResName := GetDefaultGlyphName;   if ResName = '' then     Exit(nil);   Result := LoadBitmapFromLazarusResource(Resname); end; In testing other rx components, I saw that TRxCustomDBLookupEdit (in rxlookup.pas) has the same issue. To get it fixed add the following code to rxlookup.pas:Code: [Select]function TRxCustomDBLookupEdit.GetDefaultGlyph: TBitmap; begin   Result := CreateArrowBitmap; end; With all these modifications done, I was able to compile and use the rx components in all of my Lazaraus versions available, (1.0.14, trunk, Win and Ubuntu (trunk) ). There is still a crash for TPageManager that I did not fix. My overall impression is that there's still a lot to be done to get these components to the qualitity level of the standard LCL components. ---------------------------------------------------------------------- freeman35 · 2014-01-12 14:20 I attached my patch. This patch had 2 events: Code: [Select]+//Freeman35 added +  TRxTitleClickEvent = procedure(Sender: TObject; Column: TRxColumn; Shift: TShiftState) of object; +  TDrawRxColumnCellEvent = +    procedure(Sender: TObject; ACanvas: TCanvas; const Rect: TRect; +              DataCol: Integer; Column: TColumn; State: TGridDrawState; var AText :String) of object; OnRxTitleClick : I added just Shift: TShiftState parameter, So can handle easy shift or ctrl click and set multi column sort OnDrawRxColumnCell : This is Column's event.  Column.OnDrawColumnCell same event name with rxgrid, this example explain better then me Code: [Select]procedure TFRM_X.GRD_Columns2DrawRxColumnCell(Sender: TObject; ACanvas: TCanvas; const Rect: TRect; DataCol: Integer; Column: TColumn; State: TGridDrawState; var AText: String); begin   if(Column.Field<>nil)and(Column.Field.AsInteger<0)then begin    ACanvas.Brush.Color := ClRed;    ACanvas.Font.Style := [fsBold];    AText := 'Negative Value';   end; // This code for need Editor position, maybe add in Column class, and maybe add TWincontrol property too, we will see :)  if (gdFocused in State)then FGridCellRect := Rect; end; This patch just add code, not change any code or properties name Thank you BigChimp, can follow from this link http://bugs.freepascal.org/view.php?id=25524 ---------------------------------------------------------------------- BigChimp · 2014-01-13 08:03 @freeman, please submit patches to the bugtracker so the rx developers have a chance to notice it (not all developers read the forum). (I suspect wp has uploaded See http://wiki.lazarus.freepascal.org/Lazarus_Faq#I_have_fixed.2Fimproved _Lazarus._How_can_I_add_my_changes_to_the_official_Lazarus_source.3F and http://wiki.lazarus.freepascal.org/Creating_A_Patch For example: wp did the same with his patch, see: http://bugs.freepascal.org/view.php?id=0025465 Thanks for your contribution! ---------------------------------------------------------------------- krzynio · 2014-01-20 08:16 Hello! I was looking for DBGrid component for Lazarus with filter and sum options like in SMDBGrid for Delphi. I found RX library then downloaded and installed from svn: Code: [Select] svn co https://lazarus- ccr.svn.sourceforge.net/svnroot/lazarus-ccr/components/rx I compiled and installed comp. without problems but when I am trying to put TRXDBGrid component on a form I notice the error: Error creating component: TRxDBGrid. Access violation. I was trying with trunk and with version but result is the same in both cases. I work on Debian with Lazarus 1.1.99pre-release from svn and FPC 2.6.2 from Debian Jessie repositories. I noticed this behavior with several RX components also. Please help. ---------------------------------------------------------------------- wp · 2014-01-20 08:58 Did you try my fix a few postings above? ---------------------------------------------------------------------- krzynio · 2014-01-20 09:40 Thank you very much! I replaced original files with files from your fix and now works fine. Regards, Krzysztof ---------------------------------------------------------------------- krzynio · 2014-01-21 11:21 Hi again! I am trying to display SortMarks. OnTitleClick is as follows: Code: [Select]    with (g.DataSource.DataSet as TZQuery) do begin       if SortType = stAscending then begin       SortedFields := '"'+Column.Field.FieldName+'"';         SortType := stDescending;       end       else begin       SortedFields := '"'+Column.Field.FieldName+'"';         SortType := stAscending;       end;     end; GetButtoParams looks like this: Code: [Select]  if pos(Field.DisplayName, (g.DataSource.DataSet as TZQuery).IndexFieldNames )>0 then begin     if (g.DataSource.DataSet as TZQuery).SortType=stAscending then begin     SortMarker := smDown;     end     else     SortMarker := smUp;   end   else   SortMarker := smNone;    The SortMark is drawn correctly only for smDown and only when option dgHeaderPushedLook is True. But with this option the table is sorted correctly only when I press the column header first time. Next time the table is sorted with any different column. When I set dgHeaderPushedLook to False table is sorted correctly in both directions and for correct column but SortMark is not drawn. Do I do something wrong or is it a bug? How to fix it? And one more bug? When I set option dgIndicator to False, Lazarus displays dialog box with any error and closes automatically so fast that I cannot even read the error message. ---------------------------------------------------------------------- r_1gm · 2014-02-24 14:48 Hi all, i found a problem in CurrencyEdit when i using FormatOnEditing feature, the CurrencyEdit cursor always move to left when text is formated, when i look to the source i find that the code that move the cursor to the right position is remarked, i doing small modification so the code is can be compiled and running, if this patch is right please report it to the bug tracker i can't find a way to post it(i already logged but cannot find a way to post it)  . thank you Best Regards, Rody ---------------------------------------------------------------------- BigChimp · 2014-02-24 14:56 Quotethe bug tracker i can't find a way to post it(i already logged but cannot find a way to post it) In the bugtracker, log in, create a new issue, and attach the zip file with your patch via Upload File /select file/browse... For more details, please see: http://wiki.lazarus.freepascal.org/How_do_I_create_a_bug_report#Attach ments more background: http://wiki.lazarus.freepascal.org/Creating_A_Patch http://wiki.lazarus.freepascal.org/Tips_on_writing_bug_reports Thanks. ---------------------------------------------------------------------- alexs75 · 2014-03-06 11:15 Quote from: krzynio on January 21, 2014, 12:21:20 pmHi again! I am trying to display SortMarks. OnTitleClick is as follows: For sort data in RxDBGrid from Zeos query: Set: RxDBGrid.AutoSort = true RxDBGrid.TitleButtons = true and put component TRxSortZeos on the any form of you project