• entries
    743
  • comments
    1924
  • views
    578702

Progress on Map.NET

Sign in to follow this  
Aardvajk

75 views

Map.NET


I'm pretty pleased with the progress on Map.NET really. The fiddly bit of drawing the map, scrolling it around, click-dragging a region with the mouse and filling it with blocks is all done.

I couldn't find a built in component that would display the available blocks that was what I wanted, so I implemented the palette above myself. It is based on the Visual Studio C# component panel and highlights the selected item as well as the item being hovered over.

It automatically scales down the associated image so it fits in a 32x32 square, which looks pretty good.

I decided to not have it own its list of components, so it has a few delegate functions that call back its owner (the main form in this case) to retrieve the total count of items, the image and text for each item and the currently selected index.

The idea is that the same palette will be able to display item templates instead of blocks when the item tool is selected. To implement this, I can just make the main form functions that are assigned to the palette's delegate members return the item information instead of the block information.

Should work.

[LATER]

Cut, copy, paste and delete all work on the map cells now. Cut and copy load the clipboard in a format that you can paste into Excel as well which is quite cool.

There's a Tools toolbar down the left of the main window too. Only "Select Cells" and "Paint Cells" implemented at the moment.
Sign in to follow this  


2 Comments


Recommended Comments

I think there's some hackish way to get a ListView object to look sorta like that (though not nearly as nice). It looks good though. I really need to look up how to create new controls and stuff, I've always been really daunted by that :[

Share this comment


Link to comment
Quote:
Original post by Mushu
I think there's some hackish way to get a ListView object to look sorta like that (though not nearly as nice). It looks good though. I really need to look up how to create new controls and stuff, I've always been really daunted by that :[


I haven't actually created a new control. I'm very daunted by that as well [smile].

It's just a form with a PictureBox and a VScrollBar. It implements like the PictureBox Paint(), MouseMove(), MouseLeave() and MouseDown() events.

Nothing too clever really. I'd love to know how to build that into a reusable control I could plonk on the form at design time.

Share this comment


Link to comment

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now