Click here to Skip to main content
16,005,826 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: maximum length of a CString object Pin
Kastellanos Nikos5-Jun-01 2:49
Kastellanos Nikos5-Jun-01 2:49 
GeneralRe: maximum length of a CString object Pin
Tomasz Sowinski5-Jun-01 2:55
Tomasz Sowinski5-Jun-01 2:55 
GeneralUsenet Pin
5-Jun-01 2:05
suss5-Jun-01 2:05 
GeneralRe: Usenet Pin
Anders Molin5-Jun-01 6:00
professionalAnders Molin5-Jun-01 6:00 
GeneralRe: Usenet Pin
5-Jun-01 6:20
suss5-Jun-01 6:20 
GeneralCScrollView Pin
5-Jun-01 0:32
suss5-Jun-01 0:32 
GeneralRe: CScrollView Pin
Tomasz Sowinski5-Jun-01 0:44
Tomasz Sowinski5-Jun-01 0:44 
GeneralRe: CScrollView Pin
5-Jun-01 1:38
suss5-Jun-01 1:38 
My OnDraw is this:
void CFormulaEditorView::OnDraw(CDC* pDC)
{
CFormulaEditorDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);

CFont font;
LOGFONT lf;
memset(&lf, 0, sizeof(LOGFONT));
lf.lfHeight = 20;
lf.lfCharSet = 2;
strcpy(lf.lfFaceName, "Times New Roman");
VERIFY(font.CreateFontIndirect(&lf));
CClientDC dc(this);
CFont* def_font = dc.SelectObject(&font);

UINT l = lf.lfHeight;
for (int i=0; i<=pDoc->Formulas.GetUpperBound(); i++)
{
dc.TextOut(0, 110*i+110/2-l, pDoc->Formulas[i]);
}

/////////////////////////////////////////////////////
// Done with the font. Delete the font object.
dc.SelectObject(def_font);
font.DeleteObject();
}

I suppose the problem is in
for (int i=0; i<=pDoc->Formulas.GetUpperBound(); i++)
{
dc.TextOut(0, 110*i+110/2-l, pDoc->Formulas[i]);
}
that it redraws this text on every scrolling event, but where else can I write this??
GeneralRe: CScrollView Pin
Tomasz Sowinski5-Jun-01 1:48
Tomasz Sowinski5-Jun-01 1:48 
GeneralRe: CScrollView Pin
5-Jun-01 4:25
suss5-Jun-01 4:25 
GeneralA problem with CScrollView Pin
4-Jun-01 23:19
suss4-Jun-01 23:19 
GeneralDisconnected Recordset Pin
yamini4-Jun-01 18:38
yamini4-Jun-01 18:38 
QuestionHow to use CToolBar and CStatusBar in Dialog-based application? Pin
4-Jun-01 17:53
suss4-Jun-01 17:53 
AnswerRe: How to use CToolBar and CStatusBar in Dialog-based application? Pin
Tomasz Sowinski5-Jun-01 0:32
Tomasz Sowinski5-Jun-01 0:32 
GeneralThanks Pin
5-Jun-01 3:50
suss5-Jun-01 3:50 
QuestionHow to make STL work in Vc++ 6.0 ? Pin
4-Jun-01 16:51
suss4-Jun-01 16:51 
AnswerRe: How to make STL work in Vc++ 6.0 ? Pin
Gerald Schwab4-Jun-01 17:02
Gerald Schwab4-Jun-01 17:02 
AnswerRe: How to make STL work in Vc++ 6.0 ? Pin
4-Jun-01 20:52
suss4-Jun-01 20:52 
AnswerRe: How to make STL work in Vc++ 6.0 ? Pin
4-Jun-01 22:36
suss4-Jun-01 22:36 
AnswerRe: How to make STL work in Vc++ 6.0 ? Pin
Mukkie5-Jun-01 6:44
Mukkie5-Jun-01 6:44 
AnswerSTL bug fixes for VC++ Pin
Jonathan Gilligan5-Jun-01 8:05
Jonathan Gilligan5-Jun-01 8:05 
GeneralCComboBox::CompareItem Pin
C Weykopf4-Jun-01 10:40
C Weykopf4-Jun-01 10:40 
GeneralRe: CComboBox::CompareItem Pin
Tomasz Sowinski5-Jun-01 0:40
Tomasz Sowinski5-Jun-01 0:40 
GeneralRe: CComboBox::CompareItem Pin
C Weykopf5-Jun-01 3:29
C Weykopf5-Jun-01 3:29 
GeneralRe: CComboBox::CompareItem Pin
Tomasz Sowinski5-Jun-01 4:04
Tomasz Sowinski5-Jun-01 4:04 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.