Digital Workshop

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

All times are UTC [ DST ]




Post new topic Reply to topic  [ 20 posts ]  Go to page 1, 2  Next
Author Message
 Post subject: LlistBox with Checked box
PostPosted: February 6th, 2008, 12:38 pm 
Offline

Joined: September 11th, 2006, 2:38 pm
Posts: 125
Hi all,
does anybody know how to put a list with some items and beside each item a check box that you can check it or remove the check from it.
suppose that I have same names .I want some of them for example names that start with M to be checked and then do whatever I want with them.
Any suggestion will be appreciated

_________________
Win windows 7
Opus Pro 9.5


Top
 Profile  
 
 Post subject:
PostPosted: February 6th, 2008, 9:37 pm 
Offline

Joined: November 25th, 2004, 1:24 pm
Posts: 512
Location: Scotland
Opus: 9.75
OS: Win 10
System: Asus i7-7700K 16Gb
you can do this using buttons.create a button, then in properties select the button tab
There you will see various options for a button. You can create radio buttons in which case, only one can be seleced at a time, or check box, which is what you may be looking for??

The buttons can be grouped.


Quote:

Checkboxes and Radio Buttons do not have actions attached in quite the same way as normal buttons. You will need to link the status of the buttons to a variable and then test the variable (using the If statement from the Programming tab, for example) to decide what you should do.



Sandy

_________________
Whoever designed this, never actually used it!


Top
 Profile  
 
 Post subject:
PostPosted: February 6th, 2008, 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
Try the Buttons... as checkboxes or radios as Sandy suggested.
You can set Borders to indicate 'look' for the button state is 'down'.
You could also do the 'Insert Variable' into the Button text, and have that change, say to an 'X', when Button is down (as variable changes).

That all works fine if your list of items is going to be somewhat fixed (in content) and the list isn't any longer than 800 items. More than that and managing individual buttons and maintaining aligment gets to be a chore. :wink:

There are probably some things you could do with String manipulation and or selection styles.
* concatenate or append strings, ReplaceSelection() based on where user clicks... to add or remove special characters.
* toggle between a couple styles (font?) for first character of a line when a user clicks on it.

Those could be somewhat simple, or rather involved. Depending what you're working with. And how much you expect the pub to change.

The approach you choose will depend on what subsequent uses you make of those User selections. It sounds like you might be defining 'sets' on the fly. On the other hand, "...do whatever I want with them..." is hard to read between the lines (pun intended).

Another: If the item list is kept in an external file, you could use ReadLine() functions... and I think you could have a TextObject in parallel as a Control List that would essentially allow User to click on those lines to operate on the other main list.... then control list items are Indices for other Reads and writes with that file.... Just depends on the goal. Also, parallel Arrays may be useful.

Good luck.

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


Top
 Profile  
 
 Post subject:
PostPosted: February 7th, 2008, 6:05 am 
Offline

Joined: September 11th, 2006, 2:38 pm
Posts: 125
Thanks Sandyn and Lar.But what I want to do is in my attached pic.If someone can send an example of it.It will be excellent.


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

_________________
Win windows 7
Opus Pro 9.5


Top
 Profile  
 
 Post subject:
PostPosted: February 7th, 2008, 8:55 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
Opi,

That's the stuff .NET is made of (or has toolkits for). Maybe can be made in HTML, etc.... but I wouldn't want to try it for several hundred lines. Combo, listview, etc.

I'm stumped as to how you'd build that efficiently in Opus. Perhaps it's something for the Wishlist as another object type or tool?

Maybe the code gurus have a way.

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


Top
 Profile  
 
 Post subject:
PostPosted: February 7th, 2008, 11:59 am 
Offline
Godlike
Godlike
User avatar

Joined: March 21st, 2007, 10:44 am
Posts: 3188
Location: UK
Opus: Evolution
It's not that difficult :-)

The bases of the scrolling list is part of the free functions downloadable on our website but rather than simply displaying just the list item you will need a matching box to display / activate the tick. Also rather than using an array for each I would use one array and store a custom object with a prototype for the value and tick status.

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:
PostPosted: February 9th, 2008, 7:29 pm 
Offline

Joined: September 11th, 2006, 2:38 pm
Posts: 125
Thanks for all Who help and who tried thier best to help.


Mack
I know that you always giving the key.Would you mind giving it in an example. I tried your function ,but I really didn't get what I want in this question.

_________________
Win windows 7
Opus Pro 9.5


Top
 Profile  
 
 Post subject:
PostPosted: February 13th, 2008, 5:24 pm 
Offline
Godlike
Godlike
User avatar

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

The principle is to use and offset value in your array. For example, say you have 5 textboxes containing the array variable myList[x]. It would look something like this:

myList[0]
myList[1]
myList[2]

by adding the offset variable Q it would read:

myList[0+Q]
myList[1+Q]
myList[2+Q]

This allows you to alter the value of Q thus altering the which element of the array is displayed. The function IMP uses this method in the menu page. it also shows how to limit an under & over flow for the offset.

I used this method to build a functioning listbox for a client's publication. I can't post the source code but I could post an EXE example show what is possilbe if this helps.

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:
PostPosted: February 13th, 2008, 7:15 pm 
Offline

Joined: December 25th, 2004, 3:31 pm
Posts: 178
Opuslover if you can get this working can you post the code for everyone else to see for future reference.

Would it be possible to use the clone script to make this work?


Top
 Profile  
 
 Post subject:
PostPosted: February 13th, 2008, 7:51 pm 
Offline

Joined: September 11th, 2006, 2:38 pm
Posts: 125
Mack
it sound great,
but the problem is not in the code it's on the shape how to put the checked box beside the listItem?

Roddy
Sure I'll .

cloning sounds great also , we'll wait for Mack clue and we'll see.

_________________
Win windows 7
Opus Pro 9.5


Top
 Profile  
 
 Post subject:
PostPosted: February 13th, 2008, 8:14 pm 
Offline
Godlike
Godlike
User avatar

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

I've created a sample pub that illustrates how this works. I'm not sure if this is the type thing that you're trying to build?

Mack


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

_________________
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:
PostPosted: February 13th, 2008, 8:53 pm 
Offline

Joined: September 11th, 2006, 2:38 pm
Posts: 125
I really Don't know what to say to you.But I always say that you're my teacher.
Thanks alot Mack.

really Great work from someone that always likes to help

_________________
Win windows 7
Opus Pro 9.5


Top
 Profile  
 
 Post subject:
PostPosted: February 14th, 2008, 11:28 am 
Offline

Joined: December 25th, 2004, 3:31 pm
Posts: 178
Excellent work Mack, I was trying to do it with Clone object and placing in a frame beside a list-box object. How did you do your solution.

Is the clone object used. I was working on a solution that would count number of items in list-box and then clone button object with a set distance set between each. Once that was done was about to use an array to keep track of everything.


Code:
for (i = 1; i <= numRecords; i++)
{
featureIdArray[i] = featureList.FeatureID
featureArray[i] = featureList.Name
CustomQuiz_DBArray[i] = featureList.CustomQuizID
   
Text_DB.SetSelection(-1)
Text_DB.ReplaceSelection(featureArray[i] + "\n")
     
myTextClones[i] = Button_Tick.CloneObject(16, -2 + (i * 16), true)
   
if (CustomQuiz_DBArray[i] == true)
   {
   myTextClones[i].SetState(true)
   }
   
featureList.NextRecord();

}


Top
 Profile  
 
 Post subject:
PostPosted: February 14th, 2008, 2:27 pm 
Offline
Godlike
Godlike
User avatar

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

Cheers for shout. Glad that the example illustrates what is possible. Opus really is a wonder tool :-).

No clones aren't used and niether is the Opus Listbox :-) The object is built from scratch including the scrollbar based on the scrolling array technique outlined above.

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:
PostPosted: February 14th, 2008, 10:37 pm 
Offline

Joined: December 25th, 2004, 3:31 pm
Posts: 178
Hi Mack,

So there is no need for clone object, extremely interesting.

I was using a clone system, see attached file I was working on. Looks like I was trying to "kill an ant with an elephant gun".

Would it be possible for you help me out here a bit I understand the soucecode issue. But some further help would be greatly appreciated.


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


Top
 Profile  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 20 posts ]  Go to page 1, 2  Next

All times are UTC [ DST ]


Who is online

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