Jump to content
uniGUI Discussion Forums

How to move BorderStyle=bsNone Modal form


Recommended Posts

Hi,

Its a  Standart Tuniform, "Header" is TUnilabel and Align is alTop. I added that screenshot, 'cos much better then my english :) form has not caption BorderStyle:=bsNone, so can't move.

Question is, user how can move this form ?

regards

Link to post
Share on other sites
 
procedure TForm.panelMouseDown(Sender: TObject; Button: TMouseButton;  Shift: TShiftState; X, Y: Integer);
 const
   sc_DragMove = $f012;
begin
  ReleaseCapture;
  Perform(wm_SysCommand, sc_DragMove, 0);
end;

this works in vcl, click on the panel and drag the form

Link to post
Share on other sites

Thank you for answers. Sorry for late answer, you know bairam :)

 

@mohammad, Your demo compiled old unigui, so not work on your server. And my question is, can you move that form via mouse?

@wilton_rad  Is vcl mean, non unigui application? If yes how to apply to this to unigui application?

 

Regards

Link to post
Share on other sites

Hi,

 

Also you can try this approach I think:

function window.afterrender(sender, eOpts)
{
    var me = sender;
    
    me.dd = new Ext.dd.DDProxy(me, {
        delegate: me.id
    });
    
    me.dd.afterDrag = (function() {
        me.updateLayout()
    });
    
    Ext.onReady(function() {
        Ext.get(me.id).select(".x-form-field").each(function(el) {
            me.dd.addInvalidHandleId(el.dom.id)
        })
    });
    
    me.el.setStyle('cursor', 'move');
}

http://forums.unigui.com/index.php?/topic/4567-move-tuniform-without-titlebar/

http://forums.unigui.com/index.php?/topic/6321-ot-javascript-profis-dragdrop-of-unipanel/

...

Link to post
Share on other sites
  • 3 months later...
On 6/19/2018 at 6:51 PM, Sherzod said:

Hi,

 

Also you can try this approach I think:


function window.afterrender(sender, eOpts)
{
    var me = sender;
    
    me.dd = new Ext.dd.DDProxy(me, {
        delegate: me.id
    });
    
    me.dd.afterDrag = (function() {
        me.updateLayout()
    });
    
    Ext.onReady(function() {
        Ext.get(me.id).select(".x-form-field").each(function(el) {
            me.dd.addInvalidHandleId(el.dom.id)
        })
    });
    
    me.el.setStyle('cursor', 'move');
}

http://forums.unigui.com/index.php?/topic/4567-move-tuniform-without-titlebar/

http://forums.unigui.com/index.php?/topic/6321-ot-javascript-profis-dragdrop-of-unipanel/

...

 

this code moves the form with all the controls in it. how to move the form with just one control, for example only the unipanel1 can move the form. I tried to modify the code but it didn't work :).

Link to post
Share on other sites

Hello,

Can you try this ?:

function window.afterrender(sender, eOpts)
{
    var me = sender;
    
    me.dd = new Ext.dd.DDProxy(me, {
        delegate: me.id
    });
    
    me.dd.afterDrag = (function() {
        me.updateLayout()
    });
    
    Ext.onReady(function() {
        //Ext.get(me.id).select(".x-form-field").each(function(el) {
        //    me.dd.addInvalidHandleId(el.dom.id)
        //});
        me.dd.setHandleElId(MainForm.UniPanel1.id); //<---------
    });
    
    //me.el.setStyle('cursor', 'move');
}

 

Link to post
Share on other sites

finally i found without having to change the form name :), sory me, extjs newbie

function window.afterrender(sender, eOpts)
{
    var me = sender;
    
    me.dd = new Ext.dd.DDProxy(me, {
        delegate: me.id
    });
    
    me.dd.afterDrag = (function() {
        me.updateLayout()
    });
    
    Ext.onReady(function() {
        me.dd.setHandleElId(sender.owner.UniPanel1.id);
    });
}

Link to post
Share on other sites
  • 9 months later...

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...