views:

55

answers:

2

The idea is rather simple. Some datawindow (not web datawindow) varchar fields contain detailed descriptions. I was wondering if it is possible to provide the following (wikipedia-like) functionality to users: The ability to click (or dbl-click or whatever) on specific words of the text, while reading (which somehow should be indicated as clickable - it would be perfect if they could be colored blue but I don't think this is possible) and open a relevant window (or response). Do you think something like this could be implemented?

A: 

if you use a RTF datawindow you can insert hyperlinks (in whatever colour or style you wish)

Colin Pickard
I forgot to say that we use PB 10.5.2!
Brani
+2  A: 

To achieve the colour, you could use a rich text edit style if you're using PB 11.5.

For the hyperlink functionality, I'd try to leverage the Clicked event, trying to identify with SelectedStart() what word has been clicked and then whether or not it is a hyperlink. The column would need to have TabOrder so that a click would place the cursor in the text.

Good luck,

Terry.

Terry
I forgot to say that we use PB 10.5.2!
Brani
Definitely no rich text edit style to control the colour, then. Without the visual indicator, I definitely wouldn't implement this as a Clicked event; as a user, I wouldn't want to click into a field and have something open up on me unexpectedly. I'd stick to DoubleClicked.
Terry
DoubleClicked doesn't give me the word that the user clicked on, just the name of the field. I was thinking to indicate a word like this: $word$, then select it by doubleclicking on it (no code in the event). Then, perhaps, rightclicking the selection would open a custom popup with an option to open the relevant window.
Brani
No, DoubleClick doesn't give you the word, but as I mentioned, I think you can use SelectedStart() to determine where they are doubleclicking, then determine the word yourself. I know the TXText control (which the new post-10 RTE is based on) does hyperlinks, but AFAIK that was part of the functionality stripped out for the PB implementation. I don't think there's an automagic solution based on the native PB controls, but I'd be happy to be proven wrong. For a popup menu, my own preference would be to enable/disable the menu item, but I have no suggestions on how to identify the word RMB'd.
Terry