Solved

TStatic needs MouseEvents

Posted on 1997-05-03
6
290 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
  • 3
  • 3
6 Comments
 
LVL 4

Accepted Solution

by:
md041797 earned 80 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
Active Directory Webinar

We all know we need to protect and secure our privileges, but where to start? Join Experts Exchange and ManageEngine on Tuesday, April 11, 2017 10:00 AM PDT to learn how to track and secure privileged users in Active Directory.

 
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

Free Tool: Postgres Monitoring System

A PHP and Perl based system to collect and display usage statistics from PostgreSQL databases.

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

Go is an acronym of golang, is a programming language developed Google in 2007. Go is a new language that is mostly in the C family, with significant input from Pascal/Modula/Oberon family. Hence Go arisen as low-level language with fast compilation…
Basic understanding on "OO- Object Orientation" is needed for designing a logical solution to solve a problem. Basic OOAD is a prerequisite for a coder to ensure that they follow the basic design of OO. This would help developers to understand the b…
The goal of the tutorial is to teach the user how to use functions in C++. The video will cover how to define functions, how to call functions and how to create functions prototypes. Microsoft Visual C++ 2010 Express will be used as a text editor an…
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.

830 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