Digital Workshop

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

All times are UTC [ DST ]




Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: Listbox w/ Tickbox -- I have one nagging obstacle
PostPosted: March 26th, 2009, 9:13 am 
Offline
Godlike
Godlike

Joined: November 12th, 2005, 1:56 am
Posts: 1474
Location: SFBay Area
Opus: OpusPro v9.0x, & Evol.
OS: Vista32
System: Core 2 duo 2Ghz, RAM 3GB, Nvidia Go 7700 - laptop
Previous posts pointed the way, albeit with different approaches, to creating a functional Listbox object that would have Checkboxes. I did not want to go with the scrolling Frame approach.
viewtopic.php?t=3098&highlight=listbox

I need help with one last piece that needs 'fixing'.

The Listbox and tickboxes work fine with one exception. When the first selection is made anywhere in the Listbox, the first character of the first entry (index 0) is changed when it should not be changed. I just can't find where I am causing that in the script functions.

What IS working:
I populate the Listbox from an array with names.
I run through a For Loop which inserts a single character and a Tab (\t) at the beginning of each line. I then change the Text Style of that character to use WingDings font.

All is good so far.
When a Listbox selection is made, I call another script function to get the first char of the one line and use ReplaceSelection() to essentially overwrite it with the "Checked Box" WingDing character.

Even that works correctly for almost all selections -- except the flawed changing of 1st char in line 0.

If someone can find a way past my mistake, we'll have a pretty nifty widget I think.

Thanks.
Larry

[Lar Edit:] I found a temporary workaround. Insert the two lines of code at Script line 120
Code:
//a workaround....    some debugging '--' Line 0  of Listbox
Listbox_1.SetSelection(0,1)
Listbox_1.SetSelectionStyle(WingStyle) ;

_________________
_good things come to those who wait(0)_


Top
 Profile  
 
 Post subject:
PostPosted: April 6th, 2009, 11:35 pm 
Offline
Godlike
Godlike

Joined: November 12th, 2005, 1:56 am
Posts: 1474
Location: SFBay Area
Opus: OpusPro v9.0x, & Evol.
OS: Vista32
System: Core 2 duo 2Ghz, RAM 3GB, Nvidia Go 7700 - laptop
I have deleted the earlier .imp File attachment, which had the small glitch.

I've concluded that the small fix I implemented works quite well. So I have attached the modified Opus pub you can download and use. :)

[Lar Edit:] Added note if you're going to use this widget. The values in the Listbox have extra characters in front of the normal text, so if you want to use the variable LBtestSELECT1 that is assigned to Listbox_1 Properties for User's current selection, do something like this: LBtestSELECT1.substring(2)

Note the implementation is all done within the Listbox object. Also it uses certain Fonts for the checkboxes, so make sure client will have Wingdings font. I've attached is a preview image. (note the numbers on the Left side are simply to 'monitor' what is going on with Selections/Deselection -- and can be used to drive other actions or events of course).


Thanks again to Sandyn, JosephP, and Mack who pointed the way.

Enjoy.
Larry


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

_________________
_good things come to those who wait(0)_


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

All times are UTC [ DST ]


Who is online

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