Recent

Author Topic: Searching for code samples  (Read 10388 times)

Elmug

  • Hero Member
  • *****
  • Posts: 849
Searching for code samples
« on: August 26, 2011, 02:15:20 pm »
Good people,

I read this in another thread, and it looks useful.

But I could not make sense so as to use it:


"I can recommend searching for code samples in Lazarus code base itself. Just use Ctrl-Shift-F, select Lazarus src top dir and search...

Juha"


I am on Windows XP, and can't figure out where should the focus be when I hit Ctrl-Shift-F, to start with.

Thanks for any replies!

Shebuka

  • Sr. Member
  • ****
  • Posts: 429
Re: Searching for code samples
« Reply #1 on: August 26, 2011, 03:28:18 pm »
Focus must be on any IDE form, then search for whatever function you need (all names are quite mnemonic)

Curt Carpenter

  • Hero Member
  • *****
  • Posts: 724
Re: Searching for code samples
« Reply #2 on: August 26, 2011, 04:08:30 pm »
I didn't know that.  Pretty nice!

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4680
  • I like bugs.
Re: Searching for code samples
« Reply #3 on: August 26, 2011, 05:48:53 pm »
Focus must be on any IDE form, then search for whatever function you need (all names are quite mnemonic)

No Shebuka, focus must be on a source editor for the shortcut Ctrl-Shift-F to work.
You can also select it from menu: Search -> Find in Files...
and then focus can be anywhere.

I also recommend you to look at menu entries in main menu. There are many useful features (including this Search -> Find in Files...)
Lazarus trunk also has a revamped menu structure. Please check out.

Juha
« Last Edit: August 26, 2011, 05:50:32 pm by JuhaManninen »
Mostly Lazarus trunk and FPC 3.2 on Manjaro Linux 64-bit.

Shebuka

  • Sr. Member
  • ****
  • Posts: 429
Re: Searching for code samples
« Reply #4 on: August 26, 2011, 06:01:56 pm »
Focus must be on any IDE form, then search for whatever function you need (all names are quite mnemonic)

No Shebuka, focus must be on a source editor for the shortcut Ctrl-Shift-F to work.
You can also select it from menu: Search -> Find in Files...
and then focus can be anywhere.

I also recommend you to look at menu entries in main menu. There are many useful features (including this Search -> Find in Files...)
Lazarus trunk also has a revamped menu structure. Please check out.

Juha
Ah ok, dunna know that.
On Mac, maybe because of different Application structure (there must be only one MainMenu assigne ti application at any time), the focus can be on any of IDE forms.

Elmug

  • Hero Member
  • *****
  • Posts: 849
Re: Searching for code samples
« Reply #5 on: August 26, 2011, 07:58:12 pm »
Thank you all for the kindness and good replies!
 :)

Carver413

  • Full Member
  • ***
  • Posts: 119
Re: Searching for code samples
« Reply #6 on: August 26, 2011, 09:49:38 pm »
it is also a good Idea to create a folder some where an fill it with source code from where ever you can find it. even if you think you will never use it it may give you answers when all else fails. when tring to figure how to do something with Xwindows I ended up finding my answer in some game engine. probably the last place I would have looked.

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4680
  • I like bugs.
Re: Searching for code samples
« Reply #7 on: August 27, 2011, 11:08:45 am »
Focus must be on any IDE form, then search for whatever function you need (all names are quite mnemonic)

Sorry, I must fix my earlier comments. For "Ctrl-Shift-F" focus can indeed be on IDE forms like Object Inspector or Messages, but not on Form Designer.

The command dispach system is rather primitive and partly broken. For example Copy/Paste commands are not forwarded from menu to Designer. It has its own bindings for Ctrl-C and Ctrl-V shortcuts.
I tried to forward them and Undo/Redo commands to Designer but failed badly. It broke many other parts of the IDE.

The command dispach system must be revamped some time in future, maybe in Lazarus 2.0 at year 2025. :)
It should also support truely context sensitive main menu items like eg. Eclipse has.

Juha
Mostly Lazarus trunk and FPC 3.2 on Manjaro Linux 64-bit.

Elmug

  • Hero Member
  • *****
  • Posts: 849
Re: Searching for code samples
« Reply #8 on: August 27, 2011, 01:42:50 pm »
By any chance, was Eclipse developed with FreePascal/Lazarus, so they should share back the code?

JuhaManninen

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 4680
  • I like bugs.
Re: Searching for code samples
« Reply #9 on: August 29, 2011, 08:13:14 am »
By any chance, was Eclipse developed with FreePascal/Lazarus, so they should share back the code?

Eclipse is made with Java. It is one of the best known Java IDEs out there.
It has lots of resources and support from big companies.
Yet, IMO, it is not much better than Lazarus. For example the Eclipse Codetools equivalent hogs memory and stops working during a long editing session and Eclipse must be restarted.
The numerous plugins also start to make the IDE messy.

 http://www.eclipse.org/

BTW, even if some other IDE made with FreePascal implemented a proper command dispach system, it couldn't be just copy/pasted to Lazarus. It requires many changes in Lazarus internals.

Juha
Mostly Lazarus trunk and FPC 3.2 on Manjaro Linux 64-bit.

Curt Carpenter

  • Hero Member
  • *****
  • Posts: 724
Re: Searching for code samples
« Reply #10 on: September 03, 2011, 06:13:16 pm »
Juha writes:  "Lazarus trunk also has a revamped menu structure. Please check out."

Can anyone point me to some docs describing what the "Lazarus trunk" is, and how to use it?  I'm a new user, and really paranoid about changing anything about my FPC/Lazarus setup until I have a lot more experience with it.   The revamped menu structure sounds interesting though, and I'd like to check it out if I knew how :)

BigChimp

  • Hero Member
  • *****
  • Posts: 5740
  • Add to the wiki - it's free ;)
    • FPCUp, PaperTiger scanning and other open source projects
Re: Searching for code samples
« Reply #11 on: September 03, 2011, 07:11:38 pm »
Good that you're paranoid.

Read up on installing a second install of Lazarus and FPC (hint search on -primary-config-path, that's the parameter you need to add when calling your second (or higher) instance of Lazarus).

Must be somewhere in the wiki, don't have time right now

Trunk is simply the latest subversion version (i.e. the bleeding edge code). Periodically, branches are taken and frozen and a release is made out of that.
Fixes and improvements from trunk may filter back to a fixes branch to improve a certain release.
Is basically SVN speak, there should be references in the wiki as well
Want quicker answers to your questions? Read http://wiki.lazarus.freepascal.org/Lazarus_Faq#What_is_the_correct_way_to_ask_questions_in_the_forum.3F

Open source including papertiger OCR/PDF scanning:
https://bitbucket.org/reiniero

Lazarus trunk+FPC trunk x86, Windows x64 unless otherwise specified

Martin_fr

  • Administrator
  • Hero Member
  • *
  • Posts: 12142
  • Debugger - SynEdit - and more
    • wiki
Re: Searching for code samples
« Reply #12 on: September 03, 2011, 08:19:33 pm »
"revamped menu structure" is mainly re-ordering. The menu items did exist before, but they were all in other places, and harder to find.

You can download a snapshot (see link on the left of this page). You are looking for a snapshot that has 0.9.31 in the name (rather than 0.9.30.1)
e.g:
Lazarus + fpc 2.4.4  | win32 | Lazarus-0.9.31-32164-fpc-2.4.4-20110903-win32.exe

but make sure you read up on --primary-config-path which should point to an EMPTY directory.
Lazarus will create the config on first start (it will bring up a dialog, if not, you done something wrong)

 

TinyPortal © 2005-2018