Excuse my stupidity, but I get
-------------- Build: AutoRevision in Code::Blocks (wx2.6) ---------------
Target is up to date.
-------------- Build: ConsoleRunner in Code::Blocks (wx2.6) ---------------
Target is up to date.
-------------- Build: tinyXML in Code::Blocks (wx2.6) ---------------
Target is up to date.
-------------- Build: AngelScript in Code::Blocks (wx2.6) ---------------
Target is up to date.
-------------- Build: scintilla in Code::Blocks (wx2.6) ---------------
Target is up to date.
-------------- Build: wxPropertyGrid in Code::Blocks (wx2.6) ---------------
Target is up to date.
-------------- Build: sdk in Code::Blocks (wx2.6) ---------------
Running target pre-build steps
tools/autorevision/autorevision +wx +int +t . sdk/autorevision.h
Target is up to date.
-------------- Build: wxAUI in Code::Blocks (wx2.6) ---------------
Target is up to date.
-------------- Build: src in Code::Blocks (wx2.6) ---------------
Compiling: src\main.cpp
src\main.cpp: In member function `void MainFrame::OnLanguageCCpp(wxCommandEvent&)':
src\main.cpp:2115: error: invalid use of undefined type `struct EditorColorSet'
sdk/cbeditor.h:18: error: forward declaration of `struct EditorColorSet'
Process terminated with status 1 (0 minutes, 9 seconds)
2 errors, 0 warnings
with this code. Yeah it is probably all wrong, but anyways....
void MainFrame::OnLanguageCCpp(wxCommandEvent& event)
{
cbEditor* ed = EDMAN()->GetBuiltinActiveEditor();
if (ed)
{
EditorColorSet* theme = ed->GetColorSet();
// Load the lexer somehow.....
}
}
Sorry I'm confused on how the SetColorSet works........
K one more question....
here is some code.
cbEditor* ed = EDMAN()->GetBuiltinActiveEditor();
if (ed)
{
EditorColorSet* theme;
HighlightLanguage lang = theme->GetHighlightLanguage(wxSCI_LEX_NULL);
theme->Apply(lang, ed->GetControl());
}
Of course that won't work because theme is 0 (corret me if I'm wrong). So how do I accomplish this.
I tried
EditorColorSet* theme = ed->GetColorSet();
but that didn't work either. It crashed in some situations. So how do I propagate theme? Thanks.