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 

close editable list box(%el) automatically

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



Joined: 27 Mar 2009
Posts: 11

PostPosted: Mon Jun 01, 2009 8:53 pm    Post subject: close editable list box(%el) automatically Reply with quote

hi,
i am making use of %^el[extended] so that i will be able to call the call back function every time i select a item from the editable list box.

the problem is once the item is selected it does the draw commands in call back function but the list box is open and i close it all the time with done button i created.

is there a way to close the list box automatically once the item is selected.i tried giving the call back function a -ve return value but it shows run time error.

any help is much appreciated.
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 7923
Location: Salford, UK

PostPosted: Tue Jun 02, 2009 8:31 am    Post subject: Reply with quote

It always helps if you can give us a short program to work on.
Back to top
View user's profile Send private message AIM Address
Anupriya



Joined: 27 Mar 2009
Posts: 11

PostPosted: Tue Jun 02, 2009 5:46 pm    Post subject: Reply with quote

here is the program,

PROGRAM
EXTERNAL CLOSEWIN, LSFUNCTION
..
..
CHARACTER A(2)*5
DATA(A(I),I=1,2)/'A','B'/
CHARACTER K
K="A"
I=WINIO@('%CA[......]&')
...
....
....
I= WINIO@('%2nl select:^7.3el[extended]&',angle,2L,k,lsfunction)
I=WINIO@('%2nl%^bt[DONE],CLOSEWIN)
END

INTEGER FUNCTION LSFUNCTION()
INTEGER ITEM
ITEM=CLEARWIN_INFO@['EDITABLE_LISTBOX_INDEX']
IF (ITEM.EQ.1) THEN
..
..(DRAW THIS)
END IF
IF (ITEM.EQ.2) THEN
..
..(DRAW THIS)
END IF
LSFUNCTION=1
END

THE PROGRAM WORKS FINE,BUT EVERY TIME WHEN I SELECT THE ITEM IT DOES THE DRAWING BUT I CLOSE THE BOX WITH THE DONE BUTTON.
I WAS WONDERING IF THERE IS A WAY TO CLOSE THE LIST BOX AUTOMATICALLY ONCE THE ITEM IS SELECTED.
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 7923
Location: Salford, UK

PostPosted: Tue Jun 02, 2009 7:26 pm    Post subject: Reply with quote

This works OK...

Code:
PROGRAM test
EXTERNAL lsfunction
CHARACTER*5 a(2),k
DATA(a(I),I=1,2)/'A','B'/
integer lsfunction,winio@,closewin
I=WINIO@('%ca[......]&')
I=WINIO@('%2nl select:%^7.3el[extended]&',a,3,k,lsfunction)
I=WINIO@('%2nl%^bt[DONE]','EXIT')
END

INTEGER FUNCTION lsfunction()
INTEGER item
INCLUDE <windows.ins>
item=clearwin_info@('EDITABLE_LISTBOX_INDEX')
IF (item.EQ.1) THEN
  PRINT*, "1"
END IF
IF (item.EQ.2) THEN
  print*, "2"
END IF
lsfunction=0
END
Back to top
View user's profile Send private message AIM Address
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