Silverfrost Forums

Welcome to our forums

%bh - bubble help

8 Nov 2017 9:01 #20691

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

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
8 Nov 2017 9:24 #20692

The order on line 24 should be...

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

I would recommend %th[ms_style] instead of %bh.

8 Nov 2017 10:05 #20693

Thanks Paul,

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

Regards Ken

22 Jan 2018 9:23 #21177

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?

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

22 Jan 2018 10:50 #21178

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:

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

22 Jan 2018 10:51 #21179
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
22 Jan 2018 1:53 #21182

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

24 Jan 2018 11:03 #21210

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?

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
25 Jan 2018 8:11 #21212

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.

25 Jan 2018 9:00 #21213

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.

25 Jan 2018 1:10 #21216

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) 😃

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

25 Jan 2018 2:27 #21220

Quoted from Kenneth_Smith 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) 😃

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:

26 Jan 2018 9:58 #21225

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.

Please login to reply.