Jump to content

Field property for Tag component


skafy

Recommended Posts

On 5/13/2022 at 8:41 AM, Sherzod said:

Hi,

Use this approach for now:

 

Tnx, it worked! Hw about border. 

folowing command don't seem to work: UniTag.BorderStyle:= ubsSolid;

It makes it somehow transparent...?

Link to comment
Share on other sites

38 minutes ago, skafy said:

folowing command don't seem to work: UniTag.BorderStyle:= ubsSolid;

It makes it somehow transparent...?

procedure TMainForm.UniFormCreate(Sender: TObject);
begin
  with UniTagField1 do
    if BorderStyle = ubsSolid then
      JSInterface.JSAddListener('afterrender', 'function(me){me.setStyle("border", "thin solid gray")}')

end;

 

  • Like 1
Link to comment
Share on other sites

17 minutes ago, Sherzod said:
procedure TMainForm.UniFormCreate(Sender: TObject);
begin
  with UniTagField1 do
    if BorderStyle = ubsSolid then
      JSInterface.JSAddListener('afterrender', 'function(me){me.setStyle("border", "thin solid gray")}')

end;

 

This does not read the FieldWidth value.  Above command also bordered fieldcaption wich is not OK.

Link to comment
Share on other sites

19 minutes ago, skafy said:

This does not read the FieldWidth value.  Above command also bordered fieldcaption wich is not OK.

procedure TMainForm.UniFormCreate(Sender: TObject);
begin
  with TUniEdit(UniTagField1) do
  begin
    FieldLabelWidth := 70;
    FieldLabelAlign := laLeft;
    FieldLabel := 'LabelText';
  end;

  with UniTagField1 do
    if BorderStyle = ubsSolid then
      JSInterface.JSAddListener('afterrender', 'function(me){me.bodyEl.setStyle("border", "thin solid gray")}')
end;

 

  • Like 1
Link to comment
Share on other sites

7 minutes ago, Sherzod said:
with UniTagField1 do
    if BorderStyle = ubsSolid then
      JSInterface.JSAddListener('afterrender', 'function(me){me.bodyEl.setStyle("border", "thin solid gray")}')

me.bodyEl - Please note this is a modified code.

  • Like 1
Link to comment
Share on other sites

2 minutes ago, Sherzod said:

me.bodyEl - Please note this is a modified code.

Yeees. It worked.

Sorry... I didn't see the changed code :S ( i thought you just merged two codes. :))

 

Thank you!

  • Like 1
Link to comment
Share on other sites

×
×
  • Create New...