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 

Address of data being modified by a control
Goto page Previous  1, 2
 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> ClearWin+
View previous topic :: View next topic  
Author Message
wahorger



Joined: 13 Oct 2014
Posts: 558
Location: Morrison, CO, USA

PostPosted: Thu Dec 13, 2018 5:23 pm    Post subject: Reply with quote

Thanks for taking a look, Paul. I'll pursue other options.
Back to top
View user's profile Send private message Visit poster's website
wahorger



Joined: 13 Oct 2014
Posts: 558
Location: Morrison, CO, USA

PostPosted: Fri Dec 14, 2018 10:10 pm    Post subject: Reply with quote

Paul, I am attempting to use this feature with a %ls, but the value returned is always zero.

Are there some controls for which no assignment of User_Data can be made?
Back to top
View user's profile Send private message Visit poster's website
PaulLaidler
Site Admin


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

PostPosted: Sat Dec 15, 2018 9:00 am    Post subject: Reply with quote

No. It should work for any control.

Can you post some code that illustrates the failure?
Back to top
View user's profile Send private message
wahorger



Joined: 13 Oct 2014
Posts: 558
Location: Morrison, CO, USA

PostPosted: Sat Dec 15, 2018 3:50 pm    Post subject: Reply with quote

I used your code, and added the %ls construct. The intent was do decrement "data2" when either (a) data1 was modified, or (b) when a list element was selected.

The address returned was zero (error thrown) when the list was selected.

Code:
!    PROGRAM Simple
 WINAPP
 program main
 integer iw,winio@
 character*1024 buffer
 character*10 list_elements(5)
 integer list_sel
 integer data1,data2
 integer,external::cb ,cb2
 data1 = 0
 data2 = 0
 buffer = " "
 list_elements = 'abcd defg'
 list_sel = 1
 iw = winio@("%ca[User data]&")
 iw = winio@("%30.10^re%ff&",buffer,cb)
 iw = winio@("%ud&", loc(data1))
 iw = winio@("%ff%nl%cn&")
 iw = winio@("%^10rd&",data1,cb2)
 iw = winio@('%ud&',loc(data2))
 iw = winio@('%10rd&',data2)
 iw = winio@('%ff%nl%^10.10ls&',list_elements,5,list_sel,cb2)
 iw = winio@('%ud&',loc(data2))
 iw = winio@(' ')
 print *,data2
 end
 
 integer function cb()
 use clrwin
 integer(7) addr
 addr = clearwin_info@("USER_DATA")
 core4(addr) = core4(addr)+1
 cb = 1
 end function

 integer function cb2()
 use clrwin
 integer(7) addr
 addr = clearwin_info@("USER_DATA")
 core4(addr) = core4(addr)-1
 cb2 = 1
 end function
Back to top
View user's profile Send private message Visit poster's website
PaulLaidler
Site Admin


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

PostPosted: Sat Dec 15, 2018 6:33 pm    Post subject: Reply with quote

Yes. This fails and I have fixed it in ClearWin+. I will aim to send new DLLs early next week.

I think that you probably don't need the line..

Code:
iw = winio@('%ud&',loc(data2))


at about line 20.
Back to top
View user's profile Send private message
wahorger



Joined: 13 Oct 2014
Posts: 558
Location: Morrison, CO, USA

PostPosted: Sat Dec 15, 2018 10:48 pm    Post subject: Reply with quote

The intent was to see, if it worked, that the callback had the correct pointer to the data for that rd field. Obviously, didn't need it, but if it had worked, I wanted to know!

Thanks for all the work. As I go through my code, I'll be adding in the %ud calls to other controls. The way I'm structuring the recode, I retain the existing code to populate various variables, and when the callback is successful with "USER_DATA", I'll begin larger changes. In this case, the %ls was my first set to begin!

Again, many thanks!
Bill
Back to top
View user's profile Send private message Visit poster's website
PaulLaidler
Site Admin


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

PostPosted: Tue Dec 18, 2018 4:17 pm    Post subject: Reply with quote

Bill

Here is a new set of DLLs for you to try....

https://www.dropbox.com/s/9wl57uvg1ct9hp8/newDLLs28.zip?dl=0
Back to top
View user's profile Send private message
wahorger



Joined: 13 Oct 2014
Posts: 558
Location: Morrison, CO, USA

PostPosted: Wed Dec 19, 2018 1:16 am    Post subject: Reply with quote

Paul,

YEAH! This works well. Thank you!

One note: The way I constructed my winio@() calls, except for the first one, used %ob to force formatting. The %ud was then AFTER the %cb. What this did was attach the User Data to the %cb (maybe?).

I restructured my winio@() calls to place the %cb after the %ud, and all is now well.

Just a programming note perhaps for the on-line help.

Again, many thanks.
Bill
Back to top
View user's profile Send private message Visit poster's website
PaulLaidler
Site Admin


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

PostPosted: Wed Dec 19, 2018 8:05 am    Post subject: Reply with quote

Thanks Bill. I can probably fix the problem with %ob/%cb in the ClearWin+ coding.
Back to top
View user's profile Send private message
wahorger



Joined: 13 Oct 2014
Posts: 558
Location: Morrison, CO, USA

PostPosted: Wed Dec 19, 2018 2:37 pm    Post subject: Reply with quote

Thanks, Paul!
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> ClearWin+ All times are GMT + 1 Hour
Goto page Previous  1, 2
Page 2 of 2

 
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