Jump to content
dummzeuch

Testers needed for GExperts Instant Grep expert

Recommended Posts

46 minutes ago, baka0815 said:

So, something like this?


Filename.pas | if (True) then
Line 1234    |   DoSomething()
             | else
-------------+---------------------------
Filename.pas | // Comment
Line 4567    | DoSomething();
             |

 

Yes.

Share this post


Link to post

I have change the code a little bit and this is my current result of Instant Grep dialog:

 

IG_changes.thumb.png.62c36b3300a3f3abbde22c998de30f2e.png

 

If the active editor file changes, the dialog changes it's caption too. If you are interested, I can send the necessary modifications.

Share this post


Link to post
1 hour ago, ULIK said:

I have change the code a little bit and this is my current result of Instant Grep dialog:

 

IG_changes.thumb.png.62c36b3300a3f3abbde22c998de30f2e.png

 

If the active editor file changes, the dialog changes it's caption too. If you are interested, I can send the necessary modifications.

I'm always interested in possible improvements.

Share this post


Link to post

Putting the line number to the left into a gutter just like in the editor would save a lot of vertical space - take a look at the Notepad++ search results window

Edited by Stefan Glienke
  • Like 1
  • Thanks 1

Share this post


Link to post
2 hours ago, Stefan Glienke said:

Putting the line number to the left into a gutter just like in the editor would save a lot of vertical space

Yes, I was thinking about that already but didn't find the time to check it out yet.

Share this post


Link to post
4 hours ago, ULIK said:

I have attached you a Subversion patch file. It's just a quick&dirty change, so have a look on it (especially for the new resource string. This might not be necessary).

GX_GrepInstantGrep.pas.patch

Thanks. Commited as revision #4070. I have made a small change thoug: I prefixed the file name to "- instant grep" like it is shown in e.g. the project manager window so the importantpart (the file name) is visible even if the window is too narrow to display the full title.

 

An unfortunate side effect is that the original position entry now doesn't even show "original position" in the caption. It needs some other way to be distinguished from the other entries.

Share this post


Link to post

Minor glitch: label l_PressEsc should set Layout to tlCenter to align it with checkbox (but I'm not sure, if this property is available back to Delphi 7).

 

A suggestion for an interim solution for the missing 'Original Position':

procedure PaintFileHeader(_Rect: TRect);
...
LineText := Format(SLine, [Res.Idx + 1]);
    
// Add additional text for original position, which is always the very first entry on listbox
if _Index = 0 then
  LineText := LineText + ' (' + Module + ')';
...

You might also use a different color for original position:

 

procedure PaintLines(_Rect: TRect);
...
    if odSelected in _State then begin
      BGNormal := clHighLight;
      LbCanvas.Font.Color := clHighLightText;
      BGMatch := BGNormal;
    end else if _Index = 0 then begin  // as original position is not a real result, just let it gray
      BGNormal := clBtnFace;
      LbCanvas.Font.Color := clWindowText;
      BGMatch := BGNormal;
    end else begin
      BGNormal := clWindow;
      LbCanvas.Font.Color := clWindowText;
      BGMatch := RGB(250, 255, 230);
    end;

 

IG_newmods.png.33f2536c22d87b895f632c5adbeada6f.png

 

Just some ideas, but a gutter would be much better. Feel free to add what you like.

  • Thanks 1

Share this post


Link to post

I played around with this expert and added two things:

- display with gutter:

 

instant_grep_gutter.thumb.png.79a9053987d2b4c33ea633d5d3929f77.png

 

- two buttons to refresh or clear results: refresh can be used, when typing something on editor itself that modifies the result positions.

 

If you like it, feel free to add it to repository. Please note: all modifications were only tested on Delphi XE11, but they should run on earlier versions too. As I'm not familiar with GX development: I have simply assigned two icons from GX Icon folder to speedbutton glyph, which probably is not the common way for GX. So you might change this to better fit the GX universe.

 

Attached is a patch file with my changes:

InstantGrepWithGutter.patch

Edited by ULIK
  • Thanks 2

Share this post


Link to post
3 hours ago, ULIK said:

I played around with this expert and added two things:

- display with gutter:

- two buttons to refresh or clear results: refresh can be used, when typing something on editor itself that modifies the result positions.

Thanks! I was about to add these two myself, the next time I find some free time. Having your patch will make that happen a lot faster. I still need some time for this anyway.

3 hours ago, ULIK said:

As I'm not familiar with GX development: I have simply assigned two icons from GX Icon folder to speedbutton glyph, which probably is not the common way for GX. So you might change this to better fit the GX universe.

You are correct. The right way is to use the image lists in Source\Framework\GX_SharedImages, or since Delphi 11, to assign these lists at runtime. See any of the dialogs that have a tool bar on how this is done.

Share this post


Link to post
57 minutes ago, dummzeuch said:

I still need some time for this anyway.

I just made some time for it. I have quite a bit of overtime to work off anyway.

#revision 4072

Edited by dummzeuch
  • Like 2

Share this post


Link to post

Here's my shot at it. Leaving GExperts as is and extend functionality with outside exe.  There's a fantastic amount of work in GExperts and I am learning a lot reviewing the source and the comments in @dummzeuch Blog is quite helpful. Thanks.    

 

Running a task bar manager surfaces the GExperts showing in other desktops. What's interesting GExperts moves the active Delphi instance behind the taskbar with only the titlebar showing. Unsure here some GExperts hide with Delphi instance and docking forms get a taskbar icon.       

Screenshot 2023-11-03 080357.png

Share this post


Link to post

"Jump List for Delphi 11" is the "jump list" for the Delph icon on the taskbar, that is the popup menu you get when you click on that icon with the right mouse button. That's a Windows feature.

Share this post


Link to post

Thanks does GExperts have anything that looks at file age, I found that mentioned in Ray Lischner Hidden Paths of Delphi 3  wooden book.  Then look at timestamps of the DCU to if the Build all compile processed everything. Sometimes the source needs saved first.  GExperts actually catches when a license check fails which again is some good work.     

Share this post


Link to post
37 minutes ago, Pat Foley said:

Does GExperts have anything that looks at file age, I found that mentioned in Ray Lischner Hidden Paths of Delphi 3  wooden book.  Then look at timestamps of the DCU to if the Build all compile processed everything. Sometimes the source needs saved first.  GExperts actually catches when a license check fails which again is some good work.     

I'm not quite sure what you mean here. The Delphi compiler automatically checks if the internal timestamp of a dcu file is older than the currentl source code of a unit and recompiles it, if necessary. But what exactly does hat have to do with GExperts?

Share this post


Link to post
20 minutes ago, dummzeuch said:

...the internal timestamp of a dcu file is older than the currentl source code of a unit and recompiles it, if necessary. But what exactly does hat have to do with GExperts?

I plan to code an expert to verify the dcus are kept current with current source code because sometimes the current source code needs saved before the dcus are recompiled. I need to simply review and learn more before making additional comment.

 

 

Edited by Pat Foley
Change but to because.

Share this post


Link to post

If you were seeing an access violation with a self compiled GExperts DLL and the latest code, you should update the sources to at least revsion #4079. I fixed a bug there that caused an AV.

Share this post


Link to post

Rev 4079 D11.3.1:

On download:

Restored 'GExperts\ExternalSource\OmniXML.pas'
Skipped 'GExperts\Source\Grep\GX_GrepInstantGrep.pas' -- Node remains in conflict
Checked out revision 4079.

 

On Build:

GExpertsRS110.dpr(258): error F1026: File not found: '..\..\Source\Grep\GX_GrepInstantGrep.pas' [D:\GExperts\Projects\DelphiXx110Alexandria\GExpertsRS110.dproj]
Done Building Project "D:\GExperts\Projects\DelphiXx110Alexandria\GExpertsRS110.dproj" (rebuild target(s)) -- FAILED.


Build FAILED.

"D:\GExperts\Projects\DelphiXx110Alexandria\GExpertsRS110.dproj" (rebuild target) (1) ->
(_PasCoreCompile target) ->
  GExpertsRS110.dpr(258): error F1026: File not found: '..\..\Source\Grep\GX_GrepInstantGrep.pas' [D:\GExperts\Projects\DelphiXx110Alexandria\GExpertsRS110.dproj]

    0 Warning(s)
    1 Error(s)

 

Edited by Ian Branch

Share this post


Link to post

With SVN Tortoise Update and Alexandria (11.3) no issues for me and no access violation.

Share this post


Link to post

Interesting.

I just repeated the download/build process, I had done it twice before with the result as reported above, this time all is good.  Download and build, no issues.

The errors I were getting when exiting Delphi have also seem to have disappeared.  Fingers crossed.  😉

 

Share this post


Link to post

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×