Quote Originally Posted by Jenner View Post
This is something definitely doable in XNA. Let me get some specifics first. Fish are draggable between RU's and RU sections if divided, correct? I assume they "snap" into a default position when the mouse is let go? Do the fish drag as a group or are they dragged individually?
The only reason there are three fish is because I needed a square image. I should mention that each shape can be displayed in four different orientations. The ones shown are South (the direction of water flow), but North, East, and West orientations also exist. I want the fish to always be upright (hatcheries get nervous when their fish are "belly up", which works best as long as they are square). Therefore I got a square image, and three fish fit in a square image. It is just one image, though, and was originally just one fish.

The location they snap into is the FishLocation rectangle that is part of the RU section. The rectangle is centered in the section side to side. As for height, if there is enough room to show the fish AND the icons, then the fish gets the lower half of the section, while the icons get the upper half. If the section is too small for both, then the icons go away, and the fish gets the whole section.

Fish are, indeed, draggable to any section.

Dividers, can they be freely dragged up and down or are there specific positions?
Both, actually, though I'm not showing them snapping to anything. There would be keyways (the squares that I am not showing in that image) which the dividers would snap to if they are moved near one, but they can also be placed elsewhere.

How do you handle adding and removing dividers; do you drag them "off" the RU to remove them? When adding them, do you rt-click a context menu to "add divider" to the RU?
To remove the divider it is either dragged to a different RU, thereby splitting that RU, or they are dragged out of the RU and dropped elsewhere. To add them, a divider icon is dragged from a set of icons that surrounds the main display area. There are plenty of other icons out there that can also be dragged in, but they don't affect the drawing.

How are the RU's arranged in your application? When you open this form, are there like 50 RUs on the form where you have to zoom in on the ones you want or only 2 or so like you have drawn? I'm not clear on where you're zooming and why.
When the program opens, it opens to whatever zoom level it was closed at. All of the RU are displayed on the screen, or at least as many as fit. At the lowest zoom level, depending on how the RU are arranged, they might all fit on the screen, or some might not. When zoomed in to the finest degree, then only a few RU are on the screen. The user can also select a few of them, and zoom in, thereby filling the screen with just those selected RU sized such that they fit on the screen (though only sized to one of the five zoom levels, not sized to arbitrary sizes). The reason for the zooming is so that the user can zoom out to see more RU at any one time, thus making selections easier, and zoom in to see more detail in any one RU, thereby making interactions easier.



Icon positioning, rotation, scaling, tinting, zooming are a non-issue. That's just a little math.
Those icons are just bitmaps that are drawn to whatever rectangle they have to work with. No zooming or rotation really applies to them. The rectangle is calculated in the SetScale method, and depends on the geometry of the space as well as the amount of size the icons have to work with. Once the rectangle has been calculated, the icon draws into that rectangle directly.

Finally, what's your design constraint as to why they have to be Pictureboxes?
Technically, they all have to be the same control. Everything on the form is a picturebox, and they are created dynamically when the program starts. The icons around the edge of the drawing area can either be dragged onto the RU, or fish can be dragged onto them, depending on where they are located. Those peripheral icons may or may not exist. They come and go, depending on what the user does. Everything is a drop target, or is draggable, or both, and I can't know at design time what will be in them. Therefore, I needed a control that would be capable of displaying an image (every peripheral icon has an image associated with it), and I needed only one icon such that when a drag is performed, the incoming payload is always the same type. Technically, I could add in a switch and have a variety of different types, but that would increase the complexity of the design. Furthermore, the Tag property of the control carries significant data, though ANY control would work just as well for that.

Now that I think about it, I may be wrong about that. I'll have to take another look, but it may just be important that the incoming drag item is a control, without it mattering what type of control it is, since they all have tags. There may no longer be a reason to use pictureboxes for the RU if there is a superior control to use.