|
forums.silverfrost.com Welcome to the Silverfrost forums
|
View previous topic :: View next topic |
Author |
Message |
dpannhorst
Joined: 29 Aug 2005 Posts: 165 Location: Berlin, Germany
|
Posted: Tue Jul 15, 2008 8:14 am Post subject: Selection of all items in %lv |
|
|
How can I select all items of a listview by pressing "ctrl A" for example?
I have build a callback function for "ctrl A". There I am setting the select array to 1 and I use call window_update@(items) to update all items. But nothing is happening??? |
|
Back to top |
|
|
IanLambley
Joined: 17 Dec 2006 Posts: 490 Location: Sunderland
|
Posted: Tue Jul 15, 2008 10:50 am Post subject: |
|
|
Either set the return value of your %ac[CTRL+A] callback to 1 to update all controls, or call window_update@(sel) within the callback, where "sel" is the integer*4 array whose elements are set to 1 if the item is selected otherwise to zero.
I used %lv[show_selection_always,full_row_select]
Regards
Ian |
|
Back to top |
|
|
dpannhorst
Joined: 29 Aug 2005 Posts: 165 Location: Berlin, Germany
|
Posted: Wed Jul 16, 2008 4:37 pm Post subject: |
|
|
Maybe I have not explained my problem exactly:
If I select some (or all) item(s) in the sel array and update all controls, I expect to see the selected items highlighted.
Also if I preselect some items before calling %lv none of them are highlighted. |
|
Back to top |
|
|
IanLambley
Joined: 17 Dec 2006 Posts: 490 Location: Sunderland
|
Posted: Thu Jul 17, 2008 7:15 pm Post subject: |
|
|
Try this:
This initially sets items 1 and 3 to selected
CTRL+A sets all using callback return of 1
CTRL+B sets all using callback return of 2 & call window_update@(sel)
CTRL+C sets items 2, 4 & 6 using callback return of 1
It works for me FTN95 version 5.21.0
Regards
Ian
Code: |
!Selecting cells in %lv
!
include <windows.ins>
PARAMETER (N=20)
INTEGER sel,view
CHARACTER*200 info
COMMON sel(n-1),view,info(n)
INTEGER select_all, select_all_by_update, select_some
EXTERNAL select_all, select_all_by_update, select_some
sel = 0
sel(1) = 1
sel(3) = 1
info = ' '
info( 1) = '|N1_+|N2_+|ODs_+45|ODe_+45|IDs_+45|IDe_+45|Length_+55|Elasticity_+55|Density_+55|Split_+45|N1inc_+45|N2inc_+45'
info( 2) = '|aa|||||||||||'
info( 3) = '|bb|||||||||||'
info( 4) = '|cc|||||||||||'
info( 5) = '|dd|||||||||||'
info( 6) = '|ee|||||||||||'
info( 7) = '|ff|||||||||||'
info( 8) = '|gg|||||||||||'
info( 9) = '|hh|||||||||||'
info(10) = '|ii|||||||||||'
info(11) = '|jj|||||||||||'
info(12) = '|kk|||||||||||'
info(13) = '|ll|||||||||||'
info(14) = '|mm|||||||||||'
view=1
!create list view display
i=winio@('%ww%ca[Listview Select Sample]&')
i=winio@('%bg[btnface]&')
i=winio@('%lv[show_selection_always,full_row_select]&',600,220,info,N,sel,view)
i=winio@('%ac[CTRL+A]&',select_all)
i=winio@('%ac[CTRL+B]&',select_all_by_update)
i=winio@('%ac[CTRL+C]&',select_some)
i=winio@(' ')
END
integer*4 function select_all()
PARAMETER (N=20)
INTEGER sel,view
CHARACTER*200 info
COMMON sel(n-1),view,info(n)
select_all = 1
sel = 1
end
integer*4 function select_all_by_update()
PARAMETER (N=20)
INTEGER sel,view
CHARACTER*200 info
COMMON sel(n-1),view,info(n)
select_all_by_update = 2
sel = 1
call window_update@(sel)
end
integer*4 function select_some()
PARAMETER (N=20)
INTEGER sel,view
CHARACTER*200 info
COMMON sel(n-1),view,info(n)
select_some = 1
sel = 0
do i=2,6,2
sel(i) = 1
enddo
end
|
|
|
Back to top |
|
|
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|