- This topic has 6 replies, 2 voices, and was last updated 6 years, 11 months ago by HeDiBo.
-
AuthorPosts
-
November 29, 2017 at 4:51 pm #37660HeDiBoParticipant
I would like to make an edit control like this:
[attachment=8529:Edit with hint empty.jpg] when text is not entered, but changes to this:
[attachment=8530:Edit with hint filled.jpg] when text is being entered (if entering text is cancelled or totally backspaced, the control shifts back to its initial state)
It is a familiar setup these days, primarily used in web forms.
What steps/controls could I use to accomplish this?
December 2, 2017 at 3:44 pm #57299SupportKeymasterI'm agree with you, this feature is useful.
I think, this is must be centrally controlled option, maybe from sSkinManager.Options
What do you think?
December 2, 2017 at 5:26 pm #57303HeDiBoParticipant'Support' wrote:I'm agree with you, this feature is useful.
I think, this is must be centrally controlled option, maybe from sSkinManager.Options
What do you think?
I would prefer a new component (TsHintedEdit). WIth settings in SkinManager, every TsEdit would exhibit this behavior. That may not be what you want, because in other parts of your project you may want to use normal hints. Remember a HintedEdit can only contain a very short hint. Such a HintedEdit may have a separate normal hint as well!
Thanks for considering this.
December 2, 2017 at 6:57 pm #57306SupportKeymasterThe TextHint property exists in the Delphi 2009 and newer, and supported by AphaSkins.
Do you mean this property?
I thought about another feature, when all edits changes an own looking if some value has been entered there.
December 3, 2017 at 11:09 am #57311HeDiBoParticipant'Support' wrote:The TextHint property exists in the Delphi 2009 and newer, and supported by AphaSkins.
Do you mean this property?
I thought about another feature, when all edits changes an own looking if some value has been entered there.
I'm an old Delphi 7 programmer. So, I never knew the property already existed. When I looked into it, I found that it is not used in the control that would most benefit from it: the TsDBEdit. That's because it is also missing in it's parent TDBEdit. Any idea why TextHint is a public property in TDBEdit i.s.o. a published property?
Your idea of changing an edit's look when something is entered is nice
December 3, 2017 at 12:21 pm #57313HeDiBoParticipantI looked further into the TextHint implementation of Delphi. And it's plain wrong. Because when the user shifts focus to a TEdit the hint disappears
They made this a deliberate “feature” because Windows does allow a visible hint when the edit has focus. But Delphi decided to ignore this possibility and remove the hint whenever the user shifts focus to the control
However they were gracious enough to make the flawed DoSetTextHint procedure virtual. That would allow for TsEdit to use a general sSkinManager.Options value to show the hint always.
December 3, 2017 at 1:26 pm #57314HeDiBoParticipantWhen I looked at your implementation of TextHint, I could not understand how the Hint would disappear when the TsEdit has focus.
Then I realized that it was finally a problem in DoTextHint.
I made an obvious modification to the TsEdit component by overriding the DoTextHint procedure and the hint text would show on an empty edit field even if it was focused, as expected.
-
AuthorPosts
- You must be logged in to reply to this topic.