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++ » UppHub » Scatter: Propose to add new methods
Scatter: Propose to add new methods [message #28570] Tue, 07 September 2010 16:26 Go to previous message
tojocky is currently offline  tojocky
Messages: 607
Registered: April 2008
Location: UK
Contributor

Hello All,

I propose to add the following new public methods and integrate in scatter control:
double Scatter::GetXByPoint(const Point &p_point){
	double v_x=(p_point.x-GetH_Border())*GetXRange()/(GetSize().cx-2*GetH_Border()-1)+GetXMin();		
	return v_x;
}

double Scatter::GetYByPoint(const Point &p_point){
	double v_y=(GetSize().cy-GetV_Border()-p_point.y-1)*GetYRange()/(GetSize().cy-2*GetV_Border()-GetTitleFont().GetHeight()-1)+GetYMin();
	return v_y;
}

double Scatter::GetY2ByPoint(const Point &p_point){
	double v_y2=(GetSize().cy-GetV_Border()-p_point.y-1)*GetY2Range()/(GetSize().cy-2*GetV_Border()-GetTitleFont().GetHeight()-1)+GetYMin2();
	return v_y2;
}

double Scatter::GetXPointByValue(const XY &p_v){
	double v_x=(p_v.x-GetXMin())/GetXRange()*(GetSize().cx-2*GetH_Border()-1)+GetH_Border();
	return v_x;
}

double Scatter::GetYPointByValue(const XY &p_v){
	double v_y=(GetSize().cy-GetV_Border()-1)-(p_v.y-GetYMin())/GetYRange()*(GetSize().cy-2*GetV_Border()-GetTitleFont().GetHeight()-1);
	return v_y;
}


and propose to modify method:
from:
Scatter &Scatter::SetMinUnits(double ux, double uy)
{
	xMinUnit=ux;
	yMinUnit=uy;
	yMinUnit2=yRange2*yMinUnit/yRange;
	return *this;
}

to:
Scatter &Scatter::SetMinUnits(double ux, double uy)
{
	xMinUnit=ux;
	yMinUnit=uy;
	yMinUnit2=yRange2*yMinUnit/yRange;
	AdjustMinUnitX();
	AdjustMinUnitY();
	AdjustMinUnitY2();
	return *this;
}


I use this methods very often.

Best regards, Ion Lupascu.
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Docking: How to dock to the entire portion of what remains?
Next Topic: Scatter : getDrawing !!!! help !!!!
Goto Forum:
  


Current Time: Sat Apr 27 11:25:09 CEST 2024

Total time taken to generate the page: 0.02800 seconds