term farben und combobox

This commit is contained in:
Rene Hopf
2015-07-02 19:31:10 +02:00
parent f03c3eb758
commit af27a93890
3 changed files with 16 additions and 6 deletions
+10 -1
View File
@@ -1,7 +1,16 @@
#include "basicdrawpane.hpp"
#include <wx/graphics.h>
const wxPen BasicDrawPane::pen[] = {*wxBLACK_PEN, *wxRED_PEN, *wxBLUE_PEN, *wxGREEN_PEN, *wxCYAN_PEN, *wxYELLOW_PEN, *wxGREY_PEN, *wxWHITE_PEN};
const wxPen BasicDrawPane::pen[] = {
*wxBLACK_PEN,
*wxRED_PEN,
*wxBLUE_PEN,
*wxGREEN_PEN,
wxPen(wxColour(255, 128, 0)),
wxPen(wxColour(128, 128, 64)),
wxPen(wxColour(128, 64, 128)),
wxPen(wxColour(64, 128, 128))
};
BasicDrawPane::BasicDrawPane(wxFrame* parent, int ch) : wxPanel(parent){
time = wxGetUTCTimeMillis();
+5 -4
View File
@@ -51,7 +51,7 @@ ServoFrame::ServoFrame(const wxString& title) : wxFrame(NULL, wxID_ANY, title){
topsizer->Add(drawpanel, 1,wxEXPAND,0);
wxArrayString waves;
waves.push_back("-");
waves.push_back("0");
waves.push_back("net0.cmd");
waves.push_back("net0.fb");
waves.push_back("pid0.pwm_cmd");
@@ -62,8 +62,9 @@ ServoFrame::ServoFrame(const wxString& title) : wxFrame(NULL, wxID_ANY, title){
channelstartID = currentID-1;//next ID
for(int i = 0;i<drawpanel->channels;i++){
wxBoxSizer *channelsizer = new wxBoxSizer(wxVERTICAL);
channelchoice.push_back(new wxChoice (top, ++currentID));
channelchoice.back()->Bind(wxEVT_CHOICE,&ServoFrame::OnChannelChange, this, currentID);
channelchoice.push_back(new wxComboBox (top, ++currentID, _T(""), wxDefaultPosition, wxDefaultSize, 0, NULL, wxTE_PROCESS_ENTER));
channelchoice.back()->Bind(wxEVT_COMBOBOX,&ServoFrame::OnChannelChange, this, currentID);
channelchoice.back()->Bind(wxEVT_TEXT_ENTER,&ServoFrame::OnChannelChange, this, currentID);
channelchoice.back()->Set(waves);
channelchoice.back()->SetSelection(0);
cout << channelchoice.back()->GetId() << endl;
@@ -144,7 +145,7 @@ void ServoFrame::OnChannelChange(wxCommandEvent& event){
wxString value;
switch (param) {
case 0://wave
value = event.GetSelection()==0?"0":event.GetString();
value = event.GetString();
break;
case 1://offset
case 2://gain
+1 -1
View File
@@ -33,7 +33,7 @@ private:
struct sp_port **ports;
struct sp_port *port;
wxChoice *choose_port;
std::vector<wxChoice *> channelchoice;
std::vector<wxComboBox *> channelchoice;
std::vector<wxSlider *> channelpos;
std::vector<wxSlider *> channelgain;
bool connected;