Ejemplo n.º 1
0
/////////////////////////////////////
// @mfunc Calculate a reasonable width for Linenumberdisplay
// @rvalue int | number of pixels for the margin width of margin (0)
//
int CScintillaWnd::GetLinenumberWidth(void) {
    // get number of chars needed to display highest linenumber
    int nChars = GetLinenumberChars ()+1;
    // get width of character '9' in pixels
    LRESULT lWidth = SendMessage(SCI_TEXTWIDTH, STYLE_LINENUMBER, (ULONG_PTR)_T("9"));
    return nChars * lWidth;
}
Ejemplo n.º 2
0
// Calculate a reasonable width for Linenumberdisplay
// number of pixels for the margin width of margin (0) 
int CCmdCtl_i::GetLinenumberWidth ()
{
  // get number of chars needed to display highest linenumber
  int nChars = GetLinenumberChars ()+1;
  // get width of character '9' in pixels
  LRESULT lWidth = SendMessage(SCI_TEXTWIDTH, STYLE_LINENUMBER, (long)_T("9"));
  return nChars * lWidth;
}