Click here to Skip to main content
15,915,319 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
AnswerRe: Class x needs defining before class y, circular dependecy Pin
led mike1-Nov-06 11:54
led mike1-Nov-06 11:54 
GeneralRe: Class x needs defining before class y, circular dependecy Pin
Ylis1-Nov-06 12:12
Ylis1-Nov-06 12:12 
GeneralRe: Class x needs defining before class y, circular dependecy Pin
Waldermort1-Nov-06 13:54
Waldermort1-Nov-06 13:54 
GeneralRe: Class x needs defining before class y, circular dependecy Pin
led mike2-Nov-06 4:58
led mike2-Nov-06 4:58 
QuestionWindow messages [modified] Pin
Waldermort1-Nov-06 9:58
Waldermort1-Nov-06 9:58 
AnswerRe: Window messages Pin
PJ Arends1-Nov-06 19:22
professionalPJ Arends1-Nov-06 19:22 
AnswerRe: Window messages Pin
Michael Dunn1-Nov-06 20:09
sitebuilderMichael Dunn1-Nov-06 20:09 
Questionall Slider objects are sending OnHScroll() msg Pin
aquawicket1-Nov-06 9:46
aquawicket1-Nov-06 9:46 
Hi..

I've got a dialog window with horizontal and vertical scroll bars to move the window... That all works fine.. The only problem is I have some slider controlls inside the window that move it too.. and that isn't wanted..

I'm thinkin any time I move one of my slider objects.. it sends a message to OnHScroll(); or OnVScroll(); depending.
I only want the window scroll bars to send the message. Not the dialog slider objects





void CEdrumMonDlg::OnSize(UINT nType, int cx, int cy) //Creates the window scroll bars if the window size is changed
{
CDialog::OnSize(nType, cx, cy);

m_nCurHeight = cy;
m_nCurWidth = cx;
int nScrollMax;
int nScrollMax2;
if (cy < m_rect.Height())
{
nScrollMax = m_rect.Height() - cy;
}
else
nScrollMax = 0;
if (cx < m_rect.Width())
{
nScrollMax2 = m_rect.Width() - cx;
}
else
nScrollMax2 = 0;

SCROLLINFO si;
si.cbSize = sizeof(SCROLLINFO);
si.fMask = SIF_ALL; // SIF_ALL = SIF_PAGE | SIF_RANGE | SIF_POS;
si.nMin = 0;
si.nMax = nScrollMax;
si.nPage = si.nMax/10;
si.nPos = 0;
SetScrollInfo(SB_VERT, &si, TRUE);
SetScrollPos(SB_VERT,m_nScrollPos,TRUE);

SCROLLINFO si2;
si2.cbSize = sizeof(SCROLLINFO);
si2.fMask = SIF_ALL; // SIF_ALL = SIF_PAGE | SIF_RANGE | SIF_POS;
si2.nMin = 0;
si2.nMax = nScrollMax2;
si2.nPage = si2.nMax/10;
si2.nPos = 0;
SetScrollInfo(SB_HORZ, &si2, TRUE);
SetScrollPos(SB_HORZ, m_nScrollPos2,TRUE);
}



void CEdrumMonDlg::OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar)
{

int nDelta;
int nMaxPos = m_rect.Height() - m_nCurHeight;

switch (nSBCode)
{
case SB_LINEDOWN:
if (m_nScrollPos >= nMaxPos)
return;
nDelta = min(nMaxPos/100,nMaxPos-m_nScrollPos);
break;

case SB_LINEUP:
if (m_nScrollPos <= 0)
return;
nDelta = -min(nMaxPos/100,m_nScrollPos);
break;

case SB_PAGEDOWN:
if (m_nScrollPos >= nMaxPos)
return;
nDelta = min(nMaxPos/10,nMaxPos-m_nScrollPos);
break;

case SB_THUMBPOSITION:
nDelta = (int)nPos - m_nScrollPos;
break;

case SB_PAGEUP:
if (m_nScrollPos <= 0)
return;
nDelta = -min(nMaxPos/10,m_nScrollPos);
break;

default:
return;
}
m_nScrollPos += nDelta;
SetScrollPos(SB_VERT,m_nScrollPos,TRUE);
ScrollWindow(0,-nDelta);
CDialog::OnVScroll(nSBCode, nPos, pScrollBar);
}




void CEdrumMonDlg::OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar) //pretty much same as OnVScroll
AnswerRe: all Slider objects are sending OnHScroll() msg Pin
Mark Salsbery1-Nov-06 10:03
Mark Salsbery1-Nov-06 10:03 
GeneralRe: all Slider objects are sending OnHScroll() msg Pin
aquawicket1-Nov-06 14:49
aquawicket1-Nov-06 14:49 
QuestionMFC - creating invisible window Pin
edvintas1-Nov-06 6:58
edvintas1-Nov-06 6:58 
AnswerRe: MFC - creating invisible window Pin
led mike1-Nov-06 6:59
led mike1-Nov-06 6:59 
GeneralRe: MFC - creating invisible window Pin
edvintas1-Nov-06 7:53
edvintas1-Nov-06 7:53 
AnswerRe: MFC - creating invisible window Pin
Mark Salsbery1-Nov-06 7:15
Mark Salsbery1-Nov-06 7:15 
AnswerRe: MFC - creating invisible window Pin
David Crow1-Nov-06 7:21
David Crow1-Nov-06 7:21 
QuestionRe: MFC - creating invisible window Pin
Chris Meech1-Nov-06 7:26
Chris Meech1-Nov-06 7:26 
AnswerRe: MFC - creating invisible window Pin
edvintas1-Nov-06 7:48
edvintas1-Nov-06 7:48 
GeneralRe: MFC - creating invisible window Pin
led mike1-Nov-06 8:06
led mike1-Nov-06 8:06 
QuestionRe: MFC - creating invisible window Pin
Chris Meech1-Nov-06 8:28
Chris Meech1-Nov-06 8:28 
AnswerRe: MFC - creating invisible window Pin
edvintas1-Nov-06 8:47
edvintas1-Nov-06 8:47 
GeneralRe: MFC - creating invisible window Pin
Mark Salsbery1-Nov-06 9:47
Mark Salsbery1-Nov-06 9:47 
QuestionRelease, Debug, Doc/view and message Pin
how jack1-Nov-06 6:43
how jack1-Nov-06 6:43 
AnswerRe: Release, Debug, Doc/view and message Pin
David Crow1-Nov-06 7:17
David Crow1-Nov-06 7:17 
GeneralRe: Release, Debug, Doc/view and message Pin
Reagan Conservative1-Nov-06 8:23
Reagan Conservative1-Nov-06 8:23 
QuestionRe: Release, Debug, Doc/view and message Pin
David Crow1-Nov-06 8:32
David Crow1-Nov-06 8:32 

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.