Frequently Asked Component Specific Questions

Options

Display all FAQ items

Search FAQ items:


Displaying items 1 to 1 of 1, page 1 of 1

<< previous next >>

TPlanner
Creating planner items for each disjunct selected time zone in the planner

It is possible to allow the user to select multiple disjunct cells in the planner. This enables the user to insert multiple events in one go on different places in the planner.

Disjunct selection is enabled by setting Planner.DisjunctSelect to true and disjunct selected cells are created by Ctrl & mouse click and drag in the planner. The disjunct selected cells can be marked in a different color by setting the property DisjunctSelectColor.

After disjunct selection, the selected time spans in the planner can be retrieved with Planner.Selections

This is a collection of TPlannerSelection objects. The TPlannerSelection object holds:
property SelBegin: Integer;
property SelEnd: Integer;
property SelPos: Integer;
as such, each item in this collection holds the coordinates of the selected time spans.

Example:
This example code creates planner items for each disjunct selected time zone in the planner
procedure TForm1.Button1Click(Sender: TObject);
var
  i: integer;
begin
  for i := 1 to planner1.Selections.Count do
    with planner1.CreateItem, planner1.Selections[i - 1] do
    begin
      ItemBegin := selbegin;
      ItemEnd := selend;
      ItemPos := selpos;
    end;
end;