In C++ Builder 10.1 Berlin, where can I set the default width of the
IDE generated dash line (please see highlighted part in the picture below) when adding a new event handler for example?
I changed the default right gutter from 80 to 100/120 columns and it would be nice, if this line length would be consistent to that by default.
The separator you are referring to is not generated dynamically, so you can't simply configure its width. It is actually stored in a template file ($(BCB)\Bin\bcb.bcf) and gets copied as-is into the code. If the template does not exist, the dashed divider is used by default, and it has a fixed width..
So, you would have to edit that template file to create the effect you are looking for.
From Customizing C++Builder (which is written for older IDEs, but some of its information still applies):
File and Function Divider Line
If you don't like the standard line inserted at the top of each units cpp file or the function divider line that is used when an event handler or other function is added to your code by C++Builder then you can set your own. Using lines that stand out for you and which complement your other code comments can help to partition a unit in your head when browsing code.
Specifying a custom top line or function divider line involves editing the file $(BCB)\Bin\bcb.bcf, where $(BCB) is the folder in which C++Builder is installed. This is a text file in an INI format, so you can use Notepad, WordPad, or any other text editor. There will be no standard text editor associated with the .bcf file so you will need to select one when opening the file with Windows Explorer. Alternatively you can start your text editor and browse to the file.
To specify a custom top line in new unit cpp files add a definition for Divider Line Break within a new section named Code Formatting. To specify a custom function divider line add a definition for Divider Line. Set these definitions to the text to be used in the source code. The text should be formatted as a comment so as not to cause syntax errors in your code. The following example demonstrates these customizations.
[Code Formatting]
Divider Line Break=/* ===================== TOP LINE ===================== */
Divider Line=/* ===================== END FUNCION ===================== */
If the file does not already exist, simply create it. You will need to run your text editor with administrative rights to save the file if C++Builder is installed under C:\Program Files or C:\Program Files (x86) (which it is by default).
Related
Since yesterday, all blue dots (compiled lines) in my source code are shifted with one line up.
So, the first dot starts at 'var' instead of 'begin' and the last dot is one line before the last 'end' of a function.
I deleted all files (starting with DCUs) except DPR, PAS, DFM and DPRJ and recompiled. But the dots are still shifted.
How can I fix this? It makes the step=by-step debugging almost impossible.
It could be that the file is corrupted so that you don't have proper line end combination (#13#10) on one line. Is the "one line up error" throughout the file or does it start somewhere in the middle of the unit?
Beginning with Delphi 2007 (maybe already Delphi 2005) you can check the line ends in your code by enableing checkbox Show line breaks in Tools - Options - Editor options - Source options. The line breaks look like this:
As you can see, a CR on its own is not considered a line break and messes up the synchronization of the executable line dots
Try closing Delphi then deleting all *.identcache files.
I have a batch file at the root of my Delphi projects directory that recursively deletes all identcache files.
Try This:
Open the unit in an editor with capabilities to change codification, like Notepad++.
Code/save the file as ANSI.
Open or recharge the file in the Delphi IDE.
The dots must be in the right place.
I want to write simple text pdf file and I use Synopse pdf Delphi library.
Is it possible to write one text line to file and it automatically insert new line to file without using coordinates?
The easiest is to use the mORMotReport.pas unit.
It is very easy to add some text, with automatic insert of lines, and page layout.
See this sample folder as reference.
Since yesterday, all blue dots (compiled lines) in my source code are shifted with one line up.
So, the first dot starts at 'var' instead of 'begin' and the last dot is one line before the last 'end' of a function.
I deleted all files (starting with DCUs) except DPR, PAS, DFM and DPRJ and recompiled. But the dots are still shifted.
How can I fix this? It makes the step=by-step debugging almost impossible.
It could be that the file is corrupted so that you don't have proper line end combination (#13#10) on one line. Is the "one line up error" throughout the file or does it start somewhere in the middle of the unit?
Beginning with Delphi 2007 (maybe already Delphi 2005) you can check the line ends in your code by enableing checkbox Show line breaks in Tools - Options - Editor options - Source options. The line breaks look like this:
As you can see, a CR on its own is not considered a line break and messes up the synchronization of the executable line dots
Try closing Delphi then deleting all *.identcache files.
I have a batch file at the root of my Delphi projects directory that recursively deletes all identcache files.
Try This:
Open the unit in an editor with capabilities to change codification, like Notepad++.
Code/save the file as ANSI.
Open or recharge the file in the Delphi IDE.
The dots must be in the right place.
I'd like to add a code appendix to my LyX document. There are a few options I already considered, but they all have their problems.
I know a bit about listings, but one problem with those is that, if I copy & paste my code into them, I lose all enters/newlines. Since the code is too large to correct by hand, I was wondering if there is an alternative.
In LyX there is the possibility of inserting child documents, but that seems to be only for .tex files. Would have been ideal if I could just insert my .java file as a child document.
I could print the code to PDF, but it will include margins that mess up the final document, since the PDF is placed on the left margin of the final document and then there is the margin of the PDF. Also, this PDF always contains the entire code and white areas where not the entire page has been filled.
Does anyone have good alternative?
The listings package found here
http://www.ctan.org/tex-archive/macros/latex/contrib/listings/
allows the include of external source code files (look into the reference for \lstinputlisting).
EDIT: here you find some samples how to use it:
http://en.wikibooks.org/wiki/LaTeX/Packages/Listings
If you need to copy-paste code to LyX listing box then use Edit -> Paste Special -> Seletion or Ctrl+Alt+V.
For what it's worth, at least the 2.0 versions of LyX have the ability to include listings as child documents. Insert, File, Child Document, and choose from the dropdown box "Program Listing". This uses the listings package and lets you keep your source in its own file.
If listings doesn't support your language, you can always use something like highlight or source-highlight to generate a latex snippet of syntax-highlighted code that you can add as a child document of type "Input"
Yes, if you copy&paste code into the LyX listings box, you lose all newlines, but you can preprocess your code (insert an extra newline below each line):
$ cat foo.java | sed -e 's/$/\n/' > bar.java
Then you can copy&paste the new file bar.java and everything will be ok.
I want to use a latex editor that has auto completion feature for existing references in a latex file. Do you know any good ones? I am trying to find this feature in texniccenter, but I guess it doesn't exist or I could't find it yet.
Update:
Ok, I found how to enable auto completion in Texniccenter. I needed first create a project. Then open the file in this project (or copy its text). Now Ctrl-Space inside a \ref{} tag completes the reference automatically.
Texlipse does this, also with Ctrl+Space.
Inlage includes such a function, too. New commands and new environments will also appear in the auto completion list. If you use extern BibTex files the \cite{} command will open a list with your articles and books from you .bib file.
Ok, I found it. I needed first create a project. Then open the file in this project (or copy its text). Now Ctrl-Space inside a \ref{} tag completes the reference automatically.
Kile has reference completion. If you type Ctrl+Space inside of a \ref{}, you get a list of all the references (that existed last time you compiled, of course).
LEd presents a click list of them when in a \ref{}
The RefTeX mode for Emacs will do what you're asking for: the shortcut C-c ) activates the "insert a \ref" mode (of course, you can customize which type of reference: fancyref, hyperref, etc) and pressing TAB will allow you to start typing and autocomplete by tabbing again after typing some characters.
It also figures out (or asks if it can't) what sort of ref you're inserting and shows a list of all the defined \labels in your document, selectable with the arrow keys or C-n / C-p.
Now we just need a Vi user to come along and tell us how to do it there...
Now texmaker does, not need any special key.