XWidgetSoft Forum

XWidget & XLaunchpad , Desktop customization
It is currently May 10th, 2025, 7:14 am

All times are UTC - 8 hours




Post new topic Reply to topic  [ 5 posts ] 
Author Message
 Post subject: Lock Widget Position
PostPosted: November 11th, 2014, 1:13 am 
Offline
User avatar

Joined: October 13th, 2014, 1:04 am
Posts: 13
Hello.
Is it possible to lock the widget position via code?
My purpose would be to have a lock/unlock button for the user to click to lock/unlock the widget (or a certain element).
I couldn't seem to find it via code so far...

Thanks for your help!

-yinas

_________________
-- TheYinas --
on DeviantArt: http://yinas.deviantart.com/


Top
 Profile  
 
 Post subject: Re: Lock Widget Position
PostPosted: November 11th, 2014, 5:16 am 
Offline
User avatar

Joined: December 5th, 2012, 5:52 pm
Posts: 4887
The XW has a default right click option to lock a single widget or all together.
So I don't see the meaning of creating a widget/button like this...
Now if you still want this you need to wait for a reply for the users who know more about js code.

_________________
...and remember: don't take life too seriously...
My profile on Deviantart: http://jimking.deviantart.com/


Top
 Profile  
 
 Post subject: Re: Lock Widget Position
PostPosted: November 11th, 2014, 6:53 am 
Offline

Joined: October 26th, 2013, 8:17 am
Posts: 362
Code:
widget.LockPosition=1  //widget's lockposition will be enabled
widget.LockPosition=0  //widget's lockposition will be disabled
widget.LockPosition=!widget.LockPosition  //will toggle widget's lockposition


Note:
if you want to change the button's image accordingly, better to use if..else instead of above toggling,
since it can get unsync,

example:
Code:
if(widget.LockPosition)
{
widget.LockPosition=0  //widget's lockposition will be disabled
image1.Src="enable.png"
}
else
{
widget.LockPosition=1  //widget's lockposition will be enabled
image1.Src="disable.png"
}


Last edited by hamid on November 11th, 2014, 7:05 am, edited 1 time in total.

Top
 Profile  
 
 Post subject: Re: Lock Widget Position
PostPosted: November 11th, 2014, 6:56 am 
Offline
User avatar

Joined: October 13th, 2014, 1:04 am
Posts: 13
hamid wrote:
Code:
widget.LockPosition=1  //widget's lockposition will be enabled
widget.LockPosition=0  //widget's lockposition will be disabled
widget.LockPosition=!widget.LockPosition  //will toggle widget's lockposition


thank you Hamid, will try it out soon.
.... i thought i tried this one before already <_< *me fail*

_________________
-- TheYinas --
on DeviantArt: http://yinas.deviantart.com/


Top
 Profile  
 
 Post subject: Re: Lock Widget Position
PostPosted: November 11th, 2014, 11:23 am 
Offline

Joined: June 18th, 2012, 12:07 am
Posts: 268
Great reply hamid :)


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 5 posts ] 

All times are UTC - 8 hours


Who is online

Users browsing this forum: No registered users and 12 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  

Powered by phpBB® Forum Software © phpBB Group