Thanks for the quick response. the parameter of num_lines *
text_height > control_height is a boolean - perhaps I should have
parenthesised for clarity as "(num_lines * text_height) >
control_height". That seems to work as expected.
Yes, I got this from the documentation, but it doesn't work as
expected for me (I don't know if it's relevant, but I'm using
QScintilla2). With a call to SCI_SETSCROLLWIDTH with a value of 1, the
horizontal scrollbar is still shown! I did a call to
SCI_GETSCROLLWIDTH to make sure that the value had indeed been set
correctly, and it had. The same happens with other small values of the
scroll width, e.g. 8, 16, 24. To get the horizontal scroll bar to
disappear when it's not needed, I had to do the following after the
SCI_SETSCROLLWIDTH call:
1. Get the left margin width, say as mw.
2. If vertical scroll bar is showing, do mw += the vertical scroll bar
width.
3. If the scroll width passed with SCI_SETSCROLLWIDTH is greater than
(the control's width - mw), show the
horizontal scroll bar, else hide it, using SCI_SETHSCROLLBAR.
This is what prompted me to ask about how to get the vertical scroll
bar width. I know how to get the scrollbar width when using Qt, but I
wasn't sure if there was a cross-platform way (i.e. Scintilla API) to
do it.
Perhaps it's a QScintilla bug which requires the above steps to be
taken - I've not yet had a chance to try it with a bare Scintilla
control.
Regards,
Vinay Sajip