Board index » cppbuilder » simple graphic control

simple graphic control


2005-11-20 07:49:14 AM
cppbuilder58
The graphic object I am currently using is an extension of the
TGraphicControl class.
class TBoxFrame : public TGraphicControl;
This control works great in every area except for keyboard event handling.
According to the BCB help files, TGraphicControl objects do not support
this. I am looking for another base class to extend, and I need it to
support the following actions:
1) Mouse commands (including OnMouseDown, OnMouseUp, and OnMouseMove...not
just OnClick)
2) Keyboard commands (including KeyDown, KeyUp, etc...not just KeyPress)
3) The ability to draw directly on the object's canvas.
4) The ability to Assign one object of this class to another.
Just wondering if someone could help me out with a good recommendation.
Thanks.
 
 

Re:simple graphic control

Blake Young wrote:
Quote
Just wondering if someone could help me out with a good
recommendation. Thanks.
Yes, use TCustomControl.
HTH
Jonathan
 

Re:simple graphic control

Quote
Yes, use TCustomControl.
Well, I'm having a bit of trouble with TCustomControl. Here are some
screenshots of the graphical control superimposed on top of a TImage object.
The TGraphicControl remains transparent, but the TCustomControl fills itself
in as gray, which is not what I want. The code producing these two shots is
identical, obviously with the only exception being the name of the base
class. How do I fix that transparency business?
TCustomControl
https://webspace.utexas.edu/youngba2/www/TCustomControl.gif
TGraphicControl
https://webspace.utexas.edu/youngba2/www/TGraphicControl.gif
 

{smallsort}

Re:simple graphic control

"Blake Young" < XXXX@XXXXX.COM >wrote in message
Quote
Well, I'm having a bit of trouble with TCustomControl. Here are some
screenshots of the graphical control superimposed on top of a TImage
object. The TGraphicControl remains transparent, but the TCustomControl
fills itself in as gray, which is not what I want. The code producing
these
two shots is identical, obviously with the only exception being the name
of the base class. How do I fix that transparency business?
Remove the csOpaque flag from the ControlStyle property in the component's
constructor. You may also have to override the CreateParams() method to
include the WS_EX_TRANSPARENT style, and/or intercept the WS_ERASEBKGND
message to avoid default drawing.
Gambit