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........
Although there is no such code in main.cpp (I assume you 're writing it yourself?), the error you 're getting is very descriptive. Read it again. If you still don't understand what it means, add #include <editorcolorset.h> at the top of the file.
Quote from: mandrav on January 03, 2006, 03:53:04 PM
Although there is no such code in main.cpp (I assume you 're writing it yourself?), the error you 're getting is very descriptive. Read it again. If you still don't understand what it means, add #include <editorcolorset.h> at the top of the file.
Ah ok. I though it got included with editormanager.h or something. :oops:
Thanks for helping the idiot of the day. :lol:
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.
EditorColorSet is a property of EditorManager.
Use this:
EditorColorSet* theme = Manager::Get()->GetEditorManager()->GetColorSet();
Quote from: mandrav on January 03, 2006, 09:11:52 PM
EditorColorSet is a property of EditorManager.
Use this:
EditorColorSet* theme = Manager::Get()->GetEditorManager()->GetColorSet();
Hmm still no go. Start C::B. Create new file. Click Language -> Text. C::B crash.........
Yes I know Language isn't a submenu, but I made one anyways. :)
Wait a sec I think it crashes with wxSCI_LEX_NULL...... Hmm. anyways thanks madrav. :)