U++ Forum - RDF feed
type: channel
description: Main place for discussions about U++ cross platform development framework.
items: GraphDraw/GraphCtrl
items: Re: GraphDraw/GraphCtrl

GraphDraw/GraphCtrl
type: item
description: 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
creator: Didier
date: 2020-05-01T10:20:21-00:00

Re: GraphDraw/GraphCtrl
type: item
description: 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!
creator: Pradip
date: 2020-05-01T11:04:15-00:00

Re: GraphDraw/GraphCtrl
type: item
description: Hello Pradip, Here is the first part of GraphCtrl packages
creator: Didier
date: 2020-05-01T11:30:58-00:00

Re: GraphDraw/GraphCtrl
type: item
description: 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
creator: Didier
date: 2020-05-01T11:37:44-00:00

Re: GraphDraw/GraphCtrl
type: item
description: Maybe the Ctrl name would have to be something like GanttCtrl
creator: koldo
date: 2020-05-02T08:16:41-00:00

Re: GraphDraw/GraphCtrl
type: item
description: 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
creator: Didier
date: 2020-05-02T09:38:07-00:00

Re: GraphDraw/GraphCtrl
type: item
description: 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
creator: Didier
date: 2020-05-03T13:46:24-00:00

Re: GraphDraw/GraphCtrl
type: item
description: here is the first part [Edit] deleted dowload file
creator: Didier
date: 2020-05-03T14:08:41-00:00

Re: GraphDraw/GraphCtrl
type: item
description: Here is the second part [Edit] deleted dowload file
creator: Didier
date: 2020-05-03T14:10:31-00:00

Re: GraphDraw/GraphCtrl
type: item
description: Hello Pradip, Did you download the code ? Was it useful for you ?
creator: Didier
date: 2020-05-07T19:10:32-00:00

Re: GraphDraw/GraphCtrl
type: item
description: 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
creator: Pradip
date: 2020-05-08T07:37:49-00:00

Re: GraphDraw/GraphCtrl
type: item
description: 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)
creator: Didier
date: 2020-05-08T07:43:10-00:00

Re: GraphDraw/GraphCtrl
type: item
description: 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)
creator: Didier
date: 2020-05-10T12:53:12-00:00

Re: GraphDraw/GraphCtrl
type: item
description: 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.
creator: Pradip
date: 2020-05-13T15:42:14-00:00

Re: GraphDraw/GraphCtrl
type: item
description: 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
creator: Didier
date: 2020-05-13T18:51:09-00:00

Re: GraphDraw/GraphCtrl
type: item
description: I also trie with and withour Blitz : no compilation problem (under linux) I will have to resolve my Win problem to check further
creator: Didier
date: 2020-05-13T19:06:44-00:00

Re: GraphDraw/GraphCtrl
type: item
description: 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.
creator: Pradip
date: 2020-05-14T06:16:08-00:00

Re: GraphDraw/GraphCtrl
type: item
description: McAfee is blocking to execute 14429
creator: Pradip
date: 2020-05-14T06:51:26-00:00

Re: GraphDraw/GraphCtrl
type: item
description: 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
creator: mirek
date: 2020-05-14T07:30:52-00:00

Re: GraphDraw/GraphCtrl
type: item
description: 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.
creator: Pradip
date: 2020-05-14T07:44:29-00:00

Re: GraphDraw/GraphCtrl
type: item
description: 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.
creator: Pradip
date: 2020-05-14T08:01:49-00:00

Re: GraphDraw/GraphCtrl
type: item
description: 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, ..)
creator: Didier
date: 2020-05-14T08:57:10-00:00

Re: GraphDraw/GraphCtrl
type: item
description: 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.
creator: Pradip
date: 2020-05-14T10:18:07-00:00

Re: GraphDraw/GraphCtrl
type: item
description: 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...
creator: mirek
date: 2020-05-14T11:47:18-00:00

Re: GraphDraw/GraphCtrl
type: item
description: Really wish I could do that. This is work laptop, so you know.
creator: Pradip
date: 2020-05-14T12:15:17-00:00

Re: GraphDraw/GraphCtrl
type: item
description: 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.
creator: Pradip
date: 2020-05-15T11:10:24-00:00

Re: GraphDraw/GraphCtrl
type: item
description: 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 )
creator: Didier
date: 2020-05-15T16:04:19-00:00

Re: GraphDraw/GraphCtrl
type: item
description: 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', possibl…
creator: Pradip
date: 2020-05-16T08:06:19-00:00

Re: GraphDraw/GraphCtrl
type: item
description: 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
creator: Didier
date: 2020-05-16T18:51:40-00:00

Re: GraphDraw/GraphCtrl
type: item
description: 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
creator: Didier
date: 2020-05-17T21:59:56-00:00

Re: GraphDraw/GraphCtrl
type: item
description: 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.
creator: Pradip
date: 2020-05-18T04:10:33-00:00

Re: GraphDraw/GraphCtrl
type: item
description: 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…
creator: Pradip
date: 2020-05-24T11:07:34-00:00

Re: GraphDraw/GraphCtrl
type: item
description: 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();
creator: Didier
date: 2020-05-24T18:52:04-00:00

Re: GraphDraw/GraphCtrl
type: item
description: 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?
creator: Pradip
date: 2020-05-28T07:23:50-00:00

Re: GraphDraw/GraphCtrl
type: item
description: Hello Didier, Really amazing work with the GraphCtrl! Is there a way to allow only X axis zooming but prevent Y axis zooming?
creator: Pradip
date: 2020-05-28T16:52:09-00:00

Re: GraphDraw/GraphCtrl
type: item
description: 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
creator: Didier
date: 2020-05-28T22:00:19-00:00

Re: GraphDraw/GraphCtrl
type: item
description: 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.
creator: Pradip
date: 2020-05-29T15:23:35-00:00

Re: GraphDraw/GraphCtrl
type: item
description: Hello Pradip, I will check tomorrow
creator: Didier
date: 2020-05-29T21:09:36-00:00

Re: GraphDraw/GraphCtrl
type: item
description: Thanks Didier, Take your time.
creator: Pradip
date: 2020-05-30T10:42:36-00:00

Re: GraphDraw/GraphCtrl
type: item
description: 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
creator: Didier
date: 2020-05-30T13:45:24-00:00

Re: GraphDraw/GraphCtrl
type: item
description: 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!
creator: Pradip
date: 2020-05-31T10:23:05-00:00

Re: GraphDraw/GraphCtrl
type: item
description: Hello Pradip, InvertAxis() is comming, I have something working. Needs some cleaning
creator: Didier
date: 2020-06-01T14:15:55-00:00

Re: GraphDraw/GraphCtrl
type: item
description: 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.
creator: Didier
date: 2020-06-06T20:31:16-00:00

Re: GraphDraw/GraphCtrl
type: item
description: 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
creator: Pradip
date: 2020-06-07T12:07:00-00:00

Re: GraphDraw/GraphCtrl
type: item
description: 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)
creator: Didier
date: 2020-06-07T16:49:19-00:00

Re: GraphDraw/GraphCtrl
type: item
description: 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.
creator: Pradip
date: 2020-06-11T08:44:11-00:00

Re: GraphDraw/GraphCtrl
type: item
description: 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());
creator: Pradip
date: 2020-06-11T10:34:42-00:00

Re: GraphDraw/GraphCtrl
type: item
description: 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?
creator: Pradip
date: 2020-06-11T13:53:47-00:00

Re: GraphDraw/GraphCtrl
type: item
description: 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.
creator: deep
date: 2020-06-12T08:31:40-00:00

Re: GraphDraw/GraphCtrl
type: item
description: Dear Deepak, Thanks! That will definitely help my understanding.
creator: Pradip
date: 2020-06-13T07:13:01-00:00

Re: GraphDraw/GraphCtrl
type: item
description: 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
creator: Didier
date: 2020-06-13T21:49:47-00:00

Re: GraphDraw/GraphCtrl
type: item
description: 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
creator: Didier
date: 2020-06-13T22:09:31-00:00

Re: GraphDraw/GraphCtrl
type: item
description: 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 );
creator: Didier
date: 2020-06-13T22:44:49-00:00

Re: GraphDraw/GraphCtrl
type: item
description: 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!
creator: Pradip
date: 2020-06-21T10:48:07-00:00

Re: GraphDraw/GraphCtrl
type: item
description: 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!
creator: Pradip
date: 2020-06-21T10:53:04-00:00

Re: GraphDraw/GraphCtrl
type: item
description: Quote: uploaded few screenshots They look great.
creator: koldo
date: 2020-06-21T14:22:42-00:00

Re: GraphDraw/GraphCtrl
type: item
description: koldo wrote on Sun, 21 June 2020 19:52 They look great. Thanks Koldo. Didier's work pays off.
creator: Pradip
date: 2020-06-21T14:59:23-00:00

Re: GraphDraw/GraphCtrl
type: item
description: 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
creator: Didier
date: 2020-06-21T22:28:58-00:00

Re: GraphDraw/GraphCtrl
type: item
description: 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)
creator: Didier
date: 2020-06-21T22:41:06-00:00

Re: GraphDraw/GraphCtrl
type: item
description: 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.
creator: Pradip
date: 2020-06-22T07:52:54-00:00

Re: GraphDraw/GraphCtrl
type: item
description: 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.
creator: Pradip
date: 2020-06-22T08:35:21-00:00

Re: GraphDraw/GraphCtrl
type: item
description: 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.
creator: Pradip
date: 2020-06-22T10:54:01-00:00

Re: GraphDraw/GraphCtrl
type: item
description: 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
creator: Didier
date: 2020-06-22T11:22:44-00:00

Re: GraphDraw/GraphCtrl
type: item
description: 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
creator: Pradip
date: 2020-06-22T12:01:56-00:00

Re: GraphDraw/GraphCtrl
type: item
description: 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
creator: Pradip
date: 2020-06-22T12:28:18-00:00

Re: GraphDraw/GraphCtrl
type: item
description: 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.
creator: Pradip
date: 2020-06-22T12:35:08-00:00

Re: GraphDraw/GraphCtrl
type: item
description: 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
creator: Didier
date: 2020-06-22T13:56:58-00:00

Re: GraphDraw/GraphCtrl
type: item
description: 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
creator: Didier
date: 2020-06-22T18:52:12-00:00

Re: GraphDraw/GraphCtrl
type: item
description: 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.
creator: Pradip
date: 2020-06-23T05:29:54-00:00

Re: GraphDraw/GraphCtrl
type: item
description: 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.
creator: Pradip
date: 2020-06-23T07:22:31-00:00

Re: GraphDraw/GraphCtrl
type: item
description: 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
creator: Pradip
date: 2020-06-23T12:27:45-00:00

Re: GraphDraw/GraphCtrl
type: item
description: 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)
creator: Didier
date: 2020-06-24T22:10:50-00:00

Re: GraphDraw/GraphCtrl
type: item
description: 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...
creator: Pradip
date: 2020-06-25T08:37:45-00:00

Re: GraphDraw/GraphCtrl
type: item
description: 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!
creator: Pradip
date: 2020-06-29T09:34:45-00:00

Re: GraphDraw/GraphCtrl
type: item
description: Hello Pradip, Yes I agree with you, center the zooming on mouse cursor would be much better, I will see what I can do
creator: Didier
date: 2020-06-29T10:25:34-00:00

Re: GraphDraw/GraphCtrl
type: item
description: 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
creator: Didier
date: 2020-07-11T21:31:50-00:00

Re: GraphDraw/GraphCtrl
type: item
description: 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.
creator: Pradip
date: 2020-07-12T06:06:18-00:00

Re: GraphDraw/GraphCtrl
type: item
description: Hello Didier, I'm getting 1 warning and a few errors in Upp 13664 and MSVS17 compiler. What am I missing?
creator: Pradip
date: 2020-07-12T08:26:11-00:00

Re: GraphDraw/GraphCtrl
type: item
description: 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()
creator: Didier
date: 2020-07-12T09:57:39-00:00

Re: GraphDraw/GraphCtrl
type: item
description: 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; }
creator: Didier
date: 2020-07-12T10:11:53-00:00

Re: GraphDraw/GraphCtrl
type: item
description: 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 )
creator: Didier
date: 2020-07-12T10:18:25-00:00

Re: GraphDraw/GraphCtrl
type: item
description: Oh, this is going to be a challenge. I've checked again, I still can't run even 14429, McAfee
creator: Pradip
date: 2020-07-12T11:22:00-00:00

Re: GraphDraw/GraphCtrl
type: item
description: 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.
creator: Pradip
date: 2020-07-14T15:52:41-00:00

Re: GraphDraw/GraphCtrl
type: item
description: 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.
creator: Pradip
date: 2020-07-14T18:45:42-00:00

Re: GraphDraw/GraphCtrl
type: item
description: 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;
creator: Didier
date: 2020-07-14T21:18:06-00:00

Re: GraphDraw/GraphCtrl
type: item
description: 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?
creator: koldo
date: 2020-07-15T07:45:30-00:00

Re: GraphDraw/GraphCtrl
type: item
description: Dear Koldo, I have used MSVS17 compiler. Dear Didier, please advise how you have used ScatterDraw in GraphDraw
creator: Pradip
date: 2020-07-15T07:57:37-00:00

Re: GraphDraw/GraphCtrl
type: item
description: Well, I think I have found and fixed the warnings, Please check them (I cannot )
creator: koldo
date: 2020-07-15T07:57:39-00:00

Re: GraphDraw/GraphCtrl
type: item
description: Dear Koldo, Thanks! Should I check tomorrow in tonight's nightly build then?
creator: Pradip
date: 2020-07-15T08:01:31-00:00

Re: GraphDraw/GraphCtrl
type: item
description: It is already uploaded and available in svn.
creator: koldo
date: 2020-07-15T10:58:41-00:00

Re: GraphDraw/GraphCtrl
type: item
description: 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?
creator: Pradip
date: 2021-01-16T06:08:24-00:00

Re: GraphDraw/GraphCtrl
type: item
description: Okay I got it. Changes in ScatterDraw: VectorDouble -> VectorXY ArrayDouble -> ArrayXY Didier you may please update GraphCtrl accordingly
creator: Pradip
date: 2021-01-16T07:04:46-00:00

Re: GraphDraw/GraphCtrl
type: item
description: 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
creator: Didier
date: 2021-01-16T19:57:59-00:00

Re: GraphDraw/GraphCtrl
type: item
description: 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.
creator: Didier
date: 2021-01-21T18:55:03-00:00

Re: GraphDraw/GraphCtrl
type: item
description: 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?
creator: Pradip
date: 2021-03-20T04:34:52-00:00

Re: GraphDraw/GraphCtrl
type: item
description: 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
creator: Didier
date: 2021-03-20T19:48:02-00:00

Re: GraphDraw/GraphCtrl
type: item
description: 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!
creator: Pradip
date: 2021-03-22T05:26:33-00:00

Re: GraphDraw/GraphCtrl
type: item
description: 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
creator: Pradip
date: 2021-03-25T04:43:09-00:00

Re: GraphDraw/GraphCtrl
type: item
description: 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)
creator: Didier
date: 2021-03-25T18:16:26-00:00

Re: GraphDraw/GraphCtrl
type: item
description: Thankssss Didier!
creator: Pradip
date: 2021-03-26T05:19:52-00:00