Bugs item #1665799, was opened at 2007-02-21 20:09
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=102439&aid=1665799&group_id=2439

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Scintilla
Group: Bug
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Mike Roberts (mjroberts)
Assigned to: Nobody/Anonymous (nobody)
Summary: SCI_SETSELBACK(FALSE) makes selection invisible

Initial Comment:
SCI_SETSELBACK(FALSE) is documented as restoring Scintilla's default selection 
color settings, but it doesn't actually do this - it instead just hides the 
selection permanently.

I think the problem is in scintilla/src/Editor.cxx, in Editor::WndProc(), at 
'case SCI_SETSELBACK', around line 6927.  The code there currently sets 
vs.selbackset to the wParam.  This seems reasonable at first glance, since it's 
parallel to what SCI_SETSELFORE does, but from other uses in the code it 
appears that vs.selbackset actually has a rather different meaning - in 
particular, it looks like this member really means that you should draw or not 
draw the selection in a separate background color *at all*.  For example, the 
'Print' code uses it to hide the selection range during printing; and 
Editor::TextBackground() returns the selection color only if this member is set.

My tentative fix is to replace the current first two lines of 'case 
SCI_SETSELBACK' in Editor::WndProc with the following:

vs.selbackground.desired =
  (wParam ? ColourDesired(lParam)
   : ColourDesired(0xc0, 0xc0, 0xc0));

This has the documented effect, although it's not ideal in that it hard-codes 
#c0c0c0 as the background color.  This same value is hard-coded in 
ViewStyle::Init() in scintilla/src/ViewStyle.cxx, so I didn't see a better 
solution within the context of the current code.


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=102439&aid=1665799&group_id=2439
_______________________________________________
Scintilla-interest mailing list
[email protected]
http://mailman.lyra.org/mailman/listinfo/scintilla-interest

Reply via email to