TextHint with a TwwController
XE3, Woll2Woll 10.0.1.2
Place a TButton, TwwDBEdit, TwwController and a TDataSet down and hook them up.
procedure TForm1.Button1Click(Sender: TObject);
begin
Table1.Open;
Table2.Insert;
end;
procedure TForm1.FormShow(Sender: TObject);
begin
wwDBEdit2.TextHint := 'RefNo1';
end;
When the wwDBEdit is not hooked to the Controller, the TextHint displays on Button Click. When it is hooked to the Controller, it does not.
Any remedy here?
-
TextHint (https://docwiki.embarcadero.com/Libraries/Alexandria/en/Vcl.StdCtrls.TEdit.TextHint)
For dbedit controls it only displays when in edit/insert mode, and it works fine for Woll2Woll as long as it's not hooked up to a controller.
-
I think the problem is when the border style =bsnone, then it will not show. Our controls do not paint this themselves but when borderstyle=bsnone, they enable the es_multiline style attribute to properly position the text within the control, which I am guessing does not support texthint. I'm not sure of a way around this unless you don't use framing.
From looking at our source in vcl.wwdbedit.pas, if you comment out the line that sets es_multiline it will show the hint.
procedure TwwCustomMaskEdit.CreateParams(var Params: TCreateParams);
begin
inherited CreateParams(Params);
Params.Style := Params.Style and not (ES_AUTOVSCROLL or ES_WANTRETURN);
// if (BorderStyle = bsNone) or WordWrap then
// Params.Style:= Params.Style or ES_MULTILINE;
if WordWrap then Params.Style :=
(Params.Style or ES_AUTOVSCROLL) and not ES_AUTOHSCROLL;
if FWantReturns then Params.Style:=
Params.Style or ES_WANTRETURN;
if FShowVertScrollBar then
Params.Style:= Params.Style or WS_VSCROLL;
end;
Please sign in to leave a comment.
Comments
3 comments