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 overlappable background items

Normally, when adding a background item, this is by default a non overlappable item. Setting the Background property to true automatically also sets the AllowOverlap property to false. A background item cannot be selected, moved or sized. Background items are normally used to indicate fixed time allocations, such as a time for lunch:

It can be convenient though to override this behaviour and create background items that only give a visual hint, cannot be selected or edited and over which other items can be positioned. To create such items, it is sufficient to reset the AllowOverlap property back to true after settting the Background property to true. (Note that this is not possible at design time) The code for this is:

with Planner1.CreateItemAtSelection do
begin
  Background := True;
  // reset AllowOverlap to create overlapable background item
  AllowOverlap := True;
  Text.Text := '

This is background that can be ' + 'overlapped !'; Alignment := taCenter; Color := clYellow; end;
The yellow item created as such can be overlapped with normal TPlannerItem and its only function is a visual hint as background in the planner grid: