Recent

Author Topic: Procedure View  (Read 4288 times)

Ian123

  • New Member
  • *
  • Posts: 28
Procedure View
« on: May 29, 2017, 05:44:19 pm »
Hi
In vb6 we have the option to view things in what's called procedure view. I think Xojo has it as well.
They got rid of it in vb.net and it doesn't seem to be a common feature in other
IDEs'.
Lazarus seems to have what is called in vb6 the 'full module view' which is also actually the default in vb6.
I would love it if Lazarus has a procedure view option.
The advantages are making it impossible to scroll out of a procedure and making the screen less busy.
Also it is still easy to navigate around a unit using the dropdown menus which in my view makes it easier to find
another procedure than scrolling through an entire module.
I have made a mock up of how it might look if it existed in Lazarus.
I suspect that i am in a small minority who likes this but anyway i was wondering if there is any kind of similar option in the Lazarus IDE?
Thanks.
Windows 10 64 bit *  Lazarus 1.8.0RC1 * i386-win32-win32/win64

Handoko

  • Hero Member
  • *****
  • Posts: 5153
  • My goal: build my own game engine using Lazarus
Re: Procedure View
« Reply #1 on: May 29, 2017, 06:22:13 pm »
Hello Ian123,
Welcome to the forum.

Maybe it is not what you want but I think you should try "Code Explorer", to show it:
Lazarus main menu > View > Code Explorer

Lazarus IDE is very powerful, you can customize it to the way you like. And you can save it as "Desktop" (main menu > Tools > Desktop) and reuse it on different situations, for example a desktop for "Performing GUI layout", desktop for "Coding", desktop for "Debugging".

The screenshot below is the layout of my Desktop. The left panel is "Code Editor" with a toolbar on the top, that the items chosen by myself. The right panel is "Project Inspector" and "Tab Order" at its bottom.

The panel in the middle is "Code Explorer", you can jump to the related code if you double-click an item on it. Also you may like to use the shortcut [Ctrl+Shift+Down] for "Find Procedure Method", a shortcut I use frequently when coding.

Shortcuts are very handy when do coding. To view or modify shortcuts:
Lazarus main menu > Tools > Options > Key Mappings
« Last Edit: May 29, 2017, 06:32:28 pm by Handoko »

Edson

  • Hero Member
  • *****
  • Posts: 1302
Re: Procedure View
« Reply #2 on: May 29, 2017, 06:57:48 pm »
What I do is to fold all the code (ALt+Shift+1) and then, the entire unit looks like a ComboBox of procedures/functions. I use comments, out of procedures, to group differents procedures.

Then If I need to see one procedure, just Unfold that procedure.
Lazarus 2.2.6 - FPC 3.2.2 - x86_64-win64 on Windows 10

Ian123

  • New Member
  • *
  • Posts: 28
Re: Procedure View
« Reply #3 on: May 29, 2017, 08:44:32 pm »
Hello Ian123,
Welcome to the forum.

Maybe it is not what you want but I think you should try "Code Explorer", to show it:
Lazarus main menu > View > Code Explorer

Lazarus IDE is very powerful, you can customize it to the way you like. And you can save it as "Desktop" (main menu > Tools > Desktop) and reuse it on different situations, for example a desktop for "Performing GUI layout", desktop for "Coding", desktop for "Debugging".

The screenshot below is the layout of my Desktop. The left panel is "Code Editor" with a toolbar on the top, that the items chosen by myself. The right panel is "Project Inspector" and "Tab Order" at its bottom.

The panel in the middle is "Code Explorer", you can jump to the related code if you double-click an item on it. Also you may like to use the shortcut [Ctrl+Shift+Down] for "Find Procedure Method", a shortcut I use frequently when coding.

Shortcuts are very handy when do coding. To view or modify shortcuts:
Lazarus main menu > Tools > Options > Key Mappings

Thanks, Code Explorer is awesome, I didn't know it existed and it makes navigation a lot easier.
I have been playing with it. As you say the IDE is very powerful and I have an awful lot to learn.
It's an awesome achievement especially considering it's provided free of charge.


What I do is to fold all the code (ALt+Shift+1) and then, the entire unit looks like a ComboBox of procedures/functions. I use comments, out of procedures, to group differents procedures.

Then If I need to see one procedure, just Unfold that procedure.

I like this idea too (alt shift 1). As you say it makes everything like a big combobox and really cleans up the clutter.
I just altered the code folding so it doesn't fold the sections inside a procedure so it just takes one click to expose
the entire procedure.

Thanks guys, I think your suggestions have pretty much cleared up my issues!
Windows 10 64 bit *  Lazarus 1.8.0RC1 * i386-win32-win32/win64

Ian123

  • New Member
  • *
  • Posts: 28
Re: Procedure View
« Reply #4 on: May 31, 2017, 10:58:03 am »
I was trying out anchordockingdsgn package.
It seems to work for me but I haven't got it right.
The source window is docked but the form design and the object inspector windows aren't.
When I move them over the docked window they don't dock.
Also when I go to the view menu and select code explorer i get the error in the pic below

I'm on windows 10 64 bit, I think my lazarus is 32 bit. I have 2 monitors set up.
I'll probably uninstll everything and re-install everything to see if that
fixes it unless someone has an idea of what is wrong.
Thanks
Windows 10 64 bit *  Lazarus 1.8.0RC1 * i386-win32-win32/win64

Michl

  • Full Member
  • ***
  • Posts: 226
Re: Procedure View
« Reply #5 on: May 31, 2017, 11:31:20 am »
Please try with Lazarus 1.8RC1 (e.g. https://sourceforge.net/projects/lazarus/files/Lazarus%20Windows%2032%20bits/Lazarus%201.8RC1/) or Lazarus trunk. The WMSize loop bug should be fixed there.
« Last Edit: May 31, 2017, 11:43:49 am by Michl »
Code: [Select]
type
  TLiveSelection = (lsMoney, lsChilds, lsTime);
  TLive = Array[0..1] of TLiveSelection;

marcov

  • Administrator
  • Hero Member
  • *
  • Posts: 11452
  • FPC developer.
Re: Procedure View
« Reply #6 on: May 31, 2017, 11:51:11 am »
I was trying out anchordockingdsgn package.
It seems to work for me but I haven't got it right.

Try this:

Turn lazarus off, remove (or better, backup) the configuration in %userprofile%\appdata\Local\lazarus   and restart.

 

Ian123

  • New Member
  • *
  • Posts: 28
Re: Procedure View
« Reply #7 on: May 31, 2017, 02:56:34 pm »
Please try with Lazarus 1.8RC1 (e.g. https://sourceforge.net/projects/lazarus/files/Lazarus%20Windows%2032%20bits/Lazarus%201.8RC1/) or Lazarus trunk. The WMSize loop bug should be fixed there.

Hi thanks I went ahead and installed this and it works great!



I was trying out anchordockingdsgn package.
It seems to work for me but I haven't got it right.

Try this:

Turn lazarus off, remove (or better, backup) the configuration in %userprofile%\appdata\Local\lazarus   and restart.

Hi Marcov
Thanks! Your  suggestion worked but when I compiled my project, the whole IDE started shivering and then that same error window popped up.
Maybe there was something else I could have done to fix that but in the end I decided to upgrade and it seems to work fine now.
Windows 10 64 bit *  Lazarus 1.8.0RC1 * i386-win32-win32/win64

 

TinyPortal © 2005-2018