Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

TStatic needs MouseEvents

Posted on 1997-05-03
6
Medium Priority
?
293 Views
Last Modified: 2012-05-04
Hi guys,

I have a little problem using OWL 5.0
I use a recource with an static-frame. In this static-frame I draw a picture. In the code I use a TDialog for the dialog and a TStatic for the static-frame. This works OK.

I want the static to have MouseInput, But it just can't get the TStatic to respond to MouseEvents. I guess the problem is that the static doesn't get input-focus.

In fact I want to create a child-window in a dialog from recource-data (with etched border), so that I can use TClientDC etc for the drawing. The user must be able to  click on the drawing (for selection). TStatic does the
job, except for the MouseInput

So my question is: How to get TStatic to accept MouseEvents?

.Luc.
0
Comment
Question by:LucHoltkamp
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
6 Comments
 
LVL 4

Accepted Solution

by:
md041797 earned 160 total points
ID: 1163234
Derive a new class from TStatic.
In your dialog give the frame an id other than -1.
Check the notify parent box.
Use a response table entry for your mouse event.
Make sure you call SetupWindow for TStaic if you override this member.
0
 
LVL 3

Author Comment

by:LucHoltkamp
ID: 1163235
The 'parent-notify' was the missing link. I do not understand the logic of it though. It's a frame-flag and according to the help it means that the frame sends it parent (The TStatic?) messages (STN_CLICKED, etc..) when it is clicked. It says nothing about enabling mouseevents.
Could you tell me more about it??
0
 
LVL 4

Expert Comment

by:md041797
ID: 1163236
It forces the static control to send STN_ENABLE to the dialog box.
0
Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 3

Author Comment

by:LucHoltkamp
ID: 1163237
What is the connection between STN_ENABLE messages and mouse-events? STN_ENABLE isn't even used by OWL (as far as I know) so I assume it's Windows Internal. Also: the STN_ENABLE is send to the dialog. How can the dialog affect the TStatic to accept mouse-events. Whats the mechanism behind all this? Can you enlighten me? Thanks,
.Luc.
0
 
LVL 4

Expert Comment

by:md041797
ID: 1163238
I got it backwards.
The dialog box sends STN_ENABLE to the static control on initialization. If the static control has the SS_NOTIFY sytle set, it will start accepting mouse and keyboard input after recieving this message.  This is similar to the regular WM_ENABLE message, but its new to Win95 and specific to a static control.


0
 
LVL 3

Author Comment

by:LucHoltkamp
ID: 1163239
Thanks, its more clear to me now.
.Luc.
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Introduction This article is the first in a series of articles about the C/C++ Visual Studio Express debugger.  It provides a quick start guide in using the debugger. Part 2 focuses on additional topics in breakpoints.  Lastly, Part 3 focuses on th…
IntroductionThis article is the second in a three part article series on the Visual Studio 2008 Debugger.  It provides tips in setting and using breakpoints. If not familiar with this debugger, you can find a basic introduction in the EE article loc…
The viewer will be introduced to the technique of using vectors in C++. The video will cover how to define a vector, store values in the vector and retrieve data from the values stored in the vector.
The viewer will be introduced to the member functions push_back and pop_back of the vector class. The video will teach the difference between the two as well as how to use each one along with its functionality.
Suggested Courses

715 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