Dapfor home  

Grid features

The main idea of the grid is a separation of the business logic from its presentation. The business logic is your C++ objects with their polymorphic behavior that can be inserted directly into the grid. Your business objects may be presented in different ways with different formats in one or more grids. You can add these objects by calling the function Add() of the grid, and then the grid updates, sorts, highlights and filters the objects itself. A programmer doesn't have to carry out the complicated algorithms of data updating or sorting any more.


Polymorphous data behavior
Automatic text updating and highlighting
Automatic sorting (multiple sorting)
Automatic filtration
Time shortening development of applications
Multithreading
Productivity
Hierarchical data organization
Rows and columns with different height and width
Fixed rows and columns. Hierarchical data in fixed rows
Elements selection. Selecting elements without destroying background
Icons, bitmaps
Data presentation. Inserting one element into different grids
Customization of drawing
Built in controls and their positioning in the grid
Tooltips
Copy & paste
Drag & drop
Navigation
Printing
Serialization with versions support




Polymorphous data behavior

The main grid feature is the possibility to insert an object of practically any class into the grid. The grid uses binding mechanism that permits to call methods of the class. This means, that methods of the class correspond to columns in the grid, and the objects correspond to the rows. Intersection of the line and the column is a value, returned by C++ object. This approach is more useful than binding to the container of objects. Container of objects imposes a limitation on business data structure, its placement in application etc. It is too difficult to design a hierarchy by using multiple containers. With our grid, you can store your objects anywhere and build any hierarchy. You can clearly and easily determine where your C++ objects are placed in the grid. You can do practically any manipulation in the grid by using your objects. For example, when you call grid.Select(your object) then the grid will select the right line. You do not have to find the row's index that corresponds to your business data and then select it.

Automatic text updating and highlighting

As described above, the cell in the grid presents a value, returned by the object. The value is transformed to a string though a format that is declared with the class. We propose a mechanism to notify the grid when you change values inside your C++ object. Once you have updated your object, the modifications will be reflected anywhere in each grid, where the object was inserted. The right cell will be automatically highlighted. You do not need to create timers to highlight your data. The grid frees you from having to do this routine. Note that all notifications are thread-safe and implemented without blocking the calling thread. So, there is no dead-lock risk.

Automatic sorting (multiple sorting)

If you implement the notification mechanism (this is very easy), then you will benefit from the automatic sorting of dynamically changing data in each grid where your business data was inserted. Various grids may have different sorting rules and mey use any hierarchy. No need to worry - each grid will sort your data properly.

Automatic filtration

Moreover, if you implement the notification mechanism - the grid will filter(show or hide) the dynamically updating data. You just have to define the filter rules in the interface Dapfor::GUI::IGridFilter. There is only one function which returns a boolean that indicates whether your C++ object can be visible or not. So, you can update your object and each grid will filter the object according to the filter rules. You do not need to know where your object was inserted. Note that this works in the hierarchical grids too.

Time shortening development of applications

As you see, the grid implements many useful features that will help you to release your project in a short period with very high quality. There are no compromises. We paid attention to a lot of details and we put all our skills to develop this component.

Multithreading

The grid was designed to work in a heavy multi-threaded environment. Practically all functions are thread-safe. They use both synchronous and as asynchronous mechanisms with or without blocking the calling thread. Inserting, removing, getting etc. work with blocking the calling thread. Any data updating are processed through the asynchronous mechanism. The calling thread does not wait for the end of updating operation. Much updating may occur at the same time. In this case, the dead-lock between GUI and non-GUI threads is not possible.

To display information in cells, the grid needs to retrieve values from your business objects. There are two thread-safe modes to do it:

Productivity

The grid combines real and virtual operating modes. The data is inserted into the grid in the real mode and its highlighting, sorting and filtration is conducted in the virtual mode. Taking advantage of both modes, the grid allows you to achieve a very high level of productivity. The CPU loading and memory consumption depends on the thread safety mode. Dapfor::GUI::CPreferences::DirectCall is more productive compared to Dapfor::GUI::CPreferences::MemoryBuffer. Nevertheless, productivity of each mode is more than enough for carring out practically any application. The grid permits you to insert more than 100 000 elements in a second, to do more than 50 000 automatic data updates with their automatic highlighting and also to do more than 5000 data updates in a second with their automatic sorting, filtering and highlighting.

Hierarchical data organization

Initially, the grid was designed for the hierarchical data presentation. The hierarchy is organized when elements are being inserted into the grid and can be easily changed later. You can insert objects of various classes into the same grid. This permits you to construct any type of hierarchy. You can store your objects anywhere in the application. All described above features are available both for flat and hierarchical grids...

Rows and columns with different height and width

Each column of the grid can have its own set of attributes that allow to present information in the most convinient way. It is possible to assign a width, text format, graphical format and so on for each column. The height of a row can also be defined individually.

Fixed rows and columns. Hierarchical data in fixed rows

The grid provides the possibility to organize in the grid so called "frozen" rows and columns. While scrolling elements in the grid, such rows and columns always remain at their positions. In order to freeze some columns you just have to set their number. When freezing the rows, you should remember that the data can be hierarchical. When you 'expand/collapse' or 'filter', a number of grid rows in the fixed area may change. So "frozen area" is defined not by a row's absolute number but by the context where data objects are inserted. The grid supports two contexts: scrollable and fixed. As evident from its name, in the fixed context, data cannot be scrolled and remain constantly visible.

Elements selection. Selecting elements without destroying background

You may use different color schemes for cells, columns and rows in the grid. When you select a line, an important color information may become inaccessible. To avoid this, the grid uses alpha-blended operations to mix the selection color with that of the background. To select a large quantity of elements with the mouse, for the user's convenience, there is a possibility of automatic data scrolling with their selection. The scrolling speed will change as the distance between scrolling cursor and the grid client area incraises.

Icons, bitmaps

The grid provides simple features to show pictures in cells. It is possible to stretch icons or change them dynamically. It is really easy to implement changing cyclic icons by using the highlighting features. In addition, you can set a background bitmap with a specified transparency coefficient.

Data presentation. Inserting one element into different grids

The most powerful feature of the grid is a possibility to work with objects of arbitrary classes. As described above, the rows correspond to your business objects, and columns to the class functions. The grid shows in cells values, returned by functions of these objects. Note that functions return only non-formatted typed values like long, double etc... The grid can not show them directly within the cells. To show the values within cells, the formats are used. They transform received values from the business objects to strings and, vice-versa. You can use the same set of formats in each grid or define it for each grid's header, or use individual formats just before painting. So, the same object can be presented in many ways even in the same grid.

Customization of drawing

The grid works in both real and virtual modes at the same time. The real mode allows you to insert objects into the grid while the virtual mode is used for data drawing. When data are being drawn, the grid provides all information concerning a business object, its placement and state, colors, fonts etc... Our developers have gone to great lenghts to concentrate grid drawing at one place, and to take advantage of both modes, they have provided the surprisingly easy possibility of redefine and customize anything. The decision about a font type and size, icon type, background color, highlighting, and so on can be made at the time of drawing. When you have all the information about the object's state, it is easy to take any decision. For instance, you do not need to find the data placement to change a color scheme. You will be asked by the grid when it needs the color information for painting. As a result, you can insert your business data into the grid and forget about it.

Built in controls and their positioning in the grid

The grid provides a very simple and useful positioning service for practically any MFC controls with navigation between them. In most cases, buttons, check boxes, and so on are not real controls but only their drawings. Basically, such 'controls' are supplied together with the grids and their number and functionality may be limited. Moreover such approach does not allow the use of already existing solutions or the third-party libraries. In case of real controls it is necessary to handle their location and size according to a number of elements in the grid, scrollbars' positions and also to manage their visibility (in case of filtration, expand/collapse and row deleting). This is not a trivial task and some difficulties may appear in the process of its realization. We offer the solution that permits you to attach pratically any MFC control to any cell and the grid will handle the positioning and visibility of the controls itself.

Tooltips

A tooltip is designed to enlarge an application functionality for instances when information that must be provided to the user cannot be displayed entirely. The grid provides several solutions:

Copy & paste

Copy & paste allows you to move data inside one grid, between various grids or between different applications. The grid allows you to export data to such applications as Excel and Word. In addition to standard clipboard formats, GUI library has new ones that allow you to maintain a hierarchical information and also to move data between different applications with data serialization where it is possible. At any moment the programmer can customize the copy & paste mechanism.

Drag & drop

The grid provides default Drag & drop implementation. It is possible to move selected lines inside one grid, between grids or between different applications. Moreover, at any moment the programmer can customize drag & drop behavior for his purposes. To indicate a dropping place the grid illuminates the lines between which data will be inserted. However in case of hierarchical data it is not enough because the level of hierarchy remains unknown. Our grid has a possibility to indicate this hierarchical level that allows you to clearly specify the user's wishes concerning inserting data into the desirable position.

Navigation

Working with two data contexts (fixed & scrollable), the grid handles the navigation and harmoniosly processes data selection, scrolling and focusing of lines. The programmer can define under what contexts the navigation is possible and also totally redefine it. In case of Edit in Place controls, the grid handles the navigation (Tab, Shift Tab, Key Left, Key Right, etc..). This allows you to activate the next control by using the keyboard.

Printing

The grid allows you to print its content on a printer and also has a 'print preview' option. Various levels for scaling and choosing either a portrait or a landscape mode of images will satisfy practically all clients' requests.

Serialization with versions support

Serialization in CArchive is a useful grid feature. A position, color of columns, colors, the user's preferences, and so on are serialized. The grid is projected in such a way that new grid versions will be compatible with the archives made in previous ones.

Copyright Dapfor 2007-2009
Generated on Sat Jan 30 15:01:23 2010 for MFCGrid by doxygen 1.5.5