Digital Workshop

Welcome to the Digital Workshop Message Boards
It is currently December 23rd, 2024, 2:27 am

All times are UTC [ DST ]




Post new topic Reply to topic  [ 4 posts ] 
Author Message
 Post subject: Custom Listbox
PostPosted: November 9th, 2010, 2:54 am 
Offline

Joined: July 12th, 2009, 10:33 am
Posts: 124
Hi

Following from discussion:
viewtopic.php?f=4&t=4221

I had a go at building a listbox that could be cloned using a mouseclick event and a semi-transparent rectangle to show the selection. This works, but it needs some improvement. I have removed the slide bar because it was causing problems, but will try and replace it later with some fixed scroll gaps (tiny movements would produce the need for extra adjustments).

I need to change the mousewheel functionality in this. For the moment, I have set a ticker to look for changes in the scroll position but will add mousewheel triggers in my pub. There was also a bit of a problem keeping the scroll below (or equal to) 100%. It seems to take a while for the listbox actions to complete, so this check had to be delayed. The result is a bump when you scroll to the bottom.

Anyway, this is a first attempt if it is useful for anyone. It's not complete, but I'm going to transfer it to my pub in this form, so this is as far as the test will get.

Cheers
Dan


You do not have the required permissions to view the files attached to this post.

_________________
V9.6. Windows 10. Testing on PC, Mac, iPad.


Top
 Profile Visit website  
 
 Post subject: Re: Custom Listbox
PostPosted: November 11th, 2010, 8:28 am 
Offline

Joined: July 12th, 2009, 10:33 am
Posts: 124
Had a few problems with the mouse wheel actions. The mousewheeldown event didn't work when set on the listbox, so I had to set it on the page and identify which listbox was being scrolled over using a mouseover. Also, you couldn't set the scroll from the function called by the event handler, so there was nothing to stop the user scrolling to 130%+ which created problems with the selection.

It would be good if DW could allow listbox cloning, as the workaround is pretty difficult. Mack suggested using text boxes to create a custom listbox, which may be easier than this method.

_________________
V9.6. Windows 10. Testing on PC, Mac, iPad.


Top
 Profile Visit website  
 
 Post subject: Re: Custom Listbox
PostPosted: November 11th, 2010, 9:52 am 
Offline
Godlike
Godlike
User avatar

Joined: March 21st, 2007, 10:44 am
Posts: 3188
Location: UK
Opus: Evolution
Hi Dan,

Yes, a challenge but does work. I found the original topic:

viewtopic.php?f=4&t=3098&hilit=listbox

I also dug out the example that I posted back then to have a look as the topic was geared towards custom list-boxes rather than clones. As I expected, it's possible but you must remember that cloned objects (except for simple ones) really need to use OOP for controlling aspects of themselves (IE this) and for data as static object names / variables will refer to more than one occurrence and cause conflicts.

Mack

_________________
When you have explored all avenues of possibilities, what ever remains, how ever improbable, must be the answer.

Interactive Solutions for Business & Education
Learn Anywhere. Learn Anytime.

www.interaktiv.co.uk
+44 (0) 1395 548057


Top
 Profile Visit website  
 
 Post subject: Re: Custom Listbox
PostPosted: November 11th, 2010, 11:35 am 
Offline

Joined: July 12th, 2009, 10:33 am
Posts: 124
Cheers Mack

I've got these cloned listboxes just about stable. The only problems are caused by mouse wheel scrolls, which created a few issues. I'm not 100% happy with the result, but they are functional and tidy most of the time.

I've got the clones up and running well with your OOP. Lots of scripts like the ones below. The programming is perhaps a little long winded, but works.

I was going to drop you a message re. something on your site. Will use the web form.

Cheers
Dan





function CloneShapeSetTransparency(IncDec)
{

for (loop = 1;loop<=CloneNo;loop++)
{

var CloneCloneShape = Clone[loop].GetChild(1)

if(CloneSelected[loop] == 1 || CloneSelectionMade == 0)
{

if (IncDec == null)
{

if(CloneShapeTransparent[loop] == 1)
{
CloneShapeTransparent[loop] = 2;
CloneCloneShape.SetTransparency(100,0)
}
else if(CloneShapeTransparent[loop] == 2)
{
CloneShapeTransparent[loop] = 0;
CloneCloneShape.SetTransparency(0,0)
}
else
{
CloneShapeTransparent[loop] = 1;
CloneCloneShape.SetTransparency(CloneShapeTransparency[loop],0)
}

}

else if (IncDec == "Inc" && CloneShapeTransparency[loop] < 90)
{
CloneShapeTransparent[loop] == 1
CloneShapeTransparency[loop] = CloneShapeTransparency[loop] + 5;
CloneCloneShape.SetTransparency(CloneShapeTransparency[loop],0);
}

else if (IncDec == "Dec" && CloneShapeTransparency[loop] > 10)
{
CloneShapeTransparent[loop] == 1
CloneShapeTransparency[loop] = CloneShapeTransparency[loop] - 5;
CloneCloneShape.SetTransparency(CloneShapeTransparency[loop],0);
}
}
}
}

_________________
V9.6. Windows 10. Testing on PC, Mac, iPad.


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

All times are UTC [ DST ]


Who is online

Users browsing this forum: No registered users and 45 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 © 2000, 2002, 2005, 2007 phpBB Group