Area Click Zone

#1
Hey Guys,

In doing my MFD which is born from the FS9 GPS 500, I am having a problem understanding the Zoom click zone. How on earth is this working here?

I have tried several directions to isolate these into two different area's other from how its originally working, and nothing seems to work.

I cannot understand how you can get the second coordinate from one 'area' call, such as say '34'..? That makes no sense.

Here is the code for the Map Zoom-in and Zoom-out button area's.


Code:
		<Area Name="RNG Button" Left="789" Top="324" Width="39" Height="30">
			<Area Name="RNG Out" Top="35" GpsSpecific="Y">
				<Click Kind="LeftSingle+Leave">
					(M:Event) 'LeftSingle' scmp 0 == (@g:zoominButtonDown) 0 == and if{ 1 (>@g:zoominButtonDown) @ZOOMINButton }
					(M:Event) 'Leave' scmp 0 == (@g:zoominButtonDown) 1 == and if{ 0 (>@g:zoominButtonDown) }
				</Click>
				<Cursor Type="UpArrow"/>
				<Tooltip ID="TOOLTIPTEXT_GPS_RANGE_UP"/>
			</Area>
			<Area Name="RNG In" Bottom="35" GpsSpecific="Y">
				<Click Kind="LeftSingle+Leave">
					(M:Event) 'LeftSingle' scmp 0 == (@g:zoomoutButtonDown) 0 == and if{ 1 (>@g:zoomoutButtonDown) @ZOOMOUTButton }
					(M:Event) 'Leave' scmp 0 == (@g:zoomoutButtonDown) 1 == and if{ 0 (>@g:zoomoutButtonDown) }
				</Click>
				<Cursor Type="DownArrow"/>
				<Tooltip ID="TOOLTIPTEXT_GPS_RANGE_DOWN"/>
			</Area>
		</Area>

Could someone by chance shed some light on this? I for one would be greatful.



Bill
LHC
 

n4gix

Resource contributor
#2
Bill, please note that the original XML is:

Code:
<Area Name="RNG Button" Left="410" Top="46" Width="28" Height="[B][COLOR="Red"]70[/COLOR][/B]">
	<Area Name="RNG Out" Top="[B][COLOR="Red"]35[/COLOR][/B]" GpsSpecific="Y">
		<Click Kind="LeftSingle">
			1 (&gt;@g:zoominButtonDown) @ZOOMINButton
		</Click>
		<Cursor Type="UpArrow"/>
		<Tooltip ID="TOOLTIPTEXT_GPS_RANGE_UP"/>
	</Area>
	<Area Name="RNG In" Bottom="[B][COLOR="red"]35[/COLOR][/B]" GpsSpecific="Y">
		<Click Kind="LeftSingle">
			1 (&gt;@g:zoomoutButtonDown) @ZOOMOUTButton
		</Click>
		<Cursor Type="DownArrow"/>
		<Tooltip ID="TOOLTIPTEXT_GPS_RANGE_DOWN"/>
	</Area>
</Area>
The key to understanding this is that 35 + 35 = 70... ;)

The first line defines a "master rectangle" at 410,46,28,70.

The first "sub-area" defines a segment of that "master rectangle" which is 35pixels high, beginning from the TOP of the "master rectangle."

The second "sub-area" defines a segment of that "master rectangle" which is 35pixels high, beginning from the BOTTOM of the "master rectangle."

The only reason for this type of syntax is organizational. This makes it clear that you are defining ONE BUTTON with two operations, depending on where on the buttom you click..

There is absolutely no other purpose served. It could just as easily been defined as two completely seperate mouse rectangles.
 
#3
Ahhhh... I see.

So in making the button horizontal, I would make Left and Right the width call zones.

I did try to re-write in click zone parameters, but it didnt function. Perhaps if I had totally seperated them from the 'button' string, that would have enabled them to work seperately.

Thanks for the tutorial on that Bill!


Bill
LHC
 
Top