Jump to content

Roberto Nicchi

uniGUI Subscriber
  • Posts

    226
  • Joined

  • Last visited

Posts posted by Roberto Nicchi

  1. 1 hour ago, picyka said:
    function click(sender, e, eOpts)
    {
      Ext.defer(function(){
            ajaxRequest(sender, '_beforeClick', [])
        }, 5);
    
      var textarea = document.getElementById(UniMemoResumo.JSName + '.inputId);
      textarea.select();
      document.execCommand(''copy'');
    }

    Before copying the text of the memo, I need to feed it.

    Try

    with copy_but, JSInterface do
        JSAddListener('click', JSFunction('sender', 'var textarea = document.getElementById(' + unimemo1.JSName + '.inputId); '
          + 'textarea.value=textarea.value.trim(); '
          + 'textarea.select(); '
          + 'document.execCommand(''copy'');'));
     

    Seems to work.

  2. On 3/4/2022 at 8:05 PM, picyka said:

    Hello, how do you treat focus today?

    Hello,

    sincerly i'm not sure how i solved the problem but i see that now is working... Probably i did something, but now i can't remember ...

    Do you have a similar problem ?

    Roberto

    • Thanks 1
  3. Hello,

    in the main form of my application i have enabled monitoredkeys and defined the OnKeyDown event to manage hotkeys. (F1,F2 and so on)

    I would like to disable hot keys when a standard dialog windows is opened (messagedlg and showmessage)

    I would like that when a standard dialog form is opened the user can only click in the dialog buttons and don't use any hot key.

    Is there a way to do it in a single point of the application ?

    thanks

    Roberto

    Unigui 1.90.0.1556

  4. 1 hour ago, Sherzod said:

    For now you can try this workaround...

    procedure TMainForm.UniFormCreate(Sender: TObject);
    begin
      field2.Value:=10;
      field3.Value:=10;
    
      field3.JSInterface.JSAddListener('change', 'function(sender, newVal, oldVal){if (sender.rawValue==oldVal) return false}')
    end;

     

    Hello, you code seems to work fine. Anyway i have to correct what i have said before; seems the problem happens also with the TuniNumberEdit class.

    I have used your code also for that class and seems to solve the problem.

    I have attached to this post an example that shows the problem with a TuniNumberEdit  component also. 

    Let my know if you can't reproduce the problem running the app.

    thanks

    Project1.zip

  5. The onchange event of the TuniFormattedNumberEdit class is not executed correctly.

    Look at the demo app i have attached to this post.

    In the form there are 4 components. One is a TuniFormattedNumberEdit component.

    The value of the component is changed in the form.oncreate event.

    When the focus is moved into the component the onchage event is executed. It's shouldn't. This doesn't happens for the TuniNumberEdit class.

    IMPORTANT: Use the tab key to change the focus.

    thanks

    Roberto

    Project1.zip

  6. Try to create a self contained demo app that is possible to compile and execute. Instead of a database access use a Tclientdataset. It can happens two things: 1) the demo app is working so it can help you to understand the problem in your main app 2) the demo app shows the problem and you can post it here.

  7. 15 hours ago, Sherzod said:

    Hello,

    Will this option suit you?

    procedure TMainForm.UniFormCreate(Sender: TObject);
    begin
      with UniFormattedNumberEdit1 do
        JSInterface.JSCall('updateNumericFormat', [JSControl.JSObject('aPad:false, aSep: "'+ ThousandSeparator +'", aDec: "'+ DecimalSeparator +'", mDec:' + DecimalPrecision.ToString)]);
    end;

     

    Hello, with this code the value is not formatted at all. It behaves similar to the TuniNumericEdit class.

    Don't know if is your code not working or i didn't exaplain well enough. I try with an example:

    If the value is 10 the displayed value must me 10.00 ( i want minimal 2 digits)

    If the Value is 10.1 the displayed value must me 10.10

    If the Value is 10.123 the displayed value must me 10.123

    Anyway the user can't insert a value with more than 4 decimals (DecimalPrecision=4) So if the number of decimals are less than 2 i would like to format the value with 2 decimals. If the decimals are more than 2 the value should not be formatted in the decimal part.

    thanks

    • Like 1
×
×
  • Create New...