Jump to content

newsanti

uniGUI Subscriber
  • Posts

    323
  • Joined

  • Last visited

  • Days Won

    1

Posts posted by newsanti

  1. 1 hour ago, newsanti said:

    On mobile devices, when a user interacts with the screen by touching and holding their finger on an element, several events can be triggered. Let’s explore these events:

    ontouchstart: This event fires when the user initially touches the screen. It’s equivalent to the onmousedown event for desktop devices. You can use it to detect the start of a touch interaction.
    ontouchmove: When the user moves their finger after touching the screen, this event is fired. It allows you to track continuous touch movements. For example, you can use it to create swipe gestures or drag-and-drop functionality.
    ontouchend: This event occurs when the user lifts their finger off the screen after touching it. It corresponds to the onmouseup event for desktop devices. You can use it to detect the end of a touch interaction.
    Keep in mind that these events are essential for creating responsive and touch-friendly web experiences. If you’re working with CSS animations or other interactive elements, consider using these touch events to enhance user interactions on mobile devices. 

    TunimLabel.OnMouseDown... user lifts their finger off the screen after touching it! 

    TunimLabel.OnClick... user lifts their finger off the screen after touching it!

    How to generate OnMouseDown ...While touching and holding their finger?

    image.png

     

    • Like 1
  2. On mobile devices, when a user interacts with the screen by touching and holding their finger on an element, several events can be triggered. Let’s explore these events:

    ontouchstart: This event fires when the user initially touches the screen. It’s equivalent to the onmousedown event for desktop devices. You can use it to detect the start of a touch interaction.
    ontouchmove: When the user moves their finger after touching the screen, this event is fired. It allows you to track continuous touch movements. For example, you can use it to create swipe gestures or drag-and-drop functionality.
    ontouchend: This event occurs when the user lifts their finger off the screen after touching it. It corresponds to the onmouseup event for desktop devices. You can use it to detect the end of a touch interaction.
    Keep in mind that these events are essential for creating responsive and touch-friendly web experiences. If you’re working with CSS animations or other interactive elements, consider using these touch events to enhance user interactions on mobile devices. 

    TunimLabel.OnMouseDown... user lifts their finger off the screen after touching it! 

    TunimLabel.OnClick... user lifts their finger off the screen after touching it!

    How to generate OnMouseDown ...While touching and holding their finger?

    image.png

  3. On 2/22/2024 at 11:15 AM, Sherzod said:

    This approach may help you:

    UnimMemo1.ClientEvents.UniEvents ->

    function beforeInit(sender, config)
    {
        config.listeners = {
            keyup: function(textarea) {
                var inputEl = textarea.inputElement,
                    textHeight = inputEl.dom.scrollHeight;
    
                textarea.setHeight(textHeight);
            }
        }
    }

     

    procedure TMainmForm.UnimFormShow(Sender: TObject);
    begin
      UnimMemo1.Clear;
      UnimMemo1.Lines.Add('TestLine1');
      UnimMemo1.Lines.Add('TestLine2');
      UnimMemo1.Lines.Add('TestLine3');
      UnimMemo1.Lines.Add('TestLine4');
      UnimMemo1.Lines.Add('TestLine5');
      UnimMemo1.Lines.Add('TestLine6');
      UnimMemo1.Lines.Add('TestLine7');
      UnimMemo1.Lines.Add('TestLine8');
    end;

    If fill data by code .. How to change height of textarea?
    This code change only keyup event.

  4. 37 minutes ago, newsanti said:

    Thanks.

     

    37 minutes ago, newsanti said:

    Thanks.

    Finally ..My code completed. 

    function beforeInit(sender, config)
    {
        config.listeners = {
            keyup: function(textarea) {
                   var inputEl = textarea.inputElement;
                   textHeight = inputEl.dom.scrollHeight;

                   if (textarea.getValue() == '') {
                     textHeight=35;
                   } 
                if (textHeight != textarea.getHeight()) {
                  var H1 = textHeight;
                  var H2 = textarea.getHeight();
                  if (H1<=35*4) { textarea.setHeight(textHeight); }
                  ajaxRequest(sender,'_resize',{newH: H1, oldH: H2});
                }
            }
        }
    }

    • Like 1
    • Upvote 1
  5. 5 minutes ago, Sherzod said:

    ?

     

    if textarea.getValue()=='' then         //Check when backspace and empty
                  textHeight=30;

     

    if (textarea.getValue() == '') {
        textHeight=30;
    }

     

    function beforeInit(sender, config)
    {
        config.listeners = {
            keyup: function(textarea) {
                   var inputEl = textarea.inputElement;
                    textHeight = inputEl.dom.scrollHeight;
                   if (textarea.getValue() == '') {
                     textHeight=30;
                   }
                textarea.setHeight(textHeight);
                if (textHeight != textarea.getHeight()) then {       //check to fire resize not work ? How to fix?
                  ajaxRequest(sender,'_resize',{H: textHeight});
                }  
            }
        }
    }

  6. 7 hours ago, Sherzod said:

    This approach may help you:

    UnimMemo1.ClientEvents.UniEvents ->

    function beforeInit(sender, config)
    {
        config.listeners = {
            keyup: function(textarea) {
                var inputEl = textarea.inputElement,
                    textHeight = inputEl.dom.scrollHeight;
    
                textarea.setHeight(textHeight);
            }
        }
    }

     

    function beforeInit(sender, config)
    {
        config.listeners = {
            keyup: function(textarea) {
                var inputEl = textarea.inputElement;
                    textHeight = inputEl.dom.scrollHeight;
                if textarea.getValue()=='' then         //Check when backspace and empty
                  textHeight=30;

                textarea.setHeight(textHeight);
            }
        }
    }

    If add condition when backspace not work?  How to fix it?

  7. On 12/28/2023 at 6:59 PM, Farshad Mohajeri said:

    Hello,

    Have you followed below instructions?

    https://www.unigui.com/doc/online_help/index.html?using-runtime-packages.htm

    For 64-bit you need to build "Runtime" uniGUI packages that are listed in above link for Win64 and deploy them with your application.

    That said, we always recommend using 32-bit apps along with HyperServer.

    Also, if your generated EXE is so big you can turn off all debug information, so the need for runtime packages will be eliminated.

    I create new unigui win64 project with runtime packages (1.95.0.1579) problem existed. 

  8. 15 hours ago, Sherzod said:

    Hello, 

    I haven't downloaded your test case, but please provide the main code here. What are you using?

    uses
      uniGUIVars, MainModule, uniGUIApplication, uniGUIJSInterface;

    function MainForm: TMainForm;
    begin
      Result := TMainForm(UniMainModule.GetFormInstance(TMainForm));
    end;

    procedure TMainForm.Button_PASTEClick(Sender: TObject);
    begin
      if Clipboard.HasFormat(CF_PICTURE) then
        UniImage1.Picture.Assign(Clipboard);
    end;

    initialization
      RegisterAppFormClass(TMainForm);
     

  9. 10 hours ago, Sherzod said:

    Hello, 

    What are these items?

    object dtpfUnimM0091HomeMenuShortcutFrame101: TdtpfUnimM0091HomeMenuShortcutFrame101
      Left = 0
      Top = 0
      Width = 170
      Height = 130
      Layout = 'hbox'
      LayoutAttribs.Align = 'center'
      LayoutAttribs.Pack = 'center'
      ParentAlignmentControl = False
      AlignmentControl = uniAlignmentClient
      Color = clPurple
      TabOrder = 0
      ParentColor = False
      ParentBackground = False
      Background.Fit = True
      object Panel_BODY: TUnimContainerPanel
        Left = 3
        Top = 3
        Width = 160
        Height = 120
        Hint = ''
        Color = clWhite
        ClientEvents.UniEvents.Strings = (
          
            'beforeInit=function beforeInit(sender, config)'#13#10'{'#13#10'//  config.st' +
            'yle = "box-shadow: 2px 2px 6px 1px gray;" + config.style;'#13#10'  con' +
            'fig.style = "border-radius: 10px;" + config.style;'#13#10'}')
        LayoutAttribs.Align = 'start'
        LayoutAttribs.Pack = 'start'
        LayoutConfig.Width = '92%'
        object Panel_ICON: TUnimContainerPanel
          Left = 23
          Top = 3
          Width = 125
          Height = 60
          Hint = ''
          Color = 4259584
          Layout = 'fit'
          LayoutAttribs.Align = 'center'
          LayoutAttribs.Pack = 'center'
          LayoutConfig.Width = '100%'
          object Label_ICON: TUnimLabel
            Left = 19
            Top = -3
            Width = 95
            Height = 50
            Hint = ''
            Alignment = taCenter
            AutoSize = False
            Caption = '<i class="fa-solid fa-rocket-launch"></i>'
            LayoutConfig.Height = '100%'
            LayoutConfig.Width = '100%'
            LayoutConfig.Margin = '10 0 0 0'
            ParentFont = False
            Font.Height = -40
            Font.Name = 'Noto Serif Thai'
            Font.Style = [fsBold]
          end
        end
        object Panel_NAME: TUnimContainerPanel
          Left = 23
          Top = 56
          Width = 125
          Height = 60
          Hint = ''
          Color = 12615935
          Layout = 'fit'
          LayoutAttribs.Align = 'center'
          LayoutAttribs.Pack = 'center'
          LayoutConfig.Width = '100%'
          object Label_NAME: TUnimLabel
            Left = 19
            Top = 13
            Width = 95
            Height = 42
            Hint = ''
            Alignment = taCenter
            AutoSize = False
            Caption = #3594#3639#3656#3629#3610#3633#3597#3594#3637
            LayoutConfig.Margin = '10 0 0 0'
            ParentFont = False
            Font.Height = -16
            Font.Name = 'Noto Serif Thai'
            Font.Style = [fsBold]
          end
        end
      end
    end

    image.png.32d3cfba67553685bb79e35a66e2614b.png

     

  10. TunimEdit...

    type
      TdummyUniFormControl    = class(TUniFormControl);
    ...

          var oControlX:= TdummyUniFormControl(oControl);
             if oNeuron.CheckError then
                begin
                  oControlX.FieldLabelFont.Color:= FormLinkOptions.LabelErrorColor;
                  oControlX.FieldLabel:= oNeuron.DisplayLabel;
                end
    not working. (FieldLabel color not change.)

×
×
  • Create New...