<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How to trigger an event when I move the cursor from the text? in Archicad C++ API</title>
    <link>https://community.graphisoft.com/t5/Archicad-C-API/How-to-trigger-an-event-when-I-move-the-cursor-from-the-text/m-p/305005#M1697</link>
    <description>&lt;P&gt;There is a specific control in the UD library for displaying links: UD::LinkText. You can find it in the UDLinkText.hpp.&lt;/P&gt;</description>
    <pubDate>Tue, 07 Sep 2021 08:16:41 GMT</pubDate>
    <dc:creator>Miklos Vegh</dc:creator>
    <dc:date>2021-09-07T08:16:41Z</dc:date>
    <item>
      <title>How to trigger an event when I move the cursor from the text?</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/How-to-trigger-an-event-when-I-move-the-cursor-from-the-text/m-p/224876#M1693</link>
      <description>&lt;DIV class="actalk-migrated-content"&gt;I want to use static text as a hyperlink. And for it I need to configure changing of text color, when cursor over on text, the text is red, when the cursor is not over text, the text is blue.&lt;BR /&gt;I am using StaticTextMouseMoved function for, changed text to red color, but is the method called when cursor positioned over the text, and when I remove the cursor from the text it stays red. How to make it blue?
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="cpp"&gt;void Dialog::StaticTextMouseMoved(const DG::StaticTextMouseMoveEvent&amp;amp; ev, bool* noDefaultCursor) 
{ 
    leftText_.SetTextColor(Gfx::Color::Red); 
}&lt;/LI-CODE&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 14 Sep 2021 07:19:29 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/How-to-trigger-an-event-when-I-move-the-cursor-from-the-text/m-p/224876#M1693</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-09-14T07:19:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to trigger an event when I move the cursor from the text?</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/How-to-trigger-an-event-when-I-move-the-cursor-from-the-text/m-p/224877#M1694</link>
      <description>&lt;P&gt;Haven't tried, but maybe the event arrives even if the mouse is not over the control. If so, than you can check the mouse position, and detect if it is over the control.&lt;/P&gt;
&lt;LI-CODE lang="cpp"&gt;Int32 xPos = ev.GetMouseOffset ().GetX ();
Int32 yPos = ev.GetMouseOffset ().GetY ();

if (xPos &amp;gt; 0 &amp;amp;&amp;amp; xPos &amp;lt; staticText.GetWidth () &amp;amp;&amp;amp; yPos &amp;gt; 0 &amp;amp;&amp;amp; yPos &amp;lt; staticText.GetHeight ()) {
	// mouse over the control
} else {
	// mouse not over the control
}&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Sep 2021 19:04:31 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/How-to-trigger-an-event-when-I-move-the-cursor-from-the-text/m-p/224877#M1694</guid>
      <dc:creator>Viktor Kovacs</dc:creator>
      <dc:date>2021-09-08T19:04:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to trigger an event when I move the cursor from the text?</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/How-to-trigger-an-event-when-I-move-the-cursor-from-the-text/m-p/224878#M1695</link>
      <description>Unfortunately, the event arrives even if the mouse only is over control.
&lt;BLOCKQUOTE&gt;Viktor wrote:&lt;BR /&gt;
Haven't tried, but maybe the event arrives even if the mouse is not over the control. If so, than you can check the mouse position, and detect if it is over the control.&lt;BR /&gt;

&lt;PRE&gt;&lt;I&gt;
&lt;/I&gt;Int32 xPos = ev.GetMouseOffset ().GetX ();
Int32 yPos = ev.GetMouseOffset ().GetY ();

if (xPos &amp;gt; 0 &amp;amp;&amp;amp; xPos &amp;lt; staticText.GetWidth () &amp;amp;&amp;amp; yPos &amp;gt; 0 &amp;amp;&amp;amp; yPos &amp;lt; staticText.GetHeight ()) {
	// mouse over the control
} else {
	// mouse not over the control
}
&lt;/PRE&gt;
&lt;/BLOCKQUOTE&gt;</description>
      <pubDate>Tue, 24 Aug 2021 10:00:54 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/How-to-trigger-an-event-when-I-move-the-cursor-from-the-text/m-p/224878#M1695</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-08-24T10:00:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to trigger an event when I move the cursor from the text?</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/How-to-trigger-an-event-when-I-move-the-cursor-from-the-text/m-p/224879#M1696</link>
      <description>&lt;P&gt;I dont know a simple solution. Some tricks, schematically.&lt;BR /&gt;&lt;BR /&gt;1. Dont use changing of text color, but use changing of cursor (hand).&lt;BR /&gt;( There is some ready handler in UDLib, UDLinkItemHandler.hpp )&lt;BR /&gt;&lt;BR /&gt;2. Use PanelIdle event trick&lt;BR /&gt;&lt;BR /&gt;Enable idle event in dialog constructor and attach to the DG::PanelObserver&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="cpp"&gt;	EnableIdleEvent();
	Attach( *this );&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="cpp"&gt;	virtual void Dialog::PanelIdle (const PanelIdleEvent&amp;amp; ev)
	{
		MousePosData mp;
		mp.Retrieve(*this);

		Gfx::Color color = mp.GetItem() == &amp;amp;leftText_ ? Gfx::Color::Red : Gfx::Color::Blue;
		// to avoid flickering
		if ( leftText_.GetTextColor() != color )
			leftText_.SetTextColor( color );
	}&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 08 Sep 2021 19:06:18 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/How-to-trigger-an-event-when-I-move-the-cursor-from-the-text/m-p/224879#M1696</guid>
      <dc:creator>Oleg</dc:creator>
      <dc:date>2021-09-08T19:06:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to trigger an event when I move the cursor from the text?</title>
      <link>https://community.graphisoft.com/t5/Archicad-C-API/How-to-trigger-an-event-when-I-move-the-cursor-from-the-text/m-p/305005#M1697</link>
      <description>&lt;P&gt;There is a specific control in the UD library for displaying links: UD::LinkText. You can find it in the UDLinkText.hpp.&lt;/P&gt;</description>
      <pubDate>Tue, 07 Sep 2021 08:16:41 GMT</pubDate>
      <guid>https://community.graphisoft.com/t5/Archicad-C-API/How-to-trigger-an-event-when-I-move-the-cursor-from-the-text/m-p/305005#M1697</guid>
      <dc:creator>Miklos Vegh</dc:creator>
      <dc:date>2021-09-07T08:16:41Z</dc:date>
    </item>
  </channel>
</rss>

