Watch, Follow, &
Connect with Us

For forums, blogs and more please visit our
Developer Tools Community.


Welcome, Guest
Guest Settings
Help

Thread: How to bring a sub object on top



Permlink Replies: 2 - Last Post: Mar 17, 2018 9:20 PM Last Post By: Lex Dean Threads: [ Previous | Next ]
Lex Dean

Posts: 132
Registered: 3/26/07
How to bring a sub object on top
Click to report abuse...   Click to reply to this thread Reply
  Posted: Mar 16, 2018 12:21 AM
I have a main object basically TPanel that is parent to many sub objects - TGraphicControl descendant, TEdit, TComboBox
So they all depend on the main object object for messages from the mouse......

The hint and showhint are managed through the same methods at design time as published data on all sub objects.
These properties work perfectly with TGraphicControl descendant that shears the same unit as all my code for these objects.
Of curse TControl holds the code to display the hint message that all sub objects shear.

TEdit, TComboBox will not give me a Hint up on the screen as if it has not got visibility.
The main object does not paint over these objects before painting them and is first to get the paint message.
I try and use BringForward and I do not get any change as they seem already forward.

what other options have I got to investigate.
Peter Below

Posts: 1,227
Registered: 12/16/99
Re: How to bring a sub object on top
Click to report abuse...   Click to reply to this thread Reply
  Posted: Mar 17, 2018 1:50 AM   in response to: Lex Dean in response to: Lex Dean
Lex Dean wrote:

I have a main object basically TPanel that is parent to many sub
objects - TGraphicControl descendant, TEdit, TComboBox So they all
depend on the main object object for messages from the mouse......

TgraphicControl descendents get mouse messages from their parent, but
TWinControl descendents get them directly from Windows, the parent is
not involved. The same applies to painting, TGraphicControls are told
by their parent to paint themselves onto the parent's canvas, while
TWinControls get the paint request from Windows directly and have their
own canvas (device context handle in API terminology). The parent
explicitely excludes the area covered by child controls when it paints
its own client area. Controls that have a ParentBackground property to
implement a kind of transparency do that by asking the parent to paint
the part of the background they cover before they paint their content.

The hint and showhint are managed through the same methods at design
time as published data on all sub objects. These properties work
perfectly with TGraphicControl descendant that shears the same unit
as all my code for these objects. Of curse TControl holds the code
to display the hint message that all sub objects shear. TEdit,
TComboBox will not give me a Hint up on the screen as if it has not
got visibility.

Have you set the ShowHint property of these objects to true? If not, is
the ParentShowHint property true, and does your panel have ShowHint set
to true? Hint handling is implemented by the Application object, it is
the source of the cm_showhint message sent to controls, and it decides,
which control should get the message.

--
Peter Below
TeamB

Lex Dean

Posts: 132
Registered: 3/26/07
Re: How to bring a sub object on top
Click to report abuse...   Click to reply to this thread Reply
  Posted: Mar 17, 2018 9:20 PM   in response to: Peter Below in response to: Peter Below
Peter Below wrote

{
Have you set the ShowHint property of these objects to true? If not, is
the ParentShowHint property true, and does your panel have ShowHint set
to true? Hint handling is implemented by the Application object, it is
the source of the cm_showhint message sent to controls, and it decides,
which control should get the message.
}
The TEdit TComboBox object of cause loose ParentShowHint property as true and becomes false when ShowHint property becomes true
That is expected normal behavior of all VCL Objects.

Peter Below wrote
{
TgraphicControl descendents get mouse messages from their parent, but
TWinControl descendents get them directly from Windows
}
This must be the heart of the matter before me.
Some how my Parent Object is hiding TEdit TComboBox from Windows to get a hint message
This must be considered way back in "ControlStyle" settings in Parent Object first
It contains [csAcceptsControls, csCaptureMouse, csClickEvents, csSetCaption, csOpaque, csDoubleClicks, csReplicatable]
They have no options I know of that effects hints Is that true?

Legend
Helpful Answer (5 pts)
Correct Answer (10 pts)

Server Response from: ETNAJIVE02