soccer jersey forums.silverfrost.com :: View topic - %th[ms_style] with read-only controls
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 

%th[ms_style] with read-only controls

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



Joined: 30 Aug 2007
Posts: 50
Location: munich

PostPosted: Wed Jan 25, 2023 5:26 pm    Post subject: %th[ms_style] with read-only controls Reply with quote

I want to use %th with the new scaling option (which implies the ms_style option), but I get a Clearwin+-Error: "Read-only controls can't have ms_style tooltips."
Is there a way to avoid this error?
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


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

PostPosted: Wed Jan 25, 2023 6:18 pm    Post subject: Reply with quote

Ralf

If you are using recent DLLs for the ClearWin+ library you will get the option to continue and ignore the error.

If you have this option and are able to continue, do tooltips appear for the read only controls? I presume that they don't.

If they do appear then I can suppress the error report for you.
If they don't appear then the question is "how can you make a control read only but still active for tooltips?".

If you can present a short sample program then I will be able to investigate further.
Back to top
View user's profile Send private message AIM Address
Ralf



Joined: 30 Aug 2007
Posts: 50
Location: munich

PostPosted: Thu Jan 26, 2023 10:42 am    Post subject: Reply with quote

Thanks for the reply, Paul
Yes, I get the option to continue and ignore the error, but the tooltips of the read only controls don't appear.
Here is a simple example:
Code:

program test_th

 integer :: winio@, iw

 real*8 :: var1, var2

 var1 = 1.1d0
 var2 = 2.2d0
 
 iw = winio@ ('%th[scaling=1.3]&', 1)
 iw = winio@ ('%?8rf[help-text 1]%2nl&',var1)
 iw = winio@ ('%`?8rf[help-text 2]%2nl&',var2)
 iw = winio@ ('%cn%bt[Close]')
 
 stop
end
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


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

PostPosted: Fri Jan 27, 2023 9:19 am    Post subject: Reply with quote

Ralf

I have had a look at this and this feature is not currently available in ClearWin+ but could be added.

I will add this to the list as a request for a new feature.
Back to top
View user's profile Send private message AIM Address
PaulLaidler
Site Admin


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

PostPosted: Wed Feb 01, 2023 4:22 pm    Post subject: Reply with quote

Ralf

Although the Microsoft documentation says that a read-only control can have a tooltip (by using its bounding rectangle rather than its HWND) I have not been able to get this to work for 64 bit applications.

As an alternaive solution, I have updated the native tooltips (obtained by avoiding [ms_style]) so that they can look like Microsoft tooltips and so that the font can be scaled.

New options for the native tooltips include:

1) [scale=1.3] this is the same as [scaling=1.3] but does not imply [ms_style].

2) [back_color=<colour>] and [text_color=<colour>]. The default background colour for Microsoft tooltips is white.

With these changes native tooltips can be made to be very similar to Microsoft tooltips particularly if used with [at_curosr]. They will also have the same small shadow.

The downside is that native tooltips don't have the option for a title and icon.

The upgrade will be available in the next release of the DLLs.
Back to top
View user's profile Send private message AIM Address
Ralf



Joined: 30 Aug 2007
Posts: 50
Location: munich

PostPosted: Wed Feb 01, 2023 5:05 pm    Post subject: Reply with quote

Thanks Paul,

this is a great help for me, since more and more users are using 4k-screens.

Ralf
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


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

PostPosted: Thu Feb 02, 2023 10:54 am    Post subject: Reply with quote

The failure when using Microsoft tooltips has now been identified and fixed so [ms_style] tooltips will be available for read-only controls.

The new enhancements for native and ms_style tooltips will remain in place.
Back to top
View user's profile Send private message AIM Address
Ralf



Joined: 30 Aug 2007
Posts: 50
Location: munich

PostPosted: Mon Mar 06, 2023 9:11 am    Post subject: Reply with quote

Paul
The tooltips seem to have still some issues with [ms_style].
I have changed my example as follows:
Code:

module param
 integer(kind=7)  :: handle
 real*8 :: var1, var2
end module param

program test_th
 use param

 integer          :: winio@, iw
 
 external acc

 var1 = 1.1d0
 var2 = 2.2d0
 
 iw = winio@ ('%hw&', handle)
 iw = winio@ ('%sc&', acc)
 iw = winio@ ('%th[scaling=1.3,delay]&', 1, 100)
 iw = winio@ ('%?8rf[help-text 1]%2nl&',var1)
 iw = winio@ ('%`?8rf[help-text 2]%2nl&',var2)
 iw = winio@ ('%cn%bt[Close]')

 stop
end
 
integer function cb_func()
 use param
 cb_func = 1
 var2 = var2 + 0.1d0
end
 
integer function acc()
 use param
 C_EXTERNAL ADD_ACCELERATOR@ '__add_accelerator' (VAL,INSTRING,REF)
 external cb_func
 acc = 2
 CALL ADD_ACCELERATOR@(handle,'F1',cb_func)
end

This example crashes with 'Error: Invalid window' -message when ADD_ACCELERATOR@ is called. It runs as expected when I switch off the ms_style by changing the %th-option 'scaling' to 'scale'.
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


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

PostPosted: Mon Mar 06, 2023 12:01 pm    Post subject: Reply with quote

Ralf

Adding an accelerator in this way for 64 bits does not work at the moment. It works for 32 bits.

I have fixed this for the next release of the DLLs.

I presume there is a reason why you are not simply using %ac when defining the main window.
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