Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Developing U++ » Bazaar » GraphDraw/GraphCtrl
Re: GraphDraw/GraphCtrl [message #54299 is a reply to message #54298] Mon, 22 June 2020 10:35 Go to previous messageGo to next message
Pradip is currently offline  Pradip
Messages: 61
Registered: February 2019
Location: India
Member
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.


Regards,
Pradip
Re: GraphDraw/GraphCtrl [message #54300 is a reply to message #54298] Mon, 22 June 2020 12:54 Go to previous messageGo to next message
Pradip is currently offline  Pradip
Messages: 61
Registered: February 2019
Location: India
Member
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:
index.php?t=getfile&id=6126&private=0

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.


Regards,
Pradip

[Updated on: Tue, 23 June 2020 07:26]

Report message to a moderator

Re: GraphDraw/GraphCtrl [message #54301 is a reply to message #54298] Mon, 22 June 2020 13:22 Go to previous messageGo to next message
Didier is currently offline  Didier
Messages: 559
Registered: November 2008
Location: France
Contributor
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
Re: GraphDraw/GraphCtrl [message #54302 is a reply to message #54296] Mon, 22 June 2020 14:01 Go to previous messageGo to next message
Pradip is currently offline  Pradip
Messages: 61
Registered: February 2019
Location: India
Member
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 Smile Smile Smile

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 Laughing


Regards,
Pradip
Re: GraphDraw/GraphCtrl [message #54304 is a reply to message #54297] Mon, 22 June 2020 14:28 Go to previous messageGo to next message
Pradip is currently offline  Pradip
Messages: 61
Registered: February 2019
Location: India
Member
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);

index.php?t=getfile&id=6124&private=0

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 Very Happy


Regards,
Pradip
Re: GraphDraw/GraphCtrl [message #54305 is a reply to message #54301] Mon, 22 June 2020 14:35 Go to previous messageGo to next message
Pradip is currently offline  Pradip
Messages: 61
Registered: February 2019
Location: India
Member
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.


Regards,
Pradip
Re: GraphDraw/GraphCtrl [message #54307 is a reply to message #54300] Mon, 22 June 2020 15:56 Go to previous messageGo to next message
Didier is currently offline  Didier
Messages: 559
Registered: November 2008
Location: France
Contributor
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
Re: GraphDraw/GraphCtrl [message #54315 is a reply to message #54305] Mon, 22 June 2020 20:52 Go to previous messageGo to next message
Didier is currently offline  Didier
Messages: 559
Registered: November 2008
Location: France
Contributor
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

[Updated on: Mon, 22 June 2020 22:43]

Report message to a moderator

Re: GraphDraw/GraphCtrl [message #54320 is a reply to message #54307] Tue, 23 June 2020 07:29 Go to previous messageGo to next message
Pradip is currently offline  Pradip
Messages: 61
Registered: February 2019
Location: India
Member
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.


Regards,
Pradip

[Updated on: Tue, 23 June 2020 09:24]

Report message to a moderator

Re: GraphDraw/GraphCtrl [message #54322 is a reply to message #54315] Tue, 23 June 2020 09:22 Go to previous messageGo to next message
Pradip is currently offline  Pradip
Messages: 61
Registered: February 2019
Location: India
Member
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 Very Happy

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.


Regards,
Pradip

[Updated on: Tue, 23 June 2020 09:25]

Report message to a moderator

Re: GraphDraw/GraphCtrl [message #54326 is a reply to message #54322] Tue, 23 June 2020 14:27 Go to previous messageGo to next message
Pradip is currently offline  Pradip
Messages: 61
Registered: February 2019
Location: India
Member
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


Regards,
Pradip
Re: GraphDraw/GraphCtrl [message #54334 is a reply to message #54326] Thu, 25 June 2020 00:10 Go to previous messageGo to next message
Didier is currently offline  Didier
Messages: 559
Registered: November 2008
Location: France
Contributor
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

[Updated on: Thu, 25 June 2020 00:19]

Report message to a moderator

Re: GraphDraw/GraphCtrl [message #54336 is a reply to message #54334] Thu, 25 June 2020 10:37 Go to previous messageGo to next message
Pradip is currently offline  Pradip
Messages: 61
Registered: February 2019
Location: India
Member
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... Embarassed


Regards,
Pradip
Re: GraphDraw/GraphCtrl [message #54346 is a reply to message #54336] Mon, 29 June 2020 11:34 Go to previous messageGo to next message
Pradip is currently offline  Pradip
Messages: 61
Registered: February 2019
Location: India
Member
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!


Regards,
Pradip
Re: GraphDraw/GraphCtrl [message #54347 is a reply to message #54346] Mon, 29 June 2020 12:25 Go to previous message
Didier is currently offline  Didier
Messages: 559
Registered: November 2008
Location: France
Contributor
Hello Pradip,

Yes I agree with you, center the zooming on mouse cursor would be much better, I will see what I can do

Previous Topic: NetProxy package. (HTTP/SOCKS4/4a/5 with BIND support) encapsulation for U++
Next Topic: A terminal emulator widget for U++
Goto Forum:
  


Current Time: Sat Jul 11 01:19:51 CEST 2020

Total time taken to generate the page: 0.01236 seconds