<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Серый форум &mdash; AHK: Progress Bar]]></title>
		<link>https://forum.script-coding.com/viewtopic.php?id=12244</link>
		<atom:link href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=12244&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[Недавние сообщения в теме «AHK: Progress Bar».]]></description>
		<lastBuildDate>Fri, 23 Dec 2016 10:56:04 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[Re: AHK: Progress Bar]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=110069#p110069</link>
			<description><![CDATA[<p><strong>becauseim</strong><br /></p><div class="codebox"><pre><code>period := 400
w := 50, h := 7
CreateProgress(w, h)
TimeoutAction := Func(&quot;TimeoutAction&quot;)
Return

RButton:: ShowProgress(period, TimeoutAction,  w)
Esc:: ExitApp
   
ShowProgress(time, TimeoutAction, w := &quot;&quot;)  {
   static start, timer
   (!start &amp;&amp; start := A_TickCount)
   if !timer  {
      CoordMode, Mouse
      MouseGetPos, X, Y
      GuiControl,, Progress, 0
      Gui, Show, % &quot;NA x&quot; X - w//2 &quot; y&quot; y + 15
      timer := Func(A_ThisFunc).Bind(time, TimeoutAction)
      SetTimer, % timer, 10
   }
   pos := Round((A_TickCount - start)/time*100)
   (pos &gt; 100 &amp;&amp; pos := 100)
   GuiControl,, Progress, % pos
   if (pos = 100)  || !GetKeyState(&quot;RButton&quot;, &quot;P&quot;)  {
      SetTimer,, Delete
      start := timer := &quot;&quot;
      Gui, Show, Hide
      (pos = 100 &amp;&amp; TimeoutAction.Call())
   }
}

CreateProgress(w, h)  {
   global Progress
   Gui, +ToolWindow -Caption +AlwaysOnTop
   Gui, Add, Progress, x0 y0 w%w% h%h% vProgress
   Gui, Show, Hide w%w% h%h%
}

TimeoutAction()  {
   MsgBox, Действие`, если время вышло
}</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (teadrinker)]]></author>
			<pubDate>Fri, 23 Dec 2016 10:56:04 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=110069#p110069</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Progress Bar]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=110066#p110066</link>
			<description><![CDATA[<div class="quotebox"><cite>Flasher пишет:</cite><blockquote><p>Чаще встречаешь тех, кто хочет от него избавиться.</p></blockquote></div><p>В ТС для меня он действительно ни к чему. Впрочем, как и сам вызов контекстного меню при удержании ПКМ. А в других случаях было бы интересно иметь миниатюрный прогресс-бар, привязанный к удержанию.</p>]]></description>
			<author><![CDATA[null@example.com (becauseim)]]></author>
			<pubDate>Fri, 23 Dec 2016 09:22:49 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=110066#p110066</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Progress Bar]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=110056#p110056</link>
			<description><![CDATA[<p>Еще, чтобы в минус не ушел отсчет, можно так:</p><div class="codebox"><pre><code>Number := 10
Gui, Font, s15
Gui, Add, Text, vText1, 111111111
GuiControl,,Text1, 10
Gui, Add, Progress, vProgress1 w500 h50 -Smooth Range0-500
Gui, Show

SetTimer, Progress2, 1000
ProgressBar(&quot;Progress1&quot;, Number, 1000)
return

Progress2:
Number -= 1
qw := Number &gt; 0 ? Number : 0
GuiControl,, Text1, %qw%
Return

ProgressBar(sBar, tTime, iRange)
{
	tTime := (tTime * 130)
	iSpeed := iRange / tTime
	iWay := 0 ; WriteDebug(1, &quot;Start&quot;)
	While(1)
	{
		Sleep 1
		GuiControl,, %sBar%,% iWay
		iWay += iSpeed
		If(iWay &gt; iRange)
			break
        ; WriteDebug(1, &quot;End&quot;)

	}
	
}</code></pre></div>]]></description>
			<author><![CDATA[null@example.com (svoboden)]]></author>
			<pubDate>Thu, 22 Dec 2016 23:41:57 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=110056#p110056</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Progress Bar]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=110055#p110055</link>
			<description><![CDATA[<p><strong>stealzy</strong><br />При <a href="http://pasted.co/b98470ad">таких числах</a> нет проблем.</p>]]></description>
			<author><![CDATA[null@example.com (Flasher)]]></author>
			<pubDate>Thu, 22 Dec 2016 21:51:46 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=110055#p110055</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Progress Bar]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=110054#p110054</link>
			<description><![CDATA[<p>Здрасьте, команды то не мгновенно исполняются.<br />Используйте A_TimeIdle, на старте функции записывайте ее значение, а в цикле вычисляйте разницу.</p>]]></description>
			<author><![CDATA[null@example.com (stealzy)]]></author>
			<pubDate>Thu, 22 Dec 2016 21:47:57 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=110054#p110054</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Progress Bar]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=110053#p110053</link>
			<description><![CDATA[<p><strong>becauseim</strong><br />Чаще встречаешь тех, кто хочет от него избавиться. Впрочем, это опциональная вещь.</p>]]></description>
			<author><![CDATA[null@example.com (Flasher)]]></author>
			<pubDate>Thu, 22 Dec 2016 20:37:25 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=110053#p110053</guid>
		</item>
		<item>
			<title><![CDATA[Re: AHK: Progress Bar]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=110052#p110052</link>
			<description><![CDATA[<p>Смежный вопрос. Существует ли сценарий, который добавляет к курсору маленький прогресс-бар для отображения необходимой длительности удержания ПКМ, как это реализовано в TotalCommander?<br />Иными словами, добавить к действию на удержание ПКМ на полторы секунды маленький прогресс-бар рядом с курсором.</p>]]></description>
			<author><![CDATA[null@example.com (becauseim)]]></author>
			<pubDate>Thu, 22 Dec 2016 20:31:24 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=110052#p110052</guid>
		</item>
		<item>
			<title><![CDATA[AHK: Progress Bar]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=110009#p110009</link>
			<description><![CDATA[<div class="codebox"><pre><code>Number := 10
Gui, Font, s15
Gui, Add, Text, vText1, 111111111
GuiControl,,Text1, 10
Gui, Add, Progress, vProgress1 w500 h100 -Smooth Range0-500
Gui, Show

SetTimer, Progress2, 1000
ProgressBar(&quot;Progress1&quot;, Number, 500)
return

Progress2:
Number -= 1
GuiControl,, Text1,% Number
Return

ProgressBar(sBar, tTime, iRange)
{
	tTime := (tTime * 100)
	iSpeed := iRange / tTime
	iWay := 0
	;WriteDebug(1, &quot;Start&quot;)
	While(1)
	{
		Sleep 1
		GuiControl,, %sBar%,% iWay
		iWay += iSpeed
		If(iWay &gt; iRange)
			break
	}
	;WriteDebug(1, &quot;End&quot;)

}</code></pre></div><p>Погрешность в 5 секунд. Помогите исправить.</p>]]></description>
			<author><![CDATA[null@example.com (MandarinKa02)]]></author>
			<pubDate>Thu, 22 Dec 2016 12:24:50 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=110009#p110009</guid>
		</item>
	</channel>
</rss>
