TheSwamp
Code Red => Visual DCL Programming => AutoLISP (Vanilla / Visual) => OpenDCL => Topic started by: Guest on October 04, 2007, 09:47:17 AM
-
I've also posted over here (http://www.opendcl.com/forum/index.php?topic=61.0), but thought I'd ask here as well since this site gets more attention.
So here goes...
How can I automatically select a listbox item and highlight it? I only know the text of the item, not it's number (location) in the list.
Thanks.
-
Method SetSel
This method will set the indicated list item in a multiple selection ListBox as selected or unselected.
AutoLISP Syntax:
(dcl_ListBox_SetSel Text_Numbering_V1_0_Form1_ListBox23
nIndex [as Integer]
nIsSelected [as Integer: 0 = Not Selected, 1 = Selected])
I don't undersand because there is three forums 'VisualDCL Programming', 'OpenDCL' and 'ObjectDCL'? What for 'VisualDCL Programming'?
-
Method SetSel
This method will set the indicated list item in a multiple selection ListBox as selected or unselected.
AutoLISP Syntax:
(dcl_ListBox_SetSel Text_Numbering_V1_0_Form1_ListBox23
nIndex [as Integer]
nIsSelected [as Integer: 0 = Not Selected, 1 = Selected])
I don't undersand because there is three forums 'VisualDCL Programming', 'OpenDCL' and 'ObjectDCL'? What for 'VisualDCL Programming'?
Thanks but I don't know what number the text is in the list so the Integer piece is useless to me right now until I can determine where in the list the text resides - unless I'm missing something.
-
To find Index of text string use FindStringExact method, then select it with SetSel method.
Method FindStringExact as Integer
This method finds the first string in a ListBox that contains a list item with the exact string match without changing the ListBox selection. A search for "Example Text" will find "Example Text". Use the dcl_ListBox_SelectString function instead to both find and select a string.
AutoLISP Syntax:
(Setq rValue (dcl_ListBox_FindStringExact Text_Numbering_V1_0_Form1_ListBox23
SearchString [as String]))
-
To find Index of text string use FindStringExact method, then select it with SetSel method.
Method FindStringExact as Integer
This method finds the first string in a ListBox that contains a list item with the exact string match without changing the ListBox selection. A search for "Example Text" will find "Example Text". Use the dcl_ListBox_SelectString function instead to both find and select a string.
AutoLISP Syntax:
(Setq rValue (dcl_ListBox_FindStringExact Text_Numbering_V1_0_Form1_ListBox23
SearchString [as String]))
or use dcl_ListBox_SelectString (see bolded and enlarge sized line in quote above, by me)
-
To find Index of text string use FindStringExact method, then select it with SetSel method.
Method FindStringExact as Integer
This method finds the first string in a ListBox that contains a list item with the exact string match without changing the ListBox selection. A search for "Example Text" will find "Example Text". Use the dcl_ListBox_SelectString function instead to both find and select a string.
AutoLISP Syntax:
(Setq rValue (dcl_ListBox_FindStringExact Text_Numbering_V1_0_Form1_ListBox23
SearchString [as String]))
or use dcl_ListBox_SelectString (see bolded and enlarge sized line in quote above, by me)
'snot working, man! What version are you running? I've got 4.0.2.4.
-
'snot working, man! What version are you running? I've got 4.0.2.4.
Wow you're way out of date dude.
The current stable version is 4.0.3.1 & the experimental 4.1 alpha version is 4.1.0.9.
You should at least update to 4.0.3.1 https://sourceforge.net/project/showfiles.php?group_id=187950&package_id=220267&release_id=482977 (https://sourceforge.net/project/showfiles.php?group_id=187950&package_id=220267&release_id=482977)
-
I don't undersand because there is three forums 'VisualDCL Programming', 'OpenDCL' and 'ObjectDCL'? What for 'VisualDCL Programming'?
This post should actually be in the "OpenDCL" forum, since thats what is seams you're asking about...
"ObjectDCL" is anther product.
"VisualDCL Programming" is for stuff like using VBA forms with Lisp or just basic DCL forms.
-
> Matt W
'snot working, man!
Do you really think that?
>BazzaCAD
"ObjectDCL" is anther product.
I know it, because pay for it 300$ aproximetely 3 years ago. But this product (in that time) had too many bags with Atocad crach :( I have some programs on it (for my own and my friends usage), but can't offer it to other people.
"VisualDCL Programming" is for stuff like using VBA forms with Lisp or just basic DCL forms.
Now it's clear for me.
-
> Matt W
'snot working, man!
Do you really think that?
Can you post a short, working example because what I've got isn't working.
-
I just peeked in here, and saw what was posted, and you question. I don't use OpenDcl .... so I'm no much help in this forum. :roll:
-
Matt, try installing the latest version of OpenDCL and let us know whether you still have the problem.
-
There is short example.
-
Yes, it is latest 4.1 Alpha 9.
-
There is short example.
Can you post it as a ZIP instead of a RAR?
-
There is short example.
Can you post it as a ZIP instead of a RAR?
Matt,
here's the essential code ASMI posted ..
;;
;; For the example, assume the ARX is loaded
;;
(defun c:swtest ()
(if (not (dcl_project_load "SWTest" t))
(progn (alert (strcat "SWTest ERROR!" "Can't load file: SWTest.odcl"))
(quit)
)
(progn (dcl_form_show SWTest_Form1))
)
(princ)
)
(defun c:SWTest_Form1_TextButton4_OnClicked (/ rValue)
(if (/= -1
(setq rValue (dcl_listbox_findstringexact
SWTest_Form1_ListBox1
(dcl_control_gettext SWTest_Form1_TextBox2)
)
)
)
(dcl_listbox_setcursel SWTest_Form1_ListBox1 rValue)
(alert "There isn't that string!")
)
(princ)
)
-
.. this of course finds the FULL exact string if it exists,
use (dcl_ListBox_FindString ... if you are looking for a match with partial data .. but that will also require a 'Next Match' option be coded.
/// kwb
-
Can you post it as a ZIP instead of a RAR?