Guidance
指路人
g.yi.org
Guidance Forums / Reginald Rexx / Listbox

Register 
注册
Search 搜索
首页 
Home Home
Software
Upload

  
Forum List • Thread List • Reply • Refresh • New Topic • Search • Previous • Next First 1 Last
Message1. Listbox
#13112
Posted by: gaburton 2009-09-25 18:36:07
How can I select and highlight a listbox entry in my script before displaying the initial screen?
George
George
Message2. This is how I do it with one of my scripts
#13113
Posted by: Michael S 2009-09-26 15:44:29

/***************************************************************
 Update the progress list to show what's happening              
***************************************************************/ 
insert_progress_list:

USE ARG string

guisendmsg('progress_list', 'ADDSTRING', , string)
guigetmsg('CLEAR')

/* Make sure we set focus on the current line in the
   results, so the user doesn't have to "scroll" all the time */
count = count + 1
progress_list = count
guisetctlvalue('progress_list')

RETURN 0		
This presupposes that you have defined your list with

LIST 14, 62, 504, 246, NOTIFY|REALHEIGHT|KEYS|BORDER|VSCROLL|TABSTOP, INDEX, progress_list

By doing the guisetctlvalue above, you're saying "highlight the count'th row of the the list". If you don't have the index option, then you need to know the contents of the row (and for my progress lists, that's highly unlikely)
Message3.
#13114
Posted by: gaburton 2009-09-26 19:11:47
Thanks, this solved my problem.
George
Message4.
#13115
Posted by: gaburton 2009-09-28 00:27:36
Is it possible to access the "text" in a listbox after defining it with the INDEX option?
George
Message5. How do you mean ?
#13116
Posted by: Michael S 2009-09-28 01:22:27
Where has the data for the listbox come from ?
Message6.
#13117
Posted by: gaburton 2009-09-28 04:59:17
I'm using the following statements to load the listbox (Listfiles).

error = GuiSendMsg("Listfiles", "DIR",, "!*.txt")
error = GuiSendMsg("Listfiles", "DIR",, "~*.txt")
error = GuiSendMsg("Listfiles", "InsertString",,"~None")


error = guisetctlplacement('Listfiles')

Thanks,
George
Message7.
#13118
Posted by: Jeff Glatt 2009-09-28 08:46:32
Yes, but you need to know the line number you want (where the first line is 1, the second line is 2, etc). Send the GETLBTEXT message with GuiSendMsg, and pass the line number, and the quoted name of a variable where you want the text returned.
/* Get the first line */
linenum = 1
guisendmsg("Listfiles", "GETLBTEXT", linenum, "MYVARIABLE")
SAY myvariable
Message8.
#13119
Posted by: gaburton 2009-09-28 09:22:00
Great!
George
Forum List • Thread List • Reply • Refresh • New Topic • Search • Previous • Next First 1 Last
掌柜推荐
 
 
 
 
 
 
 
 
 
 
 
 
© Thu 2024-3-28  Guidance Laboratory Inc.
Email:webmaster1g.yi.org Hits:0