29 #include "wxVectorPanel.hh"
30 #include <Gui/StringConv.hh>
34 # pragma warning (disable: 4005) //M_PI redefinition
47 wxVectorPanel::wxVectorPanel(
wxWindow* parent, wxWindowID
id,
bool editable)
56 if (vector.
Size() != controls_.size())
60 wxSizer* sizer =
new wxFlexGridSizer(vector.
Size(), 1, 0, 0);
63 for (
int i = 0; i < (int)vector.
Size(); i++)
65 wxTextCtrl* control =
new wxTextCtrl(
this, GetId(), _T(
""),
66 wxDefaultPosition, wxDefaultSize,
68 control->SetEditable(editable_);
70 controls_.push_back(control);
75 for (
int i = 0; i < (int)vector.
Size(); i++)
84 controls_[i]->SetValue(
AsciiToWx(str.str()));
91 for (
int i = 0; i < (int)controls_.size(); i++)
93 stringstream str(WxToAscii(controls_[i]->GetValue()));
wxString AsciiToWx(const char *thestring)
Converts a C string to a wxString.
unsigned int Size() const
length of the vector
BIAS::Vector< double > GetVector() const
void SetVector(const BIAS::Vector< double > &vector)