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 

%ls and %lc don't work together

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



Joined: 16 Oct 2009
Posts: 58
Location: München

PostPosted: Tue Apr 01, 2014 2:56 pm    Post subject: %ls and %lc don't work together Reply with quote

Hello, vertical input works ok.
But when I triy to move up with the Cursor up botton, line 1 creates an error.
Is it possible, that %ls and %lc don't work together?

Johann

Code:

module eingaben_modul
integer*4 sel1,icol
character cbez1(3),cinput1*10,cinput2*10
integer*4 ifocus1, ncontrol1, icontrol1(10)
common/ceing/sel1,sel2,cbez1,cbez2,ifocus1, ncontrol1, icontrol1
end module eingaben_modul

winapp 0,0
program eingabe
     
use eingaben_modul
include<windows.ins>

data cbez1   /'A','B','C'/
external ienter_monitor1,iup_monitor1
sel1 = 1
cinput1 = ' '
cinput2 = ' '
icol = rgb@(225,225,225)     
 
i=ifw1()
call add_focus_monitor@(ifw1)
ncontrol1 = 3

i=winio@('%ww%bg[grey]%fn[ARIAL]&')
i=winio@('%ac[Enter]&' ,ienter_monitor1 )
i=winio@('%ac[Up]   &' ,iup_monitor1    )
i=winio@('%ac[Esc]  &','EXIT'           )        
i=winio@('%co[no_data_border]&')

i=winio@('%co[left_justify]%tc[blue]%nl&')
i=winio@('%2nlInput 1:%2ta%~3.4`ls%lc&',cbez1,4L,sel1,1,icontrol1(1)) 
     
i=winio@('%nl%co[right_justify]%nlInput 2&')   
i=winio@('%`bg&', icol)
i=winio@('%ta%rs%lc&',cinput1(1:10),icontrol1(2))

i=winio@('%nl%co[right_justify]%nlInput 3&')   
i=winio@('%`bg&', icol)
i=winio@('%ta%rs%lc',cinput2(1:10),icontrol1(3))

call remove_focus_monitor@(ifw1)
     
stop
end


!-------------------------------------
!  function ienter_monitor1()
!-------------------------------------
integer*4 function ienter_monitor1()
use eingaben_modul 
include <windows.ins>
     
ienter_monitor1=1
if(ifocus1 .eq. icontrol1(ncontrol1))call set_highlighted@(icontrol1(ncontrol1))
if(ifocus1 .ne. icontrol1(ncontrol1))then
do k=1,ncontrol1
if(ifocus1 .eq. icontrol1(k))call set_highlighted@(icontrol1(k+1))
enddo
endif
continue
end

!-------------------------------------
!  function iup_monitor1()
!-------------------------------------
integer*4 function iup_monitor1()
use eingaben_modul
include <windows.ins>

iup_monitor1=1
if(ifocus1 .eq. icontrol1(ncontrol1)) call set_highlighted@(icontrol1(ncontrol1-1))
if(ifocus1 .ne. icontrol1(ncontrol1))then
do l=2,ncontrol1-1
if(ifocus1 .eq. icontrol1(l))call set_highlighted@(icontrol1(l-1))
enddo
endif
end

!-------------------------------------
!  function ifw1()
!-------------------------------------
integer*4 function ifw1()
use eingaben_modul
include <windows.ins>
ifw1=1
ifocus1=clearwin_info@('FOCUSSED_WINDOW')
end

Back to top
View user's profile Send private message
jalih



Joined: 30 Jul 2012
Posts: 196

PostPosted: Tue Apr 01, 2014 4:29 pm    Post subject: Re: %ls and %lc don't work together Reply with quote

Bartl wrote:
Is it possible, that %ls and %lc don't work together?

Try replacing the set_highlighted@() calls with calls to winapi function SetFocus().

Usually TAB-key is used for navigating between controls in a dialog window and is handled automatically.
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


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

PostPosted: Wed Apr 02, 2014 8:14 am    Post subject: Reply with quote

Yes, set_highlighted@ is for edit controls and causes a run time failure when used on a combo box. SetFocus() will work in this context.

Also your callback functions should return 2 rather than 1 to avoid a screen refresh.
Back to top
View user's profile Send private message AIM Address
Bartl



Joined: 16 Oct 2009
Posts: 58
Location: München

PostPosted: Fri Apr 25, 2014 3:15 pm    Post subject: Reply with quote

I found an api example with

im = SendMessage(icontrol1(1),EM_SETSEL,0,-1)
im = SetFocus(icontrol1(1))

which works very good

Thanks for the help
Back to top
View user's profile Send private message
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