コード例 #1
0
ファイル: ScintillaWnd.cpp プロジェクト: ohzooboy/oh
/////////////////////////////////////
// @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;
}
コード例 #2
0
ファイル: clc_api.cpp プロジェクト: fre2003/l3220
// 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;
}