.. include:: ../../toolkit-substitutions
.. include:: ../substitutions

.. oe:namespace:: OEDepict

.. _OEDepict_OEDrawSVGHoverText:


.. oe:function:: OEDrawSVGHoverText


   .. oe:language:: c++ java csharp

      .. oe:api::

         bool OEDrawSVGHoverText(OE2DMolDisplay& disp, OE2DAtomDisplay* adisp,
                                 const std::string& text, const OEFont& font)
         bool OEDrawSVGHoverText(OE2DMolDisplay& disp, OE2DBondDisplay* bdisp,
                                 const std::string& text, const OEFont& font)

   .. oe:language:: python

      .. oe:api:: python

         OEDrawSVGHoverText(arg1: OE2DMolDisplay, arg2: OE2DAtomDisplay,
                            text: str, font: OEFont) -> bool
         OEDrawSVGHoverText(arg1: OE2DMolDisplay, arg2: OE2DBondDisplay,
                            text: str, font: OEFont) -> bool

   Creates and interactive effect in :file:`.svg` images.
   The given text will appear when the mouse is hovering
   over the position defined by the given atom / bond display.

   .. note::

      This functionality is **only available** for :file:`.svg`
      image format. In other image formats it has no effect.

      The generated :file:`svg` image should be included into and
      HTML page with the SVG MIME type.

      .. code-block:: console

         <object data="<imagename>.svg" type="image/svg+xml"></object>

   .. seealso::

      * :ref:`chapter_svg` chapter

   *disp*
      The :ref:`OE2DMolDisplay <OEDepict_OE2DMolDisplay>` object that holds the
      data necessary to depict the molecule with which it is
      initialized.

   *adisp*
      The :ref:`OE2DAtomDisplay <OEDepict_OE2DAtomDisplay>` object that defines where the
      text will appear.

   *bdisp*
      The :ref:`OE2DBondDisplay <OEDepict_OE2DBondDisplay>` object that defines where the
      text will appear.

   *text*
      The text that appears when the cursor is hovered over the given position.

   *font*
      The graphical properties of the font used to draw the text.

   .. oe:source:: HoverAtomText.cpp
      :language: c++
      :frag:     SNIPPET-HOVERATOMTEXT

   .. oe:source:: HoverAtomText.py
      :language: python
      :frag:     SNIPPET-HOVERATOMTEXT

   .. oe:source:: HoverAtomText.java
      :language: java
      :noindent:
      :frag:     SNIPPET-HOVERATOMTEXT

   .. oe:source:: HoverAtomText.cs
      :language: csharp
      :noindent:
      :frag:     SNIPPET-HOVERATOMTEXT

   .. only:: oehtml

      .. oe:language:: c++

         .. admonition:: Download code

            :download:`HoverAtomText.cpp <../../../../../sublibs/tklibs/depict/examples/docs/HoverAtomText.cpp>`

      .. oe:language:: python

         .. admonition:: Download code

            :download:`HoverAtomText.py <../../../../../wrappers/python/docexamples/depict/HoverAtomText.py>`

      .. oe:language:: java

         .. admonition:: Download code

            :download:`HoverAtomText.java <../../../../../wrappers/java/examples/openeye/docexamples/oedepict/HoverAtomText.java>`

      .. oe:language:: csharp

         .. admonition:: Download code

            :download:`HoverAtomText.cs <../../../../../wrappers/csharp/Csharp-Examples/OEDepictDocs/HoverAtomText.cs>`


   .. _figure_OEDrawSVGHoverText_Atom:

   .. only:: oehtml

      .. raw:: html

         <p align="center">
         <b>hover mouse over any atoms</b>
         </p>

         <p align="center">
         <object data="../../_images/HoverAtomText.svg" type="image/svg+xml"  width = "400" ></object>
         <p>

         <p align="center">
         <b>Example of using the OEDrawSVGHoverText function for atom positions</b>
         <p>

      .. the below is necessary to copy over the image to the build subdirectory

      .. image:: ../images/HoverAtomText.svg
         :width: 1pt

   .. only:: oepdf

      |NOPDFIMAGE|

   .. oe:source:: HoverBondText.cpp
      :language: c++
      :frag:     SNIPPET-HOVERBONDTEXT

   .. oe:source:: HoverBondText.py
      :language: python
      :frag:     SNIPPET-HOVERBONDTEXT

   .. oe:source:: HoverBondText.java
      :language: java
      :noindent:
      :frag:     SNIPPET-HOVERBONDTEXT

   .. oe:source:: HoverBondText.cs
      :language: csharp
      :noindent:
      :frag:     SNIPPET-HOVERBONDTEXT


   .. only:: oehtml

      .. oe:language:: c++

         .. admonition:: Download code

            :download:`HoverBondText.cpp <../../../../../sublibs/tklibs/depict/examples/docs/HoverBondText.cpp>`

      .. oe:language:: python

         .. admonition:: Download code

            :download:`HoverBondText.py <../../../../../wrappers/python/docexamples/depict/HoverBondText.py>`

      .. oe:language:: java

         .. admonition:: Download code

            :download:`HoverBondText.java <../../../../../wrappers/java/examples/openeye/docexamples/oedepict/HoverBondText.java>`

      .. oe:language:: csharp

         .. admonition:: Download code

            :download:`HoverBondText.cs <../../../../../wrappers/csharp/Csharp-Examples/OEDepictDocs/HoverBondText.cs>`


   .. _figure_OEDrawSVGHoverText_Bond:

   .. only:: oehtml

      .. raw:: html

         <p align="center">
         <b>hover mouse over the middle of any bonds</b>
         </p>

         <p align="center">
         <object data="../../_images/HoverBondText.svg" type="image/svg+xml"  width = "400" ></object>
         <p>

         <p align="center">
         <b>Example of using the OEDrawSVGHoverText function for bond positions</b>
         <p>

      .. the below is necessary to copy over the image to the build subdirectory

      .. image:: ../images/HoverBondText.svg
         :width: 1pt

   .. only:: oepdf

      |NOPDFIMAGE|

   .. seealso::

      * :ref:`OE2DMolDisplay <OEDepict_OE2DMolDisplay>` class
      * :ref:`OE2DAtomDisplay <OEDepict_OE2DAtomDisplay>` and :ref:`OE2DBondDisplay <OEDepict_OE2DBondDisplay>` classes
      * :ref:`OEFont <OEDepict_OEFont>` class
      * :oe:func:`OEDepict::OEDrawSVGToggleText` function
