Sunday 25 January 2009

rounded/custom borders soln

This morning I went on Animal Crossing, and bought some white turnips and a red turnip seed from Sow Joan. It was also flea-market day today, which meant that you could go into other Animals' houses (so long as they were in) and buy stuff in their room off them. The prices were normally quite a bit lower than what you would pay Nook. The Animals didn't want to sell all their posessions though. Also when you're in your own home, animals will come in and see if they want to buy anything from you.

Since I only had my normal stuff (which obviously I want to keep) out, I didn't sell anything. You could pack away all the stuff you want, and take out all the stuff you don't want, then barter with the interested Animals to sell the items, but that was too much bother for me.

After playing on Animal for a bit we (me and Ben) went off to church. After church I was waiting around for ages for Ben to come out of Sunday School as he had left his coat in Church next to me. Eventually I found him in the big hall bit eating a croisant. He said he hadn't come out because he was going to go to Sainsbury's with Clare. It would have been nice if he could have just come out when church finished and told me so I didn't have to stand around for ages.

When I got home I went on Animal a bit more, did some more fishing since I didn't have any money on me, sold the fish and then after a few rounds of fishing and selling I had a few thousand bells, so I went to the city. When I got to the city I went to Crazy Redd's and bought a painting. It was only about three or four thousand bells, so I think it might be fake. Also the way he was laughing and saying 'sucker' or something similar under his breath makes me think I might have been ripped off.

After dinner I went on my comp and managed to get custom borders working. I used absolutely positioned divs and set their top, left, bottom, and right positions as appropriate to make the divs stretch to cover the area needed. IE6 doesn't support this method, and if I set a div to 100% width, it would stretch 100% of the page size, rather than 100% of its container width, even though its container was floated and positioned. So in IE6 I used a CSSexpression to set the divs to the width/height of the container minus the margins needed.

I added 10 divs in total - 4 for the corner images, 4 for the top and bottom side images, 1 that can be used for a background, and 1 to hold the original content of the container div. The div for the background isn't entirely necessary, as you could apply the background you want to the content div, but then the content div would need to be positioned so as not to overlap the corner images (normally this would be the case, having a seperate div for the background just increases the flexibility).

The custom borders are created from 3 images - one of the corners, 1 of the left and right sides that can be repeated and 1 of the top and bottom sides that can be repeated.

So as well as custom borders, the div can also be filled with a gradient, image or pattern. If it's filled with a pattern or image, then the content div would need to have the background applied to it.

I just got it setup using hardcoded divs and css, it would certainly be possible to write a javascript function to do the work. If I want to style more than 1 div with different custom borders, then I think setting up a javascript function to do the work would certainly be worth it.

When I had got my custom border css working I played Excite truck with Ben for a bit. After that I backed up my comp, then played Excite truck with Mac.

After tea I checked my spleenmail and also tried to work out why Microsoft Virtual PC 2007 would crash VMWare Server 2.0. I looked at the log for the Virtual Machine, and found it said 'Panic: can't get userlevel lock'. A quick google turned up this thread: Can't start VMWare Server 2.0 and Microsoft Virtual Server 2005 R2 VM at same time? Error message: "VCPU 0 RunVM failed: -2", which gives a very easy answer: Turn off hardware-assisted Virtualization in Microsoft Virtual PC 2007. I did this and it fixed the problem. I also changed the Network option on my VMWare Virtual Machine to 'NAT' instead of 'Bridged'. It didn't seem to make much difference though. I could still browse the internet on the virtual machine, but still couldn't access files on the host machine from the guest (and vice versa) through the network.

Later in the evening I watched some Mahabharat with Ben and Maccy. After that I took some photos of a succulent flower.

The weather today was rainy early in the morning, then overcast all day. I listened to bluegrass/American folk music most of the day.

Food
Breakfast: Tangerine orange marmalade toast sandwich; cup o' tea.
After church snack: milk chocolate digestive; coffee.
Dinner: Chicken & vegetable curry; green beans; rice; sultanas. Pudding was Neapolitan ice cream. Coffee; Small chocolate Santa; Sainsbury's caramel chocolate.
Tea: Mustard ham with salad sandwich; most of a packet of prawn cocktail flavour crisps; 2 bits of waffle with golden syrup and squirty cream; clementine.

No comments: