mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-07-11 22:03:01 -06:00
ScatterCtrl: Added more mark control
git-svn-id: svn://ultimatepp.org/upp/trunk@10624 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
027b963e7b
commit
6d7ec64cd3
4 changed files with 70 additions and 18 deletions
|
|
@ -214,23 +214,30 @@ void SeriesTab::Init(ScatterCtrl& scatter)
|
|||
list.SetCursor(0);
|
||||
list.WhenSel = THISBACK(UpdateFields);
|
||||
|
||||
marktype.Clear();
|
||||
|
||||
markstyle.Add(t_("No mark"));
|
||||
for(int i = 0; i < MarkPlot::GetCount(); i++)
|
||||
markstyle.Add(MarkPlot::TypeName(i));
|
||||
|
||||
markstyle.SetIndex(0);
|
||||
|
||||
for(int i = 0; i < DashStyle::GetCount(); i++)
|
||||
dashStyle.Add(DashStyle::TypeName(i));
|
||||
|
||||
UpdateFields();
|
||||
|
||||
linecolor <<= THISBACK(Change);
|
||||
fillcolor <<= THISBACK(Change);
|
||||
visible <<= THISBACK(Change);
|
||||
dash <<= THISBACK(Change);
|
||||
dashStyle.WhenAction = THISBACK(Change);
|
||||
linethickness <<= THISBACK(Change);
|
||||
|
||||
markstyle <<= THISBACK(Change);
|
||||
markstyle.WhenAction = THISBACK(Change);
|
||||
markcolor <<= THISBACK(Change);
|
||||
markwidth <<= THISBACK(Change);
|
||||
|
||||
marktype.WhenAction = THISBACK(Change);
|
||||
|
||||
unitsY <<= THISBACK(Change);
|
||||
unitsX <<= THISBACK(Change);
|
||||
|
||||
|
|
@ -240,6 +247,28 @@ void SeriesTab::Init(ScatterCtrl& scatter)
|
|||
name.SetFocus();
|
||||
}
|
||||
|
||||
void SeriesTab::ChangeMark() {
|
||||
int index = list.GetCursor();
|
||||
if (index < 0)
|
||||
return;
|
||||
|
||||
ScatterCtrl &scatter = *pscatter;
|
||||
|
||||
int id = MarkPlot::TypeIndex(~markstyle);
|
||||
|
||||
marktype.Clear();
|
||||
|
||||
if (id >= 0) {
|
||||
for (int i = 0; i < MarkPlot::GetTypeCount(id); ++i)
|
||||
marktype.Add(MarkPlot::TypeString(id, i));
|
||||
}
|
||||
if (marktype.GetCount() > 0)
|
||||
marktype.SetIndex(0);
|
||||
int idStyle = scatter.GetMarkStyleType(index);
|
||||
if (idStyle >= 0 && idStyle < marktype.GetCount())
|
||||
marktype.SetIndex(idStyle);
|
||||
}
|
||||
|
||||
void SeriesTab::Change()
|
||||
{
|
||||
int index = list.GetCursor();
|
||||
|
|
@ -251,12 +280,14 @@ void SeriesTab::Change()
|
|||
scatter.SetDataColor(index, Upp::Color(~linecolor));
|
||||
scatter.SetFillColor(index, ~fillcolor);
|
||||
scatter.ScatterDraw::Show(index, ~visible);
|
||||
scatter.Dash(index, dash.GetData().ToString());
|
||||
scatter.Dash(index, DashStyle::Style(DashStyle::TypeIndex(~dashStyle)));
|
||||
scatter.SetDataThickness(index, ~linethickness);
|
||||
|
||||
scatter.MarkStyle(index, ~markstyle);
|
||||
scatter.SetMarkColor(index, Upp::Color(~markcolor));
|
||||
scatter.SetMarkWidth(index, ~markwidth);
|
||||
scatter.SetMarkStyleType(index, marktype.GetIndex());
|
||||
ChangeMark();
|
||||
|
||||
scatter.Units(index, ~unitsY, ~unitsX);
|
||||
|
||||
|
|
@ -282,12 +313,18 @@ void SeriesTab::UpdateFields()
|
|||
linecolor <<= scatter.GetDataColor(index);
|
||||
fillcolor <<= scatter.GetFillColor(index);
|
||||
visible <<= scatter.ScatterDraw::IsVisible(index);
|
||||
dash <<= scatter.GetDash(index);
|
||||
int id = DashStyle::StyleIndex(scatter.GetDash(index));
|
||||
if (id < 0) {
|
||||
id = DashStyle::Register(Format(t_("Dash \"%s\""), scatter.GetDash(index)), scatter.GetDash(index));
|
||||
dashStyle.Add(DashStyle::TypeName(id));
|
||||
}
|
||||
dashStyle <<= DashStyle::TypeName(id);
|
||||
linethickness <<= scatter.GetDataThickness(index);
|
||||
|
||||
markstyle <<= scatter.GetMarkStyleName(index);
|
||||
markcolor <<= scatter.GetMarkColor(index);
|
||||
markwidth <<= scatter.GetMarkWidth(index);
|
||||
ChangeMark();
|
||||
|
||||
unitsY <<= scatter.GetUnitsY(index);
|
||||
unitsX <<= scatter.GetUnitsX(index);
|
||||
|
|
@ -702,6 +739,7 @@ void ProcessingTab::UpdateField(const String _name, int _id)
|
|||
tabFit.scatter.MarkStyle(0, pscatter->GetMarkStyleName(id));
|
||||
tabFit.scatter.SetMarkColor(0, pscatter->GetMarkColor(id));
|
||||
tabFit.scatter.SetMarkWidth(0, pscatter->GetMarkWidth(id));
|
||||
tabFit.scatter.SetMarkStyleType(0, pscatter->GetMarkStyleType(id));
|
||||
tabFit.scatter.SetLegendAnchor(ScatterDraw::LEGEND_ANCHOR_RIGHT_TOP).SetLegendFillColor(Null);
|
||||
|
||||
tabFit.scatter.Units(0, pscatter->GetUnitsX(id), pscatter->GetUnitsY(id));
|
||||
|
|
|
|||
|
|
@ -43,12 +43,18 @@ class SeriesTab : public WithSeries<StaticRect> {
|
|||
public:
|
||||
typedef SeriesTab CLASSNAME;
|
||||
|
||||
SeriesTab() : dashCount(DashStyle::GetCount()) {}
|
||||
~SeriesTab() {
|
||||
DashStyle::UnregisterFrom(dashCount);
|
||||
}
|
||||
void Init(ScatterCtrl& scatter);
|
||||
|
||||
private:
|
||||
ScatterCtrl *pscatter;
|
||||
int dashCount;
|
||||
|
||||
void Change();
|
||||
void ChangeMark();
|
||||
void UpdateFields();
|
||||
};
|
||||
|
||||
|
|
|
|||
|
|
@ -70,30 +70,32 @@ END_LAYOUT
|
|||
LAYOUT(Series, 420, 228)
|
||||
ITEM(ArrayCtrl, list, LeftPosZ(4, 120).VSizePosZ(4, 4))
|
||||
ITEM(EditString, name, HSizePosZ(168, 80).TopPosZ(4, 19))
|
||||
ITEM(EditDoubleSpin, linethickness, Min(0.0001).NotNull(true).LeftPosZ(200, 56).TopPosZ(72, 19))
|
||||
ITEM(EditDoubleSpin, linethickness, Min(0.0001).NotNull(true).LeftPosZ(200, 60).TopPosZ(72, 19))
|
||||
ITEM(EditString, unitsX, LeftPosZ(288, 64).TopPosZ(196, 19))
|
||||
ITEM(EditString, unitsY, LeftPosZ(176, 64).TopPosZ(196, 19))
|
||||
ITEM(Option, visible, SetLabel(t_("Visible")).LeftPosZ(352, 56).TopPosZ(48, 16))
|
||||
ITEM(DropList, markstyle, LeftPosZ(180, 116).TopPosZ(124, 19))
|
||||
ITEM(EditDoubleSpin, markwidth, SetInc(0.5).Min(0.0001).NotNull(true).LeftPosZ(180, 56).TopPosZ(148, 19))
|
||||
ITEM(DropList, marktype, LeftPosZ(332, 80).TopPosZ(124, 19))
|
||||
ITEM(EditDoubleSpin, markwidth, SetInc(0.5).Min(0.0001).NotNull(true).LeftPosZ(176, 56).TopPosZ(148, 19))
|
||||
ITEM(LabelBox, dv___8, SetLabel(t_("Units")).HSizePosZ(128, 4).TopPosZ(180, 44))
|
||||
ITEM(LabelBox, dv___9, SetLabel(t_("Mark")).HSizePosZ(128, 4).TopPosZ(108, 68))
|
||||
ITEM(Label, dv___10, SetLabel(t_("Style:")).LeftPosZ(136, 44).TopPosZ(124, 19))
|
||||
ITEM(Label, dv___11, SetLabel(t_("Color:")).LeftPosZ(304, 40).TopPosZ(124, 19))
|
||||
ITEM(ColorPusher, markcolor, LeftPosZ(348, 20).TopPosZ(124, 19))
|
||||
ITEM(Label, dv___13, SetLabel(t_("Fill:")).LeftPosZ(276, 44).TopPosZ(72, 19))
|
||||
ITEM(ColorPusher, fillcolor, LeftPosZ(324, 20).TopPosZ(72, 19))
|
||||
ITEM(Label, dv___10, SetLabel(t_("Type:")).LeftPosZ(296, 36).TopPosZ(124, 19))
|
||||
ITEM(Label, dv___11, SetLabel(t_("Color:")).LeftPosZ(244, 40).TopPosZ(148, 19))
|
||||
ITEM(ColorPusher, markcolor, LeftPosZ(288, 20).TopPosZ(148, 19))
|
||||
ITEM(Label, dv___13, SetLabel(t_("Fill:")).LeftPosZ(340, 44).TopPosZ(72, 19))
|
||||
ITEM(ColorPusher, fillcolor, LeftPosZ(388, 20).TopPosZ(72, 19))
|
||||
ITEM(Label, dv___15, SetLabel(t_("X axis:")).LeftPosZ(248, 40).TopPosZ(196, 19))
|
||||
ITEM(Label, dv___16, SetLabel(t_("Y axis:")).LeftPosZ(136, 40).TopPosZ(196, 19))
|
||||
ITEM(LabelBox, dv___17, SetLabel(t_("Line:")).HSizePosZ(128, 4).TopPosZ(32, 68))
|
||||
ITEM(Label, dv___18, SetLabel(t_("Color:")).LeftPosZ(276, 44).TopPosZ(48, 19))
|
||||
ITEM(ColorPusher, linecolor, LeftPosZ(324, 20).TopPosZ(48, 19))
|
||||
ITEM(Label, dv___18, SetLabel(t_("Color:")).LeftPosZ(264, 44).TopPosZ(72, 19))
|
||||
ITEM(ColorPusher, linecolor, LeftPosZ(312, 20).TopPosZ(72, 19))
|
||||
ITEM(Label, dv___20, SetLabel(t_("Dash:")).LeftPosZ(136, 64).TopPosZ(48, 19))
|
||||
ITEM(Label, dv___21, SetLabel(t_("Thickness:")).LeftPosZ(136, 64).TopPosZ(72, 19))
|
||||
ITEM(Label, dv___22, SetLabel(t_("Name:")).LeftPosZ(128, 40).TopPosZ(4, 21))
|
||||
ITEM(Label, dv___23, SetLabel(t_("Width:")).LeftPosZ(136, 44).TopPosZ(148, 19))
|
||||
ITEM(EditString, dash, LeftPosZ(200, 68).TopPosZ(48, 19))
|
||||
ITEM(Label, dv___23, SetLabel(t_("Width:")).LeftPosZ(136, 40).TopPosZ(148, 19))
|
||||
ITEM(DropList, dashStyle, LeftPosZ(200, 132).TopPosZ(48, 19))
|
||||
ITEM(Option, primary, SetLabel(t_("Primary")).RightPosZ(4, 68).TopPosZ(4, 16))
|
||||
ITEM(DropList, markstyle, LeftPosZ(176, 116).TopPosZ(124, 19))
|
||||
ITEM(Label, dv___27, SetLabel(t_("Style:")).LeftPosZ(136, 40).TopPosZ(124, 19))
|
||||
END_LAYOUT
|
||||
|
||||
LAYOUT(Data, 436, 252)
|
||||
|
|
|
|||
|
|
@ -234,6 +234,12 @@ esES("Sin marca")
|
|||
euES("Marka gabe")
|
||||
frFR("Sans marque")
|
||||
|
||||
T_("Dash \"%s\"")
|
||||
caES("")
|
||||
esES("Guiones \"%s\"")
|
||||
euES("")
|
||||
frFR("")
|
||||
|
||||
T_("Scatter data")
|
||||
caES("Dades del gr\303\240fic")
|
||||
esES("Datos del gr\303\241fico")
|
||||
|
|
@ -940,7 +946,7 @@ euES("")
|
|||
frFR("")
|
||||
|
||||
T_("OK")
|
||||
caES("")
|
||||
caES("Continuar")
|
||||
esES("")
|
||||
euES("")
|
||||
frFR("")
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue