Join The Works program to have access to the most current content, and to be able to ask questions and get answers from Revelation staff and the Revelation community

At 21 NOV 2019 01:48:34PM Brad Haughn wrote:

Hi All,

I was seeing the option to Draw HTML in edittable column header details. This made me think I could use it to launch a hyperlink (preferably to call some code similar to how we're already using link controls). Is this something that I can do?

If so, how? I tried putting in some simple HTML in the header and it didn't like it (things like a simple <a> tag)

Is it possible to use hyperlinks in the data itself as well?

Either of these would make some of the features we're trying to show off look amazing


At 22 NOV 2019 08:55AM Carl Pates wrote:

Hi Brad,

The DrawHTML functionality and the tags it supports are further documented in "Appendix M" of the PS Reference Manual - you can find this online on this site,or in the OI help.

It's not designed to be true HTML as such, just an easy way to get in some extra formatting options in a familiar manner, so it was never implemented with the intent to support hyperlink tags:

"Several controls support a DRAWHTML property that allows them to use a limited subset of HTML markup tags to control their text formatting. This is not true HTML, rather it is a simple markup language that may offer some familiarity to developers and make it easier to use."

Are you looking for individual words within a cell to be hyperlinked, or while text in the cell? The latter can probably be simulated with some mouse event handling so if you let me know more details I'll see how we can help.

Regards

Carl Pates


At 22 NOV 2019 12:21PM Brad Haughn wrote:

We were looking to use hyperlinks the same as the new hyperlink controls. We already do things with click events which we were excited about not having to do anymore as it would reduce the amount of code we needed and look slicker, but it sounds like we have to continue doing what we're doing.


At 25 NOV 2019 06:05AM Carl Pates wrote:

Hi Brad,

Hopefully that's a bit easier now. I've added a new property for v10.0.8 called HOTPOS which gives you the cell coordinates that the mouse is currently over, so you can use something like this in the MOUSEMOVE event to highlight a column header when the mouse is over it:

   $insert ps_EditTable_Equates

   $insert logical

   $insert colors

   

   hotPos     = get_Property( ctrlEntID, "HOTPOS" )

   prevHotPos = get_Property( ctrlEntID, "@_PREVHOTPOS" )

   

   if ( hotPos != prevHotPos ) then

      

      // Something has changed

      hotCol = hotPos<1>

      hotRow = hotPos<2>

      bShowHdrLink = FALSE$

      

      begin case

         case ( hotRow == 0 )

            // Column Header

            begin case

               case ( hotCol == 2 )

                  bShowHdrLink = TRUE$

            end case

         case OTHERWISE$

            null

      end case

      

      if ( bShowHdrLink ) then

         cellStyle = ""

         cellStyle<PS_EDT_CS_POS_FORECOLOR$> = BLUE$

         cellStyle<PS_EDT_CS_POS_UNDERLINE$> = TRUE$

         call exec_Method( ctrlEntID : ".COLUMNS", "CELLSTYLE", hotCol, PS_EDT_CS_NORMAL$, TRUE$, cellStyle )

      end

      

      if bLen( prevHotPos ) then

         cellStyle = ""

         cellStyle<PS_EDT_CS_POS_FORECOLOR$> = CLR_USEDEFAULT$

         cellStyle<PS_EDT_CS_POS_UNDERLINE$> = FALSE$

         call exec_Method( ctrlEntID : ".COLUMNS", "CELLSTYLE", prevHotPos<1>, PS_EDT_CS_NORMAL$, TRUE$, cellStyle )

      end

      

      call set_Property( ctrlEntID, "@_PREVHOTPOS", hotPos )

      

   end

   

return 1

Then in the CELLCLICK event you just do something like this:

   begin case

      case ( rowNum == 0 )

         begin case

            case ( colNum == 2 )

               call msg( @window, "Col2 Header clicked" )

         end case

   end case

   

return 1

Note that we're setting the Normal state CellStyles here - this is because the EditTable only uses the Hot state CellStyles if the HotTrack and/or HeaderTrack properties are True.

Also - you don't have to wait for HOTPOS - you can do this in MOUSEMOVE instead if you wish:

   hotPos = exec_method( ctrlEntID, "POSBYCLIENTCURSOR", mouseX, mouseY )

   if ( hotPos<1> < 0 ) or ( hotPos<2> < 0 ) then

      hotPos = ""

   end

Thanks

Carl Pates

View this thread on the Works forum...

  • third_party_content/community/commentary/forums_works/d2e2fd6335f6464b83cabb88295f7467.txt
  • Last modified: 2024/01/04 20:57
  • by 127.0.0.1