<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Серый форум &mdash; AHK: GUI смена фона при наведении на элементы в блоке]]></title>
		<link>https://forum.script-coding.com/viewtopic.php?id=12256</link>
		<atom:link href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=12256&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[Недавние сообщения в теме «AHK: GUI смена фона при наведении на элементы в блоке».]]></description>
		<lastBuildDate>Tue, 27 Dec 2016 22:11:57 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: AHK: GUI смена фона при наведении на элементы в блоке]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=110355#p110355</link>
			<description><![CDATA[<p>Круто, спасибо.</p>]]></description>
			<author><![CDATA[null@example.com (upsi_daezium)]]></author>
			<pubDate>Tue, 27 Dec 2016 22:11:57 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=110355#p110355</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: GUI смена фона при наведении на элементы в блоке]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=110353#p110353</link>
			<description><![CDATA[<div class="codebox"><pre><code>ElemsNumber := 20
logoPath := &quot;D:\Downloads\dJ8db6A.png&quot;  ; указать путь к картинке
MainColor := &quot;F0F0F0&quot;                   ; цвет фона окна
HoverColor := &quot;BBFFFF&quot;                  ; цвет при наведении
width := 300                            ; ширина окна

Gui, Main: -Caption +ToolWindow +hwndhMainGui
Gui, Main: Color, % MainColor

Loop % ElemsNumber  {
   Gui, %A_Index%: Default
   Gui, -Caption +ToolWindow +ParentMain
   Gui, Margin, 0, 0
   Gui, Color, % MainColor
   Gui, Add, Pic, x0 y0, % logoPath
   Gui, Add, Text, x+0 yp+12, result%A_Index%
   Gui, Add, Text, xp y+0 vText, sometext%A_Index%
   if (A_Index = 1)  {
      GuiControlGet, Text, Pos
      height := TextY + TextH
   }
   Gui, Show, % &quot;NA x0 y&quot; (A_Index - 1) * height &quot; w&quot; width
}
Gui, Main: Show, % &quot;NA w&quot; width &quot; h&quot; height * ElemsNumber

OnMessage(0x200, Func(&quot;WM_MOUSEMOVE&quot;).Bind(MainColor, HoverColor, hMainGui))
OnMessage(0x201, &quot;WM_LBUTTONDOWN&quot;)
Return

WM_LBUTTONDOWN()  {
   static start := 0
   if (A_TickCount - start) &lt; 400
      Return
   MsgBox, % A_Gui       ; здесь вместо MsgBox действие при клике по элементу
   Sleep, 400
   start := A_TickCount
}

WM_MOUSEMOVE(MainColor, HoverColor, hGui)  {
   static prev := [], timer
   if (!A_Gui || A_Gui = prev[1])
      Return
   
   Gui, %A_Gui%: Color, % HoverColor
   try Gui, % prev[1] &quot; :Color&quot;, % MainColor
   prev[1] := A_Gui
   
   try SetTimer, % timer, Delete
   timer := Func(&quot;ClearColor&quot;).Bind(A_Gui, MainColor, prev, hGui)
   SetTimer, % timer, 100
}

ClearColor(nGui, MainColor, prev, hMainGui)  {
   MouseGetPos,,, hwnd
   if (hwnd = hMainGui)
      Return
   
   Gui, %nGui%: Color, % MainColor
   prev[1] := &quot;&quot;
   SetTimer,, Delete
}</code></pre></div><p>Пробовал с Progress — не получилось, при смене цвета Progress выходит на передний план.</p>]]></description>
			<author><![CDATA[null@example.com (teadrinker)]]></author>
			<pubDate>Tue, 27 Dec 2016 20:30:59 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=110353#p110353</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: GUI смена фона при наведении на элементы в блоке]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=110351#p110351</link>
			<description><![CDATA[<p><strong>teadrinker</strong> да все, на которые наводишь мышкой, когда убираешь, то цвет в дефолт.<br />П.С. А, спасибо, а то я думал глюк у меня какой-то с этим сервисом.<br /></p><div class="quotebox"><cite>ypppu пишет:</cite><blockquote><p><strong>upsi_daezium</strong>, то есть Вы хотите, чтобы фон изменялся не у всего GUI, а только прямоугольное поле под группой элементов управления?</p></blockquote></div><p>Да, вы все правильно поняли.</p>]]></description>
			<author><![CDATA[null@example.com (upsi_daezium)]]></author>
			<pubDate>Tue, 27 Dec 2016 17:52:50 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=110351#p110351</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: GUI смена фона при наведении на элементы в блоке]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=110350#p110350</link>
			<description><![CDATA[<div class="quotebox"><cite>upsi_daezium пишет:</cite><blockquote><p>первый элемент меняет фон и цвет текста при наведении на него мышкой</p></blockquote></div><p>В смысле, нужно, чтобы все элементы меняли цвет при наведении, или только первый?</p><p>P. S. Неправильно указываете ссылку на картинку, чтобы её было видно здесь. В теге img нужно указывать не ссылку на страницу (http://imgur.com/a/xag1T), а именно на картинку (http://i.imgur.com/9v3c4Rj.png):</p><p><span class="postimg"><img src="http://i.imgur.com/9v3c4Rj.png" alt="http://i.imgur.com/9v3c4Rj.png" /></span></p>]]></description>
			<author><![CDATA[null@example.com (teadrinker)]]></author>
			<pubDate>Tue, 27 Dec 2016 17:03:29 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=110350#p110350</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: GUI смена фона при наведении на элементы в блоке]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=110349#p110349</link>
			<description><![CDATA[<p><strong>teadrinker</strong> вот <a href="http://imgur.com/a/xB3PY">http://imgur.com/a/xB3PY</a> это лого, в последней версии я переделал в формат пнг, потому что он поддерживает полупрозрачность.<br /><span class="postimg"><img src="http://i.imgur.com/dJ8db6A.png" alt="http://i.imgur.com/dJ8db6A.png" /></span><br />А это вариант как я хочу, первый элемент меняет фон и цвет текста при наведении на него мышкой <a href="http://imgur.com/a/xag1T">http://imgur.com/a/xag1T</a>.<br /><span class="postimg"><img src="http://i.imgur.com/9v3c4Rj.png" alt="http://i.imgur.com/9v3c4Rj.png" /></span></p>]]></description>
			<author><![CDATA[null@example.com (upsi_daezium)]]></author>
			<pubDate>Tue, 27 Dec 2016 16:56:34 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=110349#p110349</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: GUI смена фона при наведении на элементы в блоке]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=110346#p110346</link>
			<description><![CDATA[<p><strong>upsi_daezium</strong>, баз наличия Logo.gif-ов эта информация бесполезна.</p>]]></description>
			<author><![CDATA[null@example.com (teadrinker)]]></author>
			<pubDate>Tue, 27 Dec 2016 14:52:24 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=110346#p110346</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: GUI смена фона при наведении на элементы в блоке]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=110344#p110344</link>
			<description><![CDATA[<p>Вывод скрипта.<br />Обратите внимание на прозрачность у картинки первого элемента.<br /><a href="http://imgur.com/a/yUGHp">http://imgur.com/a/yUGHp</a><br /><span class="postimg"><img src="http://imgur.com/a/yUGHp" alt="http://imgur.com/a/yUGHp" /></span></p>]]></description>
			<author><![CDATA[null@example.com (upsi_daezium)]]></author>
			<pubDate>Tue, 27 Dec 2016 14:39:41 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=110344#p110344</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: GUI смена фона при наведении на элементы в блоке]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=110342#p110342</link>
			<description><![CDATA[<p><strong>upsi_daezium</strong>, то есть Вы хотите, чтобы фон изменялся не у всего GUI, а только прямоугольное поле под группой элементов управления?</p>]]></description>
			<author><![CDATA[null@example.com (ypppu)]]></author>
			<pubDate>Tue, 27 Dec 2016 14:34:30 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=110342#p110342</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: GUI смена фона при наведении на элементы в блоке]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=110341#p110341</link>
			<description><![CDATA[<p><strong>upsi_daezium</strong>, так у меня-то этих картинок нет. Но задача ясна, могу написать свой пример без этих картинок. Либо дайте на них ссылку.</p>]]></description>
			<author><![CDATA[null@example.com (teadrinker)]]></author>
			<pubDate>Tue, 27 Dec 2016 14:33:34 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=110341#p110341</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: GUI смена фона при наведении на элементы в блоке]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=110339#p110339</link>
			<description><![CDATA[<p><strong>teadrinker</strong> извиняюсь, не знал, что у вас не откроется.<br />А вот код.<br /></p><div class="codebox"><pre><code>
   
    Gui, destroy 
    Gui, -Caption +ToolWindow -AlwaysOnTop -SysMenu
    Gui, Color, ffffff
    
    results := 20
    
    i := 0
    While i &lt; results
    {
      if i = 0 ; for first result
        {
          ; возможное решение задачи посредством прогресбара
          Gui, Add, Progress,x0 y0 w300 h20 cbbffff BackgroundFFEEFF vMyProgress
          GuiControl,, MyProgress, 50 
          
          Gui, Add, Pic,+BackgroundTrans x0 y0, Logo%i%.gif
          Gui, Add, Text,+BackgroundTrans x+0 y0 gLabel , result%i%
          Gui, Add, Text, xp y20 gLabel , sometext%i%
        }
      else if i &lt;&gt; 0
        {
          Gui, Add, Pic, x0 y+0, Logo%i%.gif
          Gui, Add, Text, x+0 yp+12  gLabel ,result%i%
          Gui, Add, Text, xp+ y+0  gLabel , sometext%i%
        }

      i := i +1
    }
    Gui, Show, NA
    
    
    
    ; press control
Label:
MsgBox, %  test
Return
</code></pre></div><p>Задача такая, нужно чтобы при наведении\снятии мышки фон у данного элемента менялся. <br />Если посмотреть код или запустить скрипт, то будет видно, что создастся список из 20 элементов, в каждом из которых содержится картинка и 2 надписи. В коде я отметил, возможную попытку решения через прогрессбар.</p>]]></description>
			<author><![CDATA[null@example.com (upsi_daezium)]]></author>
			<pubDate>Tue, 27 Dec 2016 14:20:35 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=110339#p110339</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: GUI смена фона при наведении на элементы в блоке]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=110320#p110320</link>
			<description><![CDATA[<p>Что такое блок и что такое средний элемент?</p>]]></description>
			<author><![CDATA[null@example.com (ypppu)]]></author>
			<pubDate>Tue, 27 Dec 2016 10:17:41 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=110320#p110320</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: GUI смена фона при наведении на элементы в блоке]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=110292#p110292</link>
			<description><![CDATA[<p>Ну тогда проблема в моём провайдере, наверно.</p>]]></description>
			<author><![CDATA[null@example.com (teadrinker)]]></author>
			<pubDate>Mon, 26 Dec 2016 17:38:14 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=110292#p110292</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: GUI смена фона при наведении на элементы в блоке]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=110290#p110290</link>
			<description><![CDATA[<div class="quotebox"><cite>Malcev пишет:</cite><blockquote><p>У меня показывается.</p></blockquote></div><p>У меня тоже.</p>]]></description>
			<author><![CDATA[null@example.com (shiz)]]></author>
			<pubDate>Mon, 26 Dec 2016 17:30:18 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=110290#p110290</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: GUI смена фона при наведении на элементы в блоке]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=110284#p110284</link>
			<description><![CDATA[<p>У меня ни в одном десктопном браузере не показывается. Вот с мобильного попробовал — загрузилось. Может, провайдер считает сайт подозрительным. <img src="//forum.script-coding.com/img/smilies/smile.png" width="15" height="15" /></p>]]></description>
			<author><![CDATA[null@example.com (teadrinker)]]></author>
			<pubDate>Mon, 26 Dec 2016 16:21:00 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=110284#p110284</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: GUI смена фона при наведении на элементы в блоке]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=110283#p110283</link>
			<description><![CDATA[<p>Странно, почему у тебя не грузится. У меня показывается.</p>]]></description>
			<author><![CDATA[null@example.com (Malcev)]]></author>
			<pubDate>Mon, 26 Dec 2016 16:17:14 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=110283#p110283</guid>
		</item>
	</channel>
</rss>
