Code::Blocks Forums
User forums => Using Code::Blocks => Topic started by: cyanide911 on November 16, 2009, 06:45:19 pm
-
Currently it's a long process - File->New->File->C/C++ source->C++->Filename.
Is there way to simply open an Untitledx.cpp file with a single/fewer clicks, and then specify the filename while saving it? (or a similar shorter method)
-
I just right-click on the relevant directory in the Workspace tree and select Add Files... This pops up the standard Windows file open dialog, which allows you to create new files from its context menu. Of course, this doesn't allow you to use CB templates, but I've never liked that feature in any IDE I've used.
-
I just right-click on the relevant directory in the Workspace tree and select Add Files... This pops up the standard Windows file open dialog, which allows you to create new files from its context menu. Of course, this doesn't allow you to use CB templates, but I've never liked that feature in any IDE I've used.
Does not work on linux (at least not in xfce).
What about using ctrl+shift+n, answering the popup-dialog with yes and type a name, or if it should not be added to a project, click no and save with ctrl+s, type a name and that's it.
-
I add an empty file and then I write my code. Then I save the file with the .cpp extension. This seems to work, at least I haven't seen any misunderstandings. Perhaps, the online parser guess the file contents form "signals", like #include, #ifdef, typical syntax constructs and so on.
-
Yeah, but the problem with writing the code in an empty file (without .cpp extension) is syntax highlighting. CodeBlocks will hilight the syntax only if it know that I'm making a C++ file.
@Jens: CtrlShiftN opens an empty file without any popup for the file name.
-
I think this sequence
File->New->File->C/C++ source->C++->Filename
could easily be reduced by one step by integrating the C++ part into the C/C++ source part.
We are already choosing what type of file we want at that stage. Why have another stage to choose the language?
The file type list would then look like this:
C header, C++ header, C source, C++ source, Empty file
-
Yeah, but the problem with writing the code in an empty file (without .cpp extension) is syntax highlighting. CodeBlocks will hilight the syntax only if it know that I'm making a C++ file.
@Jens: CtrlShiftN opens an empty file without any popup for the file name.
The popup only occurs, if a project is open, if not, ctrl+s tries to save the file and asks for a name, if you now save with cpp-ending, you have c++ syntax-highlighting.
-
Yeah, but the problem with writing the code in an empty file (without .cpp extension) is syntax highlighting. CodeBlocks will hilight the syntax only if it know that I'm making a C++ file.
@Jens: CtrlShiftN opens an empty file without any popup for the file name.
The popup only occurs, if a project is open, if not, ctrl+s tries to save the file and asks for a name, if you now save with cpp-ending, you have c++ syntax-highlighting.
also don't forget edit->highlight mode->[your language]