<?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>Neufeld Computer Services &#187; OO Draw</title>
	<atom:link href="http://ncs.hneufeld.com/category/openoffice/oo-draw/feed/" rel="self" type="application/rss+xml" />
	<link>http://ncs.hneufeld.com</link>
	<description>Code snippets, AWS stuff, and network management</description>
	<lastBuildDate>Sat, 28 Jan 2012 15:41:22 +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>Useful Posts on GIMP</title>
		<link>http://ncs.hneufeld.com/2010/01/useful-posts-on-gimp/</link>
		<comments>http://ncs.hneufeld.com/2010/01/useful-posts-on-gimp/#comments</comments>
		<pubDate>Fri, 29 Jan 2010 23:15:48 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[OO Draw]]></category>
		<category><![CDATA[OpenOffice]]></category>
		<category><![CDATA[OpenSouce Software]]></category>
		<category><![CDATA[GIMP]]></category>

		<guid isPermaLink="false">http://www.jevlir.com/~ncs/blog/?p=425</guid>
		<description><![CDATA[I use GIMP for almost all my graphics work.  It&#8217;s actually often too complicated for me, as I&#8217;m not very artistic.  Nonetheless when one of the artistic people wants me to do something, I go to GIMP.  I&#8217;m not going &#8230; <a href="http://ncs.hneufeld.com/2010/01/useful-posts-on-gimp/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[	<p>I use <a title="Link to gimp.org" href="http://www.gimp.org" target="_blank">GIMP</a> for almost all my graphics work.  It&#8217;s actually often too complicated for me, as I&#8217;m not very artistic.  Nonetheless when one of the artistic people wants me to do something, I go to GIMP.  I&#8217;m not going to pay for Photoshop when most of what it does is quite beyond my skills.</p>
	<p>There&#8217;s a <a title="Link to OpenOffice.org Training, Tips, and Ideas" href="http://openoffice.blogs.com/openoffice/2010/01/gimp-gnu-image-manipulation-program-or-free-photoshop.html" target="_blank">helpful series on GIMP right now at OpenOffice.org Training, Tips, and Ideas</a>.  You may ask what GIMP has to to with <a title="Link to OpenOffice.org" href="http://www.openoffice.org" target="_blank">OpenOffice</a>.  Well, not much directly.  But I can testify to the value of the combination of OpenOffice.org, particularly the Draw module and GIMP working together.  The illustrations and charts for one of my company&#8217;s recent books, <a title="Link to The Messiah and His Kingdom to Come: A Biblical Road Map" href="http://enerpowerpress.com/ep_detail.php?sku=1893729559" target="_blank">The Messiah and His Kingdom to Come: A Biblical Road Map</a>, were done with that combination to quite good effect.</p>
	<p>You can find all the posts in this series via <a title="Link to GIMP category" href="http://openoffice.blogs.com/openoffice/gimp/" target="_blank">this link</a>.<br />
<div id="crp_related">
<h2>Related Posts:</h2>
	<ul>
<li><a href="http://ncs.hneufeld.com/2008/10/openoffice-30-released/" rel="bookmark" class="crp_title">OpenOffice 3.0 Released</a></li>
	<li><a href="http://ncs.hneufeld.com/2008/11/create-faviconico-with-gimp/" rel="bookmark" class="crp_title">Create favicon.ico with GIMP</a></li>
	<li><a href="http://ncs.hneufeld.com/2010/03/openoffice-writer-hyperlinked-toc/" rel="bookmark" class="crp_title">OpenOffice Writer Hyperlinked TOC</a></li>
	<li><a href="http://ncs.hneufeld.com/2009/11/no-real-market-for-linux-desktops/" rel="bookmark" class="crp_title">No Real Market for Linux Desktops</a></li>
	<li><a href="http://ncs.hneufeld.com/2008/08/getting-people-to-use-openoffice/" rel="bookmark" class="crp_title">Getting People to Use OpenOffice</a></li>
	<li>Powered by <a href="http://ajaydsouza.com/wordpress/plugins/contextual-related-posts/">Contextual Related Posts</a></li>
</ul>
</div>
]]></content:encoded>
			<wfw:commentRss>http://ncs.hneufeld.com/2010/01/useful-posts-on-gimp/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Beginning Work with Draw</title>
		<link>http://ncs.hneufeld.com/2007/05/beginning-work-with-draw/</link>
		<comments>http://ncs.hneufeld.com/2007/05/beginning-work-with-draw/#comments</comments>
		<pubDate>Mon, 14 May 2007 21:15:07 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[OO Basic]]></category>
		<category><![CDATA[OO Draw]]></category>
		<category><![CDATA[OpenOffice]]></category>

		<guid isPermaLink="false">http://ncs.hneufeld.com/?p=21</guid>
		<description><![CDATA[As a means of teaching myself how to program OO Draw using OO Basic, I am trying to duplicate some of the functionality of a game mapping system I wrote some years ago using C++. I&#8217;m going to post my &#8230; <a href="http://ncs.hneufeld.com/2007/05/beginning-work-with-draw/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[	<p>As a means of teaching myself how to program OO Draw using OO Basic, I am trying to duplicate some of the functionality of a game mapping system I wrote some years ago using C++.  I&#8217;m going to post my earliest material here just because it took me a bit of effort to find out how to do these simple things.</p>
	<p>First, I wanted to monitor the mouse pointer for mouse clicks.  This requires creating a MouseClickHandler, which the wonderful document from Andrew Pitonyak&#8217;s site, <a href="http://www.pitonyak.org/AndrewMacro.odt">Useful Macro Information For OpenOffice</a>.  This is a tremendously useful document, and Andrew Pitonyak has also written a book, <a href="http://books.energion.com/ene_item.php?asin=1930919514">OpenOffice.org Macros Explained</a>.</p>
	<p>The rest comes from the <a href="">StarOffice 8 Programming Guide for BASIC</a>, another extremely useful document along with the API documentation at <a href="http://api.openoffice.org">api.openoffice.org</a>.  I recommend working your way through both Andrew Pitonyak&#8217;s macro document and the Programming Guide before trying to understand the api docs.  That&#8217;s not advice coming from on high&#8211;I&#8217;m still working my way up from totally confused to a bit less confused.</p>
	<p>In any case, my intent with this code was to monitor the mouse click, and put the coordinates as text into a draw shape.  Since I don&#8217;t see many Draw macros around the web, and none in the <a href="http://codesnippets.services.openoffice.org/">Code Snippets database</a>, I figure it&#8217;s worth blogging this.  When I get to where things are a bit more tested and more useful, I&#8217;ll submit some snippets myself.</p>
	<p>In any case, here is the code:</p>
	<pre>REM  *****  BASIC  *****
	
Option Explicit
	
Global oDocView as Object
Global oPage As Object
Global oMouseClickHandler As Object
	
'The MouseClickHandler routine is adapted in minor ways from Andrew Pitonyak's macro document
'available from http://www.pitonyak.com/AndrewMacro.odt
'Run RegisterMouseClickHandler and then simply click anywhere in the window.
'Mouse coordinates are not adjusted for the drawing area.  That's something I'm working on
Sub RegisterMouseClickHandler
  oDocView = StarDesktop.CurrentComponent.CurrentController
  oPage = StarDesktop.CurrentComponent.DrawPages(0)
  oMouseClickHandler = _
  createUnoListener(\"eneMap_\", \"com.sun.star.awt.XMouseClickHandler\")
  oDocView.addMouseClickHandler(oMouseClickHandler)
End Sub
	
Sub UnregisterMouseClickHandler
  on error resume next
  oDocView.removeMouseClickHandler(oMouseClickHandler)
  on error goto 0
End Sub
	
Sub eneMap_disposing(oEvt)
End Sub
	
Function eneMap_mousePressed(oEvt) As Boolean
  eneMap_mousePressed = False
End Function
	
Function eneMap_mouseReleased(oEvt) As Boolean
  Dim sMsg As String
	
  With oEvt
	'If there are any modifiers or the click is with the right button, we ignore.
    If .Modifiers = 0 and .Buttons = 1 and .ClickCount = 1 and .PopupTrigger = 0 Then
    	sMsg = \"X = \" &#038; .X &#038; \" / \" &#038; \"Y = \" &#038; .Y
    	'Set the mouse coordinates as the text for shape \"Info\" which is on the drawing
    	SetShapeText(\"Info\",sMsg)
    End If
  End With
	
  eneMap_mouseReleased = False
End Function
	
'This function goes through the list of draw shapes and puts the info text in the one labeled info.
'This is obviously not a very efficient approach, but I haven't found anything to locate shapes by
'label, and I also wanted to show how one can get to the shapes.  At least to me it wasn't obvious.
Function SetShapeText(sLabel as String, sText as String)
	Dim iCnt,i as Integer
	Dim oShape as Object
	
	If oPage.hasElements() = True Then
		iCnt = oPage.getCount() - 1
		For i=0 to iCnt
			oShape = oPage.getByIndex(i)
			If oShape.Name = sLabel Then
				oShape.String = sText
				Exit Function
			End If
		Next i
	End If
End Function
</pre>
	<p>The comments should help.  There must be a shape with the name &#8220;Info&#8221; for this to work.  <a href="http://ncs.hneufeld.com/wp-content/maptest1.odg">Here</a> is the whole test drawing as it stands so you can download it if desired.<br />
<div id="crp_related">
<h2>Related Posts:</h2>
	<ul>
<li><a href="http://ncs.hneufeld.com/2007/05/listing-tables-and-indexes/" rel="bookmark" class="crp_title">Listing Tables and Indexes</a></li>
	<li><a href="http://ncs.hneufeld.com/2007/05/sorting-a-scriptural-index-take-i/" rel="bookmark" class="crp_title">Sorting a Scriptural Index &#8211; Take I</a></li>
	<li><a href="http://ncs.hneufeld.com/2007/06/in-which-i-confess-to-stupidity/" rel="bookmark" class="crp_title">In which I confess to stupidity</a></li>
	<li><a href="http://ncs.hneufeld.com/2007/04/oo-basic-guide/" rel="bookmark" class="crp_title">OO Basic Guide</a></li>
	<li><a href="http://ncs.hneufeld.com/2007/07/exporting-partial-html-for-wordpress-posts/" rel="bookmark" class="crp_title">Exporting Partial HTML for WordPress Posts</a></li>
	<li>Powered by <a href="http://ajaydsouza.com/wordpress/plugins/contextual-related-posts/">Contextual Related Posts</a></li>
</ul>
</div>
]]></content:encoded>
			<wfw:commentRss>http://ncs.hneufeld.com/2007/05/beginning-work-with-draw/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

