Solved

view,messages and events

Posted on 1998-12-02
4
172 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

What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

Join & Write a Comment

Here is how to use MFC's automatic Radio Button handling in your dialog boxes and forms.  Beginner programmers usually start with a OnClick handler for each radio button and that's just not the right way to go.  MFC has a very cool system for handli‚Ķ
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
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.
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

758 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

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now