<?xml version="1.0" encoding="utf-8"?>
<feed xmlns="http://www.w3.org/2005/Atom">
	<title type="html"><![CDATA[Серый форум &mdash; AHK: Вопрос по поводу Нейтрона]]></title>
	<link rel="self" href="https://forum.script-coding.com/extern.php?action=feed&amp;tid=16073&amp;type=atom" />
	<updated>2021-02-09T22:39:37Z</updated>
	<generator>PunBB</generator>
	<id>https://forum.script-coding.com/viewtopic.php?id=16073</id>
		<entry>
			<title type="html"><![CDATA[AHK: Вопрос по поводу Нейтрона]]></title>
			<link rel="alternate" href="https://forum.script-coding.com/viewtopic.php?pid=146092#p146092" />
			<content type="html"><![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>]]></content>
			<author>
				<name><![CDATA[Vaks_off]]></name>
				<uri>https://forum.script-coding.com/profile.php?id=40530</uri>
			</author>
			<updated>2021-02-09T22:39:37Z</updated>
			<id>https://forum.script-coding.com/viewtopic.php?pid=146092#p146092</id>
		</entry>
</feed>
