[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 483: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/bbcode.php on line 112: preg_replace(): The /e modifier is no longer supported, use preg_replace_callback instead
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4668: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3815)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4670: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3815)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4671: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3815)
[phpBB Debug] PHP Warning: in file [ROOT]/includes/functions.php on line 4672: Cannot modify header information - headers already sent by (output started at [ROOT]/includes/functions.php:3815)
XWidgetSoft Forum • View topic - Help me with these script... Clone doesn't seem to work

XWidgetSoft Forum

XWidget & XLaunchpad , Desktop customization
It is currently April 16th, 2024, 3:39 pm

All times are UTC - 8 hours




Post new topic Reply to topic  [ 12 posts ] 
Author Message
PostPosted: April 8th, 2014, 7:48 am 
Offline
User avatar

Joined: March 8th, 2013, 10:27 pm
Posts: 353


Attachments:
sidebar_dock.xwp [6.77 KiB]
Downloaded 192 times

_________________
Life is a myriad game... Just play it!
Top
 Profile  
 
PostPosted: April 8th, 2014, 9:31 am 
Offline
User avatar

Joined: December 5th, 2012, 5:52 pm
Posts: 4887
One thing that I found is that you forgot to fill the "OnClick" function of the template with the "!Open".
But tested and even with this code the shortcut doesn't work/open the file.
Why not use shortcuts like a normal dock widget..?

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


Top
 Profile  
 
PostPosted: April 8th, 2014, 6:13 pm 
Offline
User avatar

Joined: June 10th, 2012, 5:57 am
Posts: 313
var icon = template.Clone(list);
icon.parent = list;
icon.scripter = widget.scripter;


Top
 Profile  
 
PostPosted: April 8th, 2014, 6:20 pm 
Offline
User avatar

Joined: March 8th, 2013, 10:27 pm
Posts: 353

_________________
Life is a myriad game... Just play it!


Top
 Profile  
 
PostPosted: April 8th, 2014, 6:22 pm 
Offline
User avatar

Joined: March 8th, 2013, 10:27 pm
Posts: 353

_________________
Life is a myriad game... Just play it!


Top
 Profile  
 
PostPosted: April 8th, 2014, 6:35 pm 
Offline
User avatar

Joined: June 10th, 2012, 5:57 am
Posts: 313
all icons have been created.
if you set icon.src = WidgetPath+'default.png', you can see them after adding shortcuts.
but their src don't change. it's strange.


Top
 Profile  
 
PostPosted: April 8th, 2014, 10:13 pm 
Offline
User avatar

Joined: March 8th, 2013, 10:27 pm
Posts: 353
Yes... that's the problem... Something with the core?

I even tried using an image inplace of the button, still nothing...

_________________
Life is a myriad game... Just play it!


Top
 Profile  
 
PostPosted: April 8th, 2014, 11:07 pm 
Offline

Joined: June 18th, 2012, 12:07 am
Posts: 268
As you have already said the shortcuts and icons are created... if you right click on the shortcuts and select - edit shortcut - the path, name and ICON appear correctly.
If you edit shortcut 1 it updates OK, so shortcut 1 is working all OK.
So if shortcut 1 works OK ... What is the difference between shortcut 1 and the others ???
As you said it seems to be the clone process that makes it not work ???


Top
 Profile  
 
PostPosted: April 9th, 2014, 12:03 am 
Offline
User avatar

Joined: March 8th, 2013, 10:27 pm
Posts: 353
Thanks qiancang... A little hint was enough!
Looks like we needed to set the absolute path of the icon not the relative ones...

icon.Coreformat = WidgetPath+'\\%item'+i+'_Icon';

However, this causes the !Open to not fire correctly... Still, a fix was possible using event handlers.

Will post the scripts after a little finishing touches :mrgreen:

_________________
Life is a myriad game... Just play it!


Top
 Profile  
 
PostPosted: April 9th, 2014, 5:05 am 
Offline
User avatar

Joined: June 10th, 2012, 5:57 am
Posts: 313
for(i = 1; i<= nIcons; i++) {
var icon = template.Clone(list);
widget.InitControl(icon); // it's necessary!
icon.Parent = list;
icon.Name = "icon"+i;
icon.Top = (i-1)*72 + 4;
icon.Left = 0;
icon.Core = shortcutlistcore1;
icon.Coreformat = '%item'+i+'_Icon';
icon.Visible = true;
}


Top
 Profile  
 
PostPosted: April 10th, 2014, 12:10 am 
Offline
User avatar

Joined: March 8th, 2013, 10:27 pm
Posts: 353
When was this method added??

_________________
Life is a myriad game... Just play it!


Top
 Profile  
 
PostPosted: April 10th, 2014, 12:22 am 
Offline
User avatar

Joined: June 10th, 2012, 5:57 am
Posts: 313


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

All times are UTC - 8 hours


Who is online

Users browsing this forum: No registered users and 25 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:  
cron

Powered by phpBB® Forum Software © phpBB Group