Web forum is in read-only mode. Login as active registered customer for write access
  Forum Search   New Posts New Posts

FNC Planner Timeline Appearance

 Post Reply Post Reply
Author
Steinberger Helmut View Drop Down
Member
Member
Avatar

Joined: 31 Oct 2011
Posts: 61
Post Options Post Options   Quote Steinberger Helmut Quote  Post ReplyReply Direct Link To This Post Topic: FNC Planner Timeline Appearance
    Posted: 12 Nov 2018 at 1:55pm
I am just about testing the FNC Planner component. I want to display several positions in a timeline, that shows a number of days. The timeline should be on the top. This is nicely done by setting the OrientationMode. The Mode I set to DayPeriod, which seems to work well.
DisplayUnitType will be set to pduHour.
Depending on how many days the user wants to be displayed, I will set the DisplayUnit will be set to 1 up to 12.
My main problem at the moment is, to get a good Header that displays the day and the time of the day.
For Example, if I have 3 days to be displayed, I would like to have the day of week and the date to be displayed on the top of the timeline and for every DisplayUnit the time the DisplayUnit starts with.

For Example something like that:
       Mo, 12.11.2018        |        Di, 13.11.2018       |       Mi, 14.11.2018
00:00|06:00|12:00|18:00|21:00|00:00|06:00|12:00|18:00|21:00|00:00|06:00|12:00|18:00|21:00|

Is there a way to get a timeline like that?
Back to Top
Pieter Scheldeman View Drop Down
TMS Support
TMS Support
Avatar

Joined: 18 May 2010
Posts: 3025
Post Options Post Options   Quote Pieter Scheldeman Quote  Post ReplyReply Direct Link To This Post Posted: 12 Nov 2018 at 2:44pm
hi,

Unfortunately this is not possible. The time-line can only show one or the other. You can combine Days and the hours of the day separately via the MultiDay mode.
Back to Top
Steinberger Helmut View Drop Down
Member
Member
Avatar

Joined: 31 Oct 2011
Posts: 61
Post Options Post Options   Quote Steinberger Helmut Quote  Post ReplyReply Direct Link To This Post Posted: 12 Nov 2018 at 2:59pm
The problem in MultiDay mode is, that the days are displayed on the left side and the time is on the top. I need days and time on the top and positions on the left. Is this possible in any mode?
Back to Top
Pieter Scheldeman View Drop Down
TMS Support
TMS Support
Avatar

Joined: 18 May 2010
Posts: 3025
Post Options Post Options   Quote Pieter Scheldeman Quote  Post ReplyReply Direct Link To This Post Posted: 12 Nov 2018 at 3:01pm
As already mentioned in the previous post, it is not possible to have both the day and time on the timeline.
Back to Top
Steinberger Helmut View Drop Down
Member
Member
Avatar

Joined: 31 Oct 2011
Posts: 61
Post Options Post Options   Quote Steinberger Helmut Quote  Post ReplyReply Direct Link To This Post Posted: 12 Nov 2018 at 3:28pm
Ok, so I have to draw it by myself. Should be ok for me. I discovered OnBeforeDrawTime and OnAfterDrawTime and several other Events, that could be useful. Is there a detailed description what each of this does and what AAllow and ADefaultDraw does? I did not find any detailed description in the DevGuide.

Back to Top
Pieter Scheldeman View Drop Down
TMS Support
TMS Support
Avatar

Joined: 18 May 2010
Posts: 3025
Post Options Post Options   Quote Pieter Scheldeman Quote  Post ReplyReply Direct Link To This Post Posted: 12 Nov 2018 at 4:28pm
There is no detailed description of these events, but there is a sample in the TMS FNC UI Pack that demonstrates the use of those events. The Allow parameter is to completely block drawing, the ADefaultDraw is to apply graphics, but not draw the elements, so you can draw them yourself. With the Allow parameter you also need to apply graphics such as font, color, ...
Back to Top
Steinberger Helmut View Drop Down
Member
Member
Avatar

Joined: 31 Oct 2011
Posts: 61
Post Options Post Options   Quote Steinberger Helmut Quote  Post ReplyReply Direct Link To This Post Posted: 12 Nov 2018 at 5:24pm
Thank you for the info. I will give it a try. Unfortunately there is no sample app with source in the trail version, but I will buy the FNC UI Pack anyway.
Back to Top
Steinberger Helmut View Drop Down
Member
Member
Avatar

Joined: 31 Oct 2011
Posts: 61
Post Options Post Options   Quote Steinberger Helmut Quote  Post ReplyReply Direct Link To This Post Posted: 14 Nov 2018 at 11:22am
I bought the UI pack and the planner works great for me. I managed to draw the timeline, so it fits my needs.
Now I have a question about the color of the items. In the VCL planner I could set Color and ColorTo to get a transition from one color to another. I did not find a ColorTo in the FNC Planner. Is there standard way to draw the items with a color transition or do I have to draw it in an event like I draw the timeline now?
Would be nice to be able to set a ColorTo and an orientation for the color transition.
Probably I have to use HTML bgcolor and bgcolorto?
Back to Top
Pieter Scheldeman View Drop Down
TMS Support
TMS Support
Avatar

Joined: 18 May 2010
Posts: 3025
Post Options Post Options   Quote Pieter Scheldeman Quote  Post ReplyReply Direct Link To This Post Posted: 14 Nov 2018 at 1:48pm
Hi,

The default appearance of the items is stored under ItemsAppearance. if you want to draw gradients, you can use the following code:

procedure TForm1.TMSFNCPlanner1BeforeDrawItem(Sender: TObject;
  AGraphics: TTMSFNCGraphics; ARect: TRectF; AItem: TTMSFNCPlannerItem;
  var AAllow, ADefaultDraw: Boolean);
begin
  AGraphics.Fill.ColorTo := gcRed;
  AGraphics.Fill.Kind := gfkGradient;
  AGraphics.Fill.Orientation := gfoVertical;
  AGraphics.Stroke.Color := gcBlack;
end;
Back to Top
Steinberger Helmut View Drop Down
Member
Member
Avatar

Joined: 31 Oct 2011
Posts: 61
Post Options Post Options   Quote Steinberger Helmut Quote  Post ReplyReply Direct Link To This Post Posted: 14 Nov 2018 at 2:07pm
Ok, thanks for your answer.
Back to Top
Steinberger Helmut View Drop Down
Member
Member
Avatar

Joined: 31 Oct 2011
Posts: 61
Post Options Post Options   Quote Steinberger Helmut Quote  Post ReplyReply Direct Link To This Post Posted: 14 Nov 2018 at 2:51pm
How is the textsize of the item title set, when FontSize = -1 ?
The Tilte is way too large for me. I know I can set the FontSize to a smaller one, but then this size is used, no matter how the size of the rest of the planner is. I would like to set the Font Size of the Title and the Bodytext, but it should stretch in relation to the size of the Position (Positionapperance.Stretch is set to true). Is there an easy way to do this?
Back to Top
Pieter Scheldeman View Drop Down
TMS Support
TMS Support
Avatar

Joined: 18 May 2010
Posts: 3025
Post Options Post Options   Quote Pieter Scheldeman Quote  Post ReplyReply Direct Link To This Post Posted: 14 Nov 2018 at 3:00pm
The Fontsize can be controlled per item, when it is -1 it takes over the font size of ItemAppearance.TitleFont.Size or ItemAppearance.Font.Size. You could override the OnBeforeDrawItemTitle or OnBeforeDrawItemText event and then calculate the font size based on the available rectangle that is passed as a parameter.
Back to Top
Steinberger Helmut View Drop Down
Member
Member
Avatar

Joined: 31 Oct 2011
Posts: 61
Post Options Post Options   Quote Steinberger Helmut Quote  Post ReplyReply Direct Link To This Post Posted: 14 Nov 2018 at 3:40pm
Many thanks for your help. Will try that.
The FNC Planner is amazing, but Iwished there would be a more in detail documentation or a reference or something like that. Then I would not have to ask so many questions here.
Back to Top
Steinberger Helmut View Drop Down
Member
Member
Avatar

Joined: 31 Oct 2011
Posts: 61
Post Options Post Options   Quote Steinberger Helmut Quote  Post ReplyReply Direct Link To This Post Posted: 14 Nov 2018 at 4:30pm
I just discovered a problem in the mousewheel event handler.
When I set Handled to true, that has no effect on the handling of the Event in the Planner.
In TTMSFNCCustomControlBase.WMMouseWheel you do not use messaage.result to pass it to HandleMouseWheel.
I think there should be 
b := message.result;
and not
b := false;

I use the mousewheel to increase or decrease the size of the positions when the mouse cursor is somewhere over the positions and CTRL is pressed. Unfortunately it does not only increase or decrease, it also scrolls. To avoid that scrolling in that situation, I set Handled to true, but that has no effect.

Back to Top
Steinberger Helmut View Drop Down
Member
Member
Avatar

Joined: 31 Oct 2011
Posts: 61
Post Options Post Options   Quote Steinberger Helmut Quote  Post ReplyReply Direct Link To This Post Posted: 14 Nov 2018 at 4:32pm
Should be 
b := message.result = 1;
Back to Top
Steinberger Helmut View Drop Down
Member
Member
Avatar

Joined: 31 Oct 2011
Posts: 61
Post Options Post Options   Quote Steinberger Helmut Quote  Post ReplyReply Direct Link To This Post Posted: 14 Nov 2018 at 4:35pm
Ups, did not work, because Handled is not handled in HandleMouseWheel. So made this change:
  if message.Result = 0 then
     HandleMouseWheel(CreateShiftStateEx, Message.WheelDelta, b);

Now it works.
Back to Top
Pieter Scheldeman View Drop Down
TMS Support
TMS Support
Avatar

Joined: 18 May 2010
Posts: 3025
Post Options Post Options   Quote Pieter Scheldeman Quote  Post ReplyReply Direct Link To This Post Posted: 15 Nov 2018 at 9:58am
Hi,

Can you post the correct code you have changed in the WMMouseWheel to get this working?
Back to Top
Steinberger Helmut View Drop Down
Member
Member
Avatar

Joined: 31 Oct 2011
Posts: 61
Post Options Post Options   Quote Steinberger Helmut Quote  Post ReplyReply Direct Link To This Post Posted: 15 Nov 2018 at 10:07am
Here are my changes:

procedure TTMSFNCCustomControlBase.WMMouseWheel(var Message: TWMMouseWheel);
var
  b: Boolean;
begin
  b := message.Result > 0;
  if not b then
     HandleMouseWheel(CreateShiftStateEx, Message.WheelDelta, b);
end;


I guess better would be:
procedure TTMSFNCCustomControlBase.WMMouseWheel(var Message: TWMMouseWheel);
var
  b: Boolean;
begin
  inherited;
  b := message.Result > 0;
  HandleMouseWheel(CreateShiftStateEx, Message.WheelDelta, b);
end;

and 

procedure TTMSFNCCustomPlanner.HandleMouseWheel(Shift: TShiftState; WheelDelta: Integer;
  var Handled: Boolean);
var
  vpos, hpos: Double;
  sz: Single;
begin
if not Handled then
  begin
  inherited;
  vpos := GetVScrollValue;
  hpos := GetHScrollValue;

  case OrientationMode of
    pomHorizontal: sz := DefaultColumnWidth;
    pomVertical: sz := DefaultRowHeight;
    else
      sz := 0;
  end;

  if WheelDelta > 0 then
    Scroll(hpos, vpos - sz)
  else
    Scroll(hpos, vpos + sz);

  Handled := True;
  end;
end;

Back to Top
Pieter Scheldeman View Drop Down
TMS Support
TMS Support
Avatar

Joined: 18 May 2010
Posts: 3025
Post Options Post Options   Quote Pieter Scheldeman Quote  Post ReplyReply Direct Link To This Post Posted: 15 Nov 2018 at 10:11am
Thank you for your investigation, we'll apply the changes accordingly.
Back to Top
Steinberger Helmut View Drop Down
Member
Member
Avatar

Joined: 31 Oct 2011
Posts: 61
Post Options Post Options   Quote Steinberger Helmut Quote  Post ReplyReply Direct Link To This Post Posted: 15 Nov 2018 at 10:13am
Thank you. That is great, so I do not have to change it after every update.
Back to Top
Steinberger Helmut View Drop Down
Member
Member
Avatar

Joined: 31 Oct 2011
Posts: 61
Post Options Post Options   Quote Steinberger Helmut Quote  Post ReplyReply Direct Link To This Post Posted: 16 Nov 2018 at 10:13am
I have another question. I just tried out the linkage between Items. Does not exactly do what I wanted. I would like to have all linked Items of a selected Item to be selected, but not onlsy forwards, but also backwards. For example I chain link 5 Items and select the first 1 then all 5 Items apear selected, but when I select the 3rd one, only Item 3, 4 and 5 are selected. Is there any property I can set, that Item 1 and 2 are selected too, or do I have to do it in the OnAfterSelectItem event manually?
Second thing I would like to have is, that the lines between linked items are only shown, when they are selected. At the moment I can set ShowLinks in the Itemapearencse to true. But then the lines are always shown. I could do it by setting ShowLinks in the OnAfterSelectItem too, but if there is an easier way, I would like to know, before I do it the more complicated way.
Back to Top
Pieter Scheldeman View Drop Down
TMS Support
TMS Support
Avatar

Joined: 18 May 2010
Posts: 3025
Post Options Post Options   Quote Pieter Scheldeman Quote  Post ReplyReply Direct Link To This Post Posted: 19 Nov 2018 at 12:46pm
Hi,

To turn off selection, you have the property AutoSelectLinkedItems property at Interaction. You can turn that off, and then manually select all linked items. The same applies to the ShowLinks property. Both can be turned off and then handled manually in the OnAfterSelectItem
Back to Top
Rosenberger Helmut View Drop Down
New Member
New Member
Avatar

Joined: 22 Sep 2016
Posts: 21
Post Options Post Options   Quote Rosenberger Helmut Quote  Post ReplyReply Direct Link To This Post Posted: 21 Nov 2018 at 9:35am
Thank you. OnAfterSelectItem worked great for me.
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down