| 
 | 
 | 
 
Home » Developing U++ » UppHub » GraphDraw/GraphCtrl 
	
		
		
			| Re: GraphDraw/GraphCtrl [message #56646 is a reply to message #56572] | 
			Wed, 31 March 2021 10:02    | 
		 
		
			
				
				
				  | 
					
						  
						Pradip
						 Messages: 109 Registered: February 2019  Location: India
						
					 | 
					Experienced Member  | 
					 | 
		 
		 
	 | 
 
	
		Hello Didier, 
 
While working for printing the gantt chart, found that these functions need const access to scale. 
 
void GanttXGridAxisDraw::GanttGridStepCalcCbk(GridStepManager& gridStepManager,
	CoordinateConverter& coordConv){
void GanttXGridAxisDraw::PaintHGrid(Draw& dw, int yRange, const_GridStepIterator iter,
	const_GridStepIterator endIter) {
void GanttYGridAxisDraw::PaintVGrid(Draw& dw, int xRange, const_GridStepIterator iter,
		const_GridStepIterator endIter) {
 
GanttXGridAxisDraw::GanttGridStepCalcCbk needs scale to show the dynamic grid on both screen and print correctly, Please see the attached PDF which will illustrate this clearly. 
 
Paint*Grid needs scale to draw the grids with right thickness on both screen and print. 
 
Please advise.
		
		
  Regards, 
Pradip
		
 |  
	| 
		
	 | 
 
 
 |  
	| 
		
 |  
	| 
		
 |  
	| 
		
 |  
	
		
		
			| Re: GraphDraw/GraphCtrl [message #56727 is a reply to message #56654] | 
			Wed, 07 April 2021 14:51    | 
		 
		
			
				
				
				
					
						  
						Didier
						 Messages: 736 Registered: November 2008  Location: France
						
					 | 
					Contributor   | 
					 | 
		 
		 
	 | 
 
	
		Hello Pradip, 
 
Here is first version (not 100% finished, but what I wanted to see working is now OK) 
There will be some more renaming to come (not to much I hope) but you can satrt with this version. 
The main additions since you're last sync are: 
 
 
-      Introduced GraphSeries class : it's a proxy to the data that also takes care of drawing and editor dialog construction
 -      Did a clean separation for custom series ==> the series can now be in other packages 
 -      Added legend management for all series (even custom series) Smile
 -      Added properties editor dialog management for all series (even custom series) Smile . A custom GraphSerie can come with it's properties dialog and it can be changed application wide with static methods SetDefaultXxxx() (just like Chameleon)
 -      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 dependencies (I added a GraphSerie  directory intended to contain all the GraphSerie packages)
 -      Did some renaming (CustomDataSource was to confusing whith the ScatterDraw class)
 -      NEW : Changed GrahElement properties editors management : you can now change application wide the editor of a GraphElement with static methods SetDefaultXxxx() (just like Chameleon) (This enhances Styling capacities quite easily)
 -      NEW : did some more simplifications
 -      NEW : did some more renaming
  
 
 
All the modifications you requested have also been added   
But after thinking about it, maybe you have a bug : the image copied to clipboard is supposed to look exactly the same as the one on the screen but with higher resolution so the number of grid lines should not change and you should not have the behaviour you see in the image you shared 
Maybe you could share with the code of you're GridAxis manager ? 
 
 
[EDIT] : removed attached file, new version available further  
		
		
		[Updated on: Tue, 27 April 2021 23:36] Report message to a moderator  
 |  
	| 
		
	 | 
 
 
 |  
	| 
		
 |  
	| 
		
 |  
	| 
		
 |  
	| 
		
 |  
	| 
		
 |  
	| 
		
 |  
	| 
		
 |  
	
		
		
			| Re: GraphDraw/GraphCtrl [message #56776 is a reply to message #56747] | 
			Thu, 15 April 2021 09:21    | 
		 
		
			
				
				
				  | 
					
						  
						Pradip
						 Messages: 109 Registered: February 2019  Location: India
						
					 | 
					Experienced Member  | 
					 | 
		 
		 
	 | 
 
	
		Hello Didier, 
 
Please, help is needed while syncing! 
 
How should I modify the following lines? They are failing in compilation     
 
struct GanttCtrlDefaultTypes {
	typedef GanttCtrlDefaultTypes                                                      Types;
	typedef GraphDraw_ns::CoordinateConverter                                          X1_TypeCoordConverter;
	typedef GraphDraw_ns::CoordinateConverter                                          Y1_TypeCoordConverter;
	typedef GraphDraw_ns::StdGridAxisECtrl<Types, GraphDraw_ns::GanttXGridAxisDraw >   X1_TypeGridAxisDraw;
	typedef GraphDraw_ns::StdGridAxisECtrl<Types, GraphDraw_ns::GanttYGridAxisDraw >   Y1_TypeGridAxisDraw;
	typedef GraphDraw_ns::StdLabelECtrl<Types,GraphDraw_ns::LabelElement>              TypeLabelElement;
	typedef GraphDraw_ns::StdLegendECtrl<Types, GraphDraw_ns::LegendElement >          TypeLegendElement;
	typedef GraphDraw_ns::StdBlankAreaECtrl<Types, GraphDraw_ns::BlankAreaElement >    TypeBlankElement;
	typedef GraphDraw_ns::DynamicMarkerECtrl< Types >                                  TypeMarkerElement;
};
 
		
		
  Regards, 
Pradip
		[Updated on: Thu, 15 April 2021 09:27] Report message to a moderator  
 |  
	| 
		
	 | 
 
 
 |  
	
		
		
			| Re: GraphDraw/GraphCtrl [message #56777 is a reply to message #56747] | 
			Thu, 15 April 2021 09:25    | 
		 
		
			
				
				
				  | 
					
						  
						Pradip
						 Messages: 109 Registered: February 2019  Location: India
						
					 | 
					Experienced Member  | 
					 | 
		 
		 
	 | 
 
	
		Didier wrote on Fri, 09 April 2021 17:37The autoscroller is part of UppHub, if you havea very recent version of Theide, it will be available.  
Thanks! Got the latest version of UPP and got the autoscroller too
		
		
  Regards, 
Pradip
		[Updated on: Thu, 15 April 2021 09:29] Report message to a moderator  
 |  
	| 
		
	 | 
 
 
 |  
	
		
		
			| Re: GraphDraw/GraphCtrl [message #56780 is a reply to message #56776] | 
			Thu, 15 April 2021 14:52    | 
		 
		
			
				
				
				
					
						  
						Didier
						 Messages: 736 Registered: November 2008  Location: France
						
					 | 
					Contributor   | 
					 | 
		 
		 
	 | 
 
	
		Hello Pradip, 
 
Quote:How should I modify the following lines? They are failing in compilation Sad 
 
Code: [Select all] [Show/ hide] 
struct GanttCtrlDefaultTypes { 
	typedef GanttCtrlDefaultTypes                                                      Types; 
	typedef GraphDraw_ns::CoordinateConverter                                          X1_TypeCoordConverter; 
	typedef GraphDraw_ns::CoordinateConverter                                          Y1_TypeCoordConverter; 
	typedef GraphDraw_ns::StdGridAxisECtrl<Types, GraphDraw_ns::GanttXGridAxisDraw >   X1_TypeGridAxisDraw; 
	typedef GraphDraw_ns::StdGridAxisECtrl<Types, GraphDraw_ns::GanttYGridAxisDraw >   Y1_TypeGridAxisDraw; 
	typedef GraphDraw_ns::StdLabelECtrl<Types,GraphDraw_ns::LabelElement >              TypeLabelElement; 
	typedef GraphDraw_ns::StdLegendECtrl<Types, GraphDraw_ns::LegendElement >          TypeLegendElement; 
	typedef GraphDraw_ns::StdBlankAreaECtrl<Types, GraphDraw_ns::BlankAreaElement >    TypeBlankElement; 
}; 
 
  
 
This is due to some simplifications ==> one of the template parameters was removed, it had become useless over time 
So you just need to remove the 'Types'  from the template declaration 
 
'TYPES' template parameter isn't passed any more to GraphElements (they don't need this inforamtion) 
 
 
Example: 
typedef GanttCtrlDefaultTypes                                                      Types;
	typedef GraphDraw_ns::CoordinateConverter                                          X1_TypeCoordConverter;
	typedef GraphDraw_ns::CoordinateConverter                                          Y1_TypeCoordConverter;
	typedef GraphDraw_ns::StdGridAxisECtrl<GraphDraw_ns::GanttXGridAxisDraw >   X1_TypeGridAxisDraw;
	typedef GraphDraw_ns::StdGridAxisECtrl<GraphDraw_ns::GanttYGridAxisDraw >   Y1_TypeGridAxisDraw;
	typedef GraphDraw_ns::StdLabelECtrl<GraphDraw_ns::LabelElement>              TypeLabelElement;
	typedef GraphDraw_ns::StdLegendECtrl<GraphDraw_ns::LegendElement >          TypeLegendElement;
	typedef GraphDraw_ns::StdBlankAreaECtrl<GraphDraw_ns::BlankAreaElement >    TypeBlankElement;
	typedef GraphDraw_ns::DynamicMarkerECtrl                                  TypeMarkerElement;  
 
Look at the GraphCtrlDefaultTypes  declaration (there are some other simplifications  : some don't have templates at all) 
		
		
		[Updated on: Thu, 15 April 2021 15:29] Report message to a moderator  
 |  
	| 
		
	 | 
 
 
 |  
	
		
		
			| Re: GraphDraw/GraphCtrl [message #56841 is a reply to message #56780] | 
			Mon, 19 April 2021 15:14    | 
		 
		
			
				
				
				  | 
					
						  
						Pradip
						 Messages: 109 Registered: February 2019  Location: India
						
					 | 
					Experienced Member  | 
					 | 
		 
		 
	 | 
 
	
		Hello Didier, 
 
The syncing is fully complete now. Addition of the scale parameter came very handy, thanks a lot! Enclosing comparison of screen and print outputs now, perfect!  
 
While syncing, noted the following changes: 
 
Changed this as you suggested, but noticed that the template name is TStdGridAxisECtrl and not StdGridAxisECtrl; similar changes in other related lines 
//typedef GraphDraw_ns::StdGridAxisECtrl<Types, GraphDraw_ns::GanttXGridAxisDraw >   X1_TypeGridAxisDraw;
typedef GraphDraw_ns::TStdGridAxisECtrl<GraphDraw_ns::GanttXGridAxisDraw >   X1_TypeGridAxisDraw;
  
 
This needs package GraphSeries/SimpleJobSerie 
//class GanttBarSeries : public CustomDataSource {
class GanttBarSeries : public SimpleJobSerie {
 
 
For chameleon; similar changes in other related lines 
//ganttPrintStyle.x1AxisStyle.gridColor = WhiteGray();
ganttPrintStyle.x1AxisStyle.gdStyle.gridColor = WhiteGray();
  
 
In Ctor, this was bit of a surprise. The first line worked fine before in both modes, now works in debug but crashes in release. Changed line works in both. 
//GetElementY1GridAxisDraw().SetAxisInverted(); // crashes in release mode!
GetElementY1GridAxisDraw().GetCoordConverter().SetInverted();
  
 
Finally, noticed that now ScatterDraw package is needed, which wasn't the case earlier. 
 
It's an awesome experience, working with the GraphCtrl! Cheers     
 
		
		
  Regards, 
Pradip
		
 |  
	| 
		
	 | 
 
 
 |  
	
		
		
			| Re: GraphDraw/GraphCtrl [message #56843 is a reply to message #56841] | 
			Mon, 19 April 2021 19:42    | 
		 
		
			
				
				
				
					
						  
						Didier
						 Messages: 736 Registered: November 2008  Location: France
						
					 | 
					Contributor   | 
					 | 
		 
		 
	 | 
 
	
		Hello Pradip, 
 
Glad to here you succeded in syncing (hope it wasn't to much work    ) 
 
Quote:Changed this as you suggested, but noticed that the template name is TStdGridAxisECtrl and not StdGridAxisECtrl; similar changes in other related lines  
When I removed the TYPE template parameter from GraphElementCtrl i Noticed I could simplify things and define default types (that don't need templates) 
This is why I added 'T' : it's shows it is the Template version 
	typedef TStdGridAxisECtrl< GridAxisDraw >     StdGridAxisECtrl;
	typedef TStdLabelECtrl   < LabelElement>      StdLabelECtrl;
	typedef TStdLegendECtrl  < LegendElement>     StdLegendECtrl;
	typedef TStdBlankAreaECtrl<BlankAreaElement>  StdBlankAreaECtrl;
	typedef DynamicMarkerECtrl                    StdMarkerECtrl;
  
 
Quote:This needs package GraphSeries/SimpleJobSerie 
//class GanttBarSeries : public CustomDataSource { 
class GanttBarSeries : public SimpleJobSerie { 
  
 
You should have used : 
class GanttBarSeries : public GraphSerie  
Since CustomDataSource was renamed GraphSerie 
SimpleJobSerie is just an example of a job serie  
 
 
Quote:In Ctor, this was bit of a surprise. The first line worked fine before in both modes, now works in debug but crashes in release. Changed line works in both. 
 
//GetElementY1GridAxisDraw().SetAxisInverted(); // crashes in release mode! 
     GetElementY1GridAxisDraw().GetCoordConverter().SetInverted() ; 
  
I will look into this, obviously there is a problem ... 
 
 
Quote:Finally, noticed that now ScatterDraw package is needed, which wasn't the case earlier  
ScatterDraw was always necessary before: it was part of the dependecies of GraphDraw. 
Now, after the laast modifications, if you don't use ScatterSeries in you're application ScatterDraw package is no more included (since it's not needed by application) 
If you need ScatterSeries you need to make it a dependency of you're application package 
This was done to limit dependencies to the minimum and prevent inclusion of unused packages 
		
		
		[Updated on: Mon, 19 April 2021 19:56] Report message to a moderator  
 |  
	| 
		
	 | 
 
 
 |  
	| 
		
 |  
	
		
		
			| Re: GraphDraw/GraphCtrl [message #56863 is a reply to message #56843] | 
			Fri, 23 April 2021 08:03    | 
		 
		
			
				
				
				  | 
					
						  
						Pradip
						 Messages: 109 Registered: February 2019  Location: India
						
					 | 
					Experienced Member  | 
					 | 
		 
		 
	 | 
 
	
		Hello Didier, 
 
Didier wrote on Mon, 19 April 2021 23:12 
Glad to here you succeded in syncing (hope it wasn't to much work    ) 
  
Amazing  ! Though it took bit of a time, it was smooth sailing through the syncing! For custom series, now there are styles, mouse events, editor dialog (I'm still exploring) all thanks to your amazing work     
 
Didier wrote on Mon, 19 April 2021 23:12 
When I removed the TYPE template parameter from GraphElementCtrl i Noticed I could simplify things and define default types (that don't need templates) 
  
It is simplified now 
 
Didier wrote on Mon, 19 April 2021 23:12 
You should have used : 
class GanttBarSeries : public GraphSerie  
Since CustomDataSource was renamed GraphSerie 
SimpleJobSerie is just an example of a job serie  
  
Got your point. Now I'm using: 
class GanttBarSeries : public SimpleGraphSerie { 
And removed dependency with SimpleJobSerie 
 
Didier wrote on Mon, 19 April 2021 23:12 
Quote:In Ctor, this was bit of a surprise. The first line worked fine before in both modes, now works in debug but crashes in release. Changed line works in both. 
 
//GetElementY1GridAxisDraw().SetAxisInverted(); // crashes in release mode! 
      GetElementY1GridAxisDraw().GetCoordConverter().SetInverted() ; 
  
I will look into this, obviously there is a problem ... 
  
Sure, I'll keep syncing with your updates. 
		
		
  Regards, 
Pradip
		
 |  
	| 
		
	 | 
 
 
 |  
	| 
		
 |   
Goto Forum:
 
 Current Time: Tue Nov 04 16:55:01 CET 2025 
 Total time taken to generate the page: 0.06851 seconds 
 |   
 |  
  |