|
forums.silverfrost.com Welcome to the Silverfrost forums
|
View previous topic :: View next topic |
Author |
Message |
Bartl
Joined: 16 Oct 2009 Posts: 58 Location: München
|
Posted: Tue Apr 01, 2014 2:56 pm Post subject: %ls and %lc don't work together |
|
|
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 |
|
|
jalih
Joined: 30 Jul 2012 Posts: 196
|
Posted: Tue Apr 01, 2014 4:29 pm Post subject: Re: %ls and %lc don't work together |
|
|
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 |
|
|
PaulLaidler Site Admin
Joined: 21 Feb 2005 Posts: 7925 Location: Salford, UK
|
Posted: Wed Apr 02, 2014 8:14 am Post subject: |
|
|
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 |
|
|
Bartl
Joined: 16 Oct 2009 Posts: 58 Location: München
|
Posted: Fri Apr 25, 2014 3:15 pm Post subject: |
|
|
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 |
|
|
|
|
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
|