forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Selection of all items in %lv

 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> ClearWin+
View previous topic :: View next topic  
Author Message
dpannhorst



Joined: 29 Aug 2005
Posts: 165
Location: Berlin, Germany

PostPosted: Tue Jul 15, 2008 8:14 am    Post subject: Selection of all items in %lv Reply with quote

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
View user's profile Send private message Visit poster's website
IanLambley



Joined: 17 Dec 2006
Posts: 490
Location: Sunderland

PostPosted: Tue Jul 15, 2008 10:50 am    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
dpannhorst



Joined: 29 Aug 2005
Posts: 165
Location: Berlin, Germany

PostPosted: Wed Jul 16, 2008 4:37 pm    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
IanLambley



Joined: 17 Dec 2006
Posts: 490
Location: Sunderland

PostPosted: Thu Jul 17, 2008 7:15 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> ClearWin+ All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
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