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 

Some %BH (bubble help) issue

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



Joined: 09 Apr 2020
Posts: 120

PostPosted: Sun Jun 14, 2020 12:10 pm    Post subject: Some %BH (bubble help) issue Reply with quote

Hello,

I defined for my buttons bubble help strings using %BH command as follows:

Code:

...
CALL ENABLE_UTF8@(1)
...
...
    b1_h='Textový súbor so 7-riadkovou hlavičkou a hodnotami'//char(10)//' X,Y,DX,DY v tvare nepravouholníkovej mriežky, '//char(10)//&
&'(hodnoty X,Y nie sú zoradené vzostupne)'
...
...

ans=winio@('%4nl%ta%bf%fn[Courier New]Zvoľ vstupný TXT súbor:%5ta%bc[yellow]%`^?bt[&Vybrať vstupný súbor]@%`bh&',&
           'FILE_OPENR[Zvoľ súbor]',subor3,sb_vstup3,b1_h,1)
...
...


Regardless of the fact that the function ENABLE_UTF8@(1) does not work correctly in conjunction with %BH (it does not display correctly some letters
with wedge from slovakian alphabet and replaces them with the letter l, although outside %BH has no problems with these letters) I would like to know how to curb/remove an unwanted effect displayed in the picture below:

[url]

[/url]

So, the basic and most important question is: How to remove/delete the unesthethical (ugly) black area surrounding the text in the bubble?

Thanks in advance for some ideas/comments!

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


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

PostPosted: Sun Jun 14, 2020 12:16 pm    Post subject: Reply with quote

%th[balloon] should be used in preference to %bh. With [balloon] you get tooltips that can be changed dynamically. They also can have titles and icons.

[balloon] and other options imply [ms_style] which is the basis for getting all the extra functionality.
Back to top
View user's profile Send private message AIM Address
Martin_K



Joined: 09 Apr 2020
Posts: 120

PostPosted: Sun Jun 14, 2020 12:44 pm    Post subject: Reply with quote

OK Paul, I will use the %TH[balloon] command and will inform about the outcome - thanks!
Back to top
View user's profile Send private message
Martin_K



Joined: 09 Apr 2020
Posts: 120

PostPosted: Sun Jun 14, 2020 8:07 pm    Post subject: Reply with quote

Thanks Paul for your tip - it also works with %th with no option:

[url]

[/url]

With the option [balloon] it looks like follows:
[url]

[/url]

However, some interesting remarks:

I have 4 buttons for which I originally used the %BH. I changed the %BH command on %TH command on one of them only and also the rest 3 buttons which still had %BH active, showed the help as on the changed one (already with %TH). Then, I changed all other %BH to %TH, compiling and linking was OK, but I got a run time error saying the following:
[url]

[/url]

So, I changed the %bh to %th on one button only (all other buttons still have the %bh active) and everything is OK now, I can see the help over them as if all of them had %TH command (what is not true).

The question is: In case, when there are more then ONE button and there is need for bubble help, is it sufficient to use the %TH command only for ONE randomly selected button and the rest (in my case 3 buttons) must have the %BH command?
Back to top
View user's profile Send private message
Martin_K



Joined: 09 Apr 2020
Posts: 120

PostPosted: Sun Jun 14, 2020 8:34 pm    Post subject: Reply with quote

Still one important information remark: I have 4 buttons, but after start of the program, only the 1st button (serving for defining of an input file) and the 4th button (serving to end the program) are active (the other two are inactive and became active only then, when the user selects an input file using the 1st button).

When using %TH command with NO option, I can see the bubble help on all buttons by positioning the cursor over them (regardless whether they are or they are not active).

When I use the %TH with option [balloon], the bubble help is displayed only on currently active buttons (the inactive - greyed out - buttons do not show the bubble help). The bubble help with option [balloon] is only then displayed on inactive buttons, when they become active!
Back to top
View user's profile Send private message
Kenneth_Smith



Joined: 18 May 2012
Posts: 361
Location: Hamilton, Lanarkshire, Scotland.

PostPosted: Sun Jun 14, 2020 9:55 pm    Post subject: Reply with quote

Code:
module exp_mod
use clrwin
implicit none
private ; public exp1
integer :: help_control = 1
integer :: b3_control = 1

contains

integer function exp1()
integer, save :: iw
character(len=100) :: help1 = 'This is the help for button 1'//char(10)//'This is some more help for button 1'
character(len=100) :: help2 = 'This is the help for button 2'//char(10)//'This is some more help for button 2'
character(len=100) :: help3 = 'This is the help for button 3'
iw = winio@('%th[balloon]&', help_control)
iw = winio@('%mn[Exit]&','exit')
iw = winio@('%mn[Tog_help]&',toggle_cb)
iw = winio@('%mn[Tog3]&', tog3_cb)
iw = winio@('%^?tt[One]@&',                cb1, help1)
iw = winio@('%^?tt[Two]@&',                cb2, help2)
iw = winio@('%~^?tt[Three]@&', b3_control, cb3, help3)
iw = winio@(' ')
exp1 = 2
end function exp1

integer function tog3_cb()
  if (b3_control .eq. 1) then
    b3_control = 0
  else
    b3_control = 1
  end if
  tog3_cb = 1
end function tog3_cb

integer function toggle_cb()
  print*, 'toggle'
  if (help_control .eq. 1) then
    help_control = 0
  else
    help_control = 1
  end if
  print*, help_control
  call window_update@(help_control)
  toggle_cb=1
end function toggle_cb

integer function cb1()
  print*, 'CB1' ; cb1 =1
end function cb1

integer function cb2()
  print*, 'CB2' ; cb2 =1
end function cb2

integer function cb3()
  print*, 'CB3' ; cb3 =1
end function cb3

end module exp_mod

program main
use exp_mod
implicit none
integer i
i = exp1()
end
Back to top
View user's profile Send private message Visit poster's website
Martin_K



Joined: 09 Apr 2020
Posts: 120

PostPosted: Mon Jun 15, 2020 10:48 am    Post subject: Reply with quote

Thanks Ken!

Nevertheless, I am keen to get an answer to my question, since at the moment I am confused when using %TH.

Here is the code I have defining the bubble strings and their use with %TH
and also (at the moment) with %BH:

Code:

...
...
call ENABLE_UTF8@(1)
b1_h='Textový súbor so 7-riadkovou hlavičkou a hodnotami'//char(10)//' X,Y,DX,DY v tvare nepravouholníkovej mriežky, '//char(10)//&
&'(hodnoty X,Y nie sú zoradené vzostupne)'
    b2_h='Výstupný súbor, do ktorého sa zapíšu hodnoty X,Y,DX,DY vo'//char(10)//' vzostupnom poradí doplnené hodnotami X,Y,&
& pre ktoré DX=0, DY=0,'//char(10)//'aby sa vytvorila pravouholníková mriežka bodov'
    b3_h='Po zvolení vst. a výst. súboru sa kliknutím'//char(10)//'na tento gombík spustí konverzia údajov'
    b4_h='Ukončenie programu'
...
...

ans=winio@('%4nl%ta%bf%fn[Courier New]Zvoľ vstupný TXT súbor:%5ta%bc[yellow]%`^?bt[&Vybrať vstupný súbor]@%th[balloon]&',&
           'FILE_OPENR[Zvoľ súbor]',subor3,sb_vstup3,b1_h,1) ! NOTE: %TH is used for the first button
...
ans=winio@('%3nl%ta%bf%fn[Courier New]Zvoľ výstupný TXT súbor:%4ta%bc[yellow]%~^?bt[&Vy&brať výstupný súbor]@%bh&',&
           button_grey_control,'FILE_OPENW[Zvoľ súbor]',subor4,sb_vstup4,b2_h,1) ! NOTE - %BH used for the 2nd button!!!
...
...
 ans=winio@('%3nl%ta%bf%fn[Courier New]Spustenie konverzie údajov:%ta%bc[green]%~^?bt[Š&TART]@%bh&',button_grey_control,cont,b3_h,1)  ! NOTE - %BH used for the 3rd button
    ans=winio@('%ta%bf%fn[Courier New]Koniec programu:%ta%bc[red]%^?bt[&KONIEC]@%bh',knc,b4_h,1) ! NOTE - %BH used for the 4th button
...
...


Originally, when I used the %BH for all buttons, I made it according to ClearWin+ manual, where in Chapter HELP is described the use of %BH. At the end of this chapter, there is one sentence that: "...%th is used as an alternative to %`bh. %th provides a help bubble in the form of a
“tooltip”."

So, now, since %BH has a problem with the black area demonstrated above, I tried to use the %TH in the SAME manner like %BH, it means I replaced all %BH commands in my 4 buttons with %TH and got the run time demonstrated above which practically says that it is impossible to use %TH more than once. Based on this information, I let the %TH command ONLY for the 1st button and the rest 3 buttons have %BH as before - and everything works as expected (no black areas appear for the buttons with %BH), the bubble helps for all buttons look nice!

What does it mean? Generally speaking, should I understand that it is required and allowed to use the %TH only ONCE within a program and all other buttons must have %BH? I am totally confused here!

Your code above is - of coarse - crystal clear, I will re-program my code to have clear understanding of the code also for later use, but - really - I would like to know why %TH can be used only once in a program (has different philosophy than %BH?) and when the %TH is used once, whether it takes over the behaviour of %BH, when both are mixed and used as in my case above?

BTW - the function ENABLE_UTF8@(1) works with %TH problem free (all special slovakian letters are displayed correctly). It indicates some internal problem with %BH.

Thanks for the answer/s to my questions and for dispersing of my confusion!

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


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

PostPosted: Mon Jun 15, 2020 12:02 pm    Post subject: Reply with quote

%th (or %bh) is only provided once. The help text is provided via the ? modifier on each item.

ClearWin+ know which item has been used and so can insert the corresponding help text at run time.
Back to top
View user's profile Send private message AIM Address
Kenneth_Smith



Joined: 18 May 2012
Posts: 361
Location: Hamilton, Lanarkshire, Scotland.

PostPosted: Mon Jun 15, 2020 12:03 pm    Post subject: Reply with quote

Martin,

I don’t understand why you want to mix %th and %bh.

If you change the line
Code:
iw = winio@('%th[balloon]&', help_control)

in my example to
Code:
iw = winio@('%bh&', help_control)

you can see either %th or %bh for all buttons. %th is clearly better.

Note that in my example %th appears just once. The help string is added to the control via the @, which I think makes the code much more readable.

You are correct, the behaviour of %th and %bh differ for the case of a button which is inactive. I don’t think this is major issue, Paul may have a comment to make on this.

You should also consider adding an option to permit the user to turn the bubble help off. As soon as they become familiar with the program and what the controls do they rapidly find the help irritating.

Ken[img][/img]
Back to top
View user's profile Send private message Visit poster's website
Martin_K



Joined: 09 Apr 2020
Posts: 120

PostPosted: Mon Jun 15, 2020 2:02 pm    Post subject: Reply with quote

Paul - thanks. I thought that each button, for which the bubble help should be displayed, must have the %BH (or %TH) command. Your explanation is clear, thanks!

Ken, I do not want to mix %BH and %TH at all. Just I was going out from my bad premise that EACH button must have %BH (or %TH). So, initially, I replaced all %BH with %TH and I got the run time error (although there was no run time error when I had the %BH for all buttons). Therefore (to avoid the run time error) I used the %TH once and for all other buttons let the %BH, since it produced no run time error and my thought that all buttons must have either %BH or %TH was satisfied. Paul´s clarification is clear for me now and corrects my bad assumption.

And of coarse, I will built-in the possibility to switch off the bubble help. Thanks Ken!

Martin
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