Author Topic: Use a modified version of Scintilla?  (Read 9130 times)

Offline Micah

  • Single posting newcomer
  • *
  • Posts: 8
    • http://
Use a modified version of Scintilla?
« on: August 14, 2005, 10:36:11 am »
I recently added a feature to Scintilla to fold code on the line above the brace so the following:
Code: [Select]
-while(foo)
{
bar;
}
will fold into:
Code: [Select]
+while(foo)instead of:
Code: [Select]
while(foo)
+{

I would like this feature to be available to myself while using Code::Blocks, but I was unable to figure out how to include my own version of Scintilla when compiling Code::Blocks. Can anyone offer me any pointers on how to do this?

Offline Urxae

  • Regular
  • ***
  • Posts: 376
Re: Use a modified version of Scintilla?
« Reply #1 on: August 14, 2005, 10:52:05 am »
I think you'll have to change STC (the wxWidgets binding of Scintilla, %WXDIR%/contrib/stc I think) to use your version of Scintilla and recompile it, then compile Code::Blocks with that library. Don't forget to compile wxWidgets itself first if you haven't done so yet, though.

Offline rickg22

  • Lives here!
  • ****
  • Posts: 2283
Re: Use a modified version of Scintilla?
« Reply #2 on: August 14, 2005, 10:53:06 am »
Maybe we could use the wxScintilla class (a derivative of wxStyledTextCtrl, google for it). Just a question.

Can it be configured with a parameter or something?

Offline Micah

  • Single posting newcomer
  • *
  • Posts: 8
    • http://
Re: Use a modified version of Scintilla?
« Reply #3 on: August 14, 2005, 10:00:54 pm »
What configure parameters do I need to pass to compile wxWidgets for Code::Blocks?  Just --enabled-shared and everything else as default?

Offline David Perfors

  • Developer
  • Lives here!
  • *****
  • Posts: 560
Re: Use a modified version of Scintilla?
« Reply #4 on: August 14, 2005, 10:32:01 pm »
see the wiki ;)
OS: winXP
Compiler: mingw
IDE: Code::Blocks SVN WX: 2.8.4 Wish list: faster code completion, easier debugging, refactoring

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: Use a modified version of Scintilla?
« Reply #5 on: August 15, 2005, 12:32:23 am »
see the wiki ;)
Hahaha... almost falling off my chair :)
I spent 3 hours trying to compile wx this afternoon using the wiki.

Funnily, I already did so a couple of weeks ago, and it went just fine. Today it keeps failing with "unexpected end of file" - same machine, same parameters, freshly unzipped sources.

Now tell me a computer is a deterministic machine ;)
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline rickg22

  • Lives here!
  • ****
  • Posts: 2283
Re: Use a modified version of Scintilla?
« Reply #6 on: August 15, 2005, 01:13:50 am »
Anyway in case you're wondering... the scintilla in wxWidgets is composed of two parts: Scintilla, and wxStyledTextCtrl, which is an encapsulation of most (if not all) the scintilla methods.

Maybe you could do a derivative of wxStyledTextCtrl instead of having to recompile scintilla...

Offline rickg22

  • Lives here!
  • ****
  • Posts: 2283
Re: Use a modified version of Scintilla?
« Reply #7 on: August 15, 2005, 01:19:56 am »
I spent 3 hours trying to compile wx this afternoon using the wiki.

Hey - why not make a list of errors you're getting?

I can compile wx242 using the wiki (in both Windows AND Linux) and had no problems at all. Anyway Thomas, the wiki could as well use your experiences compiling ;-)

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: Use a modified version of Scintilla?
« Reply #8 on: August 15, 2005, 01:17:51 pm »
Hey - why not make a list of errors you're getting?
Doubt that will be of any help, as it is quite weird, but lets see :)

This is the thing I did a couple of weeks ago,
the exact thing I did yesterday,
and the exact same thing I did 20 minutes ago:
Code: [Select]
C:\>cd C:\wxWidgets-2.6.1\build\msw

C:\wxWidgets-2.6.1\build\msw>set path=c:\mingw\bin;c:\mingw\mingw32\bin

C:\wxWidgets-2.6.1\build\msw>mingw32-make -v
GNU Make 3.80
Copyright (C) 2002  Free Software Foundation, Inc.
This is free software; see the source for copying conditions.
There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A
PARTICULAR PURPOSE.

C:\wxWidgets-2.6.1\build\msw>mingw32-make -f makefile.gcc clean
if exist gcc_mswd\*.o del gcc_mswd\*.o
[200 more lines of output...]

C:\wxWidgets-2.6.1\build\msw>mingw32-make -f makefile.gcc USE_XRC=1 SHARED=1 MONOLITHIC=1 BUILD=release UNICODE=0 VENDOR=cb
A few weeks ago, it worked fine. Yesterday, it failed with a message like "unexpected end of file" after some 30-40 lines of output. I tried newer and older versions of the bintools, also desperately tried using msys make instead, no success in either case, so eventually I gave up.
Today, to reproduce the error messages for this post, I did the very same thing -- it compiled just fine (except for the usual 20,000 warnings about incompatible types and type definition attributes in the implementation, but I guess that is just normal for wxWidgets...).
In every case, I copied the commands from the WiKi and pasted them into the cmd window. So how is copy and paste on sunday different from copy and paste on monday, lol. This is beyond me :)
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline Urxae

  • Regular
  • ***
  • Posts: 376
Re: Use a modified version of Scintilla?
« Reply #9 on: August 15, 2005, 05:02:35 pm »
A few weeks ago, it worked fine. Yesterday, it failed with a message like "unexpected end of file" after some 30-40 lines of output. I tried newer and older versions of the bintools, also desperately tried using msys make instead, no success in either case, so eventually I gave up.
Today, to reproduce the error messages for this post, I did the very same thing -- it compiled just fine (except for the usual 20,000 warnings about incompatible types and type definition attributes in the implementation, but I guess that is just normal for wxWidgets...).
In every case, I copied the commands from the WiKi and pasted them into the cmd window. So how is copy and paste on sunday different from copy and paste on monday, lol. This is beyond me :)
Did you happen to use a different PATH setting? I'd tried a few times to compile wx without success, until I reduced my PATH to the bare essentials. Turns out it didn't work if the MSYS bin directory was in there :? (though just putting if before the MinGW bin dir may work too).

Though if CB didn't require STC I'd have had it running much sooner: wx itself compiled fine from within MSYS with the configure script and make as per the wx *nix install instructions, but I couldn't get it to compile STC. Maybe I missed some configure parameter...

Offline thomas

  • Administrator
  • Lives here!
  • *****
  • Posts: 3979
Re: Use a modified version of Scintilla?
« Reply #10 on: August 15, 2005, 05:12:24 pm »
Always my first step:
Code: [Select]
set path=c:\mingw\bin;c:\mingw\mingw32\bin
"We should forget about small efficiencies, say about 97% of the time: Premature quotation is the root of public humiliation."

Offline rickg22

  • Lives here!
  • ****
  • Posts: 2283
Re: Use a modified version of Scintilla?
« Reply #11 on: August 15, 2005, 06:39:16 pm »
makefile.gcc? :shock: Shouldn't that be Makefile.g95?

Offline AkiraDev

  • Multiple posting newcomer
  • *
  • Posts: 71
Re: Use a modified version of Scintilla?
« Reply #12 on: August 15, 2005, 08:57:00 pm »
I got the same issue a while ago, and my solution was to dump (uninstall) MSys all together, and only use MinGW for compiling in the command prompt. MSys and MinGW don't mix perfectly, unlike what one would expect. Also, make sure that you are using Mingw32-Make 3.80.

rickg22: Yes, it's correct, it IS makefile.gcc for MinGW32. makefile.g95 is an old makefile for Cygwin, I think.

Offline Urxae

  • Regular
  • ***
  • Posts: 376
Re: Use a modified version of Scintilla?
« Reply #13 on: August 15, 2005, 11:14:32 pm »
makefile.gcc? :shock: Shouldn't that be Makefile.g95?
rickg22: Yes, it's correct, it IS makefile.gcc for MinGW32. makefile.g95 is an old makefile for Cygwin, I think.
Actually, it depends on what exactly you're trying to compile. For wxWindows 2.4.2, it's makefile.g95, but for wxWidgets 2.6.1 it's makefile.gcc (assuming MinGW). They changed the name of the makefile as well as the name of the library itself. :roll:

Note that AkiraDevs statement is technically 100% correct: it is makefile.gcc (as thomas is compiling 2.6.1) and makefile.g95 is an old makefile for both Cygwin and MinGW ;).

Offline mandrav

  • Project Leader
  • Administrator
  • Lives here!
  • *****
  • Posts: 4291
    • Code::Blocks IDE
Re: Use a modified version of Scintilla?
« Reply #14 on: August 19, 2005, 08:17:50 am »
Code: [Select]
C:\wxWidgets-2.6.1\build\msw>mingw32-make -f makefile.gcc clean
if exist gcc_mswd\*.o del gcc_mswd\*.o
[200 more lines of output...]

C:\wxWidgets-2.6.1\build\msw>mingw32-make -f makefile.gcc USE_XRC=1 SHARED=1 MONOLITHIC=1 BUILD=release UNICODE=0 VENDOR=cb

You do know that you should be using the same options for "make clean" too, don't you?
Try this instead of the simple "make -f makefile.gcc clean":
Code: [Select]
C:\wxWidgets-2.6.1\build\msw>mingw32-make -f makefile.gcc USE_XRC=1 SHARED=1 MONOLITHIC=1 BUILD=release UNICODE=0 VENDOR=cb clean
(note the "clean" at EOL).

HTH,
Yiannis.
Be patient!
This bug will be fixed soon...