Developer forums (C::B DEVELOPMENT STRICTLY!) > Development
Building with wxWidgets 2.9
Cryogen:
--- Quote from: stahta01 on October 18, 2010, 05:01:10 am ---Too All:
There is three setup.h files directly involved.
<WXWIN>\include\wx\msw\setup0.h
<WXWIN>\include\wx\msw\setup.h
<WXWIN>\lib\gcc_dll\mswu\wx\setup.h
You should verify the last two have wxUSE_STC set correctly in both or at least correctly in the last one.
--- End quote ---
Yes and yes. Verified for the umpteenth time today, just to be sure.
Loaden:
--- Quote from: Loaden on October 18, 2010, 03:47:02 am ---
--- Quote from: jens on September 28, 2010, 07:28:17 am ---but you have to use "our" scintilla, because there are some C::B specific patches we use.
--- End quote ---
Maybe we can move the specific patches from wxScintilla to cbEditor or cbStyledTextCtrl?
--- End quote ---
I am trying, but I found it is impossible.
--- Code: ---/*
* This file is part of the Code::Blocks IDE and licensed under the GNU Lesser General Public License, version 3
* http://www.gnu.org/licenses/lgpl-3.0.html
*/
#ifndef CBSCINTILLA_H
#define CBSCINTILLA_H
#if wxCHECK_VERSION(2, 9, 2)
#include <wx/stc/stc.h>
#define cbSCI_KEYWORDSET_MAX wxSTC_KEYWORDSET_MAX
#define cbSCI_EOL_LF wxSTC_EOL_LF
#define cbSCI_EOL_CR wxSTC_EOL_CR
#define cbSCI_C_COMMENT wxSTC_C_COMMENT
#define cbSCI_C_COMMENTDOC wxSTC_C_COMMENTDOC
#define cbSCI_C_COMMENTDOCKEYWORD wxSTC_C_COMMENTDOCKEYWORD
#define cbSCI_C_COMMENTDOCKEYWORDERROR wxSTC_C_COMMENTDOCKEYWORDERROR
#define cbSCI_C_COMMENTLINE wxSTC_C_COMMENTLINE
#define cbSCI_C_COMMENTLINEDOC wxSTC_C_COMMENTLINEDOC
#define cbSCI_D_COMMENT wxSTC_D_COMMENT
#define cbSCI_D_COMMENTDOC wxSTC_D_COMMENTDOC
#define cbSCI_D_COMMENTDOCKEYWORD wxSTC_D_COMMENTDOCKEYWORD
#define cbSCI_D_COMMENTDOCKEYWORDERROR wxSTC_D_COMMENTDOCKEYWORDERROR
#define cbSCI_D_COMMENTLINE wxSTC_D_COMMENTLINE
#define cbSCI_D_COMMENTLINEDOC wxSTC_D_COMMENTLINEDOC
#define cbSCI_LEX_CPP wxSTC_LEX_CPP
#define cbSCI_LEX_D wxSTC_LEX_D
#define cbSCI_C_PREPROCESSOR wxSTC_C_PREPROCESSOR
#define cbSCI_C_STRING wxSTC_C_STRING
#define cbSCI_C_CHARACTER wxSTC_C_CHARACTER
#define cbSCI_C_CHARACTER wxSTC_C_CHARACTER
#define cbSCI_D_PREPROCESSOR wxSTC_D_PREPROCESSOR
#define cbSCI_D_STRING wxSTC_D_STRING
#define cbSCI_D_CHARACTER wxSTC_D_CHARACTER
#define cbSCI_D_CHARACTER wxSTC_D_CHARACTER
#define cbSCI_STYLE_LINENUMBER wxSTC_STYLE_LINENUMBER
#define cbSCI_INDIC_HIGHLIGHT wxSTC_INDIC_HIGHLIGHT
#define cbSCI_FIND_MATCHCASE wxSTC_FIND_MATCHCASE
#define cbSCI_FIND_WHOLEWORD wxSTC_FIND_WHOLEWORD
#define cbSCI_KEY_HOME wxSTC_KEY_HOME
#define cbSCI_KEY_END wxSTC_KEY_END
#define cbSCI_SCMOD_NORM wxSTC_SCMOD_NORM
#define cbSCI_SCMOD_SHIFT wxSTC_SCMOD_SHIFT
#define cbSCI_SCMOD_ALT wxSTC_SCMOD_ALT
#define cbSCI_CMD_HOME wxSTC_CMD_HOME
#define cbSCI_CMD_HOMEEXTEND wxSTC_CMD_HOMEEXTEND
#define cbSCI_CMD_HOMERECTEXTEND wxSTC_CMD_HOMERECTEXTEND
#define cbSCI_CMD_VCHOME wxSTC_CMD_VCHOME
#define cbSCI_CMD_VCHOMEEXTEND wxSTC_CMD_VCHOMEEXTEND
#define cbSCI_CMD_VCHOMERECTEXTEND wxSTC_CMD_VCHOMERECTEXTEND
#define cbSCI_CMD_LINEENDWRAP wxSTC_CMD_LINEENDWRAP
#define cbSCI_IV_LOOKBOTH wxSTC_IV_LOOKBOTH
#define cbSCI_IV_NONE wxSTC_IV_NONE
class cbScintilla : public wxStyledTextCtrl
{
public:
cbScintilla(wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, long style = 0)
: wxStyledTextCtrl(parent, id, pos, size, style)
{
}
};
#else // !wxCHECK_VERSION(2, 9, 2)
#define cbSCI_INVALID_POSITION wxSCI_INVALID_POSITION
#define cbSCI_KEYWORDSET_MAX wxSCI_KEYWORDSET_MAX
#define cbSCI_EOL_LF wxSCI_EOL_LF
#define cbSCI_EOL_CR wxSCI_EOL_CR
#define cbSCI_C_COMMENT wxSCI_C_COMMENT
#define cbSCI_C_COMMENTDOC wxSCI_C_COMMENTDOC
#define cbSCI_C_COMMENTDOCKEYWORD wxSCI_C_COMMENTDOCKEYWORD
#define cbSCI_C_COMMENTDOCKEYWORDERROR wxSCI_C_COMMENTDOCKEYWORDERROR
#define cbSCI_C_COMMENTLINE wxSCI_C_COMMENTLINE
#define cbSCI_C_COMMENTLINEDOC wxSCI_C_COMMENTLINEDOC
#define cbSCI_D_COMMENT wxSCI_D_COMMENT
#define cbSCI_D_COMMENTDOC wxSCI_D_COMMENTDOC
#define cbSCI_D_COMMENTDOCKEYWORD wxSCI_D_COMMENTDOCKEYWORD
#define cbSCI_D_COMMENTDOCKEYWORDERROR wxSCI_D_COMMENTDOCKEYWORDERROR
#define cbSCI_D_COMMENTLINE wxSCI_D_COMMENTLINE
#define cbSCI_D_COMMENTLINEDOC wxSCI_D_COMMENTLINEDOC
#define cbSCI_LEX_CPP wxSCI_LEX_CPP
#define cbSCI_LEX_D wxSCI_LEX_D
#define cbSCI_C_PREPROCESSOR wxSCI_C_PREPROCESSOR
#define cbSCI_C_STRING wxSCI_C_STRING
#define cbSCI_C_CHARACTER wxSCI_C_CHARACTER
#define cbSCI_C_CHARACTER wxSCI_C_CHARACTER
#define cbSCI_D_PREPROCESSOR wxSCI_D_PREPROCESSOR
#define cbSCI_D_STRING wxSCI_D_STRING
#define cbSCI_D_CHARACTER wxSCI_D_CHARACTER
#define cbSCI_D_CHARACTER wxSCI_D_CHARACTER
#define cbSCI_STYLE_LINENUMBER wxSCI_STYLE_LINENUMBER
#define cbSCI_INDIC_HIGHLIGHT wxSCI_INDIC_HIGHLIGHT
#define cbSCI_FIND_MATCHCASE wxSCI_FIND_MATCHCASE
#define cbSCI_FIND_WHOLEWORD wxSCI_FIND_WHOLEWORD
#define cbSCI_KEY_HOME wxSCI_KEY_HOME
#define cbSCI_KEY_END wxSCI_KEY_END
#define cbSCI_SCMOD_NORM wxSCI_SCMOD_NORM
#define cbSCI_SCMOD_SHIFT wxSCI_SCMOD_SHIFT
#define cbSCI_SCMOD_ALT wxSCI_SCMOD_ALT
#define cbSCI_CMD_HOME wxSCI_CMD_HOME
#define cbSCI_CMD_HOMEEXTEND wxSCI_CMD_HOMEEXTEND
#define cbSCI_CMD_HOMERECTEXTEND wxSCI_CMD_HOMERECTEXTEND
#define cbSCI_CMD_VCHOME wxSCI_CMD_VCHOME
#define cbSCI_CMD_VCHOMEEXTEND wxSCI_CMD_VCHOMEEXTEND
#define cbSCI_CMD_VCHOMERECTEXTEND wxSCI_CMD_VCHOMERECTEXTEND
#define cbSCI_CMD_LINEENDWRAP wxSCI_CMD_LINEENDWRAP
#define cbSCI_IV_LOOKBOTH wxSCI_IV_LOOKBOTH
#define cbSCI_IV_NONE wxSCI_IV_NONE
class cbScintilla : public wxScintilla
{
public:
cbScintilla(wxWindow* parent, wxWindowID id = wxID_ANY, const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize, long style = 0)
: wxScintilla(parent, id, pos, size, style)
{
}
};
#endif // wxCHECK_VERSION(2, 9, 2)
#endif // CBSCINTILLA_H
--- End code ---
And I have some questions:
--- Code: ---void Editor::NotifyStyleToNeeded(int endStyleNeeded) {
/* C::B begin */
SCNotification scn; memset((void*)&scn, 0, sizeof(scn));
/* C::B end */
scn.nmhdr.code = SCN_STYLENEEDED;
scn.position = endStyleNeeded;
NotifyParent(scn);
}
void Editor::NotifyStyleNeeded(Document *, void *, int endStyleNeeded) {
NotifyStyleToNeeded(endStyleNeeded);
}
void Editor::NotifyLexerChanged(Document *, void *) {
}
void Editor::NotifyErrorOccurred(Document *, void *, int status) {
errorStatus = status;
}
void Editor::NotifyChar(int ch) {
/* C::B begin */
SCNotification scn; memset((void*)&scn, 0, sizeof(scn));
/* C::B end */
scn.nmhdr.code = SCN_CHARADDED;
scn.ch = ch;
NotifyParent(scn);
}
void Editor::NotifySavePoint(bool isSavePoint) {
/* C::B begin */
SCNotification scn; memset((void*)&scn, 0, sizeof(scn));
/* C::B end */
if (isSavePoint) {
scn.nmhdr.code = SCN_SAVEPOINTREACHED;
} else {
scn.nmhdr.code = SCN_SAVEPOINTLEFT;
}
NotifyParent(scn);
}
void Editor::NotifyModifyAttempt() {
/* C::B begin */
SCNotification scn; memset((void*)&scn, 0, sizeof(scn));
/* C::B end */
scn.nmhdr.code = SCN_MODIFYATTEMPTRO;
NotifyParent(scn);
}
void Editor::NotifyDoubleClick(Point pt, bool shift, bool ctrl, bool alt) {
/* C::B begin */
SCNotification scn; memset((void*)&scn, 0, sizeof(scn));
/* C::B end */
scn.nmhdr.code = SCN_DOUBLECLICK;
scn.line = LineFromLocation(pt);
scn.position = PositionFromLocation(pt, true);
scn.modifiers = (shift ? SCI_SHIFT : 0) | (ctrl ? SCI_CTRL : 0) |
(alt ? SCI_ALT : 0);
NotifyParent(scn);
}
void Editor::NotifyHotSpotDoubleClicked(int position, bool shift, bool ctrl, bool alt) {
/* C::B begin */
SCNotification scn; memset((void*)&scn, 0, sizeof(scn));
/* C::B end */
scn.nmhdr.code = SCN_HOTSPOTDOUBLECLICK;
scn.position = position;
scn.modifiers = (shift ? SCI_SHIFT : 0) | (ctrl ? SCI_CTRL : 0) |
(alt ? SCI_ALT : 0);
NotifyParent(scn);
}
void Editor::NotifyHotSpotClicked(int position, bool shift, bool ctrl, bool alt) {
/* C::B begin */
SCNotification scn; memset((void*)&scn, 0, sizeof(scn));
/* C::B end */
scn.nmhdr.code = SCN_HOTSPOTCLICK;
scn.position = position;
scn.modifiers = (shift ? SCI_SHIFT : 0) | (ctrl ? SCI_CTRL : 0) |
(alt ? SCI_ALT : 0);
NotifyParent(scn);
}
void Editor::NotifyUpdateUI() {
/* C::B begin */
SCNotification scn; memset((void*)&scn, 0, sizeof(scn));
/* C::B end */
scn.nmhdr.code = SCN_UPDATEUI;
NotifyParent(scn);
}
void Editor::NotifyPainted() {
/* C::B begin */
SCNotification scn; memset((void*)&scn, 0, sizeof(scn));
/* C::B end */
scn.nmhdr.code = SCN_PAINTED;
NotifyParent(scn);
}
................
--- End code ---
It seems the "C::B begin" and "C::B end" flag is error position?
Loaden:
--- Quote from: Loaden on October 18, 2010, 05:34:41 am ---There is a possible way: using MONOLITHIC = 0
I am trying, and feedback the result.
--- Quote ---make -f makefile.gcc LDFLAGS=-s SHARED=1 BUILD=release UNICODE=1 MONOLITHIC=0 OFFICIAL_BUILD=1 RUNTIME_LIBS=static >nul
--- End quote ---
In wx2.9.2svn, the MONOLITHIC default to 0
--- Code: ---# Multiple libraries or single huge monolithic one? [0,1]
MONOLITHIC ?= 0
--- End code ---
--- End quote ---
Successed!
I think this should be a viable option.
Cryogen:
--- Quote from: Loaden on October 18, 2010, 06:57:11 am ---
--- Quote from: Loaden on October 18, 2010, 05:34:41 am ---There is a possible way: using MONOLITHIC = 0
I am trying, and feedback the result.
--- Quote ---make -f makefile.gcc LDFLAGS=-s SHARED=1 BUILD=release UNICODE=1 MONOLITHIC=0 OFFICIAL_BUILD=1 RUNTIME_LIBS=static >nul
--- End quote ---
In wx2.9.2svn, the MONOLITHIC default to 0
--- Code: ---# Multiple libraries or single huge monolithic one? [0,1]
MONOLITHIC ?= 0
--- End code ---
--- End quote ---
Successed!
I think this should be a viable option.
--- End quote ---
Loaden, you are my hero. The only negative is that there are some nasty, hard-coded paths in your .cbp which need to be replaced with the (#wx) versions. I built wx as you suggested and CB using your project file and it finally worked. Many, many thanks.
Gary.
Loaden:
--- Quote from: Cryogen on October 19, 2010, 01:53:53 am ---The only negative is that there are some nasty, hard-coded paths in your .cbp which need to be replaced with the (#wx) versions.
--- End quote ---
This is very strange, I did not specifically set it.
Fixed and update the patch in here: http://forums.codeblocks.org/index.php/topic,13388.msg90930.html#msg90930
Navigation
[0] Message Index
[#] Next page
[*] Previous page
Go to full version