Forum > Editor

The shortcut to the widget click method !

(1/1)

loaded:
Hi All,
When we CTRL+Left Click on the function and method names we see on the screen, we can go to the relevant code block.

How can we go to a menu item like below?

--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---MenuItem81.Click;

Martin_fr:
You mean: Select it in the Object Inspector? And even the menu-editor?

I don't know of any ctrl-click like way.

But (at least in Lazarus 2.3) the Object inspector has a filter-edit above the component tree. So you can enter "Item81" and the tree will be filtered (anything containing "item81", wich is your menuitem81, and all its parent nodes. You can enter the full name, if needed.

That would make it easy to find and select. If you select it in the OI, then it also will be selected in the menu-editor if that is open.

loaded:
Thank you so much for your answer, Martin_fr.
I have a design-disabled form that I wrote a long time ago and later developed continuously.
There are situations where I need to go to the relevant methods while not in the Object inspector but directly in the Code editor.
I hadn't thought of the method you suggested. For now I will use the method you suggested. But if there is a shortcut, it will be much nicer. Respects.

Martin_fr:
Then maybe I did not understand your question correct.

If you have (in the source edit)

--- Code: Pascal  [+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i < x.length; i++) { x[i].style.maxHeight='none'; x[i].style.height = Math.min(x[i].clientHeight+15,306)+'px'; x[i].style.resize = "vertical";}};} ---MenuItem81.Click;
Then you can ctrl-left click (Or Keyboard Alt-Up) either "MenuItem81" or "Click". And that will take you do the relevant source code.

If you mean (in case of "Click"): How to get to the implementation, rather than declaration. => There is a setting in the options (not sure of the name, but IIRC it has been answered several times on this forum). With that setting enabled ctrl-click and Alt-up will jump to the implementation.

Without the setting you use Ctrl-Shift-Down (or UP) to switch between declaration and implementation.

----
EDIT:

if you have "click" in your source, but want to go to the "OnClick" (e.g. procedure TForm1.MenuItem81Click" or similar) then you need to know the name of the OnClick event.... Or maybe the "code explorer" can help, but you still need to search it in there.

loaded:
Thank you for taking your precious time to reply. I will do research when I am available in the direction you specified.

Navigation

[0] Message Index

Go to full version