Board index » cppbuilder » TPanel OnEnter OnExit Handlers

TPanel OnEnter OnExit Handlers

Hi

Is there a bug with the OnEnter and OnExit handlers of the TPanel?  My
handler functions are not being called.  Are these even valid handlers for a
TPanel?  I am trying to create a drawing tool which allows me to create a
Panel at runtime, move and resize it all at runtime.  Does anyone have any
examples of this?

    Thanks

 

Re:TPanel OnEnter OnExit Handlers


You say you're creating the panel dynamically at runtime, but you don't say
(or show) whether you're actually assigning your handlers to the new object
or not.  What does your code look like?

Gambit

Quote
"Glenn MacGregor" <g...@oracom.com> wrote in message

news:3ba892ae$1_1@dnews...

Quote
> Is there a bug with the OnEnter and OnExit handlers of the TPanel?  My
> handler functions are not being called.  Are these even valid handlers for
a
> TPanel?  I am trying to create a drawing tool which allows me to create a
> Panel at runtime, move and resize it all at runtime.  Does anyone have any
> examples of this?

Re:TPanel OnEnter OnExit Handlers


I do set the handlers at runtime.  I have created a sample project which has
2 panels on a form.  For those panels I create OnExit and OnEnter handlers.
I mouse into and select either of those and I never get into the handlers.
This is with BCB 5.  Any clues?

Quote
"Remy Lebeau" <gambi...@gte.net> wrote in message news:3ba8d0a7$1_1@dnews...
> You say you're creating the panel dynamically at runtime, but you don't
say
> (or show) whether you're actually assigning your handlers to the new
object
> or not.  What does your code look like?

> Gambit

> "Glenn MacGregor" <g...@oracom.com> wrote in message
> news:3ba892ae$1_1@dnews...

> > Is there a bug with the OnEnter and OnExit handlers of the TPanel?  My
> > handler functions are not being called.  Are these even valid handlers
for
> a
> > TPanel?  I am trying to create a drawing tool which allows me to create
a
> > Panel at runtime, move and resize it all at runtime.  Does anyone have
any
> > examples of this?

Re:TPanel OnEnter OnExit Handlers


Once again, I ask that you please show code that demonstrates your problem.
There's a difference between CREATING handlers, which you've done, and
ASSIGNING handlers to a runtime-created object, which I'm suspecting you
haven't done.

TPanel *panel = new TPanel(this);
panel->Parent = this;

// have you done the following?
panel->OnEnter = PanelEnter;
panel->OnExit = PanelExit;

Gambit

Quote
"Glenn MacGregor" <g...@oracom.com> wrote in message news:3ba8d3aa_2@dnews...
> I do set the handlers at runtime.  I have created a sample project which
has
> 2 panels on a form.  For those panels I create OnExit and OnEnter
handlers.
> I mouse into and select either of those and I never get into the handlers.
> This is with BCB 5.  Any clues?

Re:TPanel OnEnter OnExit Handlers


I have done exactly that.  I do set the handlers on my created objects.
Does the onEnter and OnExit mean anything to a panel?

    Glenn

Quote
"Remy Lebeau" <gambi...@gte.net> wrote in message news:3ba8d580_2@dnews...
> Once again, I ask that you please show code that demonstrates your
problem.
> There's a difference between CREATING handlers, which you've done, and
> ASSIGNING handlers to a runtime-created object, which I'm suspecting you
> haven't done.

> TPanel *panel = new TPanel(this);
> panel->Parent = this;

> // have you done the following?
> panel->OnEnter = PanelEnter;
> panel->OnExit = PanelExit;

> Gambit

> "Glenn MacGregor" <g...@oracom.com> wrote in message

news:3ba8d3aa_2@dnews...

- Show quoted text -

Quote
> > I do set the handlers at runtime.  I have created a sample project which
> has
> > 2 panels on a form.  For those panels I create OnExit and OnEnter
> handlers.
> > I mouse into and select either of those and I never get into the
handlers.
> > This is with BCB 5.  Any clues?

Re:TPanel OnEnter OnExit Handlers


Remy,

I have found that I can't get the OnEnter to be called with the mouse (click
on the panel does not call the on enter).  I have to enable tabstop and tab
to it.  Is there a way to enable the mouse to start the OnEnter handler?

Quote
"Glenn MacGregor" <g...@oracom.com> wrote in message

news:3ba8e211$1_2@dnews...
Quote
> I have done exactly that.  I do set the handlers on my created objects.
> Does the onEnter and OnExit mean anything to a panel?

>     Glenn

> "Remy Lebeau" <gambi...@gte.net> wrote in message news:3ba8d580_2@dnews...
> > Once again, I ask that you please show code that demonstrates your
> problem.
> > There's a difference between CREATING handlers, which you've done, and
> > ASSIGNING handlers to a runtime-created object, which I'm suspecting you
> > haven't done.

> > TPanel *panel = new TPanel(this);
> > panel->Parent = this;

> > // have you done the following?
> > panel->OnEnter = PanelEnter;
> > panel->OnExit = PanelExit;

> > Gambit

> > "Glenn MacGregor" <g...@oracom.com> wrote in message
> news:3ba8d3aa_2@dnews...
> > > I do set the handlers at runtime.  I have created a sample project
which
> > has
> > > 2 panels on a form.  For those panels I create OnExit and OnEnter
> > handlers.
> > > I mouse into and select either of those and I never get into the
> handlers.
> > > This is with BCB 5.  Any clues?

Re:TPanel OnEnter OnExit Handlers


Apparently not, after all

Gambit

Quote
"Glenn MacGregor" <g...@oracom.com> wrote in message

news:3ba8e211$1_2@dnews...
Quote
> Does the onEnter and OnExit mean anything to a panel?

Re:TPanel OnEnter OnExit Handlers


OnEnter is triggered in response to the CM_ENTER message which is sent in
response to the WM_SETFOCUS message, which apparently TPanel does not
receive.

Gambit

Quote
"Glenn MacGregor" <g...@oracom.com> wrote in message

news:3ba8e592$1_1@dnews...

Quote
> I have found that I can't get the OnEnter to be called with the mouse
(click
> on the panel does not call the on enter).  I have to enable tabstop and
tab
> to it.  Is there a way to enable the mouse to start the OnEnter handler?

Other Threads