Solved

view,messages and events

Posted on 1998-12-02
4
182 Views
Last Modified: 2013-11-20
I have a dialog box that consists of two check boxes.I am calling my dialog box in a function named DRAWLINE.In this
function if one of the check boxes in the dialog box is checked then I ask for the coordinates to draw a line. this part is working.however if the other check box is checked then "OnLbuttonDown" function should get enabled.how can i
make it possible?.both functions ie.. drawline and onlbuttondown belong to the same view.
    Until this dialog box is called the view should not get enabled.how to make it possible?
0
Comment
Question by:manjunath_k_v
  • 2
4 Comments
 
LVL 4

Expert Comment

by:pagladasu
ID: 1325695
I would like you to clarify a few points:
DrawLine() is a member function of your view class. In this function you call the DoModal() function to display the dialog box. Here there are two check boxes. After your dialog box closes, in your DrawLine() function you somehow test the state of the check boxes and make calls to appropriate functions.
Are you trying to do this or trying to call the OnLbuttonDown() from the dialog box. Secondly what exactly do you mean by 'Until this dialog box is called the view should not get enabled' . Please clarify.

thanks
pagladasu
0
 

Author Comment

by:manjunath_k_v
ID: 1325696
  my view consists of the following functions. OnLButtonDown,OnMouseMove,OnLButtonUp and drawline. The first three corresponds to the message maps regarding mousemove.
In drawline i am calling dialogbox.
my dialog box has two check buttons named yes and no.i call this dialog box thru domodal()in the function drawline. if checkbox "yes" is checked I ask for the coordinates for the line.if checkbox "no" is checked then I must be able to draw the line in the view just by clicking the leftmousebutton and dragging the mouse.
my problem is i dont know how to connect my mouse movement with the dialog box called in drawline. Right now i am able to draw the line just by clicking the mouse an dragging.This i want to avoid.This is what i meant by saying my view should not get activated.
        I must be able to draw the line only after passing thru the dialogbox.
PLEASE HELP.
   
0
 
LVL 4

Expert Comment

by:pagladasu
ID: 1325697
You see, the view must receive input focus for the drawing. In order to do so, you can close the dialog box the appropriate check box is checked.

0
 
LVL 3

Accepted Solution

by:
plaroche earned 50 total points
ID: 1325698
Keep a member variable named m_bFreeHand in your view and check it in the button down handler.  
If it's TRUE then enable the user to draw the line, if not just call the base class and return.
Check that variable in your handlers to enable their functionality.
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this article, I'll describe -- and show pictures of -- some of the significant additions that have been made available to programmers in the MFC Feature Pack for Visual C++ 2008.  These same feature are in the MFC libraries that come with Visual …
Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

792 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question