Hello everyone.
In this video, I want to give you a tour of the CodeLite interface.
The version of CodeLite that I'm using here is 17.3.0.
This version is more recent than the versions that I used,
when I recorded the videos for the course.
Overall, they are very very similar, sure you're going to see a couple of differences
in the user interface,
some things have been cleaned up and made more streamlined.
But the basic functionality of the IDE,
namely creating workspaces, creating projects, editing the code,
building and running the code have not changed.
So, let me give you a quick tour here.
When you first open up CodeLite,
if you don't have a workspace already open since the last time you saved it,
you'll get a screen that looks like this.
Over here on the left side, you'll see the Workspace view.
This is where the workspace and projects
will reside, there aren't any open now, because I don't have a workspace open yet.
Over here in the center, you see these
four big buttons.
Again, that might change in the future,
but right now we're going to use two of them, we're going to open an existing workspace,
I'm going to create a new workspace.
Down at the bottom, we can see recently opened workspaces,
so you can see that I've already opened three workspaces
and I did that, so you can see something down here.
Very likely, the first time you run CodeLite, you're not going to have any workspaces,
so this section down here will be empty.
So, suppose I want to load a workspace, I can open a workspace and navigate to it.
Or I'm just going to click Workspace 2 right here,
which is a workspace that I created with several projects in it,
just to walk you through this interface.
So I'm just going to double click that
and you can see that CodeLite has loaded Workspace
2 into the Workspace view.
Workspace 2 has four projects in it, project 1, project 1, 3 and 4.
Each one of those is a stand alone C++ application.
We can expand each of them.
And you can see each one has a source folder,
and within the source folder, they each have a main.cpp source file.
That's where our C++ code goes.
Later in the course, we're going to have projects that have multiple CPP files in them.
Also you can see that Project 1 is bold
and italicized,
that tells you that Project 1 is the active project.
The way that CodeLite works is that it builds and runs the active project.
So when we come up and build things in a minute,
it's always going to build the active project.
So it's really important that we understand what
we're building, because we could be editing Project 4
and then pressing build, thinking that Project 4 is being built.
But if Project 1 is the active project, project 1 will be built.
Sounds confusing, but it really isn't,
just make active what you're working on, it's really straightforward.
Okay so, that's the workspace view,
we've got some tabs up here
and the only one we're going to use is Workspace, don't worry about the rest.
In the IDE or an integrated development environment, such as CodeLite
is designed for small programs like we're going to do,
and it's also designed for very large programs.
So it's got a lot of bells and whistles that we're not going to use.
These are the kinds of things you would use in programs
that are thousands of files and
very, very complicated.
So in this case, we're just going to keep it really, really simple,
this is all about learning C++ more than it is about learning CodeLite.
So, there's my workspace, you can see that I have this little
paper airplane here, and when you click that, it collapses everything.
Sometimes, we've got a lot of projects in here and they all get expanded
and it's really hard to find stuff.
So if you click that, it just collapses everything.
Now, I can expand whatever I like again.
Also, if I'm somewhere down here let's say,
and I want to go to my active project, I can just click that home icon
and that takes me to my active project right away and opens it up,
so that's kind of handy.
And you've already seen the settings,
you can click the project you want and you can click that little wrench
and it gives you your settings.
We did that when we installed and configured CodeLite a few videos ago,
all right.
So, that's the workspace view.
Now this big area right here
in the center, that's got nothing in it right now, this is your editor.
In order to use the editor, you need to click on a C++ file
or something in the project.
So in this case, I'm going to double click on main.cpp and it opened it up.
And you could see this is very similar to the program we wrote during the installs.
Hello from Project 1, makes sense.
Now let's say, I want to open up Project 2, and I want to open up that source file
that loaded up as well and it says hello from Project 2.
Up here in the tab, we can tab between those two.
And as I do that, you can see this blue bar over here in the Workspace view,
jumping to the appropriate file in the project.
We can turn that off by clicking that little link right here,
I don't know why you would want to do that, I love the fact that I can see exactly
where it's at, so I'm just going to leave that alone.
We can open up the rest of these projects as well,
let me expand all of these and I'll open up Project 3 and Project 4.
So now you can see that, I've got four project main cpps open up here,
and it's pretty easy to see,
which project they belong to and you can actually hover over it,
and it tells you the path to the workspace
and the project and the file within the project, okay? So,
that's great.
When I modify the code and again, I'm going to go, let me collapse all of these,
and I'm going to go to my active project, and there's project 1.
So, that's where I'm at right now,
I can close these up now, just to get them out of the way.
Right now, I'm working on project 1.
When I make any changes to this file for example,
suppose I added a space at the end of this line.
We get this little red dot right there, right next to the project name
in the tab, that tells you that this file is called dirty.
So in other words, what I'm working on right now is not what is on the file system.
So, it's telling you right there, hey be sure to save this,
if you really want this updated on the disk.
So we can save with file,
save file or CTRL S or you can click on this little save
icon right up here in the bar, and I'll talk more about that control bar in a moment.
So I can do that, I can press CTRL S and that little red dot goes away.
If you're on Linux, It's a little black dot on most of Linux distributions,
but again it doesn't matter what colour it is,
but you're not going to see that little x to close it.So, that's my project 1.
Let me remove that line
and again, you can see that that's red and I'm going to save it again.
So, this is how we would edit our program.
I've made this font large, so that you can see it,
better on video.
All of that is in the settings, colours and fonts, If you click that,
you can change the fonts, the colours, the
theme that you're using, whether it's a light theme or a dark theme and so forth.
I'm just going to leave this alone.
We've already learned, how to create projects, we've learned how to create
workspaces.
We did that in the installation video, so that process is exactly the same.
Now, how do we build and run?
Well, let me expand this.
Right now, project 1 is the active project, so we can come up to build.
And we've got a couple of options here, you can see,
we can run, we can build a project, we can rebuild it, we can clean it,
we can do a whole bunch of stuff, right?
We're only going to be using a couple of these, actually, probably just one of these most of the time.
In order to create an executable file that we can run,
we need to build the project.
And in order to
run an executable file, we have to have a good build, no
syntax errors, no other errors.
You can do that by pressing F7 to build the project, so let me do that.
And the output view opens up down here and I'm just going to
scroll this up just a little bit, little bit up, so you can see it all.
The output view opens up.
And we get our build output here, you can see that build output is in this build tab.
If you post on the Q & A form saying, hey, I've got some kind of error, it's not building,
I'm going to ask you to show me the build output, because that tells me what's going on.
So, this is the build output notice, successful build, no errors.
Once we have a successful build, we can come up to build and run it.
Now it's going to ask me, would you like to build the active project before executing it?
I've already built it, so I don't have to build it again, you certainly could.
And if you want to always do one of these, just remember your choice.
And click that little check mark, and it's not going to pester you all the time with this little,
pop up.
So let me execute it
building and running Project 1, so I expect
hello from Project 1 to display on my terminal, my command prompt.
Execute and there you go, hello from Project 1.
I should also mention that the process for Mac,
Linux and Windows is exactly the same.
So everything I'm talking about in this video, applies to all of the operating systems.
When we're done, we press enter and we close that.
So that's that, now we can modify the
look and feel.
So for example, suppose I don't want my output view over here.
Suppose I want my output view over here, on the right?
I can grab this blue bar,
It may not be blue on your end, but I can grab that bar
and just drag it over here.
You can see it's lighting up right there, so I'm just going to drop it there,
so there's my output view.
And, now suppose I want my workspace
view to be above that, so I can just move that over there.
So now I can have my workspace view over here, my output view over here.
The View menu option
gives you all kinds of options for example, I can turn my output put pane off.
In which case you can see it's just disappeared over here from the right
and I can turn it back on.
I can turn my workspace pane off
and back on.
This is totally up to you what your preferences
are as far as the look and feel of your work environment.
We can also do a view
with the main toolbar orientation, that's the toolbar,
that's this toolbar right up there,
the one we see with the plus and the bug and all that.
These are just shortcuts to things I've been doing, we can add a new file,
we can open a file, we can save a file.
That little hammer builds the active project.
Here, we can stop a build, which is
not a big deal for us, because our builds are pretty fast.
But when we have really large C++ programs,
builds can sometimes take an our believe it or not, or longer.
So sometimes we'll want to stop the build for whatever reason.
We can clean the active project and I'll show you what that is in just a moment.
And we can run the active project and certainly we can debug,
and we'll talk about debugging in a different video.
So, these are the main functions here.
If for whatever reason you just get lost in this interfacing,
so you start moving these things around and oh my goodness,
I don't like what I've done and I've having trouble getting back.
You can always just go to view and restore layout.
And that'll bring it right back to factory default, basically.
So as I said, there's all the view issues here,
If you don't like that main toolbar up here at the top and you want it on the left,
you could just go to view main toolbar orientation left.
And then it's going to say, do you want to reload CodeLite.
Sometimes it's going to want to restart, let me say yes, you can see what it's like.
It closes up, it opens up again
and now you can see that the toolbar is over here on the left.
So again, personal preferences there all the way around with the views.
So now, let's talk about the build again.
In this case, if I want to build,
what that means is
I want to build the active project.
So what CodeLite is going to do, it's going to go out there and it's going to see first,
has it already been built?
If it has been built, then it's going to say,
has anything changed in the source code here,
since the last build?
If the answer is no, then it's not going to rebuild it,
It doesn't need to rebuild it, since the build is current,
makes sense?
Now, if we have made any changes or it's the first time we build,
it's going to certainly build it.
So that's what build does.
Clean the project, removes any intermediate files, the executables,
it just basically
clears out everything.
Not your source code, just the build products, cleans out everything.
So the next time we build, we have a clean build, in other words, there's nothing prebuilt.
Rebuild does both of those essentially.
First it cleans and then it builds.
That's what I would encourage you to use throughout the course, rebuild project.
The reason that we don't use rebuild project in industry very much
is because, our projects can be very, very large.
And if I do a clean and then a build every time, it could take 20, 30 minutes.
Whereas, the build itself is only going to build things
that have changed since the last build,
so they're much more efficient.
But for this course, I would encourage you to select rebuild project.
So let me do that, I'm going to click rebuild project,
and you can see that the output view opened up down here.
You probably didn't see it, but right before the build happened,
the clean also happened.
And the clean kind of looks like this, I'm going to select build clean project.
And you can see that rm, means remove,
so it's removing all the files in the build debug folder,
which are all the intermediate files, all the binary files, essentially.
So that's the clean.
Now we can come up to build again now remember, let me rebuild it.
Now, when you see a build that includes g++ exe,
that's a real build that's actually building the intermediate files, okay?
I hope this makes sense.
Now if I try to build again just to build.
Notice nothing happened, there was no g++ command in there.
That's because the project was already built.
CodeLite realized I don't need to build it, it's already current.
So my advice is to always use rebuild, okay?
Now we can do it at the project level, the active project,
or we can build the entire workspace, or clean an entire workspace,
or rebuild an entire workspace.
So let me show you how to clean the entire workspace.
You can see that, I just cleaned the workspace,
so it's removing files from
every single project, so you can see project 4, project 2, project 3, project 1.
Now I can rebuild each project.
But we rebuild the workspace, and it's going to build everything
for each project within the workspace.
We're probably not going to use that, I just wanted to show you that it was there.
Okay? Perfect.
Now obviously I can run Project 1 again,
if I make project 4 the active project and I can do that by just double clicking it,
just like that.
And I can run it and go to build and run.
I don't need to build it since, I've built everything
in the workspace already, I'll just execute
and we should see hello from Project 4 and that's exactly what we see.
Great, all right?
So that covers the building,
the debugger I'll cover in a separate video later on in the class.
Let me close this output view down a little bit.
We also have
searching for example, I could search for things within files,
across files.
I know that all these programs have a main in it, so I can find in files
and I can say I want to search for main.
And press find and then the output view again opens up,
this time with the search tab highlighted.
And you can see that I've got a main in
Project 1 and Project 2 and Project 3 and so forth.
And if I want to go to, let's say, Project 1's main,
I could just find Project 1 and click here.
And there it is, Project 1's main.
I can go to Project 2's main
and Project 2 opens up, up here and there it's main.
So it's pretty handy to find things across files in your entire workspace in this case.
You can clear all this by just
clicking right there in that little broom and clear it up.
And that's my output view, It's got several uses,
this build tab is probably the mode we're going to use the most,
and it's probably the most important one, because that'll tell us if there's compiler errors and so forth,
all right?So let me close this back up.
Now if the plugins, let's talk about that for a moment,
there's really two plugins I want you to activate, they may be activated already,
they may not be, but let me show you how to do it.
You go to plugins and manage plugins and let me
close this down here.
To give us a little bit more room, let's go to plugins, manage plugins.
And there's a whole bunch of plugins and plugins are just little external
pieces of code and little programs that CodeLite uses.
So the ones that I want you to check off for sure are
language server plugin, make sure that's checked.
And down here where it says wizards, make sure that's checked,
because we're going to use that later in the course.
That's it, hit okay?
And when you come to plugins, it might ask you to restart.
But you'll see those two plugins here in the language server.
You can basically go to settings and make sure that everything's enabled, It should be by default.
And then you could restart the language server.
And what that does is that helps you do code completion, so as I type,
it's going to help me by helping me complete the code.
For example, if I typed in some variable name here
and again we'll talk all about variable names later.
Let's create an integer called age, let's say my age.
Something like that,
we put a semicolon here,
then later on, if I want to use my age, I can just type my underscore
and it pops it up for me and I can just press tab
and use it, so I don't have to type.
It also allows us, let me delete this.
It also allows us to use some of the C++ keywords and functions so example,
if I wanted to use double,
i could just do that, press tab and create a variable name.
So again, makes it very handy.
It's kind of finicky sometimes, sometimes it wants to work,
sometimes it doesn't want to work.
What I've found is, if it doesn't work, just rebuild.
Rebuild and then it kind of kicks it in.
So, that's the plugins,
the settings, there's tons of settings here.
We've already seen some of the colours and fonts, the preferences,
we've got whether we want to display line numbers over here
in the editor or not.
We can turn that on and off, highlight the current line number like that,
you can see seven is bold.
Again, I just leave all this alone, because the default
settings are pretty good.
I'll close that up, you can look through there, but again don't just
start clicking on things, because your interface is going to get pretty crazy.
So let me just leave that alone.
Then the other thing you're going to see in your code is this little red thing.
And it might be red, it might not be red, depending on the operating system,
but you'll see some kind of little icon here.
Where we can click it.
And it collapses that.
So, you can see that it collapses that.
Now that doesn't look very useful here, but when you've got a lot of
code, let's say you have 500, 600 lines of code.
And you've got parts of your program that you're really not interested in right now,
you're working on a different section.
You can collapse certain sections
to kind of just hide them, sort of it's not really hiding them, because they're there.
But just kind of get them out of my way, right now while I work on this other section.
The code is still there, you can see from the dots that the code is still there
and we can always expand it whenever we like.
Okay, so pretty much covers the basics that I wanted to cover.
Really important, don't forget about view restore layout.
If your layout gets really wonky,
just go back to view and restore your layout and you're good to go.
As far as creating workspaces and creating projects,
we've already done that before in the installation videos,
so that should be pretty straightforward.
If you have a workspace open
and you try to create a new one, it won't let you.
Make sure you close the workspace first and then you're allowed to create one.
So here's a section 19 workspace,
this is a workspace we're going to use later in the course.
Let me open it up to give you an example of
a workspace with a bunch of projects in it.
So you can see Section 19 that's again later on in the course.
This is the section, we're going to use
and this is the section on IO and how to use files and how to do things like that.
So, we've got a lot of different projects in here.
Each one has
a description, main.cpp, and this is some of the code that we'll write later on.
I know it looks maybe a little bit daunting right now, but don't worry,
it'll be fine.
I can close that up.
And in this case, challenge 1 solution is the default project.
Here is the challenge 1 solution, solution.
So there's the code and you can see here,
where it really is useful to use code folding
and fold some of this stuff and kind of get it out of the way.
So for example, there's my main, that's my whole program, right?
But let's say I only want to look at structs.
And I'm only looking at my structure, so they show up really, really cleanly
without going through hundreds and hundreds of lines of code.
In this case, that's my challenge 1 solution, suppose I want to run it.
Well, I'm going to come to build, remember it is the active project,
because it's bold and italicized,
I'm going to go to build.
I'm going to select rebuild project,
you can see my output view down here, It's doing g++ exe.
It's using everything I need to use.
Then I'm going to come to build, run project right there.
Just execute.
I'm going to get a command prompt window and that's the output from this program that we're going to do,
later on in the course.
Okay, so that's it.
This gives you a pretty good feeling for the interface,
the entire CodeLite interface, there's a lot of stuff I didn't cover obviously.
But I'm not going to use any of that stuff that I didn't cover in the course.
IDE as I said, are usually used for very large programs.
But they can also be used for small programs,
we're just not going to use all the bells and whistles.
So you have any questions, please let me know,
and I'll see you in the next video and we'll start coding.