Developer forums (C::B DEVELOPMENT STRICTLY!) > Development

EditorColorSet

(1/2) > >>

sethjackson:
Excuse my stupidity, but I get


--- Code: ----------------- 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

--- End code ---

with this code. Yeah it is probably all wrong, but anyways....


--- Code: ---void MainFrame::OnLanguageCCpp(wxCommandEvent& event)
{
    cbEditor* ed = EDMAN()->GetBuiltinActiveEditor();

    if (ed)
    {
        EditorColorSet* theme = ed->GetColorSet();

        // Load the lexer somehow.....
    }
}

--- End code ---

Sorry I'm confused on how the SetColorSet works........
 

mandrav:
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.

sethjackson:

--- 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.

--- End quote ---

Ah ok. I though it got included with editormanager.h or something. :oops:

Thanks for helping the idiot of the day. :lol:

sethjackson:
K one more question....

here is some code.


--- Code: ---cbEditor* ed = EDMAN()->GetBuiltinActiveEditor();

    if (ed)
    {
        EditorColorSet* theme;
        HighlightLanguage lang = theme->GetHighlightLanguage(wxSCI_LEX_NULL);
        theme->Apply(lang, ed->GetControl());
    }

--- End code ---

Of course that won't work because theme is 0 (corret me if I'm wrong). So how do I accomplish this.

I tried


--- Code: ---EditorColorSet* theme = ed->GetColorSet();

--- End code ---

but that didn't work either. It crashed in some situations. So how do I propagate theme? Thanks.

mandrav:
EditorColorSet is a property of EditorManager.
Use this:


EditorColorSet* theme = Manager::Get()->GetEditorManager()->GetColorSet();

Navigation

[0] Message Index

[#] Next page

Go to full version