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 

8.71 Change in %ps responses

 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> Support
View previous topic :: View next topic  
Author Message
wahorger



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

PostPosted: Wed Apr 07, 2021 3:03 pm    Post subject: 8.71 Change in %ps responses Reply with quote

I am still investigating, but there seems to be a problem with %ps. I use this a lot. I have not tested every window.

In one window where one %ps tab (the second one) has a listview, if I sort the listview and re-display, the first tab of the %ps gains focus. The sort works fine, but focus does not stay on the tab. I have this occurring on more than one window. While annoying, I can still select each tab to perform the functions needed.

On another window, I cannot select any tab but the first one to have focus. Selecting the second or subsequent tabs will cause that tab to be displayed as a flash, then focus returns to the first tab. This renders the functionality unusable.

Note that these two examples do not respond to tab selections or update events in the same way.

I am posting this as a "heads-up" for those using %ps.
Back to top
View user's profile Send private message Visit poster's website
wahorger



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

PostPosted: Wed Apr 07, 2021 4:32 pm    Post subject: Reply with quote

In my second case (re: cannot select any but the first tab), the following change was required.

The %ps had a call back. Because the tab with the listview (the first tab) needs to have the control refreshed, the %ps callback returned a value of 1. Changing this to a value of 2 allows all the tabs to now be individually selected. The %ps does not have a sheet number variable. I have provided the winio@() call for reference.

Code:
i = winio@('%^5ps[hot_track]&',window_sheet(5),window_sheet(1),window_sheet(2),window_sheet(3),window_sheet(4),handle_lithology_initial_display_callback)


I am suspicious that other %ps with a callback will require the same fix.

As a point to note, I do have individual controls inside of the tab that have callbacks attached. These control callbacks do not appear to cause any of the behavior as described, just the callback associated with a %ps.
Back to top
View user's profile Send private message Visit poster's website
wahorger



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

PostPosted: Wed Apr 07, 2021 4:50 pm    Post subject: Reply with quote

In looking at the code for my first example (re: performing an operation on the %lv in the second tab causes the first tab to be selected), the %ps does not have a callback attached. However, the callback for the %lv control (on the second tab) involved does have a callback and returns a 1 if and only if a specific action is taken. For example selecting a line of lines of the listview does not return a 1, but sorting on a column of data does. If I perform the sort, the first tab is then displayed, not the second. Stated another way, returning a value of 1 for a %lv control inside a %ps will force the first tab to be selected.

I have a button inside this second tab that, when selected, performs an action on the listview and returns a value of 1. Selecting this button does not cause the first tab to be selected.

N.B. I was finding that calling window_update@() specifically for my listview's was causing unnecessary processing to occur when also returning a 1 from the callback. Just bad form. So, I have gone through all the %lv callbacks making sure that only if the listview table is needing change with value of 1 be returned, thus allowing the system to update the display of the listview table.
Back to top
View user's profile Send private message Visit poster's website
PaulLaidler
Site Admin


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

PostPosted: Wed Apr 07, 2021 5:22 pm    Post subject: Reply with quote

Bill

If you conclude that there is a regression in ClearWin+ can you send me a sample program to look at.
Back to top
View user's profile Send private message AIM Address
wahorger



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

PostPosted: Wed Apr 07, 2021 5:29 pm    Post subject: Reply with quote

I'll give it a shot. Nothing I have is small enough.....
Back to top
View user's profile Send private message Visit poster's website
wahorger



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

PostPosted: Wed Apr 07, 2021 6:25 pm    Post subject: Reply with quote

The following will cause it to occur.

There are two tabs. The second tab has the listview.

Select the tab labelled "lv only'. If you single click on a line on the left hand listview, only the selection occurs. I have verified (separately) that the callback returning a value of 1 does occur.

If you double click on that line, it will take you back to the first tab.

Clicking on the button whose callback returns 1 will also cause no ill effects.

Anything you do on the right hand listview has no ill effects.

Code:

   winapp
   PROGRAM MAIN
        use mswin
        integer:: i,j,k
   integer:: child_1(2)=0
        integer,external:: lv_callback_1,lv_callback_2
        character*32:: lv1(3),lv2(3)
        integer:: sel1(2)=0,sel2(2)=0
        data lv1/
     $   '|col1|col2|col3|',
     $   '!data1|||',
     $   '|data2|||'/
        data lv2/
     $   '|col1|col2|col3|',
     $   '!data1|||',
     $   '|data2|||'/

   i = winio@('%sh&',child_1(2))
        i = winio@('%ca[buttons only]&')
        i = winio@('%^bt[Button callback 1] &',lv_callback_1)
        i = winio@('%^bt[Button callback 2] &',lv_callback_2)
        i = winio@('')

   i = winio@('%sh&',child_1(1))
        i = winio@('%ca[lv only]&')
        i = winio@('%^lv&',100,100,lv1,3,sel1,3,lv_callback_1)
        i = winio@('%^lv&',100,100,lv2,3,sel2,3,lv_callback_2)
        i = winio@('%ff%2nl&')
        i = winio@('%^bt[Button callback 1] &',lv_callback_1)
        i = winio@('%^bt[Button callback 2] &',lv_callback_2)
        i = winio@('')

        i = winio@('%2ps[hot_track]',child_1(2),child_1(1))
        end
   integer function lv_callback_1()
        lv_callback_1 = 1
        return
        end
        integer function lv_callback_2()
        lv_callback_2 = 2
        return
        end
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 -> Support 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