Status & Roadmap
Authors & License
Funding Ultimate++
Search on this site

SourceForge.net Logo



class ScatterCtrl : public StaticRect, public ScatterDraw 



Versatile 2D scatter graph control based on ScatterDraw.


It uses U++ Draw or Painter on demand to get better refresh speed or printing quality.


In ScatterCtrl_demo there is an overview of control possibilities.



Constructor Detail



Initializes the class.



Public Member List


void AddMouseBehavior(bool ctrl, bool alt, bool shift, bool left, bool middle, int middlewheel, bool right, ScatterAction action)

Add a new action to be launched when the combination of keys and mouse actions set by ctrl, alt, shift, left, middle, middlewheel and right is complied.



void RemoveMouseBehavior(ScatterAction action)

Remove all mouse and key combinations for action .



void ClearMouseBehavior()

Remove all mouse and key combinations to handle control.



void AddKeyBehavior(bool ctrl, bool alt, bool shift, int key, bool isVirtualKey, ScatterAction action)

Add a new action to be launched when the combination of keys set by ctrl, alt, shift and key is complied. isVirtualKey indicates if the key is a K_... virtual key or if it is a real char like 'e' or '+'.



void RemoveKeyBehavior(ScatterAction action)

Remove all key combinations for action.



void ClearKeyBehavior()

Remove all key combinations to handle control.



bool SetMouseBehavior(MouseBehaviour *mouseBehavior)

Sets mouseBehavior as the behavior of the mouse when used in ScatterCtrl.

See ScatterCtrl::MouseBehavior.



ScatterCtrl& SetMouseHandling(bool valx = true, bool valy = false)

If valx mouse can scroll or zoom in X axis.

If valy mouse can scroll or zoom in Y axis.



bool GetMouseHandlingX()

Returns true if mouse can scroll or zoom in X axis.



bool GetMouseHandlingY()

Returns true if mouse can scroll or zoom in Y axis.



ScatterCtrl& ShowContextMenu(bool show = true)

If show is true the context menu can be opened (right clicking by default).



ScatterCtrl& ShowPropertiesDlg(bool show = true)

If show is true, the context menu will have a "Properties" and "Data" dialogs.

In DEBUG mode both dialogs will always appear.

Here the "Properties" and here the "Data" dialog details are described.



ScatterCtrl& ShowProcessDlg(bool show = true)

If show is true, the context menu will have a "Process" dialog.

In DEBUG mode the "Process" menu will always appear.

Here the "Process" dialog details are described.



ScatterCtrl &ShowInfo(bool show = true)

If show is true it shows a legend with mouse location when mouse is clicked.



void SaveAsMetafile(const char* file)


Saves the control as a windows metafile in file.



void SaveToClipboard(bool saveAsMetafile = false)

Saves the control to the clipboard as a bitmap.


If saveAsMetafile is true it saves a windows metafile.



void SaveToFile(String fileName = Null)

Saves the control to fileName as a bitmap depending of file extension.

JPEG and PNG are supported

If fileName is Null a FileSel is opened to ask the user for the name of the file.



virtual void Refresh()

Calls to Ctrl::Refresh().



virtual Size GetSize() const

Returns the visual control Size. ScatterDraw::GetImage() will return the Size of Image to be get by functions like GetImage().



ScatterCtrl& SetColor(const Upp::Color& color)

Calls to ScatterDraw::SetColor(color).



ScatterCtrl& SetGridColor(const Upp::Color& grid_color)

Calls to ScatterDraw::SetGridColor(grid_color).



ScatterCtrl& SetGridWidth(int grid_width)

Calls to ScatterDraw::SetGridWidth(grid_width).



ScatterCtrl& SetPlotAreaColor(const Upp::Color& p_a_color)

Calls to ScatterDraw::SetPlotAreaColor(p_a_color).



ScatterCtrl& SetAxisColor(const Upp::Color& axis_color)

Calls to ScatterDraw::SetAxisColor(axis_color).



ScatterCtrl& SetAxisWidth(int axis_width)




ScatterCtrl& SetTitle(const String& title)

Calls to ScatterDraw::SetTitle(title);



ScatterCtrl& SetTitleFont(const Font& fontTitle)

Calls to ScatterDraw::SetTitleFont(fontTitle).



ScatterCtrl& SetTitleColor(const Upp::Color& colorTitle)

Calls to ScatterDraw::SetTitleColor(colorTitle).



ScatterCtrl& SetLabelsFont(const Font& fontLabels)

Calls to ScatterDraw::SetLabelsFont(fontLabels).



ScatterCtrl& SetLabelsColor(const Upp::Color& colorLabels)

Calls to ScatterDraw::SetLabelsColor(colorLabels).



ScatterCtrl& SetLabelX(const String& xLabel)

Calls to ScatterDraw::SetLabelX(xLabel).



ScatterCtrl& SetLabelY(const String& yLabel)

Calls to ScatterDraw::SetLabelY(yLabel).



ScatterCtrl& SetLabelY2(const String& yLabel)

Calls to ScatterDraw::SetLabelY(yLabel).



ScatterCtrl& SetPlotAreaMargin(int hLeft, int hRight, int vTop, int vBottom)

Calls to ScatterDraw::SetPlotAreaMargin(hLeft, hRight, vTop, vBottom).



ScatterCtrl& SetPlotAreaLeftMargin(int margin)

Calls ScatterDraw::SetPlotAreaLeftMargin(margin).



int GetPlotAreaLeftMargin()

Returns ScatterDraw::GetPlotAreaLeftMargin().



ScatterCtrl& SetPlotAreaTopMargin(int margin)

Calls to ScatterDraw::SetPlotAreaTopMargin(margin).



int GetPlotAreaTopMargin()

Returns ScatterDraw::GetPlotAreaTopMargin().



int GetPlotAreaRightMargin()

Returns ScatterDraw::GetPlotAreaRightMargin().



ScatterCtrl& SetPlotAreaRightMargin(int margin)

Calls to ScatterDraw::SetPlotAreaRightMargin(margin).



ScatterCtrl& SetPlotAreaBottomMargin(int margin)

Calls to ScatterDraw::SetPlotAreaBottomMargin(margin).



int GetPlotAreaBottomMargin()

Returns ScatterDraw::GetPlotAreaBottomMargin().



ScatterCtrl& ShowLegend(bool show = true)

Calls to ScatterDraw::ShowLegend(show).



bool GetShowLegend()

Returns ScatterDraw::GetShowLegend().



ScatterCtrl& SetLegendPos(const Point &pos)

Calls to ScatterDraw::SetLegendPos(pos).



ScatterCtrl& SetLegendPosX(int x)

Calls to ScatterDraw::SetLegendPosX(x).



ScatterCtrl& SetLegendPosY(int y)

Calls to ScatterDraw::SetLegendPosY(y).



Point& GetLegendPos()

Returns ScatterDraw::GetLegendPos().



ScatterCtrl& SetLegendNumCols(int num)

Calls to ScatterDraw::SetLegendNumCols(num)



int GetLegendNumCols()

Returns ScatterDraw::GetLegendNumCols().



ScatterCtrl& SetLegendRowSpacing(int num)

Calls to ScatterDraw::SetLegendRowSpacing(num)



int GetLegendRowSpacing()

Returns ScatterDraw::GetLegendRowSpacing().



ScatterCtrl& SetLegendAnchor(int anchor)

Calls to ScatterDraw::SetLegendAnchor(anchor)



int GetLegendAnchor()

Returns ScatterDraw::GetLegendAnchor().



ScatterCtrl& SetLegendFillColor(const Upp::Color &fill)

Calls to ScatterDraw::SetLegendFillColor(fill).



ScatterCtrl& SetLegendBorderColor(const Upp::Color &border)

Calls to ScatterDraw::SetLegendBorderColor(border).



Upp::Color& GetLegendFillColor()

Returns ScatterDraw::GetLegendFillColor().



Upp::Color& GetLegendBorderColor()

Returns ScatterDraw::GetLegendBorderColor().



ScatterCtrl& SetDefaultCSVSeparator(String sep)

Sets sep as the default .csv files field separator.



String GetDefaultCSVSeparator()

Gets the the default .csv files field separator.



enum ScatterAction action

Is the action to be launched if the previous conditions are complied. It can be:

NO_ACTION    No action.

SCROLL    Scrolls the graphs.

ZOOM_H_ENL    Zooms horizontally enlarging the graphs.

ZOOM_H_RED    Zooms horizontally reducing the graphs.

ZOOM_V_ENL    Zooms vertically enlarging the graphs.

ZOOM_V_RED    Zooms horizontally reducing the graphs.

SHOW_INFO    Shows an info label including mouse real X and Y coordinates.

ZOOM_WINDOW    Zoom in the window selected by the mouse.

SCROLL_LEFT    Scrolls left the graph.

SCROLL_RIGHT    Scrolls right the graph.

SCROLL_UP    Scrolls up the graph.

SCROLL_DOWN    Scrolls down the graph.



Last edit by koldo on 12/30/2016. Do you want to contribute?. T++