interpreting styles in the program
Posted: Fri Jan 25, 2008 3:00 am
Usually when I've worked with RichViews, I have a Style component on the form. I can see what's there and know how to find things in it.
Using SRV, if the user highlights a selection, I can call GetSelectionBounds and identify the item that's been selected. In most cases, in my current app, this'll be a word or phrase that's within one or that spans two items, since the input has been broken into one item per line.
What I need now is when someone highlights a word or phrase that is either a URL, email address, or that represents a URL or email address. Usually I'd test to see if its style# is the same as the one in the Style component that's designated as a URL or Hotlink or something.
But all of the styles in the SRV are embedded inside and they can't be accessed directly (from the IDE).
So ... how do you find out if a given ItemNo selected in the SRV window represents a word or phrase that has a URL or email address attached to it?
Is there a "standard Styles list" defined somewhere? Or are they named?
In my case, the contents of the RVE are normally being created as a result of an Insert File... and reading something like a Word document. It's also possible that they can be created directly within the document itself.
I need to be able to have my program recognize a selection as a URL or "anchor tag" and edit the underlying link. Also, if a URL is typed directly into the document, and someone later selects it, I need to be able to edit it.
That's through my own dialog box, not the built-in "hyperlink" button.
(The built-in "hyperlink" button doesn't seem to recognize that a selected item IS a hyperlink, even though it's displayed in blue with an underline. That is, when I select a hyperlink and click that button, there's no link in the edit box; it's empty. So _something_ is recognizing URLs and email addresses, but not the button you'd expect to do so.)
I also need to know how to set up hyperlinks behind an image -- so when you click on an image, it acts like a text hyperlink.
eg., <a href="myurl"><img href="image"></a>
I don't know if this is a different style, or a property of the image, or something else.
Thanks
-David
Using SRV, if the user highlights a selection, I can call GetSelectionBounds and identify the item that's been selected. In most cases, in my current app, this'll be a word or phrase that's within one or that spans two items, since the input has been broken into one item per line.
What I need now is when someone highlights a word or phrase that is either a URL, email address, or that represents a URL or email address. Usually I'd test to see if its style# is the same as the one in the Style component that's designated as a URL or Hotlink or something.
But all of the styles in the SRV are embedded inside and they can't be accessed directly (from the IDE).
So ... how do you find out if a given ItemNo selected in the SRV window represents a word or phrase that has a URL or email address attached to it?
Is there a "standard Styles list" defined somewhere? Or are they named?
In my case, the contents of the RVE are normally being created as a result of an Insert File... and reading something like a Word document. It's also possible that they can be created directly within the document itself.
I need to be able to have my program recognize a selection as a URL or "anchor tag" and edit the underlying link. Also, if a URL is typed directly into the document, and someone later selects it, I need to be able to edit it.
That's through my own dialog box, not the built-in "hyperlink" button.
(The built-in "hyperlink" button doesn't seem to recognize that a selected item IS a hyperlink, even though it's displayed in blue with an underline. That is, when I select a hyperlink and click that button, there's no link in the edit box; it's empty. So _something_ is recognizing URLs and email addresses, but not the button you'd expect to do so.)
I also need to know how to set up hyperlinks behind an image -- so when you click on an image, it acts like a text hyperlink.
eg., <a href="myurl"><img href="image"></a>
I don't know if this is a different style, or a property of the image, or something else.
Thanks
-David