Developer forums (C::B DEVELOPMENT STRICTLY!) > Development
indentation guilds highlight
rhf:
@ollydbg and jens.
Well done, guys!
I would still like to see dimmer indentation guide lines, similar to what notepad++ uses.
I think it involves the setting of STYLE_INDENTGUIDE, but I don't know how to do it.
Thanks again,
Bob
blueshake:
Style STYLE_INDENTGUIDE is used to specify the foreground and background colour of the indentation guides.
ollydbg:
--- Quote from: rhf on July 23, 2009, 02:23:23 pm ---@ollydbg and jens.
Well done, guys!
I would still like to see dimmer indentation guide lines, similar to what notepad++ uses.
I think it involves the setting of STYLE_INDENTGUIDE, but I don't know how to do it.
Thanks again,
Bob
--- End quote ---
Firstly, you can find in the scintilla document
http://www.scintilla.org/ScintillaDoc.html#BuildingScintilla
--- Quote ---Style definition
While the style setting messages mentioned above change the style numbers associated with text, these messages define how those style numbers are interpreted visually. There are 256 lexer styles that can be set, numbered 0 to STYLE_MAX (255). Unless you use SCI_SETSTYLEBITS to change the number of style bits, styles 0 to 31 are used to set the text attributes. There are also some predefined numbered styles starting at 32, The following STYLE_* constants are defined.
STYLE_INDENTGUIDE 37 This style sets the foreground and background colours used when drawing the indentation guides.
--- End quote ---
note: we are only interest in STYLE_INDENTGUIDE 37
Secondly, you can see the similar definition macros in, note: we are only interest in STYLE_INDENTGUIDE 37
include\wxscintilla\include\wx\wxscintilla.h line 131
--- Code: ---// Styles in range 32..38 are predefined for parts of the UI and are not used as normal styles.
// Style 39 is for future use.
#define wxSCI_STYLE_DEFAULT 32
#define wxSCI_STYLE_LINENUMBER 33
#define wxSCI_STYLE_BRACELIGHT 34
#define wxSCI_STYLE_BRACEBAD 35
#define wxSCI_STYLE_CONTROLCHAR 36
#define wxSCI_STYLE_INDENTGUIDE 37
#define wxSCI_STYLE_CALLTIP 38
#define wxSCI_STYLE_LASTPREDEFINED 39
#define wxSCI_STYLE_MAX 255
--- End code ---
So, in wxScintilla, they use wxSCI_STYLE_INDENTGUIDE.
Thirdly, I found the code in
sdk\wxscintilla\src\wxscintilla.cpp line 667
--- Code: ---// Set the foreground colour of a style.
void wxScintilla::StyleSetForeground (int style, const wxColour& fore)
{
SendMsg(SCI_STYLESETFORE, style, wxColourAsLong(fore));
}
--- End code ---
Forthly, I think you can do this in the function below:
sdk\editorcolourset.cpp line 434
--- Code: ---void EditorColourSet::Apply(HighlightLanguage lang, cbStyledTextCtrl* control)
{
......
control->StyleSetForeground(wxSCI_STYLE_INDENTGUIDE, Dimmer color like comment text);
......
}
--- End code ---
Finally, there is only one last question:
How can I get the "Dimmer color like comment text" value?
Any comments?
ollydbg:
hi, add this statement will let the indentation guild line become green.
sdk\editorcolourset.cpp Line 463
--- Code: --- control->StyleSetForeground(wxSCI_STYLE_INDENTGUIDE,wxColour(0xFF00));
--- End code ---
But I still don't know how to use a predefined color... :(
blueshake:
it works. :D
in this file gdicmn.h
--- Code: ---#define wxBLACK wxStockGDI::GetColour(wxStockGDI::COLOUR_BLACK)
#define wxBLUE wxStockGDI::GetColour(wxStockGDI::COLOUR_BLUE)
#define wxCYAN wxStockGDI::GetColour(wxStockGDI::COLOUR_CYAN)
#define wxGREEN wxStockGDI::GetColour(wxStockGDI::COLOUR_GREEN)
#define wxLIGHT_GREY wxStockGDI::GetColour(wxStockGDI::COLOUR_LIGHTGREY)
#define wxRED wxStockGDI::GetColour(wxStockGDI::COLOUR_RED)
#define wxWHITE wxStockGDI::GetColour(wxStockGDI::COLOUR_WHITE)
--- End code ---
or add a option in setting???
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version