<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
	<channel>
		<title><![CDATA[Серый форум &mdash; AHK: Вопрос по поводу Нейтрона]]></title>
		<link>https://forum.script-coding.com/viewtopic.php?id=16073</link>
		<atom:link href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=16073&amp;type=rss" rel="self" type="application/rss+xml" />
		<description><![CDATA[Недавние сообщения в теме «AHK: Вопрос по поводу Нейтрона».]]></description>
		<lastBuildDate>Tue, 09 Feb 2021 22:39:37 +0000</lastBuildDate>
		<generator>PunBB</generator>
		<item>
			<title><![CDATA[AHK: Вопрос по поводу Нейтрона]]></title>
			<link>https://forum.script-coding.com/viewtopic.php?pid=146092#p146092</link>
			<description><![CDATA[<p><strong>Доброго времени суток!</strong><br />Только начал ковырять нейтрон для создания графических интерфейсов и сразу возник вопрос.<br />Я сделал кнопку и через css задал стиль но естественно ахк не может прочесть картинку, вопрос как это исправить? Помогите пожалуйста.<br /></p><div class="codebox"><pre><code>
css =
button {
         width: 116px;
         height: 41px;
		 background: url(../button/normal.png);
		 border: none;
      }
      button:hover {
         width: 116px;
         height: 41px;
		 background: url(../button/hover.png);
		 border: none;
      }
      .clicked {
         background: url(&quot;../button/selected.png&quot;);
		 border: none;
      }</code></pre></div><p>Полный код =&gt;</p><div class="fancy_spoiler_switcher"><div class="fancy_spoiler_switcher_header" data-lang-open="открыть спойлер" data-lang-close="скрыть спойлер"><strong>+</strong>&nbsp;открыть спойлер</div><div class="fancy_spoiler"><div class="codebox"><pre><code>

#NoEnv
SetBatchLines, -1
CoordMode, Mouse, Screen

; Include the Neutron library
#Include ../Neutron.ahk

html =
( ; html
	&lt;h1&gt;Welcome to Neutron!&lt;/h1&gt;

	&lt;h2&gt;Example Button&lt;/h2&gt;
	&lt;button onclick=&quot;ahk.Clicked(event)&quot;&gt;Click Me!&lt;/button&gt; 
	&lt;button onclick=&quot;ahk.Clicked(event)&quot;&gt;Click Me!&lt;/button&gt; 
    &lt;button onclick=&quot;ahk.Clicked(event)&quot;&gt;Click Me!&lt;/button&gt;
    &lt;button onclick=&quot;ahk.Clicked(event)&quot;&gt;Click Me!&lt;/button&gt;

	&lt;h2&gt;Example Form&lt;/h2&gt;
	&lt;form onsubmit=&quot;ahk.Submitted(event)&quot;&gt;
		&lt;label for=&quot;firstName&quot;&gt;First Name:&lt;/label&gt;
		&lt;input type=&quot;text&quot; id=&quot;firstName&quot; placeholder=&quot;John&quot; required&gt;
		&lt;br&gt;
		&lt;label for=&quot;lastName&quot;&gt;Last Name:&lt;/label&gt;
		&lt;input type=&quot;text&quot; id=&quot;lastName&quot; placeholder=&quot;Smith&quot; required&gt;
		&lt;br&gt;
		&lt;button type=&quot;submit&quot;&gt;Click Me!&lt;/button&gt;
	&lt;/form&gt;
)

css =
( ; css
	/* Make the title bar dark with light text */
	header {
		background: #333333;
		color: white;
	}

	/* Make the content area dark with light text */
	body {
		background: #444;
		color: white;
	}

	/* Make input boxes follow the dark theme */
	input {
		margin: 1.25em;
		padding: 0.5em;
		border: none;
		background: #333;
		color: white;
		border-radius: 0.25em;
	}
	:-ms-input-placeholder {
		color: silver;
	}
	button {
         width: 116px;
         height: 41px;
		 background: url(../button/normal.png);
		 border: none;
      }
      button:hover {
         width: 116px;
         height: 41px;
		 background: url(../button/hover.png);
		 border: none;
      }
      .clicked {
         background: url(&quot;../button/selected.png&quot;);
		 border: none;
      }

js =
( ; js
	// Write some JavaScript here
)

title = Neutron Template Example
neutron := new NeutronWindow(html, css, js, title)

neutron.Gui(&quot;+LabelNeutron&quot;)

neutron.Show(&quot;w640 h480&quot;)

SetTimer, DynamicContent, 100
return

NeutronClose:
ExitApp
return


Clicked(neutron, event)
{
	MsgBox, % &quot;You clicked: &quot; event.target.innerText
}

Submitted(neutron, event)
{
	event.preventDefault()
	
	neutron.hide()
	
	formData := neutron.GetFormData(event.target)
	MsgBox, % &quot;Hello &quot; formData.firstName &quot; &quot; formData.lastName &quot;!&quot;
	
	; Re-show the GUI
	neutron.Show()
}

DynamicContent()
{
	global neutron
	
	MouseGetPos, x, y
	
	neutron.doc.getElementById(&quot;ahk_x&quot;).innerText := x
	neutron.doc.getElementById(&quot;ahk_y&quot;).innerText := y
}

</code></pre></div></div></div><p>Если нужна картинка =&gt;</p>]]></description>
			<author><![CDATA[null@example.com (Vaks_off)]]></author>
			<pubDate>Tue, 09 Feb 2021 22:39:37 +0000</pubDate>
			<guid>https://forum.script-coding.com/viewtopic.php?pid=146092#p146092</guid>
		</item>
	</channel>
</rss>
