Main place for discussions about U++ cross platform development framework.
Pradip wrote on Fri, 01 May 2020 12:02 Hello Didier, Thanks for replying! Yes exactly, I need date/time on x-axis. I'm trying to make something like this: I already have a tree and an array (synced) showing the activities, I will need to sync them with the graph. Also zooming is important, it should be able to zoom in to days (S, M, T, W...) as in the image, and while zooming out it could show weeks, then months, quarter and finally year. I won't really need layout designer, in any case I'll have to manipulate it with code. Thanks a lot, I'll try it once you upload it Well you can definitly display the days/weeks/wonths as you wan't but you will have to : make you're own GridAxisDraw child class with own grid style drawing (or maybe I could push further into Chameleon capacities) Add time custom display format method (The exact same format is not available out of the box) For all the zoom/scroll, verything you need is available. There is also a Linking feature that allows to sync axis between graphs (when one zooms or scrolls, the other ones follow) : maybe you could use this to link to you're grid to the graph Y axis
Quote: make you're own GridAxisDraw child class with own grid style drawing (or maybe I could push further into Chameleon capacities) Add time custom display format method (The exact same format is not available out of the box) I'll try it with my limited capacity . It will be fine to get something close if not same. Quote: For all the zoom/scroll, verything you need is available. There is also a Linking feature that allows to sync axis between graphs (when one zooms or scrolls, the other ones follow) : maybe you could use this to link to you're grid to the graph Y axis Exactly what I was planning to do!
Hello Pradip, Here is the first part of GraphCtrl packages
Here is the sencond part. I packaged my demo app GraphCtrl_demo_GUI (which doesn't look how it should since Layout Designer properties are no more taken into account (for the moment)) Take a look at : GraphCtrl_Demo/CustomDataSource_WF.h This is the cutom data class used to display the bars you saw on my screenshot Everything compiles fine with lattest Upp/trunk on windows and linux
Maybe the Ctrl name would have to be something like GanttCtrl
Hello Koldo, Yes why not have a pre-configured GanttCtrl ready-to go out of the box But first I have to simplify GraphCtrl/GraphDraw architecture (CRTP layering), since Chameleon introduction is going way to complex du to the layering technique I used, and the use of LayoutDesigner is less needed (that was the first reason for going with CRTP layers) ... so I could probably kick-out a lot of complexity and make it more usable
Hello Pradip, I started the GanttCtrl class so that you can see where to start coding and it was also at test for me to see if all was goiing to work as intended before letting you search how to do it. Here is what I get: I will upload code later today
here is the first part [Edit] deleted dowload file
Here is the second part [Edit] deleted dowload file
Hello Pradip, Did you download the code ? Was it useful for you ?
Hello Didier, Sorry for replying late, struggling without salary It's amazing that you made a custom GanttCtrl! Thanks a lot. I realized that I need to keep the data set ready for making the graph, so I have learned to use S_* structures last few days, reading every line from database was taking long time. I'll be ready in 2 more days, then I'll download the code and try to make the graph. Thanks again
Hello Pradip, Glad to here this helps you. Hope you will get a salary soon Before writing the GanttCtrl, I also refactored GraphDraw/GraphCtrl CRTP part that had become useless and to complex : I almost kicked out all of CRTP Things are simpler now (although all is not completelly finished)
Hello Pradip, I made some refactoring, simplifications, cleaning, namespace/include management, one two bug corrections and a compilation issue with latest Upp svn version Please use this last version EDIT : removed attachement (see further)
Hello Didier, I've downloaded it. I'm using MSVS17 compiler. GanttCtrl_Test compiles fine (except conversion and possible loss of data warnings) and I'm getting the same graph. However, GraphCtrl_Demo is giving some errors, perhaps all in Chameleon, see the image. Though I could do without any Chameleon capability for now, to understand the working of GraphCtrl, running the demo would be useful. I'll study more (please bear with my limited coding knowledge) and revert.
Hello Pradip, Well this is strange, under linux all compiles fine with lattest svn version The missing functions can be found in uppsrc/CtrlLib/Ch.h so it shoudn't be a problem Which Upp version are you using ? I am having difficulties with the lattest Upp svn versions on Win : my MCS V15 compiler crashes ( and CLANG doesn't work du to path problems and I can't change them: I don't have admin rights to change paths) The current version I work with on Win is svn 14390 So I am stuck to 14390 for the moment on Win Didier
I also trie with and withour Blitz : no compilation problem (under linux) I will have to resolve my Win problem to check further
Hello Didier, Didier wrote on Thu, 14 May 2020 00:21 Which Upp version are you using ? That could be the issue, I was using 13664, for which uppsrc/CtrlLib/Ch.h contains only this much: void ChStdSkin(); void ChClassicSkin(); void ChHostSkin(); I'm downloading latest stable release at the moment, I'll let you know the result.
McAfee is blocking to execute 14429
Pradip wrote on Thu, 14 May 2020 08:51 McAfee is blocking to execute 14429 This is really worrysome, but I really do not have any means how to prevent that.... I think it is the debugger code causing this issue That said, I am not sure who would believe this guy: https://cryptopotato.com/wp-content/uploads/2019/01/mcafee-n ew-finke-min-min.jpg
Hello Didier, I can't run 14429 yet, until it gains some "reputation" with McAfee! Well the issue is with Chameleon only, I'll keep studying the demo code and try to get this done.
Mirek Truly these antiviruses make so much trouble at times. First time theide.exe ran, it was the clang.exe that was blocked first, and next time onwards theide.exe was also blocked. 14-05-2020 11:47:34 mfeatp(7744.8772) <SYSTEM> Orchestrator.RepChangeListener.Activity: Real Protect cloud scanner trace complete for process id 3572 , file E:\upp-win-14429\upp\theide.exe with reason id 1 14-05-2020 11:51:22 mfeatp(7744.7476) <SYSTEM> Orchestrator.Action.Activity: Action Taken on File E:\upp-win-14429\upp\bin\clang\bin\clang.exe with reputation 1 is: Block 14-05-2020 11:51:22 mfeatp(7744.7476) <SYSTEM> Orchestrator.Action.Activity: Action Details:: File: clang.exe , Mode: Enforce , Scanner: On-Execute Scan , Detection Name: ATP/Suspect!bcea0d393d11 , Reputation: 1 [Known Malicious] , ActionTaken: Block Rule id: 0 , Content Version: Not Available 14-05-2020 11:52:58 mfeatp(7744.3840) <SYSTEM> Orchestrator.Action.Activity: Action Taken on File E:\upp-win-14429\upp\theide.exe with reputation 1 is: Block 14-05-2020 11:52:58 mfeatp(7744.3840) <SYSTEM> Orchestrator.Action.Activity: Action Details:: File: theide.exe , Mode: Enforce , Scanner: On-Execute Scan , Detection Name: ATP/Suspect!8b4fa2a4e3c1 , Reputation: 1 [Known Malicious] , ActionTaken: Block Rule id: 0 , Content Version: Not Available I think it's all about some 'reputation', saw it happening before too. And this is the reason I don't get the latest stable release immediately on release. Probably after some usage it gains on reputation with those AVs, shouldn't worry about it much.
Hello Pradip, If the problem is the Ide.exe that doesn't pass MacAfee Try mixing Ide.exe old version with uppsrc recent version I'm always doiing this since I update from svn If the dowload wont acheive because of McAfee, dowload a source only version (svn, git, ..)
Hello Didier, That's a nice trick, using old ide.exe with new uppsrc ! McAfee is still blocking clang.exe, gcc.exe, c++.exe, but I can use MSVS17 compiler. GraphCtrl_Demo_GUI is running this way now, so I have enough to study, thanks a lot.
Pradip wrote on Thu, 14 May 2020 12:18 Hello Didier, That's a nice trick, using old ide.exe with new uppsrc ! McAfee is still blocking clang.exe, gcc.exe, c++.exe, but I can use MSVS17 compiler. GraphCtrl_Demo_GUI is running this way now, so I have enough to study, thanks a lot. Well, I would offer you even better trick: Uninstall McAfee...
Really wish I could do that. This is work laptop, so you know.
Didier the code is so complex, but the result is really fascinating! Hope you won't mind if I ask you stupid questions as I go on to try it.
Hello Pradip, No problem : ask all the questions you need I will add data to GanttCtrl_Test so that it's more simple. GraphCtrl_Demo was not intended to be a public demo: it is more my overall testing application with some ugly code. There is also some documentation in graphDraw and GrapCtrl packages ( although the CRTP part is not completelly true any more : since it was to complex, I qicked out most of it )
Hello Didier, You may consider explicit conversions to avoid these warnings by MS compilers. Anyways this is of low priority, I think other compilers don't complain about it. e:\upp_projects\graphdraw\GridStepManager.h (165): warning C4244: '=': conversion from 'double' to 'unsigned int', possible loss of data e:\upp_projects\graphdraw\GridAxisDraw.h (239): warning C4244: 'argument': conversion from 'Upp::GraphDraw_ns::TypeGraphCoord' to 'Upp::int64', possible loss of data e:\upp_projects\ganttctrl\GanttGridAxisDraw.h (81): warning C4244: 'argument': conversion from 'Upp::GraphDraw_ns::TypeGraphCoord' to 'int', possible loss of data e:\upp_projects\ganttctrl\GanttGridAxisDraw.h (82): warning C4244: 'argument': conversion from 'Upp::GraphDraw_ns::TypeGraphCoord' to 'int', possible loss of data e:\upp_projects\graphdraw\GraphDrawBase.h (841): warning C4244: '=': conversion from 'Upp::int64' to 'unsigned int', possible loss of data e:\upp_projects\graphdraw\GraphDrawBase.h (857): warning C4244: '=': conversion from 'Upp::int64' to 'int', possible loss of data e:\upp_projects\graphdraw\GraphDrawBase.h (863): warning C4244: '=': conversion from 'Upp::int64' to 'int', possible loss of data e:\upp_projects\graphdraw\GraphDrawBase.h (997): warning C4244: '=': conversion from 'Upp::int64' to 'unsigned int', possible loss of data e:\upp_projects\graphdraw\GraphDrawBase.h (1024): warning C4244: '=': conversion from 'double' to 'unsigned int', possible loss of data e:\upp_projects\graphdraw\GraphFunctions.h (82): warning C4244: 'return': conversion from 'Upp::int64' to 'int', possible loss of data e:\upp_projects\graphdraw\GraphFunctions.h (56): warning C4244: 'initializing': conversion from 'T' to 'float', possible loss of data e:\upp_projects\graphdraw\GraphFunctions.h (57): warning C4244: 'initializing': conversion from 'T' to 'float', possible loss of data e:\upp_projects\graphdraw\GraphFunctions.h (58): warning C4244: 'initializing': conversion from 'T' to 'float', possible loss of data e:\upp_projects\graphdraw\GraphFunctions.h (33): warning C4244: 'initializing': conversion from 'T' to 'float', possible loss of data e:\upp_projects\graphdraw\GraphFunctions.h (34): warning C4244: 'initializing': conversion from 'T' to 'float', possible loss of data e:\upp_projects\graphdraw\GraphFunctions.h (35): warning C4244: 'initializing': conversion from 'T' to 'float', possible loss of data e:\upp_projects\graphdraw\GridStepManager.h (165): warning C4244: '=': conversion from 'double' to 'unsigned int', possible loss of data e:\upp_projects\graphdraw\GridAxisDraw.h (239): warning C4244: 'argument': conversion from 'Upp::GraphDraw_ns::TypeGraphCoord' to 'Upp::int64', possible loss of data E:\UPP_Projects\GraphDraw\GridStepManager.cpp (126): warning C4244: 'initializing': conversion from 'Upp::GraphDraw_ns::TypeGraphCoord' to 'int', possible loss of data E:\UPP_Projects\GraphDraw\GridStepManager.cpp (131): warning C4244: 'initializing': conversion from 'double' to 'unsigned int', possible loss of data E:\UPP_Projects\GraphDraw\GridStepManager.cpp (237): warning C4244: 'argument': conversion from 'Upp::GraphDraw_ns::TypeGraphCoord' to 'int', possible loss of data E:\UPP_Projects\GraphDraw\GridStepManager.cpp (238): warning C4244: 'argument': conversion from 'Upp::GraphDraw_ns::TypeGraphCoord' to 'int', possible loss of data E:\UPP_Projects\GraphDraw\GridStepManager.cpp (240): warning C4244: 'argument': conversion from 'Upp::GraphDraw_ns::TypeGraphCoord' to 'int', possible loss of data E:\UPP_Projects\GraphDraw\GridStepManager.cpp (246): warning C4244: 'initializing': conversion from 'Upp::GraphDraw_ns::TypeGraphCoord' to 'int', possible loss of data E:\UPP_Projects\GraphDraw\GridStepManager.cpp (250): warning C4244: '=': conversion from 'Upp::GraphDraw_ns::TypeGraphCoord' to 'Upp::int16', possible loss of data E:\UPP_Projects\GraphDraw\GridStepManager.cpp (266): warning C4244: '=': conversion from 'Upp::int64' to 'Upp::GraphDraw_ns::TypeGraphCoord', possible loss of data E:\UPP_Projects\GraphDraw\GridStepManager.cpp (278): warning C4244: 'initializing': conversion from 'T' to 'int', possible loss of data E:\UPP_Projects\GraphDraw\GridStepManager.cpp (283): warning C4244: 'initializing': conversion from 'Upp::GraphDraw_ns::TypeGraphCoord' to 'int', possible loss of data E:\UPP_Projects\GraphDraw\GridStepManager.cpp (302): warning C4244: '=': conversion from 'Upp::int64' to 'Upp::GraphDraw_ns::TypeGraphCoord', possible loss of data E:\UPP_Projects\GraphDraw\GridStepManager.cpp (315): warning C4244: '=': conversion from 'T' to 'Upp::int64', possible loss of data E:\UPP_Projects\GraphDraw\GridStepManager.cpp (317): warning C4244: 'argument': conversion from 'Upp::int64' to 'Upp::GraphDraw_ns::TypeGraphCoord', possible loss of data E:\UPP_Projects\GraphDraw\GridStepManager.cpp (345): warning C4244: 'argument': conversion from 'Upp::GraphDraw_ns::TypeGraphCoord' to 'Upp::int64', possible loss of data E:\UPP_Projects\GraphDraw\GridStepManager.cpp (346): warning C4244: 'argument': conversion from 'Upp::GraphDraw_ns::TypeGraphCoord' to 'Upp::int64', possible loss of data E:\UPP_Projects\GraphDraw\GridStepManager.cpp (347): warning C4244: 'argument': conversion from 'Upp::GraphDraw_ns::TypeGraphCoord' to 'Upp::int64', possible loss of data E:\UPP_Projects\GraphDraw\GridStepManager.cpp (358): warning C4244: 'initializing': conversion from 'Upp::GraphDraw_ns::TypeGraphCoord' to 'int', possible loss of data E:\UPP_Projects\GraphDraw\GridStepManager.cpp (362): warning C4244: '=': conversion from 'Upp::GraphDraw_ns::TypeGraphCoord' to 'Upp::int16', possible loss of data E:\UPP_Projects\GraphDraw\GridStepManager.cpp (377): warning C4244: '=': conversion from 'Upp::int64' to 'Upp::GraphDraw_ns::TypeGraphCoord', possible loss of data E:\UPP_Projects\GraphDraw\GridStepManager.cpp (391): warning C4244: 'initializing': conversion from 'T' to 'int', possible loss of data E:\UPP_Projects\GraphDraw\GridStepManager.cpp (396): warning C4244: 'initializing': conversion from 'Upp::GraphDraw_ns::TypeGraphCoord' to 'int', possible loss of data E:\UPP_Projects\GraphDraw\GridStepManager.cpp (415): warning C4244: '=': conversion from 'Upp::int64' to 'Upp::GraphDraw_ns::TypeGraphCoord', possible loss of data E:\UPP_Projects\GraphDraw\GridStepManager.cpp (431): warning C4244: 'argument': conversion from 'Upp::int64' to 'Upp::GraphDraw_ns::TypeGraphCoord', possible loss of data E:\UPP_Projects\GraphDraw\GridStepManager.cpp (431): warning C4244: '=': conversion from 'T' to 'Upp::int64', possible loss of data E:\UPP_Projects\GraphDraw\GridStepManager.cpp (433): warning C4244: 'argument': conversion from 'Upp::int64' to 'Upp::GraphDraw_ns::TypeGraphCoord', possible loss of data E:\UPP_Projects\GraphDraw\GridStepManager.cpp (447): warning C4244: 'argument': conversion from 'Upp::GraphDraw_ns::TypeGraphCoord' to 'Upp::int64', possible loss of data E:\UPP_Projects\GraphDraw\GridStepManager.cpp (448): warning C4244: 'argument': conversion from 'Upp::GraphDraw_ns::TypeGraphCoord' to 'Upp::int64', possible loss of data E:\UPP_Projects\GraphDraw\GridStepManager.cpp (454): warning C4244: 'initializing': conversion from 'Upp::int64' to 'Upp::GraphDraw_ns::TypeGraphCoord', possible loss of data e:\upp_projects\graphdraw\GraphDrawBase.h (841): warning C4244: '=': conversion from 'Upp::int64' to 'unsigned int', possible loss of data e:\upp_projects\graphdraw\GraphDrawBase.h (857): warning C4244: '=': conversion from 'Upp::int64' to 'int', possible loss of data e:\upp_projects\graphdraw\GraphDrawBase.h (863): warning C4244: '=': conversion from 'Upp::int64' to 'int', possible loss of data e:\upp_projects\graphdraw\GraphDrawBase.h (997): warning C4244: '=': conversion from 'Upp::int64' to 'unsigned int', possible loss of data e:\upp_projects\graphdraw\GraphDrawBase.h (1024): warning C4244: '=': conversion from 'double' to 'unsigned int', possible loss of data e:\upp_projects\graphdraw\GraphFunctions.h (82): warning C4244: 'return': conversion from 'Upp::int64' to 'int', possible loss of data e:\upp_projects\graphdraw\GraphFunctions.h (56): warning C4244: 'initializing': conversion from 'T' to 'float', possible loss of data e:\upp_projects\graphdraw\GraphFunctions.h (57): warning C4244: 'initializing': conversion from 'T' to 'float', possible loss of data e:\upp_projects\graphdraw\GraphFunctions.h (58): warning C4244: 'initializing': conversion from 'T' to 'float', possible loss of data e:\upp_projects\graphdraw\GraphFunctions.h (33): warning C4244: 'initializing': conversion from 'T' to 'float', possible loss of data e:\upp_projects\graphdraw\GraphFunctions.h (34): warning C4244: 'initializing': conversion from 'T' to 'float', possible loss of data e:\upp_projects\graphdraw\GraphFunctions.h (35): warning C4244: 'initializing': conversion from 'T' to 'float', possible loss of data e:\upp_projects\graphdraw\GridStepManager.h (165): warning C4244: '=': conversion from 'double' to 'unsigned int', possible loss of data e:\upp_projects\graphdraw\GridAxisDraw.h (239): warning C4244: 'argument': conversion from 'Upp::GraphDraw_ns::TypeGraphCoord' to 'Upp::int64', possible loss of data e:\upp_projects\graphdraw\GridStepManager.h (165): warning C4244: '=': conversion from 'double' to 'unsigned int', possible loss of data e:\upp_projects\graphdraw\GridAxisDraw.h (239): warning C4244: 'argument': conversion from 'Upp::GraphDraw_ns::TypeGraphCoord' to 'Upp::int64', possible loss of data e:\upp_projects\ganttctrl\GanttGridAxisDraw.h (81): warning C4244: 'argument': conversion from 'Upp::GraphDraw_ns::TypeGraphCoord' to 'int', possible loss of data e:\upp_projects\ganttctrl\GanttGridAxisDraw.h (82): warning C4244: 'argument': conversion from 'Upp::GraphDraw_ns::TypeGraphCoord' to 'int', possible loss of data e:\upp_projects\graphdraw\GraphDrawBase.h (841): warning C4244: '=': conversion from 'Upp::int64' to 'unsigned int', possible loss of data e:\upp_projects\graphdraw\GraphDrawBase.h (857): warning C4244: '=': conversion from 'Upp::int64' to 'int', possible loss of data e:\upp_projects\graphdraw\GraphDrawBase.h (863): warning C4244: '=': conversion from 'Upp::int64' to 'int', possible loss of data e:\upp_projects\graphdraw\GraphDrawBase.h (997): warning C4244: '=': conversion from 'Upp::int64' to 'unsigned int', possible loss of data e:\upp_projects\graphdraw\GraphDrawBase.h (1024): warning C4244: '=': conversion from 'double' to 'unsigned int', possible loss of data e:\upp_projects\graphdraw\GraphFunctions.h (82): warning C4244: 'return': conversion from 'Upp::int64' to 'int', possible loss of data e:\upp_projects\graphdraw\GraphFunctions.h (56): warning C4244: 'initializing': conversion from 'T' to 'float', possible loss of data e:\upp_projects\graphdraw\GraphFunctions.h (57): warning C4244: 'initializing': conversion from 'T' to 'float', possible loss of data e:\upp_projects\graphdraw\GraphFunctions.h (58): warning C4244: 'initializing': conversion from 'T' to 'float', possible loss of data e:\upp_projects\graphdraw\GraphFunctions.h (33): warning C4244: 'initializing': conversion from 'T' to 'float', possible loss of data e:\upp_projects\graphdraw\GraphFunctions.h (34): warning C4244: 'initializing': conversion from 'T' to 'float', possible loss of data e:\upp_projects\graphdraw\GraphFunctions.h (35): warning C4244: 'initializing': conversion from 'T' to 'float', possible loss of data
Hello Pradip, Usually I remove ALL warnings : A good code does not have any warning at all. On linux it does not show these errors, and it's my main dev plateform : that's the reason why tey are still around I will check if I can enable these errors with CLANG or GCC on linux
Hello Pradip, I removed all the warnings I see on MSC15 + some others that don't appear (sign conversions) I used the following compile flags on CLANG/linux : -std=c++14 -Wno-logical-op-parentheses -Wimplicit-float-conversion -Wshorten-64-to-32 -Wfloat-conversion -Wconditional-uninitialized But there are still some warnings that only appear on MSC
Thanks Didier, now there are not a single warning on MSVS17. I'm working for displaying timeline bars, understanding the CustomData and CustomDataSource classes. Once done I'll show you the result.
Hello Didier, Need some help. Please see my implementation of CustomData and CustomDataSource, similar to your demo: namespace Upp { namespace GraphDraw_ns { class GanttBar : public CustomData { private: int row_num; const S_ACTIVITIES* act; RectGraph bar; // TypeScreenCoord bar_thk = 5; public: GanttBar(int row, const S_ACTIVITIES* ac) : row_num(row), act(ac) { bar.left = act->START_DATE_PL.Get(); bar.right = act->END_DATE_PL.Get(); bar.top = row_num + 0.25; bar.bottom = row_num + 0.75; }; virtual ~GanttBar() {}; virtual bool Intersects(const RectGraph& graphView) const { return graphView.Intersects(bar); }; virtual bool Contains(const PointGraph& pt) const { return bar.Contains(pt); }; virtual void PaintDataPoint(BufferPainter& dw, int scale, const CoordinateConverter* xCoordConv, const CoordinateConverter* yCoordConv) { const TypeScreenCoord left = xCoordConv->toScreen(bar.left); const TypeScreenCoord right = xCoordConv->toScreen(bar.right); const TypeScreenCoord bottom = yCoordConv->toScreen(bar.top); const TypeScreenCoord top = yCoordConv->toScreen(bar.bottom); Rect r(left,top, right, bottom); ChPaint(dw, r, Yellow()); }; String ToString() const { return Format("Row num=%i\tActivity ID=%i\tBar=%s", row_num, act->ACT_ID, bar.ToString()); }; }; class GanttBarSeries : public CustomDataSource { private: const ArrayCtrl* array; Array<GanttBar> gantt_bars; public: GanttBarSeries() {}; void Link(const ArrayCtrl* ar) { array = ar; }; void RefreshBars() { if(!gantt_bars.IsEmpty()) gantt_bars.Clear(); int n = array->GetCount(); for(int i = 0; i < n; i++) { GanttBar gb(i, &ActById(array->Get(i, ACT_ID))); gantt_bars.Add(gb); } DUMP(gantt_bars); }; virtual ~GanttBarSeries() {}; virtual unsigned int GetCount() const {return gantt_bars.GetCount();}; virtual const CustomData& Get(unsigned int dataIndex) const {return gantt_bars[dataIndex];}; virtual CustomData& Get(unsigned int dataIndex) {return gantt_bars[dataIndex];}; }; }; }; You will see that I'm trying to link the Gantt with an ArrayCtrl. The DUMP is showing this: gantt_bars = [Row num=0 Activity ID=10 Bar=[737830, 0.25] - [737947, 0.75] : (117, 0.5), Row num=1 Activity ID=28 Bar=[737832, 1.25] - [737854, 1.75] : (22, 0.5), Row num=2 Activity ID=29 Bar=[737854, 2.25] - [737856, 2.75] : (2, 0.5), Row num=3 Activity ID=118 Bar=[737856, 3.25] - [737898, 3.75] : (42, 0.5), Row num=4 Activity ID=126 Bar=[737856, 4.25] - [737859, 4.75] : (3, 0.5), Row num=5 Activity ID=127 Bar=[737859, 5.25] - [737862, 5.75] : (3, 0.5), Row num=6 Activity ID=128 Bar=[737862, 6.25] - [737867, 6.75] : (5, 0.5), Row num=7 Activity ID=129 Bar=[737867, 7.25] - [737870, 7.75] : (3, 0.5), Row num=8 Activity ID=130 Bar=[737870, 8.25] - [737881, 8.75] : (11, 0.5), Row num=9 Activity ID=131 Bar=[737870, 9.25] - [737873, 9.75] : (3, 0.5), Row num=10 Activity ID=133 Bar=[737873, 10.25] - [737875, 10.75] : (2, 0.5), Row num=11 Activity ID=134 Bar=[737875, 11.25] - [737879, 11.75] : (4, 0.5), Row num=12 Activity ID=388 Bar=[737879, 12.25] - [737881, 12.75] : (2, 0.5), Row num=13 Activity ID=136 Bar=[737881, 13.25] - [737886, 13.75] : (5, 0.5), Row num=14 Activity ID=137 Bar=[737881, 14.25] - [737883, 14.75] : (2, 0.5), Row num=15 Activity ID=138 Bar=[737883, 15.25] - [737884, 15.75] : (1, 0.5), Row num=16 Activity ID=139 Bar=[737883, 16.25] - [737890, 16.75] : (7, 0.5), Row num=17 Activity ID=140 Bar=[737890, 17.25] - [737895, 17.75] : (5, 0.5), Row num=18 Activity ID=141 Bar=[737895, 18.25] - [737898, 18.75] : (3, 0.5), Row num=19 Activity ID=121 Bar=[737898, 19.25] - [737931, 19.75] : (33, 0.5), Row num=20 Activity ID=143 Bar=[737898, 20.25] - [737901, 20.75] : (3, 0.5), Row num=21 Activity ID=144 Bar=[737901, 21.25] - [737909, 21.75] : (8, 0.5), Row num=22 Activity ID=145 Bar=[737909, 22.25] - [737916, 22.75] : (7, 0.5), Row num=23 Activity ID=148 Bar=[737916, 23.25] - [737924, 23.75] : (8, 0.5), Row num=24 Activity ID=149 Bar=[737924, 24.25] - [737926, 24.75] : (2, 0.5), Row num=25 Activity ID=150 Bar=[737926, 25.25] - [737931, 25.75] : (5, 0.5), Row num=26 Activity ID=123 Bar=[737931, 26.25] - [737939, 26.75] : (8, 0.5), Row num=27 Activity ID=124 Bar=[737939, 27.25] - [737946, 27.75] : (7, 0.5), Row num=28 Activity ID=125 Bar=[737946, 28.25] - [737947, 28.75] : (1, 0.5)] So the bars are being made alright. In my application (TopWindow) header: GraphDraw_ns::GanttCtrl gantt; Upp::GraphDraw_ns::GanttBarSeries ganttBarSeries; In TopWindow constructor: ganttBarSeries.Link(&array); gantt.AddCustomSeries(ganttBarSeries); And in a callback which refreshes the linked array: ganttBarSeries.RefreshBars(); gantt.Refresh(); However the gantt chart is always empty, doing FitToData() is also not showing any bar. What am I missing here?
Hello Pradip, Two points: * FitToData() isn't implemented yet for CustomData * RefreshBars() is useless, all the refresh is already managed What you need to do is: 1 - Set graph limits graph.GetX1CoordConverter().SetGraphMin(...) graph.GetX1CoordConverter().SetGraphMax(...) graph.GetX1CoordConverter().setGraphMinRangeLimit(...); graph.GetX1CoordConverter().setGraphMaxRangeLimit(...); 2 - Set data as modified (so it will be refreshed automatically) This is important because the resulting image is cached to speed-up display when moving a cursor, changing tabs or whatever graph.SetModifyCustomSeries(); // this will force full repaint on next refresh graph.Refresh();
Hello Didier! Yes it worked! Fantastic! Please tell me, is there an easy way to flip the Y axis? Currently the origin is in bottom-left, how to make it in top-left?
Hello Didier, Really amazing work with the GraphCtrl! Is there a way to allow only X axis zooming but prevent Y axis zooming?
Hello Pradip, Pradip wrote on Thu, 28 May 2020 18:52 Hello Didier, Really amazing work with the GraphCtrl! Is there a way to allow only X axis zooming but prevent Y axis zooming? Thank you and yes there is Several restriction methods are available for zoom / scroll (these are also available directly through the layout designer as options) DisableGraphZoom DisableGraphScroll DisableAxisZoom DisableXZoom DisableYZoom DisableAxisScroll DisableXScroll DisableYScroll Quote: Please tell me, is there an easy way to flip the Y axis? Currently the origin is in bottom-left, how to make it in top-left? Well I never needed this so it isn't available out of the box, but it should be quite easy to do. I'll see if I can add a ' void InvertAxis()' method : this may come handy one day
Hello Didier, DisableXZoom(true) and DisableYZoom(true) individually are not working; they are working only if together; please check. InvertAxis will really be helpful, there are many engineering graphs which are drawn with origin at top left.
Hello Pradip, I will check tomorrow
Thanks Didier, Take your time.
Hello Pradip, I just checked and DisableYAxis() works fine but DisableXAxis() almost works fine zoom from axis (on one side of graph) (CTRL + mouse wheel) : OK X & Y zoom from graph area selection (CTRL + mouse left click n drag) : OK X & Y zoom with ctrl+ mouse wheel : does not work for X and works for Y ==> strange... code for both should be the same Need more time to investigate further
Hello Didier, Just take your time with the zoom and scroll features. All scrolling seems to be just fine, there might be a small glitch with zooming. This is what I found: With DisableYScroll(true) and DisableYZoom(true), the graph can never be scrolled in Y direction, but it is possible to zoom in Y direction by ctrl + mouse wheel. This might help you in finding the glitch. Meanwhile if you can add the InvertAxis() it will really be very helpful. As I'm exploring it, I'm amazed more and more with the thoughtful features of the GraphCtrl!!! Superb work indeed!
Hello Pradip, InvertAxis() is comming, I have something working. Needs some cleaning
tHello Pradip, I finally finished InvertAxis was working since last week but I had a bug laying around. took me some time to find it I updated GanttCtrl_test so you can see how to use it.
Hello Didier! Yay! You are just awesome! gantt.GetY1GridAxisDraw().setAxisInverted(); this does the job! Yaay! Plus the bug with zoom/scroll is also fixed now! Thank you so much! See a screenshot of my app, you really made it possible! Next I need to have dynamic grid, changing the granularity and type of display with zoom in and out, and need to find a way to scroll the gantt along with tree/array. I'll show you some sample of the dynamic grids that I'm talking about. Also I need to have a vertical line showing today, and the gray vertical bands should appear for declared holidays also. I'll study class GanttGridAxisDraw bit more. I'll write you about it soon. Thanks a lot
Hello Pradip, Looks great, happy to see it is usefull for you To make a dynamic grid you have to : ..* modify GanttGridStepCalcCbk() ....This is the method that determines where to put grid lines ..* Modify PaintXxxx() methods to give each grid step the look you want ......* PaintHGrid() : paints the grid on the graph ......* PaintAxisTop() : paints the upper axis part (where the date is displayed)
Hello Didier, Please suggest an easy way to set the grid step to a specific value, bypassing NormalizedStep. For Y axis I need to have the grid steps interval as 1, that's why.
Hello Didier, And how to change the X and Y grid colors? For previous message and this one I tried these, don't seem to work gantt.SetYGridColor(Yellow()); gantt.SetXGridColor(Yellow()); gantt.setYNbGridSteps(array.GetCount());
Hello Didier, Hope you don't mind me asking random questions Please check this code in GraphDraw.cpp void DrawSmartText(Draw& draw, int x, int y, int cx, const char *text, const Font scaledFont, Color ink, int scale) { if(*text == '\1') { RichText txt = ParseQTF(text + 1, 0); txt.ApplyZoom(GetRichTextStdScreenZoom()); txt.Paint(Zoom(scale, 1), draw, x, y, cx); return; } DrawTLText(draw, x, y, cx, ToUnicode(text, CHARSET_DEFAULT), scaledFont, ink, 0); } QTF is activated if the first byte is '\1', is this different behavior from standard QTF, where '\1' escapes all following characters?
void DrawSmartText(Draw& draw, ...) This is defined in LabelBase h/cpp Where ever it is derived from LabelBase you can use QTF. e.g. Labels, Button, Tooltip, OK/Cancel prompts etc.
Dear Deepak, Thanks! That will definitely help my understanding.
Hello Pradip, Quote: void DrawSmartText(Draw& draw, ...) In fact I have a modified copy of the original method : 'scale' parameter is added '\1' is a QTF trick of original method : if first caracter == '\1' then texte is QTF otherwise it not the case Quote: gantt.SetYGridColor(Yellow()); gantt.SetXGridColor(Yellow()); These methods do not work anymore since I added Chameleon support : work is not finished And to be honest, the simple solution would be to suppress these methods. But on the other hand, these methods allow access through the layout-designer which was my first objective... so suppressing them doesn't satisfy me. I have to find an elegant way to mix both (I have some ideas but didn't start coding yet) Quote: gantt.setYNbGridSteps(array.GetCount()); This one shoudn't be present: it uses GridStepManager::SetNbSteps() which is for internal use Quote: Please suggest an easy way to set the grid step to a specific value, bypassing NormalizedStep. For Y axis I need to have the grid steps interval as 1, that's why I will post you solution in next message
Here the code you need, A dedicated function to calculate the steps (with a fixed grid step off 1) static void GanttCtrl::step1_GridStepCalcCbk(GridStepManager& gridStepManager, CoordinateConverter& coordConv) { const unsigned int nbMaxSteps = GridStepManager::NB_MAX_STEPS; //gridStepManager.GetNbMaxSteps(); GridStepData* gridStepData = gridStepManager.GetGridStepData(); TypeGraphCoord gridStepValue = 1; TypeGraphCoord gridStartValue = GridStepManager::GetGridStartValue( gridStepValue, coordConv.getGraphMin() ); unsigned int nbSteps = (unsigned int)tabs((coordConv.getGraphMax() - gridStartValue) / gridStepValue); if (nbSteps > nbMaxSteps) { nbSteps = nbMaxSteps; } gridStepManager.SetNbSteps(nbSteps); // fill step values ==> used by gridStepIterator for (unsigned int c=0; c<nbSteps+1; ++c) { gridStepData[c].stepGraphValue = gridStartValue + gridStepValue*c; gridStepData[c].drawTickText = 0;// ==> draw tick text not needed (from you're screen shot) } } In GanttCtrl constructor, add: GetY1GridAxisDraw().GetGridStepManager().setCustomGridSteps(STDBACK(step1_GridStepCalcCbk)); And the trick is done
To set the colors using Chameleon, use the following code: In you're application header (in GanttCtrl_Test class) declare the following variable: Upp::GraphDraw_ns::GanttCtrl::Style ganttStyle; In application init (GanttCtrl_Test constructor) add the following code: (Not sure it is axisColor you wanted to change, probably gridColor) ganttStyle = graph.StyleDefault(); // ganttStyle.x1AxisStyle.axisWidth = 2; ganttStyle.x1AxisStyle.axisColor = Yellow(); // ganttStyle.x1AxisStyle.axisTextFont = StdFont(); // ganttStyle.x1AxisStyle.axisTextColor = SRed(); // ganttStyle.x1AxisStyle.axisTickColor = SRed(); // ganttStyle.x1AxisStyle.gridColor = Yellow(); // ganttStyle.x1AxisStyle.primaryTickFactory << []() ->TickMark* { TickMark* t = new LineTickMark(); t->SetTickLength(3); return t; }; // ganttStyle.x1AxisStyle.secondaryTickFactory << []() ->TickMark* { TickMark* t = new LineTickMark(); t->SetTickLength(1); return t; }; // ganttStyle.x1AxisStyle.lmntBackgnd = Null; // // ganttStyle.y1AxisStyle.axisWidth = 2; ganttStyle.y1AxisStyle.axisColor = Yellow(); // ganttStyle.y1AxisStyle.axisTextFont = StdFont(); // ganttStyle.y1AxisStyle.axisTextColor = SRed(); // ganttStyle.y1AxisStyle.axisTickColor = SRed(); // ganttStyle.y1AxisStyle.gridColor = Yellow(); // ganttStyle.y1AxisStyle.primaryTickFactory << []() ->TickMark* { TickMark* t = new LineTickMark(); t->SetTickLength(3); return t; }; // ganttStyle.y1AxisStyle.secondaryTickFactory << []() ->TickMark* { TickMark* t = new LineTickMark(); t->SetTickLength(1); return t; }; // ganttStyle.y1AxisStyle.lmntBackgnd = Null; graph.SetStyle( ganttStyle );
Hello Didier, GraphCtrl's sheer brilliance amazes me indeed! I could do all these without much difficulty: Learned to use Chameleon, bit tricky though, need to dig through a lot of typedefs Dynamic grid; virtually anything can be done with the grids with your framework! uploaded few screenshots Sync scroll with another ctrl, by using SetGraphMin and SetGraphMax; noted that Link syncs with another CoordinateConverter 2 questions: How to alter the default margin of 3 px? The following line doesn't work: // gantt.SetTopMargin(1).SetLeftMargin(1).SetBottomMargin(1).Se tRightMargin(1); some text seems to spill into the margin, see in one of the uploaded images What can be done with CustomDataSource::PaintOne? How does style work? I must say again, thanks a lot for GraphCtrl! It makes life so easy!
Didier wrote on Sun, 14 June 2020 03:19 I have to find an elegant way to mix both (I have some ideas but didn't start coding yet) I'm sure you will find a way!
Quote: uploaded few screenshots They look great.
koldo wrote on Sun, 21 June 2020 19:52 They look great. Thanks Koldo. Didier's work pays off.
Hello Pradip, I see you're are making good progress on you're app : looking good I suppose you used two CustomDataSource classes in you're Gantt: - one for the jobs - one for the links ? I have made some cleaning up and plugged back-in all the SetXxxx methods (colors, fonts, ...) so the layout designer is parameters are working again I mixed Chameleon and Layout params the following way: - At création Chameleon is used in standard way and stays unmodified until a SetXxxx() method is called - After modifying a parameter with SetXxxx() the a local copy of the style is made and the copy is modified ==> so you get Chameleon settings + local settings together There still is a bug : a small heap leak is there (the delete of local copy makes the app crash and I didn't find why for the moment) I also did some more cleaning and did some methods renaming: - All the GetXxxx GraphElement() are now named GetElementXxxxx() - All the SetXTttt() are now named SetX1Ttttt() (so that the you have X1, X2, Y1, Y2, ... (and not X, X1 which was not homogenous) X (not X1 or X2) now applies only to methods that apply to all X1, X2, .... Its clearer this way One good side effect of all this (I was hopping this would come around sooner or latter) : Completion works fine now on GraphCtrl
Quote: How to alter the default margin of 3 px? The following line doesn't work: // gantt.SetTopMargin(1).SetLeftMargin(1).SetBottomMargin(1).Se tRightMargin(1); some text seems to spill into the margin, see in one of the uploaded images This works (at least when modifying it thriugh the layout designer) : maybe a Refresh() is missing somewhere Normaly the updateSizes() method recalculates all the internal sizes taking into account the margins but it is for internal use and is called by Refresh() Question : When you resize you're app, all is recalculated so the new margin values should be taken into account : does this work for you ? Quote: What can be done with CustomDataSource::PaintOne? How does style work? This work in progress, it is mearly at start point : I intend to use it to enable things like selection (draw the point with a different style : highlight for example)
Hello Didier, Downloaded the last one and got trouble, really don't know how to fix this. GanttCtrl constructor is leading to this, please help.
Hello Didier, I reverted to the version sent by you on 07-Jun, that's still working fine. I'll try to figure out what went wrong with the latest one.
Hello Didier, Sorry I panicked a bit. I missed to add the GD_ macros in GanttCtrl declaration, after adding them that error is gone. Also I needed to change the first line in the macro to make it run: CH_STYLE(GanttCtrl, Style, StyleDefault) { gdStyle = GanttCtrl::CH_EmptyGraphDraw::StyleGDDefault(); Plus I made other method name changes as described by you in your message. However, the result is this: Both axes are inverted; custom grids are not drawn as before, and a floating element has appeared. I'll continue with the previous version and wait for you have a look at these and advise.
Hello Pradip, This is either upp version that needs update or a memory corruption du to my latest modifications... If it doesn't disapear with an upp update, don't bother, it's probably the same problem I'm tracking with my delete bug. Sorry for this I published it to soon
Hello Didier, Didier wrote on Mon, 22 June 2020 03:58 I suppose you used two CustomDataSource classes in you're Gantt: Exactly, I have used two CustomDataSource classes, so that the links (now made arrows) are drawn first, then the activity bars. Didier wrote on Mon, 22 June 2020 03:58 One good side effect of all this (I was hopping this would come around sooner or latter) : Completion works fine now on GraphCtrl Definitely it does, and be rest assured that I'll find enough usage of GraphCtrl in future so I guess it will be validated thoroughly
Hello Didier, Didier wrote on Mon, 22 June 2020 04:11 This works (at least when modifying it thriugh the layout designer) : maybe a Refresh() is missing somewhere Normaly the updateSizes() method recalculates all the internal sizes taking into account the margins but it is for internal use and is called by Refresh() Question : When you resize you're app, all is recalculated so the new margin values should be taken into account : does this work for you ? No this is not working, see the image, even after resizing, the margins are 3px. This line is in the constructor of that TopWindow. gantt.SetTopMargin(1).SetLeftMargin(1).SetBottomMargin(1).SetRightMargin(1); Didier wrote on Mon, 22 June 2020 04:11 This work in progress, it is mearly at start point : I intend to use it to enable things like selection (draw the point with a different style : highlight for example) Good god! Are you reading my mind? lol! I want exactly that to happen when the selection in tree/array changes! so thoughtful
Hello Didier, Didier wrote on Mon, 22 June 2020 16:52 Hello Pradip, This is either upp version that needs update or a memory corruption du to my latest modifications... If it doesn't disapear with an upp update, don't bother, it's probably the same problem I'm tracking with my delete bug. Sorry for this I published it to soon It's just fine, I'm going ahead with the previous package you gave, that is working fine. I still can't run 14429 thanks to McAfee, we'll see if we can make it work in future. Right now it's good, just need to find out how to adjust the margins.
The floating element is the Legend, I also updated a bit the default chameleon style (the floating style was missing) So the float element was there before, it just wasn visible. Just add: graph.HideLegend(); For the rest, I have no idea. I will check tonight
Pradip, Quote: just need to find out how to adjust the margins I found what is wrong : at L21 of GraphDraw/StdGraphElements.h class BlankAreaElement : public GraphElement { public: typedef BlankAreaElement CLASSNAME; typedef GraphElement _B; BlankAreaElement() {} virtual ~BlankAreaElement() {} virtual void PaintElement(Draw& dw, int scale) { /* do noting */} virtual void SetElementWidth(int v) { _width = Upp::max(v, 3); } // --- REMOVE THIS lINE --- private: BlankAreaElement( BlankAreaElement& p) {} }; I have no idea why this was here and it is useless ( just checked, it's been around for years 6.5 years LOL ), I am removing it from the code base For the rest, if you send me the code of you're GanttCtrl (and only that) it would be easier
Didier wrote on Mon, 22 June 2020 19:26 For the rest, I have no idea. I will check tonight Fine, I'll continue with the previous one until you are done.
Didier wrote on Tue, 23 June 2020 00:22 I have no idea why this was here and it is useless ( just checked, it's been around for years 6.5 years LOL ), I am removing it from the code base Ah that works, too wasy LOL! And somewhere in your code I've even seen a date in 2012! Codes never age isn't it, they are evergreen Quote: For the rest, if you send me the code of you're GanttCtrl (and only that) it would be easier Uploading my code. I have CustomData and CustomDataSource in the same file. You will see there are some dependencies. bool IsHoliday(Date) this determines if that date is holiday or not (2nd or 4th Sat and Sun and declared holidays). you may plan to replace this with a callback maybe. Other dependencies I'll explain if you need. One suggestion: CustomData::Intersects and CustomData::Contains deal with bounding box of the data point. In some situations the bounding box depends on screen coordinates, please consider this.
Pradip wrote on Tue, 23 June 2020 12:52 One suggestion: CustomData::Intersects and CustomData::Contains deal with bounding box of the data point. In some situations the bounding box depends on screen coordinates, please consider this. Didier, This is really needed, please consider Intersects() and Contains() to have knowledge of CoordinateConverter objects
Hello Pradip, I did a quick check on you're code, and after only renaming what needed to be renamed and commented the code for which I didn't have the data types, all compiled and works fine: grid and axis are draw as you wan't and only Y axis is inverted. I uploaded the modyfied code So maybe it's the app code that modifys the configuration ? Quote: One suggestion: CustomData::Intersects and CustomData::Contains deal with bounding box of the data point. In some situations the bounding box depends on screen coordinates, please consider this. In fact this was done on purpose: to avoid manipulating Graph and Screen coordinates. At first I used screen coordinates in API but it revealed to be un-adapted and error prone du to all the clipping and/or offsets applied EDIT : file removed (newer dowload available)
Didier wrote on Thu, 25 June 2020 03:40 I did a quick check on you're code, and after only renaming what needed to be renamed and commented the code for which I didn't have the data types, all compiled and works fine: grid and axis are draw as you wan't and only Y axis is inverted. I uploaded the modyfied code So maybe it's the app code that modifys the configuration ? Didier: Sorry I screwed up in panic mode! Now it's all working fine with the new code base. I think I know what went wrong, I didn't clean either GraphDraw or my app package, so maybe old object file was linking with new and...
Hello Didier, Another suggestion: Right now the zoom seems to happens with respect to the center of graph, of course subject to MinRangeLimit and MaxRangeLimit. It would be just great if instead of center of graph it would have been the mouse position!
Hello Pradip, Yes I agree with you, center the zooming on mouse cursor would be much better, I will see what I can do
Hello Pradip, I just uploaded the latest version of the code. The feature you requested is now the default behaviour (although original behaviour can stil be set by using SetZoomOnCursor(false) ) It took me some time because I had to finish plugging back in Properties Editors and be compatible with Chameleon) and I did some more cleaning up. Noticable changes: * Properties dialog accessible in plot area now displays one Properties dialog containing all the dialogs in tabs (it can be fully customized) * Properties values can now be changed and are comptible with Chameleon * some renaming has been done * some cleaning has been done GraphDraw_CRTP has been deleted and an uneeded inheritance level has been removed Take a look at GD_XYLTMM_GraphCtrl : it now contains a good example to build a fully custom GraphCtrl You should get 2 small compilation issues: * all GraphElements StyleXxxx renamed to StyleGEXxxx example: StyleXAxisDefault() ==> StyleGEXAxisDefault() * all X_ or Y_ in Types renamed to X1_ and Y1_ example X_TypeCoordConverter ==> X1_TypeCoordConverter Look at the GanttCtrl package : I made the corrections needed These renamings aim to suppress ambiguities to make code more readable. I think most of the renaming/cleaning should be finished now, all this started when I pushed Chameleon in and I wanted to have a better code base Note: Properties dialogs are quite ugly and not finished : next step is to try to do better BTW : you're GridAxis works fine, looks great and it will be a great addition. If you enhance it please post it back so we can all benefit
That's just great Didier, I'm downloading the package, I'll check it. Of course, I'll upload my version of the GridAxis, you may need to do some alteration to include it in the base.
Hello Didier, I'm getting 1 warning and a few errors in Upp 13664 and MSVS17 compiler. What am I missing?
Oh crap !!! : The 'Hash_t' type only exists in recent versions of Upp ... you're version is to old Just replace it with the type returned by memhash()
After checking, memhash() was introduced with hash_t ... so you don't have it (you need at least svn 14534) Here is the current default code (svn 14673) which should work for you (until you can update to latest version ) hash_t memhash(const void *ptr, size_t count) { unsigned hash = 1234567890U; const byte *s = (byte *)ptr; const byte *e = s + count; while(s < e) hash = ((hash << 5) - hash) ^ *s++; return hash; }
As for the warning, MSVC is probably winning about this // GraphElements are NOT COPYABLE nor MOVEABLE GraphElementParent(GraphElementParent&&) = delete; GraphElementParent(const GraphElementParent&&) = delete; GraphElementParent(GraphElementParent& ) = delete; GraphElementParent(const GraphElementParent& ) = delete; Since I don't have access to a valid MSVC, just tell what to put (normally this is valid code )
Oh, this is going to be a challenge. I've checked again, I still can't run even 14429, McAfee
Didier wrote on Sun, 12 July 2020 15:48 As for the warning, MSVC is probably winning about this // GraphElements are NOT COPYABLE nor MOVEABLE GraphElementParent(GraphElementParent&&) = delete; GraphElementParent(const GraphElementParent&&) = delete; GraphElementParent(GraphElementParent& ) = delete; GraphElementParent(const GraphElementParent& ) = delete; Since I don't have access to a valid MSVC, just tell what to put (normally this is valid code ) I think this we can ignore. In MSVS community also someone reported this as an issue.
Didier wrote on Sun, 12 July 2020 03:01 I just uploaded the latest version of the code. Hello Didier! Guess what, I can now run 14679! McAfee didn't cry about it Modified my code and successfully eliminated all errors. Now there are some new 'possible loss of data' warning, see the image. You can ignore 'multiple copy constructors specified' errors.
Hello Pradip, Quote: Guess what, I can now run 14679! McAfee didn't cry about it Great news ! You should now see a good performance boost du to all the optimization work Mirek did using intrinsics ( Thanks Mirek ) For the other warnings, they are not from my packages ... so I can't do anything about it ScatterDraw, which is now part of Uppsrc was written by Koldo ==> you need to post him a request for correction in this thread : https:// www.ultimatepp.org/forums/index.php?t=thread&frm_id=93&a mp;a mp;
Dear Pradip, dear Didier I cannot reproduce the warnings in DataSource.h. Could you indicate me which compiler has been used and how DataSource.h is included?
Dear Koldo, I have used MSVS17 compiler. Dear Didier, please advise how you have used ScatterDraw in GraphDraw
Well, I think I have found and fixed the warnings, Please check them (I cannot )
Dear Koldo, Thanks! Should I check tomorrow in tonight's nightly build then?
It is already uploaded and available in svn.
Hello Didier, Hope you are doing fine I tried to compile GraphCtrl_Demo in UPP version 15260 and found some errors in clang compiler; it is complaining about VectorDouble and ArrayDouble. Please see the image. What should be done?
Okay I got it. Changes in ScatterDraw: VectorDouble -> VectorXY ArrayDouble -> ArrayXY Didier you may please update GraphCtrl accordingly
Hello Pradip, All is fine here thanks I have a version which contains the necessary corrections ... but also cmes with a lot of other modifications : corrections and enhancements. The modifications are the following: The main mofifications aim to allow easy overriding of the properties editors (so that they can be fully customized ( my graphic designer tallent is very very bad ) To achieve this I had to kick out inheritance in Style classes (simpler this way) ==> No inheritance at all must be used at all ! ==> this implies the StyleDefault() methods may need update ==> the main properties window (the one accessible when hovering graph area now displays all available properties as TABs) I also did some renaming (very few) where needed One ranming was to follow a simple naming convention : when in a GraphElement class, getter an setter should be named GetElement...() SetElement...() ) ==> so no confusion with GraphDraw / GraphCtrl methods Bug corrections Here is the updated package
Hello again Pradip, While reconnecting with code (which I didn't work on for some time now : other things to do ) I just noticed I forgot to talk about some important modifications which I was working on and are not finished yet (but are isolated from rest of code for the moment and so normally will not bother you) ==> I was working on making ScatterDraw compatibility encapsulated in a CustomDataSource so that this could be optional (I like it when embedding all libraries is not mandatory ) ... This would have the could side effect of moving all ScatterDraw dedicated code to this CustomDataSource and thus cleaning GraphDraw.
Hello Didier! Sorry for not replying to you for a while! Me too wasn't working with the code for sometime, got back to them recently. Will try the new GraphCtrl package after some days, will keep the points you mentioned in mind for then. Ahh you have worked on making things better, can't wait to see them By any chance could you implement the PaintOne() (not sure if I remember the name right), for highlighting one data point for say selection or so?
Hello Pradip, I recommend you wait a little bit more before synching. I enhanced support for custom series, I did the following changes: Introduced GraphSeries class : it's a proxy to the data that also nows takes care of drawing and editor dialog Did a clean separation for custom series ==> the series can now be in other packages Added legend management for all series (even custom series) Added properties editor dialog management for all series (even custom series) . A custom serie can come with it's properties dialog Did some packaging : isolated existing Series in a dedicated packages ==> this allows to choose exactly which kind of serie you will use and limit minimal dependancies Did some renaming (CustomDataSource was to confusing whith the ScatterDraw class) [*] ScatterSerie interface changed a (very little bit) : preperties are not available directly at GraphCtrl level, you need to get access to the GraphSeries (so just one simple modification that can be done with search/replace) I reached a good level, but some other changes aren't done yet and still very dirty (example I tried to isolate GraphElements in different packages and succeded .... but this makes to many packages, so I rolled back With these enhancements, you could contribute you're series very simply
Hello Didier, Sure, I'll wait until you finish working at your end, and I'm sure it will be very cool when you are done Looking forward to it!
Hello Didier, While trying to print the gantt chart in a report, please advise if using the GetImage() method is best for this purpose? Thanks in advance
Hello Pradip, The GetImage() method is intended exactly for that I recommend you use one of the following GetImage(...) methods (search in GraphDraw package) : Image GetImage( Size size, Color backGndColor = Upp::White(), const int scale = 1 ); Image GetImage(Size size, const int scale = 1 ) { return GetImage(size, White(), scale ); } inline Image GetImage(const int scale=1) { return GetImage( _ctrlRect.Size()*scale, scale ); } inline Image GetImage(Color backGndColor, const int scale=1) { return GetImage( _ctrlRect.Size()*scale, backGndColor, scale ); } The 'scale' parameter is intended to make a high resolution image intended for better rendering in reports (and printing). Basically reportImageSize = screenImageSize * scale and it doens't scale anything else so it works as if you had a bigger screen. If you want a predefined size for you're repport, just use GetImage(size, scale) I use it regularly in my repports. Take a look at the 'copy' action in context menu in graph ==> it will copy the graph to clipboard while applying a scale=3 (3 is default copy ratio)
Thankssss Didier!