Pages ’09 Text Box in Footer/Header flow problem

Today I was helping Michaela with formatting her assignment and she had left and right justified text in her header.

Left and Right justification done with spaces

On some pages the right justified text was not correctly aligning on the right edge, so I inserted a Text Box into the header, made it’s alignment right with text flow, and then made the text in the Text Box right justified. The numbers are the ‘Page Number’ and ‘Page Count’ Auto Text

And this looked good until I looked down in the double digits pages, were you see:

It you copy the Text Box into the page body it does not have this problem. If you copy’n’paste the Text Box over it’s self it correctly draws, but if you change any text alignment settings, or save/load the document that ‘flow’ error returns.

Top Left Text box has been Pasted into, thus looks fixed.

The problem only occurs for the Text Box text in the header/footer, not the same text values placed into the header/footer normally.

I think the problem occurs, because the Text Box is only flowed for the first Header as the later text all uses the space for the first ‘Page Number’ value which is a ‘1’. If you put a section break on a page, then on the next page, turn off the ‘use previous headers & footers’ option, but have the same formatting the Page Number (21 for my example) is correctly spaced:

MacBook upgrades

A few months back we upgrade from 1GB to 4GB of memory in the MacBook. Two weeks ago I upgraded from Leopard to Snow Leopard, wow it has a smaller foot print, it also just works better and runs 64bit, I didn’t even know the MacBook was a 64bit CPU. This weekend I upgraded the hard disk from 80GB to a 320GB disk. Wow lots of space again.

Wow tech hardware is so cheap here in the USA, and upgrading the MacBook was so simple, I’m a little shocked I didn’t do it earlier.

Now I just just need to hurry up with an idea and build an iPod/iPhone app.

Why my file operations fail on the Mac

My first thought for why things fails is the the Environment.SpecialFolder don’t map, and thus I found this page talking about it

So I ran the code on my Windows XP box and got:

Desktop                 C:\Documents and Settings\spilgrim\Desktop
Programs                C:\Documents and Settings\spilgrim\Start Menu\Programs
Personal                C:\Documents and Settings\spilgrim\My Documents
Personal                C:\Documents and Settings\spilgrim\My Documents
Favorites               C:\Documents and Settings\spilgrim\Favorites
Startup                 C:\Documents and Settings\spilgrim\Start Menu\Programs\Startup
Recent                  C:\Documents and Settings\spilgrim\Recent
SendTo                  C:\Documents and Settings\spilgrim\SendTo
StartMenu               C:\Documents and Settings\spilgrim\Start Menu
MyMusic                 C:\Documents and Settings\spilgrim\My Documents\My Music
DesktopDirectory        C:\Documents and Settings\spilgrim\Desktop
Templates               C:\Documents and Settings\spilgrim\Templates
ApplicationData         C:\Documents and Settings\spilgrim\Application Data
LocalApplicationData    C:\Documents and Settings\spilgrim\Local Settings\Application Data
InternetCache           C:\Documents and Settings\spilgrim\Local Settings\Temporary Internet Files
Cookies                 C:\Documents and Settings\spilgrim\Cookies
History                 C:\Documents and Settings\spilgrim\Local Settings\History
CommonApplicationData   C:\Documents and Settings\All Users\Application Data
System                  C:\WINDOWS\system32
ProgramFiles            C:\Program Files
MyPictures              C:\Documents and Settings\spilgrim\My Documents\My Pictures
CommonProgramFiles      C:\Program Files\Common Files

and on my MacBook I get

Desktop                 /Users/parents/Desktop
Personal                /Users/parents
MyMusic                 /Users/parents/Music
DesktopDirectory        /Users/parents/Desktop
ApplicationData         /Users/parents/.config
LocalApplicationData    /Users/parents/.local/share
CommonApplicationData   /usr/share
MyPictures              /Users/parents/Pictures

One question raised on that page is why are there two Personal values, and it’s because MyDocuments is the second Enumeration, but .ToString() only names the first in order of an enum set.

So the mystery deepens as I’m using Environment.SpecialFolder.Personal, and therefore it should work, but it seems to be failing to create the data directory, time to explore more…

After some a bit more playing around I found the file “SAVE/player.cha” in my Mac folder structure, and realised I was doing string concatenation with DOS slashes, etc. hard coded all over the place, so I refactored the code, and now it saves/loads files fine.

I then created a Mac .app bundle, so you can now just download form Google Code the Mac OS X version of the game, un-tar/gzip it, and as long as you have Mono installed, tada, instant game action. Albeit slow…

Only problem to solve is that the save files are case sensitive, in how they are searched and managed, and I’ve not got a standard schema in place. I may have to build some wrapper code to manage this, so odd DOS/Windows casing works fine on Mac/Linux systems.

Also I’ll have to make a Linux tar ball for those Linux/Mono people to test play with.

Sony Walkman NWZ-E345 and MacBook

We purchased a Sony Walkman NWZ-E345 for Michaela’s welcome to the USA present.

We had some concern once we got home because it only mentions support for Windows XP and Windows Vista on the packaging, and nobody on Amazon had mentioned Mac support.

But never fear it works perfectly with our MacBook, it just appears as an USB device, and you just drag’n’drop like an USB hard drive, and when you disconnect (after ejecting via Finder), it rescans the library.

Michaela really likes it, problem solved (the problems was bad music choice in the car).

Curse of the Azure Bonds port working on Mac OS X

Just tried running the game under Mono on my MacBook, and it like works!

Except for

  • Saved games/player file IO does not work. I think this is due to the new Vista locations, thus I’ll need a new pick a location code, in which case I could leave Windows XP working in the old location…
  • It runs really slow in combat, ie you can see the icon redraws
  • There is no sound
  • The right click context menu do not seem to work
  • You have to lunch it from the terminal prompt