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

C / C++ / MFC

 
GeneralRe: request:using vc++ to write a program on clock Pin
David Crow4-Jun-05 5:50
David Crow4-Jun-05 5:50 
GeneralRe: request:using vc++ to write a program on clock Pin
Trollslayer3-Jun-05 21:11
mentorTrollslayer3-Jun-05 21:11 
GeneralRe: request:using vc++ to write a program on clock Pin
ThatsAlok3-Jun-05 22:33
ThatsAlok3-Jun-05 22:33 
GeneralRe: request:using vc++ to write a program on clock Pin
ThatsAlok4-Jun-05 1:56
ThatsAlok4-Jun-05 1:56 
GeneralRe: request:using vc++ to write a program on clock Pin
Tom Archer4-Jun-05 4:27
Tom Archer4-Jun-05 4:27 
GeneralAccessing interfaces without directx Pin
elvis89003-Jun-05 13:32
elvis89003-Jun-05 13:32 
GeneralRe: Accessing interfaces without directx Pin
Trollslayer3-Jun-05 21:13
mentorTrollslayer3-Jun-05 21:13 
GeneralCScrollView sizing oddity Pin
bitznarf3-Jun-05 13:04
bitznarf3-Jun-05 13:04 
Im outputing some simple text to a view using CScrollView and i encountered something that I found to be very odd. When I use this code control the size of the scrollbars it cuts off some of the text.

CRAWConversionScrollDoc* pDoc = GetDocument();<br />
	ASSERT_VALID(pDoc);<br />
<br />
	CRect rTextSize;<br />
	rTextSize.SetRect( 0, 0, 800, 1200 ); //this seems only to matter if i make the width to small, increasing it makes no differance<br />
	this->GetDC()->DrawText( *(pDoc->GetConvertedData()), &rTextSize, DT_LEFT | DT_EXPANDTABS | DT_CALCRECT );<br />
<br />
	CSize sizeTotal;<br />
	sizeTotal.cx = rTextSize.Width();<br />
	sizeTotal.cy = rTextSize.Height();	<br />
	CScrollView::SetScrollSizes(MM_TEXT, sizeTotal);


however when I modify the code to proportionaly resize the scrollbars like so it works just fine

CRAWConversionScrollDoc* pDoc = GetDocument();<br />
	ASSERT_VALID(pDoc);<br />
<br />
	CRect rTextSize;<br />
	rTextSize.SetRect( 0, 0, 800, 1200 );          //this seems only to matter if i make the width to small, increasing it makes no differance<br />
	this->GetDC()->DrawText( *(pDoc->GetConvertedData()), &rTextSize, DT_LEFT | DT_EXPANDTABS | DT_CALCRECT );<br />
<br />
	CSize sizeTotal;<br />
	sizeTotal.cx = rTextSize.Width() + ((double)rTextSize.Width()/1.6);<br />
	sizeTotal.cy = rTextSize.Height() + (rTextSize.Height()/8);<br />
	<br />
	CScrollView::SetScrollSizes(MM_TEXT, sizeTotal)<code><br />
<br />
What im wondering is the reason for this behavior.  With the modified code my text comes out properly regrardless of how much text there is be it 1 page or 50+ pages.<br />
<br />
Any help with this would be appreciated<br />
-thx

GeneralRe: CScrollView sizing oddity Pin
Jack Puppy3-Jun-05 14:59
Jack Puppy3-Jun-05 14:59 
GeneralRe: CScrollView sizing oddity Pin
bitznarf4-Jun-05 14:03
bitznarf4-Jun-05 14:03 
GeneralStack Overflow on Edit Box Pin
Grahamfff3-Jun-05 11:07
Grahamfff3-Jun-05 11:07 
GeneralRe: Stack Overflow on Edit Box Pin
Blake Miller3-Jun-05 11:11
Blake Miller3-Jun-05 11:11 
GeneralRe: Stack Overflow on Edit Box Pin
Gary R. Wheeler4-Jun-05 3:21
Gary R. Wheeler4-Jun-05 3:21 
GeneralRe: Stack Overflow on Edit Box Pin
Gary R. Wheeler4-Jun-05 3:36
Gary R. Wheeler4-Jun-05 3:36 
GeneralRe: Stack Overflow on Edit Box Pin
Grahamfff4-Jun-05 8:24
Grahamfff4-Jun-05 8:24 
QuestionGetting a window that uses directdraw? Pin
Programmer_4_L1f33-Jun-05 11:07
Programmer_4_L1f33-Jun-05 11:07 
AnswerRe: Getting a window that uses directdraw? Pin
Azrael.LingChen3-Jun-05 20:23
Azrael.LingChen3-Jun-05 20:23 
GeneralGraying Out Tabs in a Property Page Pin
laiju3-Jun-05 10:38
laiju3-Jun-05 10:38 
GeneralRe: Graying Out Tabs in a Property Page Pin
David Crow3-Jun-05 11:03
David Crow3-Jun-05 11:03 
GeneralNeed help resolving a deadlock Pin
Budric B.3-Jun-05 10:19
Budric B.3-Jun-05 10:19 
GeneralRe: Just found the problem Pin
Budric B.3-Jun-05 11:02
Budric B.3-Jun-05 11:02 
GeneralRe: Just found the problem Pin
Blake Miller3-Jun-05 11:08
Blake Miller3-Jun-05 11:08 
GeneralA question about CBT hook Pin
Gaetano Sferra3-Jun-05 9:10
Gaetano Sferra3-Jun-05 9:10 
GeneralRe: A question about CBT hook Pin
Nilesh K.5-Jun-05 23:32
Nilesh K.5-Jun-05 23:32 
GeneralRe: A question about CBT hook Pin
Gaetano Sferra6-Jun-05 0:44
Gaetano Sferra6-Jun-05 0:44 

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.