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: 162
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: 5102
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: 162
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: 162
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: 1701
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: 5102
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: 162
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
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