Jump to content

Resize Component


rtalmeida

Recommended Posts

Hi,

 

it's possible?

 

You can try this approach, but the compatibility is not fully tested, try

 

For example for UniMemo:

function added(sender, container, pos, eOpts) 
{
    sender.resizable = {
        minWidth: 160,
        minHeight: 120,
        dynamic: true,
        pinned: true,
        handles: 's e se',
        heightIncrement: 20,
        widthIncrement: 20
    };
}

Best regards,

Link to comment
Share on other sites

  • 2 years later...
On 1/20/2020 at 12:28 AM, herculanojs said:

For UniMemo:

procedure TMainForm.UniFormCreate(Sender: TObject);
begin
  with UniMemo1.JSInterface do
    JSAddListener('afterrender',
                  'function(){'+
                      'this.initResizable({'+
                      '    minWidth: 100,'+
                      '    minHeight: 100'+
                      '}); '+
                      'this.bodyEl.setStyle("width", "100%");'+
                  '}'
    );

end;

 

  • Like 1
Link to comment
Share on other sites

6 hours ago, Sherzod said:

For UniMemo:


procedure TMainForm.UniFormCreate(Sender: TObject);
begin
  with UniMemo1.JSInterface do
    JSAddListener('afterrender',
                  'function(){'+
                      'this.initResizable({'+
                      '    minWidth: 100,'+
                      '    minHeight: 100'+
                      '}); '+
                      'this.bodyEl.setStyle("width", "100%");'+
                  '}'
    );

end;

 

Not working for UniEdit or UniButton, for example...

Link to comment
Share on other sites

Just now, Артем said:

Not working for UniEdit or UniButton, for example...

Tested in uniedit and working perfect

with UniEdit1.JSInterface do
    JSAddListener('afterrender',
                  'function(){'+
                      'this.initResizable({'+
                      '    minWidth: 100,'+
                      '    minHeight: 100'+
                      '}); '+
                      'this.bodyEl.setStyle("width", "100%");'+
                  '}'
    );
Link to comment
Share on other sites

2 minutes ago, herculanojs said:

Tested in uniedit and working perfect


with UniEdit1.JSInterface do
    JSAddListener('afterrender',
                  'function(){'+
                      'this.initResizable({'+
                      '    minWidth: 100,'+
                      '    minHeight: 100'+
                      '}); '+
                      'this.bodyEl.setStyle("width", "100%");'+
                  '}'
    );

May be this is because I using UniSFBitBtn (SF Components)?

Link to comment
Share on other sites

 how to enable and disable it by clicking a button?

15 hours ago, Sherzod said:

For UniMemo:


procedure TMainForm.UniFormCreate(Sender: TObject);
begin
  with UniMemo1.JSInterface do
    JSAddListener('afterrender',
                  'function(){'+
                      'this.initResizable({'+
                      '    minWidth: 100,'+
                      '    minHeight: 100'+
                      '}); '+
                      'this.bodyEl.setStyle("width", "100%");'+
                  '}'
    );

end;

 

 

Link to comment
Share on other sites

  • 5 weeks later...

Please sign in to comment

You will be able to leave a comment after signing in



Sign In Now
×
×
  • Create New...