Solved

view,messages and events

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Running shell command from Access 3 68
List out all word 7 255
SQUD PROXY SERVER, UNIX, SLL/HTTPS 5 72
x-bar in Google Sheets 2 24
Introduction: Displaying information on the statusbar.   Continuing from the third article about sudoku.   Open the project in visual studio. Status bar – let’s display the timestamp there.  We need to get the timestamp from the document s…
Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
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.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

929 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

9 Experts available now in Live!

Get 1:1 Help Now