Click here to Skip to main content
15,895,667 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralSetup Project Pin
Galen_225-Jan-05 5:42
Galen_225-Jan-05 5:42 
GeneralRe: Setup Project Pin
rwestgraham25-Jan-05 23:24
rwestgraham25-Jan-05 23:24 
GeneralMFC and web-site Pin
includeh1025-Jan-05 5:14
includeh1025-Jan-05 5:14 
GeneralRe: MFC and web-site Pin
Tom Wright25-Jan-05 5:37
Tom Wright25-Jan-05 5:37 
GeneralSave/Restore appearance scheme Pin
Member 166110225-Jan-05 4:49
Member 166110225-Jan-05 4:49 
GeneralRe: Save/Restore appearance scheme Pin
David Crow26-Jan-05 3:43
David Crow26-Jan-05 3:43 
Questioninf file??? Pin
charleslau285525-Jan-05 4:40
charleslau285525-Jan-05 4:40 
GeneralDrawDragRect Pin
poiut25-Jan-05 4:17
poiut25-Jan-05 4:17 
What would cause DrawDragRect to draw black square?

It's suppose to disappear if you draw over the same square twice but some how I am getting black square and I don't know what's causing it. I am using pretty much the same code I used for OnMouseMove(which works fine), the only difference is I changed how deltaPt behave.

dc.DrawDragRect(pLink->GetRc(moving[1]-1)-ScrollClip, bdry, pLink->GetRc(moving[1]-1)-ScrollClip, bdry, NULL, NULL);
Would cause no square to be drawn

dc.DrawDragRect(pLink->GetRc(moving[1]-1)-ScrollClip, bdry, pLink->GetRcLast(moving[1]-1)-ScrollClip-deltaPt, bdry, NULL, NULL);
Would cause a delay on clearing up. Show two square when I scroll down.

In both cases I would suspect my code would work. I am out of ideas what else to test for.Sigh | :sigh:



Here is my code
BOOL CEditView::OnMouseWheel(UINT nFlags, short zDelta, CPoint pt){
CClientDC dc(this);
CPoint deltaPt = CPoint(0,0);
POSITION pos = 0;
CEditDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
CObList& LinkList = pDoc->GetLinkList();
CPoint ScrollClip;
int MaxScroll;

ScrollClip = GetScrollPosition();
MaxScroll = GetScrollLimit(SB_VERT);

if(zDelta < 0 && (ScrollClip.y < MaxScroll)) {
deltaPt = CPoint(0, 63);
} else if (zDelta > 0 && ScrollClip.y > 0) {
deltaPt = CPoint(0, -63);
} else {
deltaPt = CPoint(0, 0);
}
CString test;
if(moving[1]){
pos=LinkList.FindIndex(moving[0]-1);
CLink* pLink = (CLink*) LinkList.GetAt(pos);
pLink->OffsetRc(moving[1]-1, deltaPt);
dc.DrawDragRect(pLink->GetRc(moving[1]-1)-ScrollClip, bdry, pLink->GetRcLast(moving[1]-1)-ScrollClip, bdry, NULL, NULL);
pLink->EqualRc(moving[1]-1);
}

return CScrollView::OnMouseWheel(nFlags, zDelta, pt);
}
QuestionDLL -basic and AFX_MANAGE_STATE macro ??? Pin
GDavy25-Jan-05 2:51
GDavy25-Jan-05 2:51 
AnswerRe: DLL -basic and AFX_MANAGE_STATE macro ??? Pin
David Crow25-Jan-05 3:26
David Crow25-Jan-05 3:26 
GeneralCallback Function VC++ --&gt; VB Pin
racing5725-Jan-05 2:03
racing5725-Jan-05 2:03 
Generalsending data from VC++ to Excel Sheet Pin
neelima_1525-Jan-05 0:12
neelima_1525-Jan-05 0:12 
GeneralRe: sending data from VC++ to Excel Sheet Pin
David Crow25-Jan-05 2:29
David Crow25-Jan-05 2:29 
Questionhow to display integers Pin
doneirik24-Jan-05 23:29
doneirik24-Jan-05 23:29 
AnswerRe: how to display integers Pin
Chris Losinger25-Jan-05 4:36
professionalChris Losinger25-Jan-05 4:36 
GeneralLinker error - looks like message map not getting exported from an extension DLL Pin
Nish Nishant24-Jan-05 22:28
sitebuilderNish Nishant24-Jan-05 22:28 
GeneralRe: Linker error - looks like message map not getting exported from an extension DLL Pin
22491724-Jan-05 23:30
22491724-Jan-05 23:30 
Generalmake AddIn to Visual Studio .net Pin
JabraJabra24-Jan-05 21:46
JabraJabra24-Jan-05 21:46 
Generalstd::out_of_range Pin
Anonymous24-Jan-05 19:38
Anonymous24-Jan-05 19:38 
GeneralRe: std::out_of_range Pin
Christian Graus24-Jan-05 20:06
protectorChristian Graus24-Jan-05 20:06 
GeneralRe: std::out_of_range Pin
markkuk25-Jan-05 2:08
markkuk25-Jan-05 2:08 
QuestionHow to disable minimized, maximized and restore button of my window? Pin
Anonymous24-Jan-05 18:12
Anonymous24-Jan-05 18:12 
AnswerRe: How to disable minimized, maximized and restore button of my window? Pin
toxcct24-Jan-05 21:25
toxcct24-Jan-05 21:25 
AnswerRe: How to disable minimized, maximized and restore button of my window? Pin
Cedric Moonen24-Jan-05 22:55
Cedric Moonen24-Jan-05 22:55 
GeneralExtract text from Ms -office documents Pin
mjvalan24-Jan-05 17:48
mjvalan24-Jan-05 17:48 

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.