FNC Planner Timeline Appearance |
Post Reply ![]() |
Author | |
Steinberger Helmut ![]() Member ![]() Joined: 31 Oct 2011 Posts: 61 |
![]() ![]() ![]() ![]() 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?
|
|
![]() |
|
Pieter Scheldeman ![]() TMS Support ![]() Joined: 18 May 2010 Posts: 3087 |
![]() ![]() ![]() ![]() |
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.
|
|
![]() |
|
Steinberger Helmut ![]() Member ![]() Joined: 31 Oct 2011 Posts: 61 |
![]() ![]() ![]() ![]() |
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?
|
|
![]() |
|
Pieter Scheldeman ![]() TMS Support ![]() Joined: 18 May 2010 Posts: 3087 |
![]() ![]() ![]() ![]() |
As already mentioned in the previous post, it is not possible to have both the day and time on the timeline.
|
|
![]() |
|
Steinberger Helmut ![]() Member ![]() Joined: 31 Oct 2011 Posts: 61 |
![]() ![]() ![]() ![]() |
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.
|
|
![]() |
|
Pieter Scheldeman ![]() TMS Support ![]() Joined: 18 May 2010 Posts: 3087 |
![]() ![]() ![]() ![]() |
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, ...
|
|
![]() |
|
Steinberger Helmut ![]() Member ![]() Joined: 31 Oct 2011 Posts: 61 |
![]() ![]() ![]() ![]() |
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.
|
|
![]() |
|
Steinberger Helmut ![]() Member ![]() Joined: 31 Oct 2011 Posts: 61 |
![]() ![]() ![]() ![]() |
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?
|
|
![]() |
|
Pieter Scheldeman ![]() TMS Support ![]() Joined: 18 May 2010 Posts: 3087 |
![]() ![]() ![]() ![]() |
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; |
|
![]() |
|
Steinberger Helmut ![]() Member ![]() Joined: 31 Oct 2011 Posts: 61 |
![]() ![]() ![]() ![]() |
Ok, thanks for your answer.
|
|
![]() |
|
Steinberger Helmut ![]() Member ![]() Joined: 31 Oct 2011 Posts: 61 |
![]() ![]() ![]() ![]() |
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?
|
|
![]() |
|
Pieter Scheldeman ![]() TMS Support ![]() Joined: 18 May 2010 Posts: 3087 |
![]() ![]() ![]() ![]() |
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.
|
|
![]() |
|
Steinberger Helmut ![]() Member ![]() Joined: 31 Oct 2011 Posts: 61 |
![]() ![]() ![]() ![]() |
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.
|
|
![]() |
|
Steinberger Helmut ![]() Member ![]() Joined: 31 Oct 2011 Posts: 61 |
![]() ![]() ![]() ![]() |
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. |
|
![]() |
|
Steinberger Helmut ![]() Member ![]() Joined: 31 Oct 2011 Posts: 61 |
![]() ![]() ![]() ![]() |
Should be
b := message.result = 1;
|
|
![]() |
|
Steinberger Helmut ![]() Member ![]() Joined: 31 Oct 2011 Posts: 61 |
![]() ![]() ![]() ![]() |
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.
|
|
![]() |
|
Pieter Scheldeman ![]() TMS Support ![]() Joined: 18 May 2010 Posts: 3087 |
![]() ![]() ![]() ![]() |
Hi,
Can you post the correct code you have changed in the WMMouseWheel to get this working?
|
|
![]() |
|
Steinberger Helmut ![]() Member ![]() Joined: 31 Oct 2011 Posts: 61 |
![]() ![]() ![]() ![]() |
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; |
|
![]() |
|
Pieter Scheldeman ![]() TMS Support ![]() Joined: 18 May 2010 Posts: 3087 |
![]() ![]() ![]() ![]() |
Thank you for your investigation, we'll apply the changes accordingly.
|
|
![]() |
|
Steinberger Helmut ![]() Member ![]() Joined: 31 Oct 2011 Posts: 61 |
![]() ![]() ![]() ![]() |
Thank you. That is great, so I do not have to change it after every update.
|
|
![]() |
|
Steinberger Helmut ![]() Member ![]() Joined: 31 Oct 2011 Posts: 61 |
![]() ![]() ![]() ![]() |
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.
|
|
![]() |
|
Pieter Scheldeman ![]() TMS Support ![]() Joined: 18 May 2010 Posts: 3087 |
![]() ![]() ![]() ![]() |
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
|
|
![]() |
|
Rosenberger Helmut ![]() New Member ![]() Joined: 22 Sep 2016 Posts: 21 |
![]() ![]() ![]() ![]() |
Thank you. OnAfterSelectItem worked great for me.
|
|
![]() |
Post Reply ![]() |
Forum Jump | Forum Permissions ![]() You cannot post new topics in this forum You cannot reply to topics in this forum You cannot delete your posts in this forum You cannot edit your posts in this forum You cannot create polls in this forum You cannot vote in polls in this forum |