I am using SetCurSel method on a ListView control but does not work as
expected.
During initialization of the form I populate the control with data arranged
in three columns and use the SetCurSel method to set the initial selection
on the 10th row of the list.
However when the form is displayed if you press the arrow keys on the
keyboard up or down you will notice that the current selection although
shows to be on item 10 is actually on item 0 and as soon as the down arrow
on the keyboard is pressed the selection moves to item 1 second selection
on the list.
I think this could be a bug in the SetCurSel Method of the ListView
control.
I have attached the related LV.odcl file and following is the AutoLisp Code
that I've used with AutoCAD 2010 plain vanilla.
(defun c:LV ( / )
(or LoadRunTime (load "_OpenDclUtils.lsp") (exit))
(LoadRunTime)
(dcl_Project_Load "LV.odcl" T)
(dcl_FORM_SHOW LV_Form1)
;; The Event handlers manage the form here.
(princ)
)
(defun c:LV_Form1_OnInitialize ( / Row)
(dcl_ListView_AddColumns LV_Form1_ListView1 '(("A") ("B") ("C")))
(dcl_ListView_SetColumnWidth LV_Form1_ListView1 0 100)
(dcl_ListView_SetColumnWidth LV_Form1_ListView1 1 150)
(dcl_ListView_SetColumnWidth LV_Form1_ListView1 2 200)
(setq Row 1)
(repeat 100
(setq Row (+ (dcl_ListView_AddString LV_Form1_ListView1 (strcat (itoa
Row) "\t123\t" "ABC")) 2))
)
;; I think the following function SetCurSel does not work as expected
(dcl_ListView_SetCurSel LV_Form1_ListView1
10)http://sourceforge.net/account/login.php?return_to=%2Ftracker%2F%3Ffunc%
3Dadd%26group_id%3D187950%26atid%3D923363
)
PLEASE NOTE! Same behavior on the 5.0.2.4 release and AutoCAD 2009.
Owen Wengerd
ARX General
None
Public
|
Date: 2009-07-09 16:10 This is now fixed for Beta 7. |
| Filename | Description | Download |
|---|---|---|
| LV.odcl | Download |
| Field | Old Value | Date | By |
|---|---|---|---|
| status_id | Open | 2009-07-09 16:10 | owenwengerd |
| resolution_id | None | 2009-07-09 16:10 | owenwengerd |
| category_id | None | 2009-07-09 16:10 | owenwengerd |
| assigned_to | nobody | 2009-07-09 16:10 | owenwengerd |
| close_date | - | 2009-07-09 16:10 | owenwengerd |
| File Added | 332816: LV.odcl | 2009-06-29 17:06 | renencon |