Digital Workshop

Welcome to the Digital Workshop Message Boards
It is currently January 10th, 2025, 10:13 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 3 posts ] 
Author Message
 Post subject: Combobox
PostPosted: February 7th, 2006, 6:30 pm 
Offline

Joined: November 22nd, 2004, 7:26 pm
Posts: 119
Location: Austria
Hi!

Is there any way that you can customize the ListBox object in Opus so that it works like a Combobox (like in Flash). It would be helpful if anyone could attach a simple example.

Greetings

Klaus

_________________
Klaus Rosmanitz
Austria


________
XP Home , Opus Pro 5.5


Top
 Profile  
 
 Post subject:
PostPosted: February 7th, 2006, 8:15 pm 
Offline

Joined: April 1st, 2005, 6:59 pm
Posts: 98
Location: Maastricht, The Netherlands
Opus: V7
OS: Mac OS X 10.7.2 | Windows 8 Dev
System: i5 2.7 | 8G Ram | 1 T HD
Code:
function SearchDB()
{
var db = new Database("FILEDSN=lasselsbergerVT.dsn");
var records = null;

   var sql = "SELECT * FROM Artikel WHERE Omschrijving LIKE '%"+zoekserie+"%' OR Merk LIKE '%"+zoekserie+"%' OR Code LIKE '%"+zoekserie+"%'OR Kleur LIKE '%"+zoekserie+"%'ORDER BY Code;";
   // Debug.trace(sql+"\n");
   records = db.ExecuteSQL(sql);
   
   
count = records.GetNumberOfRecords()

for (n=0;n<count;n++) {
Listbox.ReplaceSelection(records.Code + " " + records.formaatlengte + " " + records.formaatbreedte + " " + records.afbeelding +"\n")
records.NextRecord()
}
}


Top
 Profile Visit website  
 
 Post subject: More info
PostPosted: February 7th, 2006, 8:19 pm 
Offline

Joined: April 1st, 2005, 6:59 pm
Posts: 98
Location: Maastricht, The Netherlands
Opus: V7
OS: Mac OS X 10.7.2 | Windows 8 Dev
System: i5 2.7 | 8G Ram | 1 T HD
Hi Klaus,

To fast to help! :roll:

Code:
function SearchDB()
{
var db = new Database("FILEDSN=lasselsbergerVT.dsn");
var records = null;

   var sql = "SELECT * FROM Artikel WHERE Omschrijving LIKE '%"+zoekserie+"%' OR Merk LIKE '%"+zoekserie+"%' OR Code LIKE '%"+zoekserie+"%'OR Kleur LIKE '%"+zoekserie+"%'ORDER BY Code;";
   // Debug.trace(sql+"\n");
   records = db.ExecuteSQL(sql);
   
   
count = records.GetNumberOfRecords()

for (n=0;n<count;n++) {
Listbox.ReplaceSelection(records.Code + " " + records.formaatlengte + " " + records.formaatbreedte + " " + records.afbeelding +"\n")
records.NextRecord()
}
}


From my database I read the data into a listbox : Code , formaatlengte, formaatbreedte and afbeelding.

On click the data is sored in a var selected, if you want to store the again in variables in your pub use this script.

Code:
myText.SetSelection(0,-1)
myText.ReplaceSelection(" ")
myText1.SetSelection(0,-1)
myText1.ReplaceSelection(" ")
myText2.SetSelection(0,-1)
myText2.ReplaceSelection(" ")
myText3.SetSelection(0,-1)
myText3.ReplaceSelection(" ")
var myArray = selected.split(" ")
myText.ReplaceSelection(myArray[0])
artikelcode1 = myText.GetSelectionText(myArray[0])
myText1.ReplaceSelection(myArray[1])
x1=myText1.GetSelectionText(myArray[1])
myText2.ReplaceSelection(myArray[2])
x=myText2.GetSelectionText(myArray[2])
myText3.ReplaceSelection(myArray[3])
afbeeldingvt1=myText3.GetSelectionText(myArray[3])


You have to make 3 text fields myText1 etc.

Hope this helps.


cheers

Ronnie


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

All times are UTC [ DST ]


Who is online

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