Jump to content

likemike

uniGUI Subscriber
  • Posts

    356
  • Joined

  • Last visited

  • Days Won

    7

Posts posted by likemike

  1. Hello!

    I've one problem with this:

    On 8/19/2021 at 7:59 PM, Sherzod said:

    Hello,

    Try this approach.

    1. UnimCanvas -> ClientEvents -> UniEvents ->

    function beforeInit(sender, config)
    {
       sender._drawImg = function(imgSrc) {
            var img = new Image();
            img.onload = function() {
                sender._cc_.drawImage(img, 0, 0, sender._c_.width, sender._c_.height);
            };
            img.src = imgSrc;
        }
    }

    2. Usage:

    procedure TMainmForm.UnimButton1Click(Sender: TObject);
    begin
      UnimCanvas1.JSInterface.JSCall('_drawImg', ['files/nature.jpg']);
    end;

     

    If the JPG was changed, the next call always show the original JPG (because it's loaded from the browser cache) - even if I try to open a complete different images.
    So my question is: how can I force the browser to load the JPG without using the cache? (there was another question in this forum with the solution to add a timestamp behind the pictures name. But I have to preserve the filenames!)

    Thanks in advance

    Mike

  2. I don't see any creation of tmpStream...
    Try this:
     

    var
      tmpStream : TMemoryStream;
    begin
      tmpStream:=TMemorystream.Create; 
      TRY
        TBlobField(FieldByName('li_image')).SaveToStream(tmpStream);
        tmpStream.Position :=0;
        UniCanvas1.Color := clWhite;
        UniCanvas1.Clear;
        uniCanvas1.LoadFromStream(tmpStream);  
      FINALLY
        FreeAndNil(tmpStream);
      END;
    end;

     

  3. 1.       Rename STAR_sisblu_com_br.ca-bundle -> ca_bundle.crt
    2.      Rename STAR_sisblu_com_br.crt -> certificate.crt
    3.      Rename STAR_sisblu_com_br.key ->key.pem
    4.      Install OpenSSL  www.hacom.de/temp/Win64OpenSSL_Light-1_1_1k.exe
    5.      In OpenSSL commandline go to directory, where the files are saved and call :
                  openssl x509 -in certificate.crt -out cert.pem -outform PEM
                  openssl x509 -in ca_bundle.crt -out root.pem -outform PEM

    6.      Copy the files key.pem, cert.pem and root.pem (certificate.crt, ca_bundle.crt are optional) in to appropriate directory

  4. Try this in UniServerModule->CustomCss:

    .bigcheck input[type="checkbox"] {
      width: 25px !important;
      height: 25px !important;
    }

    and put "bigcheck" in the LayoutConfig->Cls of the TUnimCheckBox

     

    Sorry - I've misunderstood you... I thought you want to increase the size of the checkbox.

  5. Hello Farshad and Unigui crew!

    I'm using UniGui only for mobile purpose. Since I've bought the license, there was only few development concerning the mobile components.

    In a few months an extension of my license is necessary, but I have doubts that the development improves concerning mobile components. 

    As x11 mentioned in this post 

    there are a lot of bugs and meaningful improvements but only few (or none) of that points were done. 

    So please, is there a realistic chance, that development of the mobile components will increase in the early future?

    I'm sure, I'm not alone with this opinion...

    Regards

    Mike

    • Upvote 1
  6. On 9/20/2021 at 11:03 AM, Abaksoft said:

    Thank you IrigSoft,

    When runing the appli I have an AV on :  SessionManager.Sessions.Lock;   (on TUniServerModule.UniThreadTimer1Timer)

    Because of :   SessionManager.Sessions.Lock;     

    I remember a few days you solved it (on a precedent topic). Is this sample updated ? 

    Thx.

    Hello!

    How do you resolve this AV? 

  7. Hello!

    I've found the problem after 30 hours of testing.

    The error 1400 occurs because of a memory leak.

    I forgot to free one object in OnCalcFields event of a FDQuery. So the consumption of memory aumented fast.

  8. Hello!

    I need some JS-scripts to address a UnimMemo.

    I use Form->Script:

    Ext.form.TextArea.prototype.deleteAtCursor = function(txt) {
        var val = this.getValue(),
            start = this.inputElement.dom.selectionStart,
            end = this.inputElement.dom.selectionEnd;
    
        this.setValue(val.substring(0, start - 1) + val.substring(end));
        this.inputElement.dom.selectionStart = this.inputElement.dom.selectionEnd = start - 1;
        Ext.defer(function() { this.focus(false); }, 10);
    }

    to do a backspace and it works!

    I use Form->Script:

    Ext.form.TextArea.prototype.insertAtCursor = function(txt) {
        var val = this.getValue(),
            start = this.inputElement.dom.selectionStart,
            end = this.inputElement.dom.selectionEnd;
    
        this.setValue(val.substring(0, start) + txt + val.substring(end));
        this.inputElement.dom.selectionStart = this.inputElement.dom.selectionEnd = start + txt.length;
        Ext.defer(function() { this.focus(false); }, 10);
    } 

    to insert text and it works, too!

    But when I put both together in Form->Script, then an error occurs saying: "Ajax Error: unexpected identifier!"

    Isn't it allowed to have more than one function in a script? Or is there a special syntax necessary?

    I know, that these problems are based on my lack of understanding Sancha and JS, so it's very frustrating to have to ask every time things, that normally could be done on my own.

    Thanks in advance

  9. Just now, Sherzod said:

    Or do you mean showing the virtual keyboard?

    Yes - if the form opens, the memo isn't focused. That means 1. no cursor is visible in the memo area and 2. the virtual keyboard isn't displayed.

    But I've tested it now on different devices and browsers. It only doesn't work on iOS/Safari. 

  10. Hello!

    I bet, this is a stupid question, but I want to set the focus of an UnimMemo automatically when the form opens.

    I've tried
    - OnFormShow -> UnimMemo1.Setfocus  : doesn't work
    - Form1.ActiveControl:=UnimMemo1 : doesn't work

    Only way to focus the memo is to tap it.

  11. Hello!

    If I try to add a string to UnimMemo, 2 linefeeds are added:

    UnimMemo1.Text:='Hello!';
    UnimMemo1.Text:=UnimMemo1.Text+'Test';

    The result is:

    Quote

    Hello!
    Test
    <cursor is here>

    So I tried this solution:

    But this doesn't work with UnimMemo (Ajax error: undefined is not an object (evaluating 'Ext.form.field.TextArea.prototype') )

  12. Hello!

    It's a step in the right direction.

    But I need the CellEditor for most of the columns and a "special" editor for a few columns.

    If I disable option "dgEditing", I have to open my editor for every column which the user wants to edit - that's not good.

    If I enable option "dgEditing", it works nearly perfect, but to make my editor work correctly, I need to disable "dgEditing" before the editor opens. After closing the editor I try to enable "dgEditing" again, but that doesn't work.
    Here's my code:
     

    procedure TForm.UnimDBGrid1AjaxEvent(Sender: TComponent; EventName: string; Params: TUniStrings);
    var columnIDX : INTEGER;
    begin
        if EventName = '_doubleclick' then 
        begin
            columnIDX:=Params['colidx'].AsInteger;
            
            if columnIDX=2 then 
            begin
                try
                    UnimDBGrid1.Options:=UnimDBGrid1.Options-[dgEditing];
                    FEditor.ShowModal;
                finally
                    UnimDBGrid1.Options:=UnimDBGrid1.Options+[dgEditing]; // that has no effect
                end;
                // here I save the text in my editor memo to the text-field
                QTable.FieldByName('TEXT').AsString:=FEditor.UnimMemo1.Text;
            end;
        end;
    end; 

     

  13. OK! This is the demo-project "DBGrid Editors" (modified with activated "CellEditor"-property). DBGrid Editors.rar

    When I want to display a calculator, when the user edits the salary-column, I need an event fireing when the user doubleclick the salary-field.

    And I want to display an extra editor-form when the user edits the name-colum for example. 

    In my application one column holds a lot of text and calculations, so I need to open a special editor-form when the user double-click this cell.

×
×
  • Create New...