Hi,
I have added a scroll bar to one of the splitter windows in my application. I see the scroll bar but it wount move.
Here is the initialisation
void CTableView::OnInitialUpdate()
{
CView::OnInitialUpdate();
// TODO: Add your specialized code here and/or call the base class
CSize sizeTotal;
// TODO: calculate the total size of this view
sizeTotal.cx = 180;
sizeTotal.cy = 1000;
SetScrollSizes(MM_TEXT, sizeTotal);
}
The OnDraw function looks like this,
void CTableView::OnDraw(CDC* pDC)
{
CGsdoc_b1Doc* pDoc = GetDocument();
// TODO: add draw code here
RECT rct;
int textY = 0;
int textX1 = 0;
int textX2 = 0;
int i = 0, j = 0;
short tmpVal = 0, decimal = 0, integer = 0;
unsigned char lsbVal = 0, msbVal = 0;
float floatVal = 0;
CString strTemp;
int numTempVal = 0;
int minute = 0;
int hour = 0;
CString strTime;
ASSERT_VALID(pDoc);
CPen blackPen;
blackPen.CreatePen(PS_SOLID,1,RGB(0,0,0));
CPen* pBlackOldPen = pDC->SelectObject(&blackPen); //Select aPen as pen
if(pDoc->GetGraphComplete())
{
textX1 = 25;
textX2 = 110;
textY = 32;
rct.left = 20;
rct.top = 30;
rct.right = 190;
rct.bottom = 50;
pDC->Rectangle(&rct);
pDC->TextOut(textX1, textY,"Tid");
pDC->TextOut(textX2, textY,"Temperatur");
numTempVal = (pDoc->m_FileSize-5)/2;
for(i=0; i<numTempVal; i++)
{
rct.top = rct.bottom;
rct.bottom = rct.bottom + 20;
textY = textY + 20;
lsbVal = pDoc->m_FileBuffer[j];
j++;
msbVal = pDoc->m_FileBuffer[j];
j++;
tmpVal = msbVal << 8; //store and shift up MSB of data value
tmpVal = tmpVal | lsbVal; //concatenate MSB and LSB
integer = tmpVal / 10;
decimal = tmpVal % 10;
floatVal = decimal*0.1;
floatVal = integer + floatVal;
integer = floatVal;
strTemp.Format("%d", integer);
minute = pDoc->m_Minute + i;
hour = pDoc->m_Hour;
if (minute >= 60)
{
hour++;
minute = minute-60;
}
if(hour >= 24)
{
hour = hour-24;
}
strTime.Format("%d%s%d", hour, ":", minute);
pDC->Rectangle(&rct);
pDC->TextOut(textX1,textY, strTime);
pDC->TextOut(textX2, textY, strTemp);
}
pDC->MoveTo(105,30);
pDC->LineTo(105,rct.bottom);
}
}
Happy for any help.
