Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 247481 Details for
Bug 365571
Can not set legend and xy labels in Plot2d Wizard.
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
[patch]
Patch for Plot2d Wizard, adding legend functionality
wxMaxima-0.7.2-Plot2dLabels.patch (text/plain), 9.04 KB, created by
Feng Yu
on 2007-11-04 07:14:21 UTC
(
hide
)
Description:
Patch for Plot2d Wizard, adding legend functionality
Filename:
MIME Type:
Creator:
Feng Yu
Created:
2007-11-04 07:14:21 UTC
Size:
9.04 KB
patch
obsolete
>--- wxMaxima-0.7.2.org/src/Plot2dWiz.cpp 2007-11-04 01:42:37.000000000 -0400 >+++ wxMaxima-0.7.2/src/Plot2dWiz.cpp 2007-11-04 01:55:53.000000000 -0500 >@@ -53,6 +53,9 @@ > label_5 = new wxStaticText(this, -1, _("to:")); > text_ctrl_4 = new BTextCtrl(this, -1, wxT("5"), wxDefaultPosition, > wxSize(70, -1)); >+ label_xlabel = new wxStaticText(this, -1, _("L:")); >+ text_ctrl_xlabel = new BTextCtrl(this, -1, wxEmptyString, wxDefaultPosition, >+ wxSize(70, -1)); > label_6 = new wxStaticText(this, -1, _("Variable:")); > text_ctrl_5 = new BTextCtrl(this, -1, wxT("y"), wxDefaultPosition, > wxSize(40, -1), wxTE_READONLY); >@@ -62,6 +65,9 @@ > label_8 = new wxStaticText(this, -1, _("to:")); > text_ctrl_7 = new BTextCtrl(this, -1, wxT("5"), wxDefaultPosition, > wxSize(70, -1)); >+ label_ylabel = new wxStaticText(this, -1, _("L:")); >+ text_ctrl_ylabel = new BTextCtrl(this, -1, wxEmptyString, wxDefaultPosition, >+ wxSize(70, -1)); > label_9 = new wxStaticText(this, -1, _("Ticks:")); > text_ctrl_8 = new wxSpinCtrl(this, -1, wxEmptyString, wxDefaultPosition, > wxDefaultSize, wxSP_ARROW_KEYS, 0, 1000); >@@ -89,9 +95,14 @@ > combo_box_2 = new wxComboBox(this, combobox, wxEmptyString, wxDefaultPosition, > wxSize(280, -1), 6, > combo_box_2_choices, wxCB_DROPDOWN); >+ label_zoom = new wxStaticText(this, -1, _("zoom")); >+ text_ctrl_zoom = new BTextCtrl(this, -1, wxT("1.0"), wxDefaultPosition, wxSize(40,-1)); > label_12 = new wxStaticText(this, -1, _("Plot to file:")); > text_ctrl_9 = new BTextCtrl(this, -1, wxEmptyString, wxDefaultPosition, > wxSize(280, -1)); >+ label_legend = new wxStaticText(this, -1, _("Legend:")); >+ text_ctrl_legend = new BTextCtrl(this, -1, wxEmptyString, wxDefaultPosition, >+ wxSize(280,-1)); > button_4 = new wxBitmapButton(this, file_browse_2d, > wxArtProvider::GetBitmap(wxART_FILE_OPEN, > wxART_HELP_BROWSER)); >@@ -120,7 +131,12 @@ > text_ctrl_6->SetValue(wxT("0")); > text_ctrl_7->SetValue(wxT("0")); > text_ctrl_8->SetValue(wxT("10")); >- >+ wxString zoom; >+ wxConfig::Get()->Read(wxT("Wiz/Plot2d/zoom"), &zoom); >+ text_ctrl_zoom->SetValue(zoom); >+ text_ctrl_xlabel->SetToolTip(_("X Label")); >+ text_ctrl_ylabel->SetToolTip(_("Y Label")); >+ text_ctrl_legend->SetToolTip(_("Usage: \"legend1\", \"legend2\"")); > button_4->SetToolTip(_("Browse")); > #if defined __WXMSW__ > button_1->SetDefault(); >@@ -133,7 +149,7 @@ > > wxConfig::Get()->Read(wxT("Wiz/Plot2D/format"), &selection); > wxConfig::Get()->Read(wxT("Wiz/Plot2D/sendRanges"), &sendRanges); >- >+ > combo_box_1->SetSelection(selection); > > text_ctrl_1->SetFocus(); >@@ -144,18 +160,23 @@ > { > wxFlexGridSizer* grid_sizer_1 = new wxFlexGridSizer(4, 1, 3, 3); > wxBoxSizer* sizer_1 = new wxBoxSizer(wxHORIZONTAL); >- wxFlexGridSizer* grid_sizer_2 = new wxFlexGridSizer(7, 2, 3, 3); >+ wxFlexGridSizer* grid_sizer_2 = new wxFlexGridSizer(8, 2, 3, 3); > wxBoxSizer* sizer_2 = new wxBoxSizer(wxHORIZONTAL); > wxBoxSizer* sizer_3 = new wxBoxSizer(wxHORIZONTAL); > wxBoxSizer* sizer_4 = new wxBoxSizer(wxHORIZONTAL); > wxBoxSizer* sizer_5 = new wxBoxSizer(wxHORIZONTAL); >+ wxBoxSizer* sizer_options = new wxBoxSizer(wxHORIZONTAL); > grid_sizer_1->Add(label_1, 0, wxALIGN_CENTER_HORIZONTAL | wxALL, 2); > grid_sizer_2->Add(label_2, 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL | wxALL, 2); > sizer_2->Add(text_ctrl_1, 0, wxALL | wxALIGN_CENTER_VERTICAL, 2); > sizer_2->Add(button_3, 0, wxALL, 2); > grid_sizer_2->Add(sizer_2, 1, wxEXPAND, 0); >+ grid_sizer_2->Add(label_legend, 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL | wxALL, 2); >+ grid_sizer_2->Add(text_ctrl_legend, 0, wxALL | wxALIGN_CENTER_VERTICAL, 2); > grid_sizer_2->Add(label_3, 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL | wxALL, 2); > sizer_3->Add(text_ctrl_2, 0, wxALL | wxALIGN_CENTER_VERTICAL, 2); >+ sizer_3->Add(label_xlabel, 0, wxALL | wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL, 2); >+ sizer_3->Add(text_ctrl_xlabel, 0, wxALL | wxALIGN_CENTER_VERTICAL, 2); > sizer_3->Add(label_4, 0, wxALL | wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL, 2); > sizer_3->Add(text_ctrl_3, 0, wxALL | wxALIGN_CENTER_VERTICAL, 2); > sizer_3->Add(label_5, 0, wxALL | wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL, 2); >@@ -163,6 +184,8 @@ > grid_sizer_2->Add(sizer_3, 1, 0, 0); > grid_sizer_2->Add(label_6, 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL | wxALL, 2); > sizer_4->Add(text_ctrl_5, 0, wxALL, 2); >+ sizer_4->Add(label_ylabel, 0, wxALL | wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL, 2); >+ sizer_4->Add(text_ctrl_ylabel, 0, wxALL | wxALIGN_CENTER_VERTICAL, 2); > sizer_4->Add(label_7, 0, wxALL | wxALIGN_CENTER_VERTICAL | wxALL, 2); > sizer_4->Add(text_ctrl_6, 0, wxALL, 2); > sizer_4->Add(label_8, 0, wxALL | wxALIGN_CENTER_VERTICAL | wxALL, 2); >@@ -173,7 +196,10 @@ > grid_sizer_2->Add(label_10, 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL | wxALL, 2); > grid_sizer_2->Add(combo_box_1, 0, wxALL, 2); > grid_sizer_2->Add(label_11, 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL | wxALL, 2); >- grid_sizer_2->Add(combo_box_2, 0, wxALL, 2); >+ sizer_options->Add(combo_box_2, 0, wxALL, 2); >+ sizer_options->Add(label_zoom, 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL | wxALL, 2); >+ sizer_options->Add(text_ctrl_zoom, 0, wxALL,2); >+ grid_sizer_2->Add(sizer_options, 0, wxEXPAND, 0); > sizer_5->Add(text_ctrl_9, 0, wxALL | wxALIGN_CENTER_VERTICAL, 2); > sizer_5->Add(button_4, 0, wxALL, 2); > grid_sizer_2->Add(label_12, 0, wxALIGN_RIGHT | wxALIGN_CENTER_VERTICAL | wxALL, 2); >@@ -334,6 +360,45 @@ > } > text_ctrl_8->SetValue(curr); > } >+ else if (curr == wxT("legend")) >+ { >+ curr = wxEmptyString; >+ while (i < s.Length() && s.GetChar(i) != ',') >+ i++; >+ i++; >+ while (i < s.Length() && s.GetChar(i) != ']') >+ { >+ curr += s.GetChar(i); >+ i++; >+ } >+ text_ctrl_legend->SetValue(curr); >+ } >+ else if (curr == wxT("xlabel")) >+ { >+ curr = wxEmptyString; >+ while (i < s.Length() && s.GetChar(i) != '"') >+ i++; >+ i++; >+ while (i < s.Length() && s.GetChar(i) != '"') >+ { >+ curr += s.GetChar(i); >+ i++; >+ } >+ text_ctrl_xlabel->SetValue(curr); >+ } >+ else if (curr == wxT("ylabel")) >+ { >+ curr = wxEmptyString; >+ while (i < s.Length() && s.GetChar(i) != '"') >+ i++; >+ i++; >+ while (i < s.Length() && s.GetChar(i) != '"') >+ { >+ curr += s.GetChar(i); >+ i++; >+ } >+ text_ctrl_ylabel->SetValue(curr); >+ } > } > i++; > } >@@ -348,6 +413,10 @@ > wxString x2 = text_ctrl_4->GetValue(); > wxString y1 = text_ctrl_6->GetValue(); > wxString y2 = text_ctrl_7->GetValue(); >+ wxString legend = text_ctrl_legend->GetValue(); //legend >+ wxString xlabel = text_ctrl_xlabel->GetValue(); //xlabel >+ wxString ylabel = text_ctrl_ylabel->GetValue(); //ylabel >+ wxString zoom = text_ctrl_zoom->GetValue(); // zoom papersize > int t = text_ctrl_8->GetValue(); // Number of ticks > wxString file = text_ctrl_9->GetValue(); // plot to file > >@@ -368,10 +437,28 @@ > s += text_ctrl_5->GetValue(); > s += wxT(",") + y1 + wxT(",") + y2 + wxT("]"); > } >+ >+ if (legend.Length()>0) >+ { >+ s += wxT(", [legend,") + legend + wxT("]"); >+ } >+ if (xlabel.Length()>0) >+ { >+ s += wxT(", [xlabel,\"") + xlabel + wxT("\"]"); >+ } >+ if (ylabel.Length()>0) >+ { >+ s += wxT(", [ylabel,\"") + ylabel + wxT("\"]"); >+ } > if (f != _("default") && f != _("inline")) > s += wxT(",\n [plot_format, ") + f + wxT("]"); > if (p.Length() > 0) > s += wxT(",\n [gnuplot_preamble, \"") + p + wxT("\"]"); >+ else if (zoom.Length()>0){ >+ s += wxT(",\n [gnuplot_preamble, \"set size ") >+ + zoom + wxT(",") + zoom >+ + wxT("\"]"); >+ } > if (t != 10) > { > s += wxT(",\n [nticks,"); >@@ -384,16 +471,15 @@ > #if defined (__WXMSW__) > file.Replace(wxT("\\"), wxT("/")); > #endif >- > if (file.Right(4) != wxT(".eps") && file.Right(3) != wxT(".ps")) > file = file + wxT(".eps"); > s += wxT(",\n [gnuplot_out_file, \"") + file + wxT("\"]"); > } > else if (f == _("inline")) > s = wxT("wx") + s; >- > s += wxT(")$"); >- >+ if(zoom.Length()) >+ wxConfig::Get()->Write(wxT("Wiz/Plot2D/zoom"), zoom); > wxConfig::Get()->Write(wxT("Wiz/Plot2D/format"), combo_box_1->GetSelection()); > return s; > } >--- wxMaxima-0.7.2/src/Plot2dWiz.h.org 2007-11-04 01:42:27.000000000 -0400 >+++ wxMaxima-0.7.2/src/Plot2dWiz.h 2007-11-04 01:36:33.000000000 -0500 >@@ -69,6 +69,14 @@ > wxComboBox* combo_box_2; > wxStaticText* label_12; > BTextCtrl* text_ctrl_9; >+ wxStaticText* label_legend; >+ BTextCtrl* text_ctrl_legend; >+ wxStaticText* label_xlabel; >+ BTextCtrl* text_ctrl_xlabel; >+ wxStaticText* label_ylabel; >+ BTextCtrl* text_ctrl_ylabel; >+ wxStaticText* label_zoom; >+ BTextCtrl* text_ctrl_zoom; > wxBitmapButton* button_4; > wxStaticLine* static_line_1; > wxButton* button_1;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 365571
: 247481