<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>WinSoft.se &#187; The Wall</title>
	<atom:link href="http://www.winsoft.se/tag/the-wall/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.winsoft.se</link>
	<description>Development with focus on Visual Basic .NET</description>
	<lastBuildDate>Thu, 26 Jan 2012 19:28:40 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>User interaction: GetItemAt and GetItemsAt</title>
		<link>http://www.winsoft.se/2010/07/user-interaction-getitemat-och-getitemsat/</link>
		<comments>http://www.winsoft.se/2010/07/user-interaction-getitemat-och-getitemsat/#comments</comments>
		<pubDate>Fri, 09 Jul 2010 17:16:47 +0000</pubDate>
		<dc:creator>Anders Hesselbom</dc:creator>
				<category><![CDATA[Programs]]></category>
		<category><![CDATA[The Wall]]></category>

		<guid isPermaLink="false">http://www.winsoft.se/?p=1282</guid>
		<description><![CDATA[Edit: This post concerns &#8220;The Wall&#8221;, a discontinued project. GetItemAt The GetItemAt function returns the graphical item (text item, bar item, numeric item) that exists at a given position, in characters. If no item exists at the given position, the value Nothing will be returned (null). The GetItemsAt function also takes a position (X and [...]]]></description>
			<content:encoded><![CDATA[<p><em><strong>Edit:</strong> This post concerns &#8220;The Wall&#8221;, a discontinued project.</em></p>
<p><strong>GetItemAt</strong></p>
<p>The <strong>GetItemAt</strong> function returns the graphical item (text item, bar item, numeric item) that exists at a given position, in characters. If no item exists at the given position, the value <strong>Nothing</strong> will be returned (null). The <strong>GetItemsAt</strong> function also takes a position (X and Y) as argument but <strong>GetItemsAt</strong> will always return a collection object. If no graphical items exist at the given position, the collection will be empty. If more than one item exists at the given position, all of the items will be returned in that collection.</p>
<p>This first example will register two text items. Both of them will be static (that is, they will not auto update). The value of the first one will be Apples and the value of the second one will be Pears. Also, the program registers a callback for mouse clicking. If you click on Apples, a message box will show the word Apples, if you click on Pears, a message box will show the word Pears.</p>
<p>To start off, this code will register the items:</p>
<pre>BackgroundColor = "#000000"

RegisterTextItem 0, "ApplesItem", 4, 2, "#ffffff", "InitApplesItem"
RegisterTextItem 0, "PearsItem", 4, 3, "#ffffff", "InitPearsItem"

Sub InitApplesItem(ByVal Item)
   Item.Value = "Apples"
End Sub

Sub InitPearsItem(ByVal Item)
   Item.Value = "Pears"
End Sub</pre>
<p><img alt="" src="http://imghost.winsoft.se/upload/811861278695578userinteraction1.jpg" class="alignnone" width="354" height="297" /></p>
<p>And this is the complete source code. Here I register a callback function to detect clicks, and from there I use the <strong>GetItemAt</strong> function to see what item the user clicked on.</p>
<pre>BackgroundColor = "#000000"

RegisterTextItem 0, "ApplesItem", 4, 2, "#ffffff", "InitApplesItem"
RegisterTextItem 0, "PearsItem", 4, 3, "#ffffff", "InitPearsItem"
RegisterClickCallback "Click"

Sub InitApplesItem(ByVal Item)
   Item.Value = "Apples"
End Sub

Sub InitPearsItem(ByVal Item)
   Item.Value = "Pears"
End Sub

Sub Click(ByVal X, ByVal Y)
	Set Item=GetItemAt(X, Y)
	If Not Item Is Nothing Then
		MsgBox Item.Value
	End If
End Sub</pre>
<p><strong>GetItemsAt</strong></p>
<p>This is a constructed example to show how to use the <strong>GetItemsAt</strong> function. I am sure you can think of more and better examples.</p>
<p>This program holds a bar item and a text item overlaying the bar item. You want to detect clicks on any bar item in the program. This code adds the text and bar items, it also registers a click callback called Click. The click callback uses the <strong>GetItemsAt</strong> function to determine if the bar was clicked.</p>
<pre>BackgroundColor = "#000000"

Bar=RegisterBarItem(1, "B", 3, 2, "#5599aa", "UpdateBar")
GetItem(Bar).Size = 11
GetItem(Bar).ValueVisible = False

RegisterTextItem 0, "T", 4, 2, "#ffffff", "InitText"
RegisterClickCallback "Click"

Sub InitText(ByVal Item)
   Item.Value = "Some text"
End Sub

Sub UpdateBar(ByVal Item)
   Item.Value=Round(Rnd() * 100)
End Sub

Sub Click(ByVal X, ByVal Y)
   Set Items=GetItemsAt(X, Y)
   For Each Item In Items
      If Item.TypeName = "BarItem" Then
         MsgBox "You have clicked on a bar named " &#038; Item.Name &#038; "."
      End If
   Next
End Sub</pre>
<p>Note how the click callback function filters out any bar items from the collection, and displays the name of them (just one in this case).</p>
]]></content:encoded>
			<wfw:commentRss>http://www.winsoft.se/2010/07/user-interaction-getitemat-och-getitemsat/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tweaking the wall, part 3/3: Startup script</title>
		<link>http://www.winsoft.se/2010/07/tweaking-the-wall-part-33-startup-script/</link>
		<comments>http://www.winsoft.se/2010/07/tweaking-the-wall-part-33-startup-script/#comments</comments>
		<pubDate>Sun, 04 Jul 2010 09:16:16 +0000</pubDate>
		<dc:creator>Anders Hesselbom</dc:creator>
				<category><![CDATA[Programs]]></category>
		<category><![CDATA[The Wall]]></category>

		<guid isPermaLink="false">http://www.winsoft.se/?p=1278</guid>
		<description><![CDATA[Edit: This post concerns &#8220;The Wall&#8221;, a discontinued project. The basic rule is that a VBScript file called TheWall.vbs that is placed in the same folder as TheWall.exe is loaded when TheWall.exe is started. Remember that you start TheWall.exe, not any script file &#8211; the script file is loaded by TheWall.exe. So if you are [...]]]></description>
			<content:encoded><![CDATA[<p><em><strong>Edit:</strong> This post concerns &#8220;The Wall&#8221;, a discontinued project.</em></p>
<p>The basic rule is that a VBScript file called TheWall.vbs that is placed in the same folder as TheWall.exe is loaded when TheWall.exe is started. Remember that you start TheWall.exe, not any script file &#8211; the script file is loaded by TheWall.exe. So if you are creating a shortcut, the shortcut should point to TheWall.exe.</p>
<p>You can manipulate this behavior by passing a filename as an argument to TheWall.exe. If a filename is passed, The Wall attempts to load that file instead of TheWall.vbs. There is no fallback, so the file you pass as an argument, must exist. The Wall cannot be started if no filename is passed as argument and the file TheWall.vbs is not present, or if a filename is passed as an argument and that file does not exist.</p>
<p>To check what file is running, use the <strong>ScriptFilename</strong> property.</p>
<pre>MsgBox ScriptFilename</pre>
<p>Just for the fun of it, this code will produce a line that is bouncing within a box. And now you know how to start it.</p>
<pre>BackgroundColor = "#000000"

X1 = 0
Y1 = 0
X1Speed = 4
Y1Speed = 2

X2 = 30
Y2 = 190
X2Speed = 2
Y2Speed = 1

BeforeUpdate "Bounce"

Sub Bounce(ByVal G)
   X1 = X1 + X1Speed
   Y1 = Y1 + Y1Speed
   If X1 > 200 Or X1 < 0 Then
      X1Speed = X1Speed * -1
   End If
   If Y1 > 200 Or Y1 < 0 Then
      Y1Speed = Y1Speed * -1
   End If

   X2 = X2 + X2Speed
   Y2 = Y2 + Y2Speed
   If X2 > 200 Or X2 < 0 Then
      X2Speed = X2Speed * -1
   End If
   If Y2 > 200 Or Y2 < 0 Then
      Y2Speed = Y2Speed * -1
   End If

   G.DrawBar "#555555", 0, 0, 200, 200
   G.DrawLine "#ffffff", X1, Y1, X2, Y2
End Sub</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.winsoft.se/2010/07/tweaking-the-wall-part-33-startup-script/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tweaking the wall, part 2/3: Using the graphics drawing interface</title>
		<link>http://www.winsoft.se/2010/07/tweaking-the-wall-part-23-using-the-graphics-drawin-interface/</link>
		<comments>http://www.winsoft.se/2010/07/tweaking-the-wall-part-23-using-the-graphics-drawin-interface/#comments</comments>
		<pubDate>Sat, 03 Jul 2010 13:18:22 +0000</pubDate>
		<dc:creator>Anders Hesselbom</dc:creator>
				<category><![CDATA[Programs]]></category>
		<category><![CDATA[The Wall]]></category>

		<guid isPermaLink="false">http://www.winsoft.se/?p=1269</guid>
		<description><![CDATA[Edit: This post concerns &#8220;The Wall&#8221;, a discontinued project. The BeforUpdate and AfterUpdate callback functions are basically used to allow custom graphics to be drawn below or above it. The graphics drawing interface is passed as an argument to the function you register as a callback function. Again, this Is the Hello World application of [...]]]></description>
			<content:encoded><![CDATA[<p><em><strong>Edit:</strong> This post concerns &#8220;The Wall&#8221;, a discontinued project.</em></p>
<p>The <strong>BeforUpdate</strong> and <strong>AfterUpdate</strong> callback functions are basically used to allow custom graphics to be drawn below or above it. The graphics drawing interface is passed as an argument to the function you register as a callback function. Again, this Is the Hello World application of The Wall:</p>
<pre>BackgroundColor = "#445566"
RegisterTextItem 0, "A", 4, 4, "#aabbcc", "InitializeText"

Sub InitializeText(ByVal Item)
   Item.Value = "Hello World!"
End Sub</pre>
<p>This is what we get:</p>
<p><span style="font-size: 18px; background-color: #000; color: #0f0;">Hello World!</span></p>
<p>No, let&#8217;s say that I want to draw something before and after the text item that I have registered in the above code, I would have to register these two callback methods too, like so:</p>
<pre>BackgroundColor = "#000000"
RegisterTextItem 0, "A", 1, 1, "#00ff00", "InitializeText"

BeforeUpdate "MyBeforeFunction"
AfterUpdate "MyAfterFunction"

Sub MyBeforeFunction(ByVal G)
   <span style="color: #0a0;">'TODO: Use the graphics drawing interface here!</span>
End Sub

Sub MyAfterFunction(ByVal G)
   <span style="color: #0a0;">'TODO: Use the graphics drawing interface here!</span>
End Sub

Sub InitializeText(ByVal Item)
   Item.Value = "Hello World!"
End Sub</pre>
<p>Any drawing done in <strong>MyBeforeFunction</strong> will appear behind the text Hello World! since <strong>MyBeforeFunction</strong> was registered using the built in <strong>BeforeUpdate</strong> function. Any drawing done in <strong>MyAfterFunction</strong> will appear in front of the text since it was registered using the built in <strong>AfterUpdate</strong> function.</p>
<p>This will give us a blue rectangle behind the text, and a yellow rectangle in front of the text.</p>
<pre>BackgroundColor = "#000000"
RegisterTextItem 0, "A", 1, 1, "#00ff00", "InitializeText"

BeforeUpdate "MyBeforeFunction"
AfterUpdate "MyAfterFunction"

Sub MyBeforeFunction(ByVal G)
   G.DrawBar "#0000ff", 0, 0, 400, 60
End Sub

Sub MyAfterFunction(ByVal G)
   G.DrawBar "#ffff00", 0, 65, 400, 60
End Sub

Sub InitializeText(ByVal Item)
   Item.Value = "Hello World!"
End Sub</pre>
<p>Like so:</p>
<p><img alt="" src="http://imghost.winsoft.se/upload/114001278162485helloworld.jpg" class="alignnone" width="346" height="149" /></p>
<p>The <strong>DrawLine</strong> function accepts a color (all colors are in string format), X1, Y1, X2 and Y2. The <strong>DrawBar</strong> function accepts a color, X, Y, Width and Height, just as the <strong>DrawRectangle</strong> function.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.winsoft.se/2010/07/tweaking-the-wall-part-23-using-the-graphics-drawin-interface/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Tweaking the wall, part 1/3: Before and after update</title>
		<link>http://www.winsoft.se/2010/06/tweaking-the-wall-part-13-before-and-after-update/</link>
		<comments>http://www.winsoft.se/2010/06/tweaking-the-wall-part-13-before-and-after-update/#comments</comments>
		<pubDate>Fri, 25 Jun 2010 20:13:41 +0000</pubDate>
		<dc:creator>Anders Hesselbom</dc:creator>
				<category><![CDATA[Programs]]></category>
		<category><![CDATA[The Wall]]></category>

		<guid isPermaLink="false">http://www.winsoft.se/?p=1242</guid>
		<description><![CDATA[Edit: This post concerns &#8220;The Wall&#8221;, a discontinued project. The Wall has some support for free drawing. This can either be done before or after updating the screen. Any drawing that is done before updating will be displayed behind registered objects (se the Hello World example) and any drawing that is done after updating will [...]]]></description>
			<content:encoded><![CDATA[<p><em><strong>Edit:</strong> This post concerns &#8220;The Wall&#8221;, a discontinued project.</em></p>
<p>The Wall has some support for free drawing. This can either be done before or after updating the screen. Any drawing that is done before updating will be displayed behind registered objects (se the <a href="http://www.winsoft.se/2010/06/a-demo-is-available/">Hello World example</a>) and any drawing that is done after updating will be displayed on top of registered objects. The coordinate system of registered objects use characters, and by default a character is 25 pixels wide and 42 pixels high.</p>
<p>The Hello World application in The Wall Looks like this&#8230;</p>
<pre>BackgroundColor = "#445566"
RegisterTextItem 0, "A", 4, 4, "#aabbcc", "InitializeText"

Sub InitializeText(ByVal Item)
	Item.Value = "Hello!"
End Sub</pre>
<p>&#8230;and the result looks like this:</p>
<p><img class="alignnone" src="http://imghost.winsoft.se/upload/616031277496381thewall1.jpg" alt="" width="181" height="57" /></p>
<p>The code I add to illustrate how graphics can be added behind registered objects is red and bold in the following listing. <strong>BeforeUpdate &#8220;MyBeforeFunction&#8221;</strong> tells The Wall to call a function before drawing the registered items. The argument is the name of the function.</p>
<pre>BackgroundColor = "#445566"
RegisterTextItem 0, "A", 1, 1, "#aabbcc", "InitializeText"

<strong><span style="color: #800000;">BeforeUpdate "MyBeforeFunction"

Sub MyBeforeFunction(ByVal G)
	G.DrawLine 0, 70, 100, 70
End Sub</span></strong>

Sub InitializeText(ByVal Item)
	Item.Value = "Hello!"
	Item.Shadowed = True
End Sub</pre>
<p>The result is the word &#8220;Hello!&#8221; with a white line behind it. I added a shadow behind the text to make the effect more visible.</p>
<p><img class="alignnone" src="http://imghost.winsoft.se/upload/778491277496388thewall2.jpg" alt="" width="182" height="55" /></p>
<p>To draw graphics in front of the registered items, use the <strong>AfterUpdate</strong> function to register a callback for that. This code (new lines are red and bold) also draws a line in front of &#8220;Hello!&#8221;.</p>
<pre>BackgroundColor = "#445566"
RegisterTextItem 0, "A", 1, 1, "#aabbcc", "InitializeText"

BeforeUpdate "MyBeforeFunction"
<strong><span style="color: #800000;">AfterUpdate "MyAfterFunction"</span></strong>

Sub MyBeforeFunction(ByVal G)
	G.DrawLine "#ffffff", 0, 60, 300, 60
End Sub

<strong><span style="color: #800000;">Sub MyAfterFunction(ByVal G)
	G.DrawLine "#ffffff", 0, 62, 300, 62
End Sub</span></strong>

Sub InitializeText(ByVal Item)
	Item.Value = "Hello!"
	Item.Shadowed = True
End Sub</pre>
<p>This is the result:</p>
<p><img class="alignnone" src="http://imghost.winsoft.se/upload/443231277496396thewall3.jpg" alt="" width="161" height="45" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.winsoft.se/2010/06/tweaking-the-wall-part-13-before-and-after-update/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>A demo is available</title>
		<link>http://www.winsoft.se/2010/06/a-demo-is-available/</link>
		<comments>http://www.winsoft.se/2010/06/a-demo-is-available/#comments</comments>
		<pubDate>Tue, 22 Jun 2010 18:24:10 +0000</pubDate>
		<dc:creator>Anders Hesselbom</dc:creator>
				<category><![CDATA[Programs]]></category>
		<category><![CDATA[The Wall]]></category>

		<guid isPermaLink="false">http://www.winsoft.se/?p=1237</guid>
		<description><![CDATA[Edit: This post concerns &#8220;The Wall&#8221;, a discontinued project. The Wall is an intelligent home component that can display and update text items, numeric values and bars. Also, The Wall can react to mouse clicks from a computer mouse or from a touch screen. The demo has all the functionality of the full version, but [...]]]></description>
			<content:encoded><![CDATA[<p><em><strong>Edit:</strong> This post concerns &#8220;The Wall&#8221;, a discontinued project.</em></p>
<p><a href="http://www.winsoft.se/tag/the-wall/">The Wall</a> is an intelligent home component that can display and update <a href="http://www.winsoft.se/2010/02/the-most-basic-panel-for-the-wall/">text items</a>, <a href="http://www.winsoft.se/2010/02/numeric-values-in-the-wall/">numeric values</a> and <a href="http://www.winsoft.se/2010/02/bars-in-the-wall/">bars</a>. Also, The Wall can <a href="http://www.winsoft.se/2010/02/handling-user-input-from-the-wall/">react to mouse clicks</a> from a computer mouse or from a touch screen. The demo has all the functionality of the full version, but adds an overlay. This is the &#8220;Hello world&#8221; of The Wall:</p>
<pre>BackgroundColor = "#445566"
RegisterTextItem 0, "A", 4, 4, "#aabbcc", "InitializeText"

Sub InitializeText(ByVal Item)
   Item.Value = "Hello!"
End Sub</pre>
<p>The demo will display &#8220;Hello!&#8221; at position 4 x 4 with an overlay, like so:</p>
<p><img alt="" src="http://imghost.winsoft.se/upload/298981277230688preview.jpg" class="alignnone" width="481" height="468" /></p>
<p>The MSI file is available for download <a href="http://www.winsoft.se/files/TheWall.msi" target="_blank">from here</a>. If you are using Windows Vista or Windows 7, you might need to download the <a href="http://www.winsoft.se/2008/12/msscriptcontrol-and-vista/">Microsoft Script Control</a>, since The Wall is powered by <a href="http://www.microsoft.com/downloads/details.aspx?familyid=d7e31492-2595-49e6-8c02-1426fec693ac&#038;displaylang=en" target="_blank">VBScript</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.winsoft.se/2010/06/a-demo-is-available/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Handling user input from The Wall</title>
		<link>http://www.winsoft.se/2010/02/handling-user-input-from-the-wall/</link>
		<comments>http://www.winsoft.se/2010/02/handling-user-input-from-the-wall/#comments</comments>
		<pubDate>Tue, 23 Feb 2010 20:48:39 +0000</pubDate>
		<dc:creator>Anders Hesselbom</dc:creator>
				<category><![CDATA[Programs]]></category>
		<category><![CDATA[The Wall]]></category>

		<guid isPermaLink="false">http://www.winsoft.se/?p=996</guid>
		<description><![CDATA[Edit: This post concerns &#8220;The Wall&#8221;, a discontinued project. Please read this first. This post shows how detect mouse input in The Wall. The Wall provides functionality for displaying data on a screen, an important component for anyone building an intelligent home. The system relies on the user&#8217;s ability use VBScript to collect data he [...]]]></description>
			<content:encoded><![CDATA[<p><em><strong>Edit:</strong> This post concerns &#8220;The Wall&#8221;, a discontinued project.</em></p>
<p>Please read <a href="http://www.winsoft.se/2010/02/introducing-the-wall/">this</a> first. This post shows how detect mouse input in The Wall.</p>
<p>The Wall provides functionality for displaying data on a screen, an important component for anyone building an intelligent home. The system relies on the user&#8217;s ability use VBScript to collect data he or she wants to display, but there are some built in functions for simplifying this. I will cover these functions later. Finally, it has a very simple mechanism for detecting clicks or touch screen activity, demonstrated here.</p>
<p>To activate click detection, call the <strong>RegisterClickCallback</strong> function and pass the name of the function that will be called when a click is detected, &#8220;<strong>ClickCallback</strong>&#8221; in this case.</p>
<p>The following code will register a text item for displaying the current date and time, a numeric item for displaying the number of detected clicks, and another text item for displaying the coordinate of the click (in characters):</p>
<pre><span style="color: #229922;">'Blueish background color.</span>
BackgroundColor = "#334499"

<span style="color: #229922;">'The background grid can be useful when designing the screen.</span>
BackgroundGrid = True

<span style="color: #229922;">'Every 60 seconds, display the current date and time.</span>
RegisterTextItem 60, "DateAndTime", 0, 0, "#00ffff", "UpdateDateAndTime"

<span style="color: #229922;">'For the fun of it, a click counter updated each second.</span>
RegisterNumericItem 1, "Counter", 0, 2, "#ffff00", "UpdateCounter"
Set Item=GetItem("Counter")
Item.CharacterCount=3

Dim ClickCounter
ClickCounter=0

<span style="color: #229922;">'And a string that displays the coordinates.</span>
RegisterTextItem 1, "Coordinates", 0, 4, "#ff88ff", "UpdateCoordinates"

Dim LastX
Dim LastY
LastX = -1
LastY = -1

<span style="color: #229922;">'This is the magic: Activate a callback for each click.</span>
RegisterClickCallback "ClickCallback"

<span style="color: #229922;">'Callback: Display date and time.</span>
Sub UpdateDateAndTime(ByVal Item)
   Item.Value = "Date: " &amp; GetDate() &amp; " Time: " &amp; GetShortTime()
End Sub

<span style="color: #229922;">'Callback: Display the click counter.</span>
Sub UpdateCounter(ByVal Item)
   Item.Value = ClickCounter
End Sub

<span style="color: #229922;">'Callback: Display the coordinates where the click occured.</span>
Sub UpdateCoordinates(ByVal Item)
   Item.Value = LastX &amp; ", " &amp; LastY
End Sub

<span style="color: #229922;">'This callback is not called on a given interval, but</span>
<span style="color: #229922;">'when the user clicks (or points at the touch screen).</span>
Sub ClickCallback(ByVal X, ByVal Y)
   <span style="color: #229922;">'Save the coordinates and increase the counter.</span>
   ClickCounter = ClickCounter + 1
   LastX = X
   LastY = Y
End Sub</pre>
<p>The result might look like this after 7 clicks:</p>
<p><img alt="" src="http://imghost.winsoft.se/upload/947871266958056wall.jpg" class="alignnone" width="300" height="225" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.winsoft.se/2010/02/handling-user-input-from-the-wall/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Bars in The Wall</title>
		<link>http://www.winsoft.se/2010/02/bars-in-the-wall/</link>
		<comments>http://www.winsoft.se/2010/02/bars-in-the-wall/#comments</comments>
		<pubDate>Sun, 21 Feb 2010 10:47:31 +0000</pubDate>
		<dc:creator>Anders Hesselbom</dc:creator>
				<category><![CDATA[Programs]]></category>
		<category><![CDATA[The Wall]]></category>

		<guid isPermaLink="false">http://www.winsoft.se/?p=992</guid>
		<description><![CDATA[Edit: This post concerns &#8220;The Wall&#8221;, a discontinued project. Please read this first. This post shows how to display bars using The Wall. Bars are created using the RegisterBarItem function. These are the arguments: Parameter 1: UpdateFrequency (32 bit integer) tells how often the text should be updated (that is, how often the callback function [...]]]></description>
			<content:encoded><![CDATA[<p><em><strong>Edit:</strong> This post concerns &#8220;The Wall&#8221;, a discontinued project.</em></p>
<p>Please read <a href="http://www.winsoft.se/2010/02/introducing-the-wall/">this</a> first. This post shows how to display bars using The Wall.</p>
<p>Bars are created using the <strong>RegisterBarItem</strong> function. These are the arguments:</p>
<p><span style="text-decoration: underline;">Parameter 1:</span> <strong>UpdateFrequency</strong> (32 bit integer) tells how often the text should be updated (that is, how often the callback function will be called) in seconds. 0 means that the item never will be updated. All callback functions are called at startup, and if the <strong>UpdateFrequency</strong> parameter is greater than 0, it will be called again and again until The Wall is closed. In the example above, <strong>CallbackA</strong> will be called once, <strong>CallbackB</strong> will be called each second and <strong>CallbackC</strong> will be called every two seconds.</p>
<p><span style="text-decoration: underline;">Parameter 2:</span> <strong>Name</strong> (string) is the name of the item for later reference.</p>
<p><span style="text-decoration: underline;">Parameter 3 and 4:</span> The X and Y position in characters for the item.</p>
<p><span style="text-decoration: underline;">Parameter 5:</span> The color of the item in HTML format.</p>
<p><span style="text-decoration: underline;">Parameter 6:</span> The name of the callback procedure. All callback procedures take one object parameter. The type of the object that is passed depend on the type of item you add.</p>
<p>In the following example, I create four bars, and I then use the <strong>GetItem</strong> function to get a reference to each bar so that I can set some properties of the bar.</p>
<p><strong>HighAlarmLevel</strong> gets or sets how high value the <strong>Value</strong> property can be before it causes the bar to enter alarm state.</p>
<p><strong>LowAlarmLevel</strong> gets or sets how low the value of the Value property can be before it causes the bar to enter alarm state.</p>
<p><strong>Orientation</strong> gets or sets the bar orientation. It can be <strong>Horizontal</strong> or <strong>Vertical</strong>.</p>
<p><strong>Size</strong> gets or sets the height of a vertical bar or the length of a horizontal bar.</p>
<p><strong>ValueVisible</strong> gets or sets whether the value of the bar will be printed out on the bar. If so, <strong>ValueColor</strong> control the color and <strong>DecimalCount</strong> controls the number of decimals that will be used.</p>
<p>Finally, the script holds the callback functions for the four bars. I have chosen to call them <strong>UpdateFirstBar</strong>, <strong>UpdateSecondBar</strong>, <strong>UpdateThirdBar</strong> and <strong>UpdateFourthBar</strong>.</p>
<pre><span style="color: #229922;">'Grey background color.</span>
BackgroundColor = "#666666"

<span style="color: #229922;">'Register 4 bars, each with one second interval.</span>
RegisterBarItem 1, "Bar1", 3, 1, "#00ff00", "UpdateFirstBar"
RegisterBarItem 1, "Bar2", 7, 1, "#00ff00", "UpdateSecondBar"
RegisterBarItem 1, "Bar3", 1, 5, "#00ff00", "UpdateThirdBar"
RegisterBarItem 1, "Bar4", 1, 6, "#00ff00", "UpdateFourthBar"

Dim B

<span style="color: #229922;">'Do some initialization of the first bar:</span>
Set B = GetItem("Bar1")
B.HighAlarmLevel = 10
B.DecimalCount = 2
B.Orientation = Vertical
B.ValueColor = "#ffffff"
B.Size = 4

<span style="color: #229922;">'Do some initialization of the second bar:</span>
Set B = GetItem("Bar2")
B.Orientation = Vertical
B.ValueVisible = False
B.Size = 4

<span style="color: #229922;">'Do some initialization of the third bar:</span>
Set B = GetItem("Bar3")
B.Orientation = Horizontal
B.ValueVisible = False
B.Size = 9

<span style="color: #229922;">'And the fourth:</span>
Set B = GetItem("Bar4")
B.HighAlarmLevel = 10
B.DecimalCount = 2
B.Orientation = Horizontal
B.ValueColor = "#ffffff"
B.Size = 9

<span style="color: #229922;">'The callbacks. Item.Value is a double that represents the fill percentage.</span>

Sub UpdateFirstBar(ByVal Item)
   Item.Value = (Item.Value + 0.31)
End Sub

Sub UpdateSecondBar(ByVal Item)
   Item.Value = (Item.Value + 0.5)
End Sub

Sub UpdateThirdBar(ByVal Item)
   Item.Value = (Item.Value + 2)
End Sub

Sub UpdateFourthBar(ByVal Item)
   Item.Value = (Item.Value + 1)
End Sub</pre>
<p>This is a screenshot of The Wall running the above script:</p>
<p><img alt="" src="http://imghost.winsoft.se/upload/447821266747808bars.jpg" class="alignnone" width="300" height="225" /></p>
]]></content:encoded>
			<wfw:commentRss>http://www.winsoft.se/2010/02/bars-in-the-wall/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Numeric values in The Wall</title>
		<link>http://www.winsoft.se/2010/02/numeric-values-in-the-wall/</link>
		<comments>http://www.winsoft.se/2010/02/numeric-values-in-the-wall/#comments</comments>
		<pubDate>Thu, 18 Feb 2010 21:08:39 +0000</pubDate>
		<dc:creator>Anders Hesselbom</dc:creator>
				<category><![CDATA[Programs]]></category>
		<category><![CDATA[The Wall]]></category>

		<guid isPermaLink="false">http://www.winsoft.se/?p=979</guid>
		<description><![CDATA[Edit: This post concerns &#8220;The Wall&#8221;, a discontinued project. Please read this first. This post shows how to display text numeric using The Wall. To register a numeric item, call the RegisterNumericItem function. It takes the same arguments as the RegisterTextItem function, but you might want to set some properties to the numeric item. In [...]]]></description>
			<content:encoded><![CDATA[<p><em><strong>Edit:</strong> This post concerns &#8220;The Wall&#8221;, a discontinued project.</em></p>
<p>Please read <a href="http://www.winsoft.se/2010/02/introducing-the-wall/">this</a> first. This post shows how to display text numeric using The Wall.</p>
<p>To register a numeric item, call the <strong>RegisterNumericItem</strong> function. It takes the same arguments as the <strong>RegisterTextItem</strong> function, but you might want to set some properties to the numeric item.</p>
<p>In this example, I add one text item and one numeric item. I then use the <strong>GetItem</strong> function to get a reference to the numeric item, so that I can set some of its properties.</p>
<p>The numeric items have properties for setting the expected range of the numeric value. These properties are called <strong>LowAlarmLevel</strong> and <strong>HighAlarmLevel</strong>. In this example, I set the <strong>HighAlarmLevel</strong> to 20, making the item flash if the <strong>Value</strong> property holds a value that equals to 20 or is higher.</p>
<p>Since the callback function <strong>HandleNumber</strong> is called each second (see the first argument in the <strong>RegisterNumericItem</strong> call) the value property will be out of range after 20 seconds, and the numeric item will start flashing on the screen.</p>
<p>Here is the VBScript code for this (must be located in TheWall.vbs):</p>
<pre><span style="color: #229922;">'Make full screen on primary screen.</span>
<span style="color: #229922;">'Exclude this line for windowed mode.</span>
MakeFullscreen 0

<span style="color: #229922;">'Grey background color.</span>
BackgroundColor = "#666666"

<span style="color: #229922;">'Register a static text item.</span>
RegisterTextItem 0, "MyStaticText", 1, 1, "#bbccdd", "InitTextItem"

<span style="color: #229922;">'Register a numeric item with one update per second.</span>
RegisterNumericItem 1, "MyNumericItem", 38, 1, "#00ff00", "HandleNumber"

<span style="color: #229922;">'Do some initialization of the numeric item. Get a reference...</span>
Dim N
Set N = GetItem("MyNumericItem")

<span style="color: #229922;">'...set the upper alarm threshold...</span>
N.HighAlarmLevel = 20

<span style="color: #229922;">'...the number of characters positions I want to display...</span>
N.CharacterCount = 3

<span style="color: #229922;">'...and the number of decimals I want to display. None.</span>
N.DecimalCount = 0

<span style="color: #229922;">'The callback for the text item. Called once.</span>
Sub InitTextItem(ByVal Item)
   Item.Value = "An increasing number with alarm at 20:"
End Sub

<span style="color: #229922;">'The callback for the numeric item. Called once a second.</span>
Sub HandleNumber(ByVal Item)
   Item.Value = (Item.Value + 1)
End Sub</pre>
<p>You should see something like this on your screen:</p>
<pre style="background-color: #666666; font-size: 15px;">
<span style="color: #bbccdd;"> An increasing number with alarm at 20:</span> <span style="color: #00ff00;">17</span>
</pre>
<p>Note that the <strong>Value</strong> property of a text item is a <strong>String</strong> (as in the <strong>InitTextItem</strong> callback function) but for a numeric item, the <strong>Value</strong> property is a <strong>Double</strong> (as in the <strong>HandleNumber</strong> callback function).</p>
]]></content:encoded>
			<wfw:commentRss>http://www.winsoft.se/2010/02/numeric-values-in-the-wall/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>The most basic panel for The Wall</title>
		<link>http://www.winsoft.se/2010/02/the-most-basic-panel-for-the-wall/</link>
		<comments>http://www.winsoft.se/2010/02/the-most-basic-panel-for-the-wall/#comments</comments>
		<pubDate>Wed, 17 Feb 2010 18:52:40 +0000</pubDate>
		<dc:creator>Anders Hesselbom</dc:creator>
				<category><![CDATA[Programs]]></category>
		<category><![CDATA[The Wall]]></category>

		<guid isPermaLink="false">http://www.winsoft.se/?p=971</guid>
		<description><![CDATA[Edit: This post concerns &#8220;The Wall&#8221;, a discontinued project. Please read this first. This post shows how to display text values using The Wall. This is a very simple panel. To run it, place this code in a file called TheWall.vbs, place it next to TheWall.exe and start TheWall.exe. If you are running a single [...]]]></description>
			<content:encoded><![CDATA[<p><em><strong>Edit:</strong> This post concerns &#8220;The Wall&#8221;, a discontinued project.</em></p>
<p>Please read <a href="http://www.winsoft.se/2010/02/introducing-the-wall/">this</a> first. This post shows how to display text values using The Wall.</p>
<p>This is a very simple panel. To run it, place this code in a file called TheWall.vbs, place it next to TheWall.exe and start TheWall.exe. If you are running a single display system, you must delete the first line or change it so that it says <strong>MakeFullscreen 0</strong>.</p>
<pre><span style="color: #229922;">'Make full screen on secondary screen (0 = primary screen).</span>
<span style="color: #229922;">'Exclude this line for windowed mode.</span>
MakeFullscreen 1

<span style="color: #229922;">'Black background color.</span>
BackgroundColor = "#000000"

<span style="color: #229922;">'Register three text items.</span>
RegisterTextItem 0, "A", 0, 0, "#00ff00", "CallbackA"
RegisterTextItem 1, "B", 1, 1, "#0000ff", "CallbackB"
RegisterTextItem 2, "C", 2, 2, "#00ffff", "CallbackC"

Sub CallbackA(ByVal Item)
   <span style="color: #229922;">'For a text item, value (what the item is displaying) is a string.</span>
   Item.Value = "Some green text"
End Sub

Sub CallbackB(ByVal Item)
   Item.Value = "Some blue text"
End Sub

Sub CallbackC(ByVal Item)
   Item.Value = "Some cyan text"
End Sub</pre>
<p>This is the result:</p>
<p><img class="alignnone" src="http://imghost.winsoft.se/upload/267521266430891thewall.jpg" alt="" width="300" height="225" /></p>
<p>Each item you want The Wall to display has two parts: The registration and the callback function. In the example above, the registration is represented by three calls to the <strong>RegisterTextItem</strong> function, each call for every item. The registration tells The Wall what items it should display, the callback function tells The Wall the value that the item should display. These are the arguments of the <strong>RegisterTextItem</strong> function:</p>
<p><u>Parameter 1:</u> <strong>UpdateFrequency</strong> (32 bit integer) tells how often the text should be updated (that is, how often the callback function will be called) in seconds. 0 means that the item never will be updated. All callback functions are called at startup, and if the <strong>UpdateFrequency</strong> parameter is greater than 0, it will be called again and again until The Wall is closed. In the example above, <strong>CallbackA</strong> will be called once, <strong>CallbackB</strong> will be called each second and <strong>CallbackC</strong> will be called every two seconds.</p>
<p><u>Parameter 2:</u> <strong>Name</strong> (string) is the name of the item for later reference.</p>
<p><u>Parameter 3 and 4:</u> The X and Y position in characters for the item.</p>
<p><u>Parameter 5:</u> The color of the item in HTML format.</p>
<p><u>Parameter 6:</u> The name of the callback procedure. All callback procedures take one object parameter. The type of the object that is passed depend on the type of item you add.</p>
<p>If this program gets to run for 71 seconds, the output will be <strong>A=1</strong>, <strong>B=71</strong> and <strong>C=36</strong> because <strong>CallbackA</strong> is called once at startup, <strong>CallbackB</strong> is called every second and <strong>CallbackC</strong> is called each other second (you might need to adjust the first line):</p>
<pre>MakeFullscreen 1
BackgroundColor = "#000000"

RegisterTextItem 0, "A", 0, 0, "#00ff00", "CallbackA"
RegisterTextItem 1, "B", 1, 1, "#0000ff", "CallbackB"
RegisterTextItem 2, "C", 2, 2, "#00ffff", "CallbackC"

Dim A
A = 0

Dim B
B = 0

Dim C
C = 0

Sub CallbackA(ByVal Item)
   A = A + 1
   Item.Value = ("A=" &amp; CStr(A))
End Sub

Sub CallbackB(ByVal Item)
   B = B + 1
   Item.Value = ("B=" &amp; CStr(B))
End Sub

Sub CallbackC(ByVal Item)
   C = C + 1
   Item.Value = ("C=" &amp; CStr(C))
End Sub</pre>
<p>The reason for using callback functions for collecting the values that should be displayed is that the value might be likely to change. The reason for using VBScript for this is that you might want to display values that The Wall doesn&#8217;t know how to collect. Can you grab the value using VBScript, you can feed it to The Wall. No limits!</p>
]]></content:encoded>
			<wfw:commentRss>http://www.winsoft.se/2010/02/the-most-basic-panel-for-the-wall/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Introducing The Wall</title>
		<link>http://www.winsoft.se/2010/02/introducing-the-wall/</link>
		<comments>http://www.winsoft.se/2010/02/introducing-the-wall/#comments</comments>
		<pubDate>Tue, 16 Feb 2010 20:47:01 +0000</pubDate>
		<dc:creator>Anders Hesselbom</dc:creator>
				<category><![CDATA[Programs]]></category>
		<category><![CDATA[The Wall]]></category>

		<guid isPermaLink="false">http://www.winsoft.se/?p=965</guid>
		<description><![CDATA[Edit: This post concerns &#8220;The Wall&#8221;, a discontinued project. The Wall is an important component for anyone who is designing or building an intelligent home. The Wall takes care of collecting and displaying data and optionally handling touch screen input. What does The Wall do? It displays any value on the screen, and it responds [...]]]></description>
			<content:encoded><![CDATA[<p><em><strong>Edit:</strong> This post concerns &#8220;The Wall&#8221;, a discontinued project.</em></p>
<p>The Wall is an important component for anyone who is designing or building an intelligent home. The Wall takes care of collecting and displaying data and optionally handling touch screen input.</p>
<p><strong>What does The Wall do?</strong><br />
It displays any value on the screen, and it responds to touch screen input (optionally). The Wall run in full screen mode on any screen (the primary screen or any other) until it is closed. You close it by pressing Alt+F4. If you are using one single screen, you might need to activate the program just by clicking the mouse before pressing Alt+F4 (depending on what you have done while the program has been running). If you are multitasking on multiple displays, you might need to activate it by pressing Alt+Tab before pressing Alt+F4.</p>
<p><strong>Programming The Wall</strong><br />
TheWall.exe loads the file TheWall.vbs from the same directory it is started from. You need to know a few commands and techniques to be able to build it. I will show how this is done by posting examples here. You can&#8217;t choose a script from within The Wall &#8211; your script must be located in a file called TheWall.vbs and it must be located next to TheWall.exe. Many posts will be dedicated to this topic.</p>
<p><strong>Get The Wall</strong><br />
As for now, I cannot give away The Wall for free. A demo version will be available for download. The demo version has the same functionality as &#8220;real&#8221; version, but with a text overlay.</p>
<p><strong>Where is the mouse cursor?</strong><br />
In the current version: If you are using one single screen, The Wall hides the mouse cursor. If you are using multiple screens, the mouse cursor remains visible. This might change.</p>
<p><strong>Requirements</strong><br />
You must have the <a href="http://www.winsoft.se/2008/12/msscriptcontrol-and-vista/">MSScriptControl</a> installed.</p>
<p>Check the <a href="http://www.winsoft.se/tag/the-wall/">The Wall</a> tag for new posts on this subject.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.winsoft.se/2010/02/introducing-the-wall/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>

