Click here to Skip to main content
14,669,117 members
Home » Discussions » C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: SendMessage Function .... Pin
sach!!7-Aug-06 20:43
Membersach!!7-Aug-06 20:43 
GeneralRe: SendMessage Function .... Pin
Naren Neelamegam7-Aug-06 20:57
MemberNaren Neelamegam7-Aug-06 20:57 
GeneralRe: SendMessage Function .... Pin
sach!!7-Aug-06 21:07
Membersach!!7-Aug-06 21:07 
GeneralRe: SendMessage Function .... Pin
sach!!7-Aug-06 20:58
Membersach!!7-Aug-06 20:58 
GeneralRe: SendMessage Function .... Pin
Parthi_Appu8-Aug-06 0:51
MemberParthi_Appu8-Aug-06 0:51 
AnswerRe: SendMessage Function .... Pin
Hamid_RT7-Aug-06 21:21
MemberHamid_RT7-Aug-06 21:21 
GeneralRe: SendMessage Function .... Pin
sach!!7-Aug-06 21:31
Membersach!!7-Aug-06 21:31 
QuestionMoving Ellipse Problem [modified] Pin
uday kiran janaswamy7-Aug-06 20:08
Memberuday kiran janaswamy7-Aug-06 20:08 
hi all,

I have Created a an Ellipse/Circle in mouse move, But after creating the Circle/Ellipse in the View i am trying to Drag the Circle what i have created.

But before Dragging the Circle what i have created. I am not able to see the dragged circle from the point what i am dragging. the Dragging is starting from the slight different position.

here is the Code.

void CPaintingView::OnLButtonDown(UINT nFlags, CPoint point)
{
Anchor = point;
OldPoint = Anchor;

int nTime = GetDoubleClickTime();
SetTimer(1,nTime,0);

if((nFlags && MK_LBUTTON) && circleDrawn == false) // For First Time
{
CString strReadBuffer,strTokenizer;
int index = -1,ind=0;

for(int i =0; i < strCollect.GetSize(); i++)
{
strReadBuffer = strCollect.GetAt(i);
index = strReadBuffer.Find(",");
do
{
strTokenizer = strReadBuffer.Left(index);
strReadBuffer = strReadBuffer.Mid(index+1);
index = strReadBuffer.Find(",");
array[ind++]= atoi(strTokenizer.GetBuffer(0));
}while(index != -1);

if(index == -1) array[ind++] = atoi(strReadBuffer.GetBuffer(0));
array[ind++] = '\0';
ind =0;

CRgn rgn;
rgn.CreateEllipticRgn(array[0],array[1],array[2],array[3]);
if(rgn.PtInRegion(point)== TRUE) insidepoint = true;
}
}

CScrollView::OnLButtonDown(nFlags, point);
}

void CPaintingView::OnLButtonUp(UINT nFlags, CPoint point)
{
CClientDC dc(this);

DrawTo = point;
CPen one,*old;


if(bEllipseFlag && insidepoint == true)
{
dc.SetROP2(R2_NOT);
dc.SelectStockObject(NULL_BRUSH);
dc.SetBkMode(TRANSPARENT);
dc.Ellipse(array[0],array[1],array[2],array[3]);
}
else if(bEllipseFlag && insidepoint == false)
{
CRect rect;
GetClientRect(&rect);
ScreenToClient(&rect);
one.CreatePen(PS_DASH,1,RGB(200,100,50));
old = dc.SelectObject(&one);
SetCursor(AfxGetApp()->LoadCursor(IDC_CURSOR1));
dc.SelectStockObject(NULL_BRUSH);
dc.Ellipse(Anchor.x, Anchor.y, point.x, point.y);
dc.SelectObject(old);

CString strCordinates;
strCordinates.Format("%d,%d,%d,%d",Anchor.x,Anchor.y,point.x,point.y);
strCollect.Add(strCordinates);
}

CScrollView::OnLButtonUp(nFlags, point);
}

void CPaintingView::OnMouseMove(UINT nFlags, CPoint point)
{

CClientDC dc(this);
CPen one,*old;

if((insidepoint == true ) && (nFlags & MK_LBUTTON))
{
CRect rect;
GetClientRect(&rect);
ScreenToClient(&rect);
dc.SetROP2(R2_NOT);
one.CreatePen(PS_DASH,1,RGB(200,100,50));
old = dc.SelectObject(&one);
dc.SelectStockObject(NULL_BRUSH);
dc.Ellipse(OldPoint.x+ array[0],OldPoint.y+array[1],(point.x + array[2]),(point.y + array[3])); // Here the Position is not getting Correctly
dc.Ellipse(OldPoint.x+ array[0],OldPoint.y+array[1],(point.x + array[2]),(point.y + array[3])); //A slight Difference in Position I cant Understand why this happens. please help me out.
OldPoint = point;
dc.SelectObject(old);
showCordinates(point);
}

if((nFlags && MK_LBUTTON) && bEllipseFlag && circleDrawn == true)
{
SetCursor(AfxGetApp()->LoadCursor(IDC_CURSOR1));
dc.SetROP2(R2_NOT);
dc.SelectStockObject(NULL_BRUSH);
one.CreatePen(PS_DASH,1,RGB(200,100,50));
old = dc.SelectObject(&one);
dc.Ellipse(OldPoint.x, OldPoint.y, Anchor.x, Anchor.y);
dc.Ellipse(Anchor.x, Anchor.y, point.x, point.y);
OldPoint= point;
dc.SelectObject(old);
showCordinates(point);
}
CScrollView::OnMouseMove(nFlags, point);
}

// what shall i do for getting the Circle Dragged exacltly and at the Point where i have dragged.

please help me out.


Uday kiran


-- modified at 2:09 Tuesday 8th August, 2006
AnswerRe: Moving Ellipse Problem Pin
Hamid_RT7-Aug-06 21:44
MemberHamid_RT7-Aug-06 21:44 
GeneralRe: Moving Ellipse Problem Pin
uday kiran janaswamy7-Aug-06 23:16
Memberuday kiran janaswamy7-Aug-06 23:16 
GeneralRe: Moving Ellipse Problem Pin
Hamid_RT8-Aug-06 1:05
MemberHamid_RT8-Aug-06 1:05 
GeneralRe: Moving Ellipse Problem [modified] Pin
uday kiran janaswamy8-Aug-06 1:42
Memberuday kiran janaswamy8-Aug-06 1:42 
GeneralRe: Moving Ellipse Problem Pin
Hamid_RT8-Aug-06 4:37
MemberHamid_RT8-Aug-06 4:37 
QuestionHow to resize application acoording to system resolution set? Pin
jadhav1237-Aug-06 19:02
Memberjadhav1237-Aug-06 19:02 
AnswerRe: How to resize application acoording to system resolution set? Pin
mails2dhana7-Aug-06 19:33
Membermails2dhana7-Aug-06 19:33 
GeneralRe: How to resize application acoording to system resolution set? Pin
Naveen7-Aug-06 19:43
MemberNaveen7-Aug-06 19:43 
GeneralRe: How to resize application acoording to system resolution set? Pin
Hamid_RT7-Aug-06 20:34
MemberHamid_RT7-Aug-06 20:34 
AnswerRe: How to resize application acoording to system resolution set? Pin
Naren Neelamegam7-Aug-06 21:05
MemberNaren Neelamegam7-Aug-06 21:05 
QuestionDisable tab control Pin
see me7-Aug-06 17:50
Membersee me7-Aug-06 17:50 
AnswerRe: Disable tab control Pin
Naveen7-Aug-06 18:54
MemberNaveen7-Aug-06 18:54 
AnswerRe: Disable tab control Pin
Parthi_Appu7-Aug-06 19:20
MemberParthi_Appu7-Aug-06 19:20 
QuestionUser Process Memory Pin
Manish K. Agarwal7-Aug-06 17:39
MemberManish K. Agarwal7-Aug-06 17:39 
AnswerRe: User Process Memory Pin
Michael Dunn7-Aug-06 19:57
sitebuilderMichael Dunn7-Aug-06 19:57 
QuestionWinSock error with recv() function. Pin
Robert Palma Jr.7-Aug-06 16:35
MemberRobert Palma Jr.7-Aug-06 16:35 
AnswerRe: WinSock error with recv() function. Pin
Kiran Pinjala7-Aug-06 20:19
MemberKiran Pinjala7-Aug-06 20:19 

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.