LAMW - How to create EditText with (X) button clear lazarus / 43-Android ---------------------------------------------------------------------- Agmcz · 2021-10-06 12:18 Hi all How to create EditText with (X) button clear an example is attached for more clarification... ---------------------------------------------------------------------- jmpessoa · 2021-10-06 17:28 Good suggestion! I will try implement some new component like this! Thank you! ---------------------------------------------------------------------- Agmcz · 2021-10-06 18:24 more...  copy text to clipboard. ---------------------------------------------------------------------- Mongkey · 2021-10-07 13:34 yes LAMW can do with only already created components, if it doesnt fit your need you can create syntetic button using panel. The most easiest is using recycler -> easy to manipulate. Placing button background with image also can. Beautifying with compound also great! Many ways  Oops, you could place button inside edittext, align rightend, set your button font with 5  smaller font than edittext. You can create many buttons inside, set your button background with 0% color png, it does all magic ---------------------------------------------------------------------- Mongkey · 2021-10-07 14:18 ---------------------------------------------------------------------- Mongkey · 2021-10-07 22:39 this is what u need, this demo using jlabel instead jbutton, but you can do both, ---------------------------------------------------------------------- Mongkey · 2021-10-07 22:47 , all controls seem to be clickable, so you can treat them as button for clipboard ing or something ---------------------------------------------------------------------- Mongkey · 2021-10-07 23:20 Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i {hint: Pascal files location: ...\modbus\jni }unit u_main; {$mode delphi} interface uses  {$IFDEF UNIX}{$IFDEF UseCThreads}  cthreads,  {$ENDIF}{$ENDIF}  Classes, SysUtils, AndroidWidget, tcpsocketclient, Laz_And_Controls;  type   { TAndroidModule1 }   TAndroidModule1 = class(jForm)    jButton1: jButton;    jEditText1: jEditText;    jTCPSocketClient1: jTCPSocketClient;    jTextView1: jTextView;    jTextView2: jTextView;    jTextView3: jTextView;    procedure AndroidModule1JNIPrompt(Sender: TObject);    procedure jButton1Click(Sender: TObject);    procedure jTCPSocketClient1BytesReceived(Sender: TObject;      var jbytesReceived: TDynArrayOfJByte);    procedure jTCPSocketClient1Connected(Sender: TObject);    procedure jTCPSocketClient1MessagesReceived(Sender: TObject;      messageReceived: string);  private    {private declarations}  public  {public declarations}  end; var  AndroidModule1: TAndroidModule1; implementation  {$R *.lfm}   { TAndroidModule1 } procedure TAndroidModule1.jButton1Click(Sender: TObject);begin  jTCPSocketClient1.ConnectAsync('192.168.0.18',502);  jTCPSocketClient1.SendMessage('tst');end; procedure TAndroidModule1.AndroidModule1JNIPrompt(Sender: TObject);begin  jButton1.SetFontFromAssets('materialdesignicons-webfont.ttf');  jButton1.Text:='111'+self.ParseHtmlFontAwesome('f101');   jTextView3.SetFontFromAssets('materialdesignicons-webfont.ttf');  jTextView3.Text:=self.ParseHtmlFontAwesome('f101');end; procedure TAndroidModule1.jTCPSocketClient1BytesReceived(Sender: TObject;  var jbytesReceived: TDynArrayOfJByte);beginend; procedure TAndroidModule1.jTCPSocketClient1Connected(Sender: TObject);begin  jtextview1.Text:='connected';end; procedure TAndroidModule1.jTCPSocketClient1MessagesReceived(Sender: TObject;  messageReceived: string);begin  jtextview2.Text:=messageReceived;end; end. Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i object AndroidModule1: TAndroidModule1  MarginLeft = 0  MarginTop = 0  MarginRight = 0  MarginBottom = 0  Enabled = True  Left = 395  Top = 145  Width = 320  Height = 400  Text = 'AndroidModule1'  ActivityMode = actMain  BackgroundColor = colbrDefault  ActionBarTitle = abtDefault  AnimationDurationIn = 1500  AnimationDurationOut = 1500  AnimationMode = animNone  OnJNIPrompt = AndroidModule1JNIPrompt  object jTextView1: jTextView    MarginLeft = 5    MarginTop = 5    MarginRight = 5    MarginBottom = 5    Enabled = True    Left = 5    Top = 5    Width = 61    Height = 20    Visible = True    PosRelativeToAnchor = []    PosRelativeToParent = [rpTop, rpLeft]    LayoutParamWidth = lpWrapContent    LayoutParamHeight = lpWrapContent    Text = 'jTextView1'    Alignment = taLeft    BackgroundColor = colbrDefault    FontColor = colbrDefault    FontSize = 0    TextTypeFace = tfNormal    FontSizeUnit = unitDefault    GravityInParent = lgNone  end  object jButton1: jButton    MarginLeft = 5    MarginTop = 5    MarginRight = 5    MarginBottom = 5    Enabled = True    Left = 5    Top = 35    Width = 80    Height = 50    Visible = True    Anchor = jTextView1    PosRelativeToAnchor = [raBelow]    PosRelativeToParent = [rpLeft]    LayoutParamWidth = lpOneQuarterOfParent    LayoutParamHeight = lpWrapContent    Text = 'jButton1'    BackgroundColor = colbrDefault    FontColor = colbrDefault    FontSize = 0    FontSizeUnit = unitDefault    GravityInParent = lgNone    OnClick = jButton1Click  end  object jTextView2: jTextView    MarginLeft = 5    MarginTop = 5    MarginRight = 5    MarginBottom = 5    Enabled = True    Left = 5    Top = 95    Width = 61    Height = 20    Visible = True    Anchor = jButton1    PosRelativeToAnchor = [raBelow]    PosRelativeToParent = [rpLeft]    LayoutParamWidth = lpWrapContent    LayoutParamHeight = lpWrapContent    Text = 'jTextView2'    Alignment = taLeft    BackgroundColor = colbrDefault    FontColor = colbrDefault    FontSize = 0    TextTypeFace = tfNormal    FontSizeUnit = unitDefault    GravityInParent = lgNone  end  object jEditText1: jEditText    MarginLeft = 10    MarginTop = 5    MarginRight = 5    MarginBottom = 5    Enabled = True    Left = 10    Top = 125    Width = 80    Height = 39    Visible = True    Anchor = jTextView2    PosRelativeToAnchor = [raBelow]    PosRelativeToParent = [rpLeft]    LayoutParamWidth = lpOneQuarterOfParent    LayoutParamHeight = lpWrapContent    Alignment = taLeft    InputTypeEx = itxText    MaxTextLength = -1    BackgroundColor = colbrDefault    FontColor = colbrDefault    FontSize = 0    Hint = 'search'    HintTextColor = colbrLightSteelBlue    ScrollBarStyle = scrNone    MaxLines = 1    HorScrollBar = True    VerScrollBar = True    WrappingLine = False    Editable = True    FontSizeUnit = unitDefault    CloseSoftInputOnEnter = True    CapSentence = False    CaptureBackPressed = False    GravityInParent = lgNone  end  object jTextView3: jTextView    MarginLeft = 5    MarginTop = 5    MarginRight = 5    MarginBottom = 5    Enabled = True    Left = 24    Top = 134    Width = 61    Height = 20    Visible = True    Anchor = jEditText1    PosRelativeToAnchor = [raAlignBaseline, raAlignRight]    PosRelativeToParent = []    LayoutParamWidth = lpWrapContent    LayoutParamHeight = lpWrapContent    Text = 'jTextView3'    Alignment = taLeft    BackgroundColor = colbrDefault    FontColor = colbrCrimson    FontSize = 0    TextTypeFace = tfNormal    FontSizeUnit = unitDefault    GravityInParent = lgNone  end  object jTCPSocketClient1: jTCPSocketClient    OnMessagesReceived = jTCPSocketClient1MessagesReceived    OnBytesReceived = jTCPSocketClient1BytesReceived    OnConnected = jTCPSocketClient1Connected    Left = 224    Top = 56  endend ---------------------------------------------------------------------- jmpessoa · 2021-10-08 21:46 Done! Improved  jEditText component! New! Property: "ActionIconIdentifier" events:  "OnActionIconTouchUp"  and "OnActionIconTouchDown" Demo:  ""AppEditTextActionIconDemo1 Thanks! ---------------------------------------------------------------------- Agmcz · 2021-10-09 23:01 Good job jmpessoa  this is what i wanted. Minor addition for demo: Code: Pascal  [Select][+][-]window.onload = function(){var x1 = document.getElementById("main_content_section"); if (x1) { var x = document.getElementsByClassName("geshi");for (var i = 0; i   if jEditText1.GetTextLength() > 0 then  begin    if not jEditText1.IsActionIconShowing() then      jEditText1.ShowActionIcon();  end  else  begin    jEditText1.HideActionIcon();  end;