Page 1 of 2

Newbie questions

Posted: Thu Jan 08, 2009 6:40 pm
by chuckf
Hi,
I've just started my trial of CodeLite so I have a few questions...
Running on Windows xp.

1. I don' understand workspaces/projects.
The Quick Start walks me through setting up the "Hello World" app which works fine - except it does not build.
When I try to set up a workspace for source I already have, I don't see how to generate the workspace structure.
2. Tags - I created a database from my source code.
Right-click on a function and select Goto Declaration. - Nothing happens.
I'm sure I'm missing something really basic!
3. Is there a macro language? I can't find any way of implementing macros.
Do I have to write a plugin for simple macros?

Thanks for your time.
chuckf

Re: Newbie questions

Posted: Thu Jan 08, 2009 6:49 pm
by eranif

Re: Newbie questions

Posted: Thu Jan 08, 2009 7:13 pm
by chuckf
Thanks, but it didn't really address my questions...
chuckf

Re: Newbie questions

Posted: Thu Jan 08, 2009 7:18 pm
by eranif
The main point:
every thing should be working if you have set up a workspace / project correctly.

To create a project from a set of files:
- create empty workspace
- create project (right click on the workspace icon)
- right click on the new project (the yellow icon) - and select 'import from files from directory'

Eran

Re: Newbie questions

Posted: Thu Jan 08, 2009 8:13 pm
by aaulia
I'll try to help you
1. Workspace is like a desktop, and a project is like an application, 1 Workspace can contain many projects. You may think it like a Visual Studio Solution, it's the same. To create a single project you first create a Workspace, and then create a project in it.
2. Tag, If you already have a project, I don't you have to manually create tag for that project, Codelite AFAIK already tag the code in your project automatically. Unless you want to use other library and want to have code information from those as well, then you manually create the tag for the library.
3. Do you mean C++ macro, or CodeLite macro ? AFAIK CodeLite doesn't have macro, but I might be wrong.

Re: Newbie questions

Posted: Thu Jan 08, 2009 9:31 pm
by sdolim
Another way to look at it:

A workspace is kind of like a simple Makefile or Solution:
  • A workspace is a list of items that need to be built (exe's, lib's, etc).
  • A project is a single build target (one exe or one lib).
  • The Project Properties is how you specify the "build rules" for the target and it's dependencies on other projects. You can create different kinds of builds for the target, e.g. Debug or Release, with separate build rules.
  • The workspace also has build modes (aka configurations) where you can specify what kind of build you are doing for all projects. The Build Matrix is where you specify each project's build mode for a particular Workspace build mode. (This is because the names of the build modes aren't fixed, you can specify them however you want.) Another use for build modes is to specify the platform you're building for.
As mentioned before, a workspace is also kind of like a Desktop:
  • CodeLite lets you work on one workspace at a time. It remembers the set of files you had open when you last used the workspace, and some other information, like Active Project (the project/target that gets launched by Run or Debug commands).
  • The workspace has an automatically maintained tag database for all the source files in its projects. You don't have to create this db. The other db (external) is for installed code on your machine (e.g. /usr/include/*.h) that doesn't change much.
  • A bunch of the tag features work only on source files that belong to a project/workspace, which is another reason to use the whole Workspace feature set.
Scott

Re: Newbie questions

Posted: Thu Jan 08, 2009 9:33 pm
by sdolim
On the macros question, maybe what you are looking for is in the Snippets or Abbreviations plugins.

Re: Newbie questions

Posted: Thu Jan 08, 2009 9:41 pm
by chuckf
Ok, the step I was missing was 'import from files from directory'.
Now I see the files in the workspace view.

I think that I should now be able to select "Goto Declaration". This still doesn't do anything.
3. Do you mean C++ macro, or CodeLite macro ? AFAIK CodeLite doesn't have macro, but I might be wrong.
I mean CodeLite macros.

Thanks!
chuckf

Re: Newbie questions

Posted: Thu Jan 08, 2009 10:03 pm
by sdolim
Sorry, the "Snippets" is actually called "SnipWiz". Both it and Abbreviations are under the Plugins menu. SnipWiz snippets can be activated in the current editor by the context menu. Take a look. Are these what you mean by CodeLite macros?

Re: Newbie questions

Posted: Thu Jan 08, 2009 10:19 pm
by chuckf
sdolim wrote:On the macros question, maybe what you are looking for is in the Snippets or Abbreviations plugins.
Actually, I'm looking for ways of doing things with one keystroke.

For example:
My cursor is on a toward the bottom of the window. I would like to move the current line up to the middle of the window so I can see the lines around it. In my previous editor, I would run a script to scroll the the window to a certain number of lines from the top of the window.

or,

Copy the current word to the clipboard: SelectWord, Copy

or,

Replace a word with clipboard contents: SelectWord, Paste

etc.

Thanks!
chuckf