unselect items of a listbox

Started by gdu, July 16, 2007, 02:54:49 AM

Previous topic - Next topic

gdu

i got one form, where i have 2 listboxes, is there is a selction made in listbox A, the selected elements of listbox B should not be highlighted. i tried it with
(defun c:ListBoxCopyPaste_Grenzkat_ListBox3_OnSelChanged (nSelection sSelText /)
  (Odcl_ListBox_SetCurSel ListBoxCopyPaste_Grenzkat_ListBox4 -1)
)
but it doesn´t work.
any help welcome
gert

hope you know what i am supposed to do ;)

Kerry

gert,
I'd like to see a sample LSP and ODCL with a little better description og your question.

Thanks,
Kerry
Perfection is not optional.
My other home is TheSwamp

gdu

#2
ok, maybe some pics make it clear, better than my english ;)
wrong


ok


ok too


So the problem is, if i make a selction in one listbox, i want to unselect (unhighlight) the selected items in the other listbox

owenwengerd

Quote from: gdu on July 17, 2007, 04:18:37 AM
So the problem is, if i make a selction in one listbox, i want to unselect (unhighlight) the selected items in the other listbox

I have attached a small test project that works the way you describe. Does that help?

[attachment deleted by admin]

Kerry

Thanks Owen.
It's lunch time (here) and I logged in to answer this while having munchies ...
Perfection is not optional.
My other home is TheSwamp

gdu

#5
sorry, but i could not get your program to run
if i load the lisp, i get a no function def
dcl_project_load
but i use this line in my lsp for dcl too?!?
and i could not open the odcl to have a look at your example, odcl doesn´t open the odc programm, just odc, and renaming odcl in odc didn´t work  ;D
but i see, that you solve the problem with
(defun c:Test_Form1_ListBox3_OnSelChanged (nSelection sSelText /)
     (dcl_ListBox_SetCurSel Test_Form1_ListBox4 -1)
)
just like i posted in my first entry, so maybe i just have a mixup in my definition or i have to make it with a workaround... store all entries of a listbox in a list, clear the listbox, add the list to the listbox, force an update...

but thanks a lot for your time to give me some help...
mit freundlichem gruß
gert

edit:
i have just seen, that you use
(dcl_ListBox_SetCurSel
instead of
(Odcl_ListBox_SetCurSel
like i do
i use OpenDCL 4.0.1.8

Kerry

Quote from: Kerry Brown on July 16, 2007, 02:47:00 PM
gert,
I'd like to see a sample LSP and ODCL with a little better description og your question.

Thanks,
Kerry

gert,
can you please attach a sample LSP and ODCL.

also, you may be best downloading and installing the most recent build from SourceForge. ... you are about 4 builds out of date.

regards
Kerry.
Perfection is not optional.
My other home is TheSwamp

gdu

ListBoxCopyPaste.odcl is a ListBoxCopyPaste.odc file, the only file my opendcl editor stores the files

maybe i try to update to the latest version, do my workaround or just ignore the cosmetic troubles

mit freundlichem gruß
gert



[attachment deleted by admin]

dkh007

You need to download the latest OpenDCL (version 4.0.2.2) http://sourceforge.net/project/showfiles.php?group_id=187950 You are using an old beta and the problem you have may simply be related to the beta you are using.
Daniel Hargreaves, AIA, CSI, CDT, RAS
accustudio.com

gdu

i have downloaded the 4.0.2.2 verion, unistalled the old version, installed the new 4.0.2.2 version, and nothing works ;)
so i had to.....

after the install, i haven´t found any arx in the install folder, looked at an example and it seems to be changed something at the (load runtime... stuff
i changed this so that my progromm now starts
than i had wrong function names, because all the names changed from
odcl_form_show
   into
dcl_form_show
so i changed them automatically, but than there was a no funct def at
loaddclproj
which still is
loadodclproj
the new file extention is odcl, so i cant open my old odc files by clicking on them in the explorer, but i can open them when i select all files in the opendcl studio prog. than i can save them as odcl, which makes it possible to open them by clicking.
now everything seems to work, but my
(dcl_form_closeall 0)
which only works, after clicking it twice.... 1. click, you can see the window disapear for 1/100 of a second, than it is up again, click it once more, than it is gone.


gdu

i am now on the newest version, and the problem remains the same, it only works, if selection style is "single" if it is multiple, the setcursel -1 does not work.

BazzaCAD

Quote from: gdu on July 19, 2007, 05:35:33 AM
i have downloaded the 4.0.2.2 verion, unistalled the old version, installed the new 4.0.2.2 version, and nothing works ;)
so i had to.....

after the install, i haven´t found any arx in the install folder, looked at an example and it seems to be changed something at the (load runtime... stuff
i changed this so that my progromm now starts
than i had wrong function names, because all the names changed from
odcl_form_show
   into
dcl_form_show
so i changed them automatically, but than there was a no funct def at
loaddclproj
which still is
loadodclproj
the new file extention is odcl, so i cant open my old odc files by clicking on them in the explorer, but i can open them when i select all files in the opendcl studio prog. than i can save them as odcl, which makes it possible to open them by clicking.
now everything seems to work, but my
(dcl_form_closeall 0)
which only works, after clicking it twice.... 1. click, you can see the window disapear for 1/100 of a second, than it is up again, click it once more, than it is gone.

Most of these changes have been documented in the Help File: http://www.opendcl.com/HelpFiles/main.html & on the SF site.
You can just rename your .odc files to .odcl in Win. Exp. you don't need to open them and resave them.
You can do a find and replace in any text editor to switch the "(odcl_" with "(dcl_" note "(" & "_" so you don't replace other functions that shouldn't be replaced.
a.k.a.
Barry Ralphs
barryDOTralphsATgmailDOTcom

Kerry

#12
Quote from: gdu on July 19, 2007, 05:35:33 AM
..................
the new file extention is odcl, so i cant open my old odc files by clicking on them in the explorer, but i can open them when i select all files in the opendcl studio prog. than i can save them as odcl, which makes it possible to open them by clicking.
now everything seems to work, .................


Have you tried setting your file associations ?

.. just choose one of your .ODC files ...
2 pictures..

[attachment deleted by admin]
Perfection is not optional.
My other home is TheSwamp

Kerry

#13
Quote from: gdu on July 19, 2007, 07:25:34 AM
............... it only works, if selection style is "single" if it is multiple, the setcursel -1 does not work.

Perhaps Try this ..

;; assume the ARX is loaded.
;; load the ODCL

(DCL_PROJECT_LOAD "LB-Test" T)

;; ----------------------------
;; Define Events

(DEFUN c:LB-Test_Form1_DeSelect_OnClicked (/)
    (SETQ
        rValue (DCL_LISTBOX_GETSELECTEDNTHS LB-Test_Form1_ListBox-A)
    )
    (DCL_MESSAGEBOX (VL-PRINC-TO-STRING rValue)
                    "Items to Delelect"
                    2
                    2
    )
    (FOREACH item rValue
        (DCL_LISTBOX_SETSEL LB-Test_Form1_ListBox-A item 0)
    )
)
;; ------------
(DEFUN c:LB-Test_Form1_ListBox-A_OnSelChanged (nSelection sSelText /)
    (FOREACH item
             (DCL_LISTBOX_GETSELECTEDNTHS LB-Test_Form1_ListBox-B)
        (DCL_LISTBOX_SETSEL LB-Test_Form1_ListBox-B item 0)
    )
)
;; ------------
(DEFUN c:LB-Test_Form1_ListBox-B_OnSelChanged (nSelection sSelText /)
    (FOREACH item
             (DCL_LISTBOX_GETSELECTEDNTHS LB-Test_Form1_ListBox-A)
        (DCL_LISTBOX_SETSEL LB-Test_Form1_ListBox-A item 0)
    )
)
;; ----------------------------
;; Define Main Entry Point
(DEFUN c:test () (DCL_FORM_SHOW LB-Test_Form1))

;; ----------------------------
;; Run the routine
(c:test)



.. and attachments ..

[attachment deleted by admin]
Perfection is not optional.
My other home is TheSwamp