Nateo Concept: Initialization
Initialization of the Time Chart
This chapter explains the steps that are neccessary to get a
Assumptions
We will no go through creation of a Windows Form containing a Time Chart. We will start at the point where you have already performed the following steps:
- You already created the Windows Forms Application
- You already placed the Nateo.dll into your solutions folder and added it to your solution as a Reference.
- You already added a Form to your application or kept the default Form as the one to work with.
Getting started
Now you should take a look into the Toolbox where and find the controls the IDE offers for use in Forms: As you added the Nateo.dll as a Reference, you should now see a section
named 'Nateo'. Once you open it, you find the Nateo controls in there.
The first step is to drag the following elements to your Form and specify them accordingly in terms of name, location, anchors, docking etc.:
- One NtTimeChartControl. This is the central control.
- One NtHeaderControl. Place it on top or to the bottom of the NtTimeChartControl, depending on where you want it. In general, top is the better option.
- As many NtFlankControls as you prefer. For usability reasons having exactly one NtFlankControl located to the left of the NtTimeChartControl is by far the best to recommend.
- A NtHScrollBar that will work as the Time Charts horizontal scroll bar. The recommended position of course is to the bottom of the NtTimeChartControl.
- A NtVScrollBar as the vertical scroll bar. Best position is to the right of the NtTimeChartControl or to the right of the rightmost NtFlankControl if one of those is located to the right.
- One NtHScrollBar per NtFlankControl that shall support horizontal scrolling. Horizontal scrolling in Flank Controls is no good usability. Better to have no horizontal scroll bars here.
- One NtBackPanel. On initialization it will be relocated so it makes up the 3D border around the NtTimeChartControl, NtFlankControls, Scrollbars etc. Place this NtBackpanel anywhere on your Form and make it small so it does not disturb.
Initialization in the Form's Load() member method
1. Set the interfaces the NtTimeChartControl might need. Example:
Of course you need to create the implementing interface methods or classes. This is not covered here.
2. Set general flags and properties that define the behaviour of the NtTimeChart.
Settings like
Anyway this is a good time to set the fonts and brushes for the category headers (if you want to use categories). Example (for two category levels):
3. Add event handlers for all events you want to catch, like double clicking on objects etc. Example:
4. Set up the NtTimeChartControl's sheet, columns and initial scaling.
The NtTimeChartControl has a specific number of columns you must set up on initialization. The follwoing example creates 240 columns, so whenever display mode is switched to 'hours' the control will cover 10 days.
Please note that the initial column width of 90 pixels and the time display mode
5. Maintain the Scrollbars, Flank Controls, Header Control, and Back Panel.
The horizontal and vertical scroll bars need to be attached to their master controls. Flank Controls are initialized with the
6. Setting up the NtDisplayDefs and the NtRowHeaders.
Suppose you have a method named
This example does not prepare any bitmap for any of the NtRowHeaders to keep things simple. Of course you can initialize Row Headers depending on the data types differently or create your own subclasses of
NtRowHeader to implement special abilities.
7. Set the data and the NtPerspective.
Now as everything is configured, it is time to insert the data into the Time Chart and finally define the row setup. First the Time Chart is scrolled to the current point of time (aligned to the middle of the
client area). Then the data is set (
These are all steps for initializing filling and launching the NtTimeChartControl. Please refer to the tutorials for hands on examples.
<< Prev.: Tooltips Next: Overview >>
