Author Topic: Error in CSED 1.03 Source File CSED.BAS  (Read 6041 times)

0 Members and 1 Guest are viewing this topic.

Offline Nick Melnick

  • Newbie
  • *
  • Posts: 14
  • User-Rate: +1/-2
Error in CSED 1.03 Source File CSED.BAS
« on: December 01, 2014, 09:10:09 PM »
In function CSED_CreateMdiChild, the line beginning with "RedrawWindow pSed.hwndClient" is commented out.
Uncomment it, otherwise:
 o un-maximized child windows are not displayed properly
 o Files opened from the "Recent Files" menu will not have properly displayed children
 o Files opened from the toolbar's open file dropdown WILL have properly displayed children (?)
 
IMHO, the source files CSED_PRINT.inc and CSED_TOOLBARS.inc should be updated to reflect the bug
fixes presented in this thread.

This may not be the proper thread for this (dated) question, but I've been fooling around with
code improvements in SED 2.02 & 2.03 because I still use them when I want split window capability.
It reminded me of the fact that none of the SED releases ever responded to Bold or Italic font
settings (although Underline always worked). PBSITE (the predecessor to SED) and CSED both do
this properly.
Debugging to find the problem is leading to a dead end since everything seems to be doing what it
should to produce these font settings.

So - does anyone out there have any idea what might be causing this issue???
(Its not the Scintilla DLL, every version up to the latest has been tried)

Offline José Roca

  • Administrator
  • Hero Member
  • *****
  • Posts: 2483
  • User-Rate: +204/-0
Re: Error in CSED 1.03 Source File CSED.BAS
« Reply #1 on: December 01, 2014, 11:33:03 PM »
Updated.

Offline Nick Melnick

  • Newbie
  • *
  • Posts: 14
  • User-Rate: +1/-2
Re: Error in CSED 1.03 Source File CSED.BAS
« Reply #2 on: December 02, 2014, 03:09:26 PM »
I have also noticed that when a child is not maximized and slowly sized downwards vertically, it sizes in "steps".
This can be fixed by changing the %FALSE parameter of the MoveWindow call in the WM_SIZE message
in CSED_MDIWindowProc to %TRUE and catching the WM_ERASEBKGND message and returning %TRUE.

Offline Nick Melnick

  • Newbie
  • *
  • Posts: 14
  • User-Rate: +1/-2
Re: Error in CSED 1.03 Source File CSED.BAS
« Reply #3 on: December 02, 2014, 10:46:24 PM »
Found the problem with SED's font formatting.
Much of the code in SCI_SetOptions had to be restructured.

Offline Theo Gottwald

  • Administrator
  • Hero Member
  • *****
  • Posts: 924
  • User-Rate: +30/-4
    • it-berater
Re: Error in CSED 1.03 Source File CSED.BAS
« Reply #4 on: December 03, 2014, 09:36:39 AM »
What exactly did you change, Nick?
I could not understand what changes are needed in PRINT and TOOLBARS etc.

Offline Nick Melnick

  • Newbie
  • *
  • Posts: 14
  • User-Rate: +1/-2
Re: Error in CSED 1.03 Source File CSED.BAS
« Reply #5 on: December 03, 2014, 02:40:13 PM »
PRINT had the following 2 lines reversed, making the character "<" print as garbage:
 REPLACE "&" WITH "&amp;" IN txt
 REPLACE "<" WITH "&lt;" IN txt

TOOLBARS required the modifications posted in 'CSED - Modification' replies #67 & #69.

The way that the code was structured in the SCI_SetOptions sub would only allow Bold or Italic to
be shown if you unchecked 'use always the default font' and chose a particular item to modify.
In other words, using the default font setting was bypassed and had no effect. Jose got it right in CSED.
My changes are shown below. Just paste it over the relevant existing code:

Code: [Select]
         ' Set the Comments style
         SciMsg pSci, %SCI_STYLESETFONT, %SCE_B_COMMENT, BYVAL IIF&(g_tSciColorsAndFonts.UseAlwaysDefaultFont,_
                  VARPTR(g_tSciColorsAndFonts.DefaultFontName), VARPTR(g_tSciColorsAndFonts.CommentFontName))
         SCI_SetCharset pSci, %SCE_B_COMMENT, IIF$(g_tSciColorsAndFonts.UseAlwaysDefaultFont,_
                  g_tSciColorsAndFonts.DefaultFontCharset, g_tSciColorsAndFonts.CommentFontCharset)
         SciMsg pSci, %SCI_STYLESETBOLD, %SCE_B_COMMENT, IIF&(g_tSciColorsAndFonts.UseAlwaysDefaultFont,_
                  g_tSciColorsAndFonts.DefaultFontBold, g_tSciColorsAndFonts.CommentFontBold)
         SciMsg pSci, %SCI_STYLESETITALIC, %SCE_B_COMMENT, IIF&(g_tSciColorsAndFonts.UseAlwaysDefaultFont,_
                  g_tSciColorsAndFonts.DefaultFontItalic, g_tSciColorsAndFonts.CommentFontItalic)
         SciMsg pSci, %SCI_STYLESETUNDERLINE, %SCE_B_COMMENT, IIF&(g_tSciColorsAndFonts.UseAlwaysDefaultFont,_
                  g_tSciColorsAndFonts.DefaultFontUnderline, g_tSciColorsAndFonts.CommentFontUnderline)

         SciMsg pSci, %SCI_STYLESETFORE, %SCE_B_COMMENT, g_tSciColorsAndFonts.CommentForeColor
         SciMsg pSci, %SCI_STYLESETCASE, %SCE_B_COMMENT, EdOpt.DefaultCase

         SciMsg pSci, %SCI_STYLESETSIZE, %SCE_B_COMMENT, IIF&(g_tSciColorsAndFonts.UseAlwaysDefaultFontSize,_
                  g_tSciColorsAndFonts.DefaultFontSize, g_tSciColorsAndFonts.CommentFontSize)

         SciMsg pSci, %SCI_STYLESETBACK, %SCE_B_COMMENT, IIF&(g_tSciColorsAndFonts.UseAlwaysDefaultBackColor,_
                  g_tSciColorsAndFonts.DefaultBackColor, g_tSciColorsAndFonts.CommentBackColor)

         ' Set the Keywords style
         SciMsg pSci, %SCI_STYLESETFONT, %SCE_B_KEYWORD, BYVAL IIF&(g_tSciColorsAndFonts.UseAlwaysDefaultFont,_
                  VARPTR(g_tSciColorsAndFonts.DefaultFontName), VARPTR(g_tSciColorsAndFonts.KeywordFontName))
         SCI_SetCharset pSci, %SCE_B_KEYWORD, IIF$(g_tSciColorsAndFonts.UseAlwaysDefaultFont,_
                  g_tSciColorsAndFonts.DefaultFontCharset, g_tSciColorsAndFonts.KeywordFontCharset)
         SciMsg pSci, %SCI_STYLESETBOLD, %SCE_B_KEYWORD, IIF&(g_tSciColorsAndFonts.UseAlwaysDefaultFont,_
                  g_tSciColorsAndFonts.DefaultFontBold, g_tSciColorsAndFonts.KeywordFontBold)
         SciMsg pSci, %SCI_STYLESETITALIC, %SCE_B_KEYWORD, IIF&(g_tSciColorsAndFonts.UseAlwaysDefaultFont,_
                  g_tSciColorsAndFonts.DefaultFontItalic, g_tSciColorsAndFonts.KeywordFontItalic)
         SciMsg pSci, %SCI_STYLESETUNDERLINE, %SCE_B_KEYWORD, IIF&(g_tSciColorsAndFonts.UseAlwaysDefaultFont,_
                  g_tSciColorsAndFonts.DefaultFontUnderline, g_tSciColorsAndFonts.KeywordFontUnderline)

         SciMsg pSci, %SCI_STYLESETFORE, %SCE_B_KEYWORD, g_tSciColorsAndFonts.KeywordForeColor
         SciMsg pSci, %SCI_STYLESETCASE, %SCE_B_KEYWORD, EdOpt.KeywordCase

         SciMsg pSci, %SCI_STYLESETSIZE, %SCE_B_KEYWORD, IIF&(g_tSciColorsAndFonts.UseAlwaysDefaultFontSize,_
                  g_tSciColorsAndFonts.DefaultFontSize, g_tSciColorsAndFonts.KeywordFontSize)

         SciMsg pSci, %SCI_STYLESETBACK, %SCE_B_KEYWORD, IIF&(g_tSciColorsAndFonts.UseAlwaysDefaultBackColor,_
                  g_tSciColorsAndFonts.DefaultBackColor, g_tSciColorsAndFonts.KeywordBackColor)

         ' Set the Constants style
         SciMsg pSci, %SCI_STYLESETFONT, %SCE_B_CONSTANT, BYVAL IIF&(g_tSciColorsAndFonts.UseAlwaysDefaultFont,_
                  VARPTR(g_tSciColorsAndFonts.DefaultFontName), VARPTR(g_tSciColorsAndFonts.ConstantFontName))
         SCI_SetCharset pSci, %SCE_B_CONSTANT, IIF$(g_tSciColorsAndFonts.UseAlwaysDefaultFont,_
                  g_tSciColorsAndFonts.DefaultFontCharset, g_tSciColorsAndFonts.ConstantFontCharset)
         SciMsg pSci, %SCI_STYLESETBOLD, %SCE_B_CONSTANT, IIF&(g_tSciColorsAndFonts.UseAlwaysDefaultFont,_
                  g_tSciColorsAndFonts.DefaultFontBold, g_tSciColorsAndFonts.ConstantFontBold)
         SciMsg pSci, %SCI_STYLESETITALIC, %SCE_B_CONSTANT, IIF&(g_tSciColorsAndFonts.UseAlwaysDefaultFont,_
                  g_tSciColorsAndFonts.DefaultFontItalic, g_tSciColorsAndFonts.ConstantFontItalic)
         SciMsg pSci, %SCI_STYLESETUNDERLINE, %SCE_B_CONSTANT, IIF&(g_tSciColorsAndFonts.UseAlwaysDefaultFont,_
                  g_tSciColorsAndFonts.DefaultFontUnderline, g_tSciColorsAndFonts.ConstantFontUnderline)

         SciMsg pSci, %SCI_STYLESETFORE, %SCE_B_CONSTANT, g_tSciColorsAndFonts.ConstantForeColor
         SciMsg pSci, %SCI_STYLESETCASE, %SCE_B_CONSTANT, EdOpt.DefaultCase

         SciMsg pSci, %SCI_STYLESETSIZE, %SCE_B_CONSTANT, IIF&(g_tSciColorsAndFonts.UseAlwaysDefaultFontSize,_
                  g_tSciColorsAndFonts.DefaultFontSize, g_tSciColorsAndFonts.ConstantFontSize)

         SciMsg pSci, %SCI_STYLESETBACK, %SCE_B_CONSTANT, IIF&(g_tSciColorsAndFonts.UseAlwaysDefaultBackColor,_
                  g_tSciColorsAndFonts.DefaultBackColor, g_tSciColorsAndFonts.ConstantBackColor)

         ' Set the Identifiers style
         SciMsg pSci, %SCI_STYLESETFONT, %SCE_B_IDENTIFIER, BYVAL IIF&(g_tSciColorsAndFonts.UseAlwaysDefaultFont,_
                  VARPTR(g_tSciColorsAndFonts.DefaultFontName), VARPTR(g_tSciColorsAndFonts.IdentifierFontName))
         SCI_SetCharset pSci, %SCE_B_IDENTIFIER, IIF$(g_tSciColorsAndFonts.UseAlwaysDefaultFont,_
                  g_tSciColorsAndFonts.DefaultFontCharset, g_tSciColorsAndFonts.IdentifierFontCharset)
         SciMsg pSci, %SCI_STYLESETBOLD, %SCE_B_IDENTIFIER, IIF&(g_tSciColorsAndFonts.UseAlwaysDefaultFont,_
                  g_tSciColorsAndFonts.DefaultFontBold, g_tSciColorsAndFonts.IdentifierFontBold)
         SciMsg pSci, %SCI_STYLESETITALIC, %SCE_B_IDENTIFIER, IIF&(g_tSciColorsAndFonts.UseAlwaysDefaultFont,_
                  g_tSciColorsAndFonts.DefaultFontItalic, g_tSciColorsAndFonts.IdentifierFontItalic)
         SciMsg pSci, %SCI_STYLESETUNDERLINE, %SCE_B_IDENTIFIER, IIF&(g_tSciColorsAndFonts.UseAlwaysDefaultFont,_
                  g_tSciColorsAndFonts.DefaultFontUnderline, g_tSciColorsAndFonts.IdentifierFontUnderline)

         SciMsg pSci, %SCI_STYLESETFORE, %SCE_B_IDENTIFIER, g_tSciColorsAndFonts.IdentifierForeColor
         SciMsg pSci, %SCI_STYLESETCASE, %SCE_B_IDENTIFIER, EdOpt.DefaultCase

         SciMsg pSci, %SCI_STYLESETSIZE, %SCE_B_IDENTIFIER, IIF&(g_tSciColorsAndFonts.UseAlwaysDefaultFontSize,_
                  g_tSciColorsAndFonts.DefaultFontSize, g_tSciColorsAndFonts.DefaultFontSize)

         SciMsg pSci, %SCI_STYLESETBACK, %SCE_B_IDENTIFIER, IIF&(g_tSciColorsAndFonts.UseAlwaysDefaultBackColor,_
                  g_tSciColorsAndFonts.DefaultBackColor, g_tSciColorsAndFonts.IdentifierBackColor)

         ' Set the Numbers style
         SciMsg pSci, %SCI_STYLESETFONT, %SCE_B_NUMBER, BYVAL IIF&(g_tSciColorsAndFonts.UseAlwaysDefaultFont,_
                  VARPTR(g_tSciColorsAndFonts.DefaultFontName), VARPTR(g_tSciColorsAndFonts.NumberFontName))
         SCI_SetCharset pSci, %SCE_B_NUMBER, IIF$(g_tSciColorsAndFonts.UseAlwaysDefaultFont,_
                  g_tSciColorsAndFonts.DefaultFontCharset, g_tSciColorsAndFonts.NumberFontCharset)
         SciMsg pSci, %SCI_STYLESETBOLD, %SCE_B_NUMBER, IIF&(g_tSciColorsAndFonts.UseAlwaysDefaultFont,_
                  g_tSciColorsAndFonts.DefaultFontBold, g_tSciColorsAndFonts.NumberFontBold)
         SciMsg pSci, %SCI_STYLESETITALIC, %SCE_B_NUMBER, IIF&(g_tSciColorsAndFonts.UseAlwaysDefaultFont,_
                  g_tSciColorsAndFonts.DefaultFontItalic, g_tSciColorsAndFonts.NumberFontItalic)
         SciMsg pSci, %SCI_STYLESETUNDERLINE, %SCE_B_NUMBER, IIF&(g_tSciColorsAndFonts.UseAlwaysDefaultFont,_
                  g_tSciColorsAndFonts.DefaultFontUnderline, g_tSciColorsAndFonts.NumberFontUnderline)

         SciMsg pSci, %SCI_STYLESETFORE, %SCE_B_NUMBER, g_tSciColorsAndFonts.NumberForeColor
         SciMsg pSci, %SCI_STYLESETCASE, %SCE_B_NUMBER, EdOpt.DefaultCase

         SciMsg pSci, %SCI_STYLESETSIZE, %SCE_B_NUMBER, IIF&(g_tSciColorsAndFonts.UseAlwaysDefaultFontSize,_
                  g_tSciColorsAndFonts.DefaultFontSize, g_tSciColorsAndFonts.NumberFontSize)

         SciMsg pSci, %SCI_STYLESETBACK, %SCE_B_NUMBER, IIF&(g_tSciColorsAndFonts.UseAlwaysDefaultBackColor,_
                  g_tSciColorsAndFonts.DefaultBackColor, g_tSciColorsAndFonts.NumberBackColor)

         ' Set the Operators style
         SciMsg pSci, %SCI_STYLESETFONT, %SCE_B_OPERATOR, BYVAL IIF&(g_tSciColorsAndFonts.UseAlwaysDefaultFont,_
                  VARPTR(g_tSciColorsAndFonts.DefaultFontName), VARPTR(g_tSciColorsAndFonts.OperatorFontName))
         SCI_SetCharset pSci, %SCE_B_OPERATOR, IIF$(g_tSciColorsAndFonts.UseAlwaysDefaultFont,_
                  g_tSciColorsAndFonts.DefaultFontCharset, g_tSciColorsAndFonts.OperatorFontCharset)
         SciMsg pSci, %SCI_STYLESETBOLD, %SCE_B_OPERATOR, IIF&(g_tSciColorsAndFonts.UseAlwaysDefaultFont,_
                  g_tSciColorsAndFonts.DefaultFontBold, g_tSciColorsAndFonts.OperatorFontBold)
         SciMsg pSci, %SCI_STYLESETITALIC, %SCE_B_OPERATOR, IIF&(g_tSciColorsAndFonts.UseAlwaysDefaultFont,_
                  g_tSciColorsAndFonts.DefaultFontItalic, g_tSciColorsAndFonts.OperatorFontItalic)
         SciMsg pSci, %SCI_STYLESETUNDERLINE, %SCE_B_OPERATOR, IIF&(g_tSciColorsAndFonts.UseAlwaysDefaultFont,_
                  g_tSciColorsAndFonts.DefaultFontUnderline, g_tSciColorsAndFonts.OperatorFontUnderline)

         SciMsg pSci, %SCI_STYLESETFORE, %SCE_B_OPERATOR, g_tSciColorsAndFonts.OperatorForeColor
         SciMsg pSci, %SCI_STYLESETCASE, %SCE_B_OPERATOR, EdOpt.DefaultCase

         SciMsg pSci, %SCI_STYLESETSIZE, %SCE_B_OPERATOR, IIF&(g_tSciColorsAndFonts.UseAlwaysDefaultFontSize,_
                  g_tSciColorsAndFonts.DefaultFontSize, g_tSciColorsAndFonts.OperatorFontSize)

         SciMsg pSci, %SCI_STYLESETBACK, %SCE_B_OPERATOR, IIF&(g_tSciColorsAndFonts.UseAlwaysDefaultBackColor,_
                  g_tSciColorsAndFonts.DefaultBackColor, g_tSciColorsAndFonts.OperatorBackColor)

         ' Set the Preprocessor style
         SciMsg pSci, %SCI_STYLESETFONT, %SCE_B_PREPROCESSOR, BYVAL IIF&(g_tSciColorsAndFonts.UseAlwaysDefaultFont,_
                  VARPTR(g_tSciColorsAndFonts.DefaultFontName), VARPTR(g_tSciColorsAndFonts.PreprocessorFontName))
         SCI_SetCharset pSci, %SCE_B_PREPROCESSOR, IIF$(g_tSciColorsAndFonts.UseAlwaysDefaultFont,_
                  g_tSciColorsAndFonts.DefaultFontCharset, g_tSciColorsAndFonts.PreprocessorFontCharset)
         SciMsg pSci, %SCI_STYLESETBOLD, %SCE_B_PREPROCESSOR, IIF&(g_tSciColorsAndFonts.UseAlwaysDefaultFont,_
                  g_tSciColorsAndFonts.DefaultFontBold, g_tSciColorsAndFonts.PreprocessorFontBold)
         SciMsg pSci, %SCI_STYLESETITALIC, %SCE_B_PREPROCESSOR, IIF&(g_tSciColorsAndFonts.UseAlwaysDefaultFont,_
                  g_tSciColorsAndFonts.DefaultFontItalic, g_tSciColorsAndFonts.PreprocessorFontItalic)
         SciMsg pSci, %SCI_STYLESETUNDERLINE, %SCE_B_PREPROCESSOR, IIF&(g_tSciColorsAndFonts.UseAlwaysDefaultFont,_
                  g_tSciColorsAndFonts.DefaultFontUnderline, g_tSciColorsAndFonts.PreprocessorFontUnderline)

         SciMsg pSci, %SCI_STYLESETFORE, %SCE_B_PREPROCESSOR, g_tSciColorsAndFonts.PreprocessorForeColor
         SciMsg pSci, %SCI_STYLESETCASE, %SCE_B_PREPROCESSOR, EdOpt.DefaultCase

         SciMsg pSci, %SCI_STYLESETSIZE, %SCE_B_PREPROCESSOR, IIF&(g_tSciColorsAndFonts.UseAlwaysDefaultFontSize,_
                  g_tSciColorsAndFonts.DefaultFontSize, g_tSciColorsAndFonts.PreprocessorFontSize)

         SciMsg pSci, %SCI_STYLESETBACK, %SCE_B_PREPROCESSOR, IIF&(g_tSciColorsAndFonts.UseAlwaysDefaultBackColor,_
                  g_tSciColorsAndFonts.DefaultBackColor, g_tSciColorsAndFonts.PreprocessorBackColor)

         ' Set the Strings style
         SciMsg pSci, %SCI_STYLESETFONT, %SCE_B_STRING, BYVAL IIF&(g_tSciColorsAndFonts.UseAlwaysDefaultFont,_
                  VARPTR(g_tSciColorsAndFonts.DefaultFontName), VARPTR(g_tSciColorsAndFonts.StringFontName))
         SCI_SetCharset pSci, %SCE_B_STRING, IIF$(g_tSciColorsAndFonts.UseAlwaysDefaultFont,_
                  g_tSciColorsAndFonts.DefaultFontCharset, g_tSciColorsAndFonts.StringFontCharset)
         SciMsg pSci, %SCI_STYLESETBOLD, %SCE_B_STRING, IIF&(g_tSciColorsAndFonts.UseAlwaysDefaultFont,_
                  g_tSciColorsAndFonts.DefaultFontBold, g_tSciColorsAndFonts.StringFontBold)
         SciMsg pSci, %SCI_STYLESETITALIC, %SCE_B_STRING, IIF&(g_tSciColorsAndFonts.UseAlwaysDefaultFont,_
                  g_tSciColorsAndFonts.DefaultFontItalic, g_tSciColorsAndFonts.StringFontItalic)
         SciMsg pSci, %SCI_STYLESETUNDERLINE, %SCE_B_STRING, IIF&(g_tSciColorsAndFonts.UseAlwaysDefaultFont,_
                  g_tSciColorsAndFonts.DefaultFontUnderline, g_tSciColorsAndFonts.StringFontUnderline)

         SciMsg pSci, %SCI_STYLESETFORE, %SCE_B_STRING, g_tSciColorsAndFonts.StringForeColor
         SciMsg pSci, %SCI_STYLESETCASE, %SCE_B_STRING, EdOpt.DefaultCase

         SciMsg pSci, %SCI_STYLESETSIZE, %SCE_B_STRING, IIF&(g_tSciColorsAndFonts.UseAlwaysDefaultFontSize,_
                  g_tSciColorsAndFonts.DefaultFontSize, g_tSciColorsAndFonts.StringFontSize)

         SciMsg pSci, %SCI_STYLESETBACK, %SCE_B_STRING, IIF&(g_tSciColorsAndFonts.UseAlwaysDefaultBackColor,_
                  g_tSciColorsAndFonts.DefaultBackColor, g_tSciColorsAndFonts.StringBackColor)

         ' Set the lexer

If there's any interest, I can upload a SED 2.03 executable containing code enhancements such as
smoother splitting, enhanced text display, total use of direct calls, etc...

Offline Theo Gottwald

  • Administrator
  • Hero Member
  • *****
  • Posts: 924
  • User-Rate: +30/-4
    • it-berater
Re: Error in CSED 1.03 Source File CSED.BAS
« Reply #6 on: December 04, 2014, 11:53:51 AM »
Of course there is interest. A friend of mine told me that he had the problem that the background of the Sctintilla was blinking with the cursor on Win 8.1.
I could not see this in my own tests. Do you have an idea where it could come from?
I don't even understand how i could make the background blink with the cursor :-).
« Last Edit: December 04, 2014, 12:06:40 PM by Theo Gottwald »

Offline Nick Melnick

  • Newbie
  • *
  • Posts: 14
  • User-Rate: +1/-2
Re: Error in CSED 1.03 Source File CSED.BAS
« Reply #7 on: December 04, 2014, 03:51:17 PM »
Theo, that goes on my list of the strangest things I've heard of.
I assume you have Win8 and it works OK for you. First thing that comes
to mind, is that your friend desperately needs a video driver update.

Attached, is the modified SED 2.03 executable. Back up your original exe guys.

Offline Nick Melnick

  • Newbie
  • *
  • Posts: 14
  • User-Rate: +1/-2
Re: Error in CSED 1.03 Source File CSED.BAS
« Reply #8 on: December 08, 2014, 06:09:49 PM »
[EDIT] Fixed options bug
Thought I'd mention that <ctrl+space>  will switch the focus between open split views.
This happens automatically when a window is split.
« Last Edit: February 06, 2015, 03:46:37 PM by Nick Melnick »