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 

%bh - bubble help

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



Joined: 18 May 2012
Posts: 175
Location: Glasgow, Scotland.

PostPosted: Wed Nov 08, 2017 10:01 am    Post subject: %bh - bubble help Reply with quote

I was experimenting with a new format code %bh (new to me anyway) last night.

Can somebody tell me where I am going wrong in line 20 of the code below. At run time I get an error message saying the help string is missing.

Thanks

Ken

Code:
program test
implicit none
include<windows.ins>
integer i
integer      :: bubble_help_control
real(kind=2) :: val

!
!The help string is either surrounded by square brackets, or an @ character
!is placed in the format string to indicate that the help string is supplied as an extra
!argument.

val = 0.d0
bubble_help_control = 1
i = winio@('%rb[Enable Bubble Help]&', bubble_help_control)
i = winio@('%2nl%ws&','Input a number')
i = winio@('%ta%?rf@%bh&', val, 'Enter a value', bubble_help_control) ! This works as expected
i = winio@(' ')

val = 0.d0
bubble_help_control = 1
i = winio@('%rb[Enable Bubble Help]&', bubble_help_control)
i = winio@('%2nl%ws&','Input a number')
i = winio@('%ta%?rf%bh[Enter a value]&', val, bubble_help_control)  ! What is wrong with this line?
i = winio@(' ')
end

Back to top
View user's profile Send private message Visit poster's website
PaulLaidler
Site Admin


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

PostPosted: Wed Nov 08, 2017 10:24 am    Post subject: Reply with quote

The order on line 24 should be...

Code:
i = winio@('%ta%?rf[Enter a value]%bh&', val, bubble_help_control) 


I would recommend %th[ms_style] instead of %bh.
Back to top
View user's profile Send private message
Kenneth_Smith



Joined: 18 May 2012
Posts: 175
Location: Glasgow, Scotland.

PostPosted: Wed Nov 08, 2017 11:05 am    Post subject: Reply with quote

Thanks Paul,

That was an easy one for you to answer Very Happy . I'll take a look at %th.

Regards
Ken
Back to top
View user's profile Send private message Visit poster's website
Kenneth_Smith



Joined: 18 May 2012
Posts: 175
Location: Glasgow, Scotland.

PostPosted: Mon Jan 22, 2018 10:23 am    Post subject: Reply with quote

I have been using this a lot now. And my help strings are getting longer.

Is it possible to set the help string up to appear over two lines, rather than a single very long line of text?

In the example code below the help is displayed as:

Percentage tolerance to apply to impedance data specified above. This value must be between -10.0 and +10.0

I would really like to display this as:-

Percentage tolerance to apply to impedance data specified above.
This value must be between -10.0 and +10.0

Is this possible?


Code:
program test
implicit none
include <windows.ins>
integer i
real(kind=2) :: impedance_tol = 5.d0
      i = winio@('%th[delay]&',1,50)
      i = winio@('%2.1ob&')
      i = winio@('%tc&',rgb@(0,0,255))
      i = winio@('%ws%cb&', 'Impedance tolerance [%]')
      i = winio@('%?rf[Percentage tolerance to apply to impedance data specified above. &
                     & This value must be between -10.0 and +10.0]&', impedance_tol)
      i = winio@('%cb&')
      i = winio@('  ')

end program test


Thanks

Ken
Back to top
View user's profile Send private message Visit poster's website
LitusSaxonicum



Joined: 23 Aug 2005
Posts: 1771
Location: Yateley, Hants, UK

PostPosted: Mon Jan 22, 2018 11:50 am    Post subject: Reply with quote

Dare I suggest that additional pop-up help in a control that is labelled inside a %ob-%cb box that can also be labelled, is a bit OTT, especially when it is so lengthy?

There is another approach, which is to provide a readily-accessible 'Help' button, with the resulting dialog able to be of any length and complexity.

Pop-up help of any kind is most useful for toolbars etc where there is no labelling of any kind, just an icon. If it is too lengthy, then other controls are obscured, which isn't always a good thing.

Also, I've found that if %th appears too quickly, it is a bit irritating to a skilled user, and therefore some users prefer to turn it off. I've found that a 300 delay is a compromise where it is still useful, but less irritating.

The Microsoft instructions (at https://msdn.microsoft.com/en-us/library/windows/desktop/dn742494(v=vs.85).aspx and elsewhere) tell us that the key lies in the basic design of the UI. I've found this difficult to do, because I am self-taught, and the instructor didn't know any more than the pupil! I found this quote very telling:

Quote:
Seeking help beyond the primary UI is by its very nature disorienting; do your best to mitigate such an experience by well-designed UI and intelligent "street signs" to direct users to the answers they need.


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


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

PostPosted: Mon Jan 22, 2018 11:51 am    Post subject: Reply with quote

Code:
winapp
program test
implicit none
include <windows.ins>
integer i
real(kind=2) :: impedance_tol = 5.d0
character(256) fmt
      fmt = '%?rf[Percentage tolerance to apply to impedance data specified above.'// &
            & char(10)//'This value must be between -10.0 and +10.0]&'
      i = winio@('%th&',1)
      i = winio@('%2.1ob&')
      i = winio@('%tc&',rgb@(0,0,255))
      i = winio@('%ws%cb&', 'Impedance tolerance [%]')
      i = winio@(trim(fmt), impedance_tol)
      i = winio@('%cb&')
      i = winio@('  ')
end program test
Back to top
View user's profile Send private message
Kenneth_Smith



Joined: 18 May 2012
Posts: 175
Location: Glasgow, Scotland.

PostPosted: Mon Jan 22, 2018 2:53 pm    Post subject: Reply with quote

Thanks Paul that does exactly what I was looking for.

Eddie, I take your points on-board. The boxes are hidden in the final application and I do have a help on/off toggle button.

Ken
Back to top
View user's profile Send private message Visit poster's website
Kenneth_Smith



Joined: 18 May 2012
Posts: 175
Location: Glasgow, Scotland.

PostPosted: Thu Jan 25, 2018 12:03 am    Post subject: Reply with quote

I have noticed that using %th and %`?rh works as expected and displays the help message.

However %th[balloon] and %`?rh does not display a help message, and neither does %th[ms_style] and %`?rh

Is this as expected, or a bug?

Code:
winapp
program test
implicit none
include <windows.ins>
integer i
real(kind=2) :: pf = -0.95d0

      i = winio@('%th&',1)
      i = winio@('%tc&',rgb@(0,0,255))
      i = winio@('%bg[grey]&')   
      i = winio@('%ws&', 'Load power factor')
      i = winio@('%`bg[white]&')
      i = winio@('%2ta%?`rf[Negative value denotes lagging current]&', pf)
      i = winio@('  ')

      i = winio@('%th[ms_style]&',1)
      i = winio@('%tc&',rgb@(0,0,255))
      i = winio@('%bg[grey]&')   
      i = winio@('%ws&', 'Load power factor')
      i = winio@('%`bg[white]&')
      i = winio@('%2ta%?`rf[Negative value denotes lagging current]&', pf)
      i = winio@('  ')

      i = winio@('%th[balloon]&',1)
      i = winio@('%tc&',rgb@(0,0,255))
      i = winio@('%bg[grey]&')   
      i = winio@('%ws&', 'Load power factor')
      i = winio@('%`bg[white]&')
      i = winio@('%2ta%?`rf[Negative value denotes lagging current]&', pf)
      i = winio@('  ')   
       
end program test
Back to top
View user's profile Send private message Visit poster's website
PaulLaidler
Site Admin


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

PostPosted: Thu Jan 25, 2018 9:11 am    Post subject: Reply with quote

It turns out that [balloon] implies [ms_style] and that the ms_style tooltip is disabled when the control is read-only. This can be fixed one way or another. If it is a Microsoft thing then ClearWin+ can report an error. If it is a ClearWin+ thing then it's a ClearWin+ bug that can be fixed.
Back to top
View user's profile Send private message
narayanamoorthy_k



Joined: 19 Jun 2014
Posts: 129
Location: Chennai, IN

PostPosted: Thu Jan 25, 2018 10:00 am    Post subject: Reply with quote

Hi Smith,
This is exactly the Power System Engineering data UI. I recognize here the example displays like the Power factor, Leading current, Lagging Current, Impedance etc, as I am a Power System Engineer. I work on these parameters regularly.
Best wishes to your Bubble help and this is very interesting too.
_________________
Thanks and Regards
Moorthy
Back to top
View user's profile Send private message
Kenneth_Smith



Joined: 18 May 2012
Posts: 175
Location: Glasgow, Scotland.

PostPosted: Thu Jan 25, 2018 2:10 pm    Post subject: Reply with quote

Thanks Paul.

Hi Moorthy, yes I've been working in power system analysis for 30 years - and still get confused with the sign of reactive power (complex power, and positive vars being associated with a negative imaginary current) Smile

Hence my desire for bubble help/tool tips when displaying calculated results.
Back to top
View user's profile Send private message Visit poster's website
narayanamoorthy_k



Joined: 19 Jun 2014
Posts: 129
Location: Chennai, IN

PostPosted: Thu Jan 25, 2018 3:27 pm    Post subject: Re: Reply with quote

Kenneth_Smith wrote:
Thanks Paul.

Hi Moorthy, yes I've been working in power system analysis for 30 years - and still get confused with the sign of reactive power (complex power, and positive vars being associated with a negative imaginary current) Smile

Hence my desire for bubble help/tool tips when displaying calculated results.


Hi Smith,
Very nice to learn that you are a power system engineer with vast experience. I have been working in Power System Analysis engineering for 27 years. Nice meeting you too here.

Its true that this tool tips always helps the users. This is very helpful too, when we work on such a very technical engineering calculations. Idea
_________________
Thanks and Regards
Moorthy
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


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

PostPosted: Fri Jan 26, 2018 10:58 am    Post subject: Reply with quote

It turns out that by default Microsoft tooltips are disabled for read-only controls.

ClearWin+ has now been ammended so that it provides a non-fatal error report in this context.
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