dcl_BlockList_SetCurSel

Started by scottcd, April 29, 2009, 04:05:27 AM

Previous topic - Next topic

scottcd

I am trying to create a legend. Please see attached files.

In trying to 'select all' I cannot seem to get (dcl_BlockList_SetCurSel Legend_Form1_BlockList1 -1) to work ?

Additionally, if I drag from the blocklist to the listbox the icon etc is removed from the blocklist, but if I try to use multiple selection can this be replicated?

Thanks in advance

Scott
OpenDCL Version 5.1.0.3


Fred Tomke

Hello,

removing items while drag and drop is by design. You can suppress this when you activate OnDragDropBegin at the blocklist and OnDragDropFromControl at the list on the right. In that case you can control which item has to be copied to the right by yourself.

(dcl_BlockList_SetCurSel Legend_Form1_BlockList1 -1) is only for deselecting all. For selecting all items you have to create a loop to select every single item. At least don't forget to set the focus to the list, otherwise you won't see the selection.

Try the code below:

Code (autolisp) Select

(defun c:Legend_Form1_TextButton2_OnClicked (/ intCnt)     ; Select All Button
  (repeat (setq intCnt (dcl_BlockList_GetCount Legend_Form1_BlockList1))
    (dcl_BlockList_SetCurSel Legend_Form1_BlockList1 (setq intCnt (1- intCnt)))
  ); repeat
  (dcl_Control_SetFocus Legend_Form1_BlockList1)
); c:Legend_Form1_TextButton2_OnClicked


Fred
Fred Tomke
Dipl.-Ing. (FH) Landespflege

[ landscaper - landscape developer - digital landscape and urban design]

scottcd

Thanks Fred,

I will give that a shot :-\

Cheers

Scott


owenwengerd

In addition to what Fred said, note that holding the [Ctrl] button during a drag/drop operation turns it into a copy operation instead of a move operation.
Owen Wengerd (Outside The Box) / ManuSoft

scottcd

Thanks for the help.

I have added your suggestions and the resulting files are now uploaded to Show your stuff.

I was thinking about refining it a bit further.

Is it possible to filter the blocks shown in the blocklist so blocks contained within an xref are not displayed ?

Thanks

Scott

owenwengerd

Quote from: scottcd on May 01, 2009, 04:43:33 AM
Is it possible to filter the blocks shown in the blocklist so blocks contained within an xref are not displayed ?

No, but if there was a DeleteItem method for block list controls, you could remove the xref blocks with your own code. I suggest adding a feature request for a BlockList_DeleteItem method.
Owen Wengerd (Outside The Box) / ManuSoft

scottcd

Thanks for the reply Owen.

I will submit this request.

Cheers
Scott