1. Daniel Vivier
  2. PowerBuilder
  3. Monday, 21 March 2022 13:42 PM UTC

I have a radio button column in a DW with 3 options. I'd like to add a tooltip that explained each option as you hovered over it, but as far as I can tell there is only one tooltip for the entire column. Explaining all 3 options in one tooltip would be pretty wordy.

I don't suppose there is a way to achieve this? Maybe it should be an enhancement request?

Mark Goldsmith Accepted Answer Pending Moderation
  1. Monday, 21 March 2022 15:10 PM UTC
  2. PowerBuilder
  3. # 1

Hi Dan,

I don't believe there is a built-in way to accomplish this but you could do so by creating a user event mapped to pbm_dwnmousemove and then change the tool tip on the fly depending upon where the xpos is for horizontally positioned radio buttons and the ypos for vertically positioned radio buttons. You would also want to check for the mouse position being over the object in question and if it isn't do nothing.

The code in the event would look something like the following for two radio buttons side-by-side:

If dwo.Name = "which_continent" Then
	If PixelsToUnits(xpos, XPixelsToUnits!) > 950 Then
		dwo.tooltip.tip = "Select this only for North Amercia"
	Else
		dwo.tooltip.tip = "Select this for all other continents"
	End If
End If

The first tooltip setting is for the radio button on the right and the 950 (PBUs) represents the mouse position just before that radio button starts.

Obviously a downside from coding it as I have is that every time you modify this object (EG its position, the number of options/ radio buttons etc.) you will have to manually change the above code. However, depending on your circumstances and use case it may work for you.

HTH...regards,

Mark

Comment
There are no comments made yet.
Andreas Mykonios Accepted Answer Pending Moderation
  1. Monday, 21 March 2022 14:37 PM UTC
  2. PowerBuilder
  3. # 2

Radio buttons work more like an option list. It's more similar to a dropdown listbox... If you need it to work like that then you may not have any easy solution.

I do like radio buttons working the way checkboxes work. But for that I usually do a custom implementation. There you can have a different tooltip. But it simulates the way a checkbox would work...

Radio buttons above are in different rows. So the whole implementation has a different logic...

Andreas.

Comment
  1. Daniel Vivier
  2. Monday, 21 March 2022 14:44 PM UTC
Sure, if I had lots of screen real estate I could do that. But this is sort of a data-entry DW with multiple rows of data, and I don't want to make each row much higher (and wider) by having longer text in the 3 radio buttons, displayed vertically instead of horizontally.



At this point my solution is going to be using a 3-line tooltip explaining each of the 3 options.
  1. Helpful
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.