BACKGROUND

I have found that I often wish to see a set of data as either a form or a table/grid. TheInfoView control is being developed to support that goal while allowing for other views to be addedin the future as I find a need for them.

DEMO

The demo currently has a list on the left and a view on the right. Clicking on an entry in the list will make that the current view on the right.

NAVIGATION

IVRowCol / Table

  • Mouse Wheel - Scroll rows
  • Control + Mouse Wheel - Scroll columns
  • Arrow keys
  • End - last col
  • Home - first col
  • Control+End - Last cell
  • Control+Home - First cell
  • Page up/down - page

If row or column resizing is on, drag when sizing arrows show to resize column. Also note that sizing can be on the entire grid or just the headers.

You can select by either using shift with the navigation keys, shift clicking, or dragging around cells.

IVCol / Form

  • Mouse Wheel - Scroll rows
  • Control + Mouse wheel - Scroll columns
  • Up/down arrow keys - next/prev col
  • Home - first col
  • End - last col
  • Control+Home - first cell
  • Control+End - last cell
  • Page up - Prev record
  • Page down - Next record

You can select by either using shift with the navigation keys, shift clicking, or dragging around cells.

IVRow / Card

  • Mouse Wheel - Scroll rows
  • Up/down arrow keys - next/prev row
  • Home - first row
  • End - last row
  • Page up - Prev page
  • Page down - Next page

You can select by either using shift with the navigation keys, shift clicking, or dragging around cells.

EXTENSIBILITY

The viewer is designed to be highly extensible and configurable. It accomplishes this in a several ways.

1st IVBase contains Views implemented as iExtend. One view is active at a time. Table, Form, and Card views currently exist. Other views may be implemented as well.

2nd IVBase, IVTable, IVForm, and IVCard contain Extensions implemented as iExtend. Extensions are user supplied code that can either preempt existing functionality or add new functionality. Example usage scenarios would be to extend keyboard handling or implement drag and drop or respond to additional windows events.

3rd layouts are managed via an iLayout that double as a renderer. The current layouts are sequential, flow, simple, and positioned. Sequential lays out cells horizontally or vertically. Flow lays out uniform cells either down/right or right/down. Cells may either be evenly distributed, x cols/rows, or fixed in size. Simple allows laying out multi-line forms by placing fields either relatively or using a fixed size. Positioned allows placing fields at a specific location and may be anchored on the left, top, right, or bottom.

4th each part is rendered using an iRender. There are several existing renderers:

  • Bar - Renders a bar of a given thickness on a side of the rectangle (or in the horizontal or vertical middle)
  • Bar - Renders a bar on a specified side of the rectangle
  • Bevel - Renders a beveled frame
  • Button - Renders a button frame in a particular state
  • Compound - Renders a list of iRenderers
  • Fill - Fills a square/rounded rectangle with a solid or gradient color.
  • Focus - Draws a focus rectangle
  • Frame - Draws a "picture" style frame, thick corners, thin outline
  • Inflate - Changes the rendering rectangle dimensions.
  • Offset - Changes the rendering rectangle dimensions on any side.
  • Outline - Outlines a square/rounded rectangled with a color.
  • Rows - Uses a different renderer based on the row number
  • Split - Fills a rectangle with two different sets of colors based on a fixed or percentage
  • Text - Renders text at an angle with a color.
  • TextRect - Renders text in a rectangle with a color and alignment.
  • ThemeHeader - Renders a header frame in a particular state
Value based renderers
  • Bound - Renders content and optionally a prompt
  • Checkbox - Renders a checked or unchecked checkbox
  • Icon - Renders an icon
  • Image - Renders an image positioned, stretched with fill, min , or max constraint, and tile x, y, and xy
  • Radio - Renders a radio / option button
  • Text - Renders text
  • TextRotated - Renders text rotated at an angle
  • TransparentImage - Renders an image except for a specified color.
The value based renderers also support mapping that allows translating a stored value into something to display.

With the multi-renderers, adding RenderFill and RenderOutline to a RenderCompound would allow you to draw an outlined rectangle. Adding two different colored FillRect's to a Rows would allow you to achieve alternating rows. Placing layout renderers allow you to achieve a specific layout within a region.

In addition iRender has been designed to be easy to implement. Simply create a class and implement the Render method to fill in the supplied rectangle and you can use it the same as the supplied renderers. There are generally two types of renderers, fillers and drawers. Fillers cover the rectangle with something. drawers render some detail into the rectangle but don't nesassarily fill them in. There are also generally two types of drawers: constant drawers and value drawers. To implement a value drawer, add an iValue interface. Value drawers may also implement iAlign. Constant drawers tend to add a decoration, while value drawers tend to render content.

5th each rendering part generally allows for 3 separate renderers: Normal, Selected (the way a selected part is rendered), and Hot (the way the part under the mouse is rendered).

6th user DrawOverride allows the user to change the value or renderer in any way (including replacing them) as well as choosing to perform their own rendering in place of the supplied renderer. Each rendered part allows for independent overriding. The user can change values for the renderer, substitute a different renderer, or take over and actually perform the rendering.

7th IVBase is a "Virtual" control meaning it does not directly store any data. Instead information is rendered from an iDataSource. This has been designed to be easy to implement for whatever way you store your information. It simply asks for the information at a row and column and you supply the value. Included is a DataTable, DataView, DataSet for storing data in a general way along with an iDataTableDataSource that can be used with IVBase. There is also a sample of loading it from a tab delimited text file and it can also be used to temporarily store information from databases or other sources such as WMI. The sample datasources also support pivoting the data to change the presentation.

8th parts allow one or more drawing overrides. In addition to having a default renderer, specific rows or columns may have either the background and/or the content overridden.