andrewm@46: /* andrewm@46: ============================================================================== andrewm@46: andrewm@46: This is an automatically generated GUI class created by the Introjucer! andrewm@46: andrewm@46: Be careful when adding custom code to these files, as only the code within andrewm@46: the "//[xyz]" and "//[/xyz]" sections will be retained when the file is loaded andrewm@46: and re-saved. andrewm@46: andrewm@46: Created with Introjucer version: 3.1.0 andrewm@46: andrewm@46: ------------------------------------------------------------------------------ andrewm@46: andrewm@46: The Introjucer is part of the JUCE library - "Jules' Utility Class Extensions" andrewm@46: Copyright 2004-13 by Raw Material Software Ltd. andrewm@46: andrewm@46: ============================================================================== andrewm@46: */ andrewm@46: andrewm@46: //[Headers] You can add your own extra header files here... andrewm@50: #ifndef TOUCHKEYS_NO_GUI andrewm@46: //[/Headers] andrewm@46: andrewm@46: #include "TouchkeyReleaseAngleMappingExtendedEditor.h" andrewm@46: andrewm@46: andrewm@46: //[MiscUserDefs] You can add your own user definitions and misc code here... andrewm@46: //[/MiscUserDefs] andrewm@46: andrewm@46: //============================================================================== andrewm@46: TouchkeyReleaseAngleMappingExtendedEditor::TouchkeyReleaseAngleMappingExtendedEditor (TouchkeyReleaseAngleMappingFactory& factory) andrewm@46: : factory_(factory) andrewm@46: { andrewm@46: addAndMakeVisible (titleLabel = new Label ("title label", andrewm@46: TRANS("Release Angle Mapping (Zone N, #M)"))); andrewm@46: titleLabel->setFont (Font (15.00f, Font::bold)); andrewm@46: titleLabel->setJustificationType (Justification::centredLeft); andrewm@46: titleLabel->setEditable (false, false, false); andrewm@46: titleLabel->setColour (TextEditor::textColourId, Colours::black); andrewm@46: titleLabel->setColour (TextEditor::backgroundColourId, Colour (0x00000000)); andrewm@46: andrewm@46: addAndMakeVisible (presetLabel = new Label ("preset label", andrewm@46: TRANS("Preset:"))); andrewm@46: presetLabel->setFont (Font (15.00f, Font::plain)); andrewm@46: presetLabel->setJustificationType (Justification::centredLeft); andrewm@46: presetLabel->setEditable (false, false, false); andrewm@46: presetLabel->setColour (TextEditor::textColourId, Colours::black); andrewm@46: presetLabel->setColour (TextEditor::backgroundColourId, Colour (0x00000000)); andrewm@46: andrewm@46: addAndMakeVisible (presetComboBox = new ComboBox ("parameter combo box")); andrewm@46: presetComboBox->setEditableText (false); andrewm@46: presetComboBox->setJustificationType (Justification::centredLeft); andrewm@46: presetComboBox->setTextWhenNothingSelected (String::empty); andrewm@46: presetComboBox->setTextWhenNoChoicesAvailable (TRANS("(no choices)")); andrewm@46: presetComboBox->addListener (this); andrewm@46: andrewm@46: addAndMakeVisible (presetLabel2 = new Label ("preset label", andrewm@46: TRANS("Window Length:"))); andrewm@46: presetLabel2->setFont (Font (15.00f, Font::plain)); andrewm@46: presetLabel2->setJustificationType (Justification::centredLeft); andrewm@46: presetLabel2->setEditable (false, false, false); andrewm@46: presetLabel2->setColour (TextEditor::textColourId, Colours::black); andrewm@46: presetLabel2->setColour (TextEditor::backgroundColourId, Colour (0x00000000)); andrewm@46: andrewm@46: addAndMakeVisible (windowLengthEditor = new TextEditor ("range low text editor")); andrewm@46: windowLengthEditor->setMultiLine (false); andrewm@46: windowLengthEditor->setReturnKeyStartsNewLine (false); andrewm@46: windowLengthEditor->setReadOnly (false); andrewm@46: windowLengthEditor->setScrollbarsShown (true); andrewm@46: windowLengthEditor->setCaretVisible (true); andrewm@46: windowLengthEditor->setPopupMenuEnabled (true); andrewm@46: windowLengthEditor->setText (String::empty); andrewm@46: andrewm@46: addAndMakeVisible (presetLabel3 = new Label ("preset label", andrewm@46: TRANS("ms. before release"))); andrewm@46: presetLabel3->setFont (Font (15.00f, Font::plain)); andrewm@46: presetLabel3->setJustificationType (Justification::centredLeft); andrewm@46: presetLabel3->setEditable (false, false, false); andrewm@46: presetLabel3->setColour (TextEditor::textColourId, Colours::black); andrewm@46: presetLabel3->setColour (TextEditor::backgroundColourId, Colour (0x00000000)); andrewm@46: andrewm@46: addAndMakeVisible (presetLabel4 = new Label ("preset label", andrewm@46: TRANS("Release Moving Up"))); andrewm@46: presetLabel4->setFont (Font (15.00f, Font::bold)); andrewm@46: presetLabel4->setJustificationType (Justification::centredLeft); andrewm@46: presetLabel4->setEditable (false, false, false); andrewm@46: presetLabel4->setColour (TextEditor::textColourId, Colours::black); andrewm@46: presetLabel4->setColour (TextEditor::backgroundColourId, Colour (0x00000000)); andrewm@46: andrewm@46: addAndMakeVisible (upMinSpeedEditor = new TextEditor ("up release speed editor")); andrewm@46: upMinSpeedEditor->setMultiLine (false); andrewm@46: upMinSpeedEditor->setReturnKeyStartsNewLine (false); andrewm@46: upMinSpeedEditor->setReadOnly (false); andrewm@46: upMinSpeedEditor->setScrollbarsShown (true); andrewm@46: upMinSpeedEditor->setCaretVisible (true); andrewm@46: upMinSpeedEditor->setPopupMenuEnabled (true); andrewm@46: upMinSpeedEditor->setText (String::empty); andrewm@46: andrewm@46: addAndMakeVisible (presetLabel5 = new Label ("preset label", andrewm@46: TRANS("Min. release speed:"))); andrewm@46: presetLabel5->setFont (Font (15.00f, Font::plain)); andrewm@46: presetLabel5->setJustificationType (Justification::centredRight); andrewm@46: presetLabel5->setEditable (false, false, false); andrewm@46: presetLabel5->setColour (TextEditor::textColourId, Colours::black); andrewm@46: presetLabel5->setColour (TextEditor::backgroundColourId, Colour (0x00000000)); andrewm@46: andrewm@46: addAndMakeVisible (upNote1Editor = new TextEditor ("up note 1 editor")); andrewm@46: upNote1Editor->setMultiLine (false); andrewm@46: upNote1Editor->setReturnKeyStartsNewLine (false); andrewm@46: upNote1Editor->setReadOnly (false); andrewm@46: upNote1Editor->setScrollbarsShown (true); andrewm@46: upNote1Editor->setCaretVisible (true); andrewm@46: upNote1Editor->setPopupMenuEnabled (true); andrewm@46: upNote1Editor->setText (String::empty); andrewm@46: andrewm@46: addAndMakeVisible (presetLabel6 = new Label ("preset label", andrewm@46: TRANS("Send notes:"))); andrewm@46: presetLabel6->setFont (Font (15.00f, Font::plain)); andrewm@46: presetLabel6->setJustificationType (Justification::centredRight); andrewm@46: presetLabel6->setEditable (false, false, false); andrewm@46: presetLabel6->setColour (TextEditor::textColourId, Colours::black); andrewm@46: presetLabel6->setColour (TextEditor::backgroundColourId, Colour (0x00000000)); andrewm@46: andrewm@46: addAndMakeVisible (upNote2Editor = new TextEditor ("up note 2 editor")); andrewm@46: upNote2Editor->setMultiLine (false); andrewm@46: upNote2Editor->setReturnKeyStartsNewLine (false); andrewm@46: upNote2Editor->setReadOnly (false); andrewm@46: upNote2Editor->setScrollbarsShown (true); andrewm@46: upNote2Editor->setCaretVisible (true); andrewm@46: upNote2Editor->setPopupMenuEnabled (true); andrewm@46: upNote2Editor->setText (String::empty); andrewm@46: andrewm@46: addAndMakeVisible (upNote3Editor = new TextEditor ("up note 3 editor")); andrewm@46: upNote3Editor->setMultiLine (false); andrewm@46: upNote3Editor->setReturnKeyStartsNewLine (false); andrewm@46: upNote3Editor->setReadOnly (false); andrewm@46: upNote3Editor->setScrollbarsShown (true); andrewm@46: upNote3Editor->setCaretVisible (true); andrewm@46: upNote3Editor->setPopupMenuEnabled (true); andrewm@46: upNote3Editor->setText (String::empty); andrewm@46: andrewm@46: addAndMakeVisible (presetLabel7 = new Label ("preset label", andrewm@46: TRANS("With velocities:"))); andrewm@46: presetLabel7->setFont (Font (15.00f, Font::plain)); andrewm@46: presetLabel7->setJustificationType (Justification::centredRight); andrewm@46: presetLabel7->setEditable (false, false, false); andrewm@46: presetLabel7->setColour (TextEditor::textColourId, Colours::black); andrewm@46: presetLabel7->setColour (TextEditor::backgroundColourId, Colour (0x00000000)); andrewm@46: andrewm@46: addAndMakeVisible (upVelocity1Editor = new TextEditor ("up velocity 1 editor")); andrewm@46: upVelocity1Editor->setMultiLine (false); andrewm@46: upVelocity1Editor->setReturnKeyStartsNewLine (false); andrewm@46: upVelocity1Editor->setReadOnly (false); andrewm@46: upVelocity1Editor->setScrollbarsShown (true); andrewm@46: upVelocity1Editor->setCaretVisible (true); andrewm@46: upVelocity1Editor->setPopupMenuEnabled (true); andrewm@46: upVelocity1Editor->setText (String::empty); andrewm@46: andrewm@46: addAndMakeVisible (upVelocity2Editor = new TextEditor ("up velocity 2 editor")); andrewm@46: upVelocity2Editor->setMultiLine (false); andrewm@46: upVelocity2Editor->setReturnKeyStartsNewLine (false); andrewm@46: upVelocity2Editor->setReadOnly (false); andrewm@46: upVelocity2Editor->setScrollbarsShown (true); andrewm@46: upVelocity2Editor->setCaretVisible (true); andrewm@46: upVelocity2Editor->setPopupMenuEnabled (true); andrewm@46: upVelocity2Editor->setText (String::empty); andrewm@46: andrewm@46: addAndMakeVisible (upVelocity3Editor = new TextEditor ("up velocity 3 editor")); andrewm@46: upVelocity3Editor->setMultiLine (false); andrewm@46: upVelocity3Editor->setReturnKeyStartsNewLine (false); andrewm@46: upVelocity3Editor->setReadOnly (false); andrewm@46: upVelocity3Editor->setScrollbarsShown (true); andrewm@46: upVelocity3Editor->setCaretVisible (true); andrewm@46: upVelocity3Editor->setPopupMenuEnabled (true); andrewm@46: upVelocity3Editor->setText (String::empty); andrewm@46: andrewm@46: addAndMakeVisible (presetLabel8 = new Label ("preset label", andrewm@46: TRANS("Release Moving Down"))); andrewm@46: presetLabel8->setFont (Font (15.00f, Font::bold)); andrewm@46: presetLabel8->setJustificationType (Justification::centredLeft); andrewm@46: presetLabel8->setEditable (false, false, false); andrewm@46: presetLabel8->setColour (TextEditor::textColourId, Colours::black); andrewm@46: presetLabel8->setColour (TextEditor::backgroundColourId, Colour (0x00000000)); andrewm@46: andrewm@46: addAndMakeVisible (downMinSpeedEditor = new TextEditor ("down release speed editor")); andrewm@46: downMinSpeedEditor->setMultiLine (false); andrewm@46: downMinSpeedEditor->setReturnKeyStartsNewLine (false); andrewm@46: downMinSpeedEditor->setReadOnly (false); andrewm@46: downMinSpeedEditor->setScrollbarsShown (true); andrewm@46: downMinSpeedEditor->setCaretVisible (true); andrewm@46: downMinSpeedEditor->setPopupMenuEnabled (true); andrewm@46: downMinSpeedEditor->setText (String::empty); andrewm@46: andrewm@46: addAndMakeVisible (presetLabel9 = new Label ("preset label", andrewm@46: TRANS("Min. release speed:"))); andrewm@46: presetLabel9->setFont (Font (15.00f, Font::plain)); andrewm@46: presetLabel9->setJustificationType (Justification::centredRight); andrewm@46: presetLabel9->setEditable (false, false, false); andrewm@46: presetLabel9->setColour (TextEditor::textColourId, Colours::black); andrewm@46: presetLabel9->setColour (TextEditor::backgroundColourId, Colour (0x00000000)); andrewm@46: andrewm@46: addAndMakeVisible (downNote1Editor = new TextEditor ("down note 1 editor")); andrewm@46: downNote1Editor->setMultiLine (false); andrewm@46: downNote1Editor->setReturnKeyStartsNewLine (false); andrewm@46: downNote1Editor->setReadOnly (false); andrewm@46: downNote1Editor->setScrollbarsShown (true); andrewm@46: downNote1Editor->setCaretVisible (true); andrewm@46: downNote1Editor->setPopupMenuEnabled (true); andrewm@46: downNote1Editor->setText (String::empty); andrewm@46: andrewm@46: addAndMakeVisible (presetLabel10 = new Label ("preset label", andrewm@46: TRANS("Send notes:"))); andrewm@46: presetLabel10->setFont (Font (15.00f, Font::plain)); andrewm@46: presetLabel10->setJustificationType (Justification::centredRight); andrewm@46: presetLabel10->setEditable (false, false, false); andrewm@46: presetLabel10->setColour (TextEditor::textColourId, Colours::black); andrewm@46: presetLabel10->setColour (TextEditor::backgroundColourId, Colour (0x00000000)); andrewm@46: andrewm@46: addAndMakeVisible (downNote2Editor = new TextEditor ("down note 2 editor")); andrewm@46: downNote2Editor->setMultiLine (false); andrewm@46: downNote2Editor->setReturnKeyStartsNewLine (false); andrewm@46: downNote2Editor->setReadOnly (false); andrewm@46: downNote2Editor->setScrollbarsShown (true); andrewm@46: downNote2Editor->setCaretVisible (true); andrewm@46: downNote2Editor->setPopupMenuEnabled (true); andrewm@46: downNote2Editor->setText (String::empty); andrewm@46: andrewm@46: addAndMakeVisible (downNote3Editor = new TextEditor ("down note 3 editor")); andrewm@46: downNote3Editor->setMultiLine (false); andrewm@46: downNote3Editor->setReturnKeyStartsNewLine (false); andrewm@46: downNote3Editor->setReadOnly (false); andrewm@46: downNote3Editor->setScrollbarsShown (true); andrewm@46: downNote3Editor->setCaretVisible (true); andrewm@46: downNote3Editor->setPopupMenuEnabled (true); andrewm@46: downNote3Editor->setText (String::empty); andrewm@46: andrewm@46: addAndMakeVisible (presetLabel11 = new Label ("preset label", andrewm@46: TRANS("With velocities:"))); andrewm@46: presetLabel11->setFont (Font (15.00f, Font::plain)); andrewm@46: presetLabel11->setJustificationType (Justification::centredRight); andrewm@46: presetLabel11->setEditable (false, false, false); andrewm@46: presetLabel11->setColour (TextEditor::textColourId, Colours::black); andrewm@46: presetLabel11->setColour (TextEditor::backgroundColourId, Colour (0x00000000)); andrewm@46: andrewm@46: addAndMakeVisible (downVelocity1Editor = new TextEditor ("down velocity 1 editor")); andrewm@46: downVelocity1Editor->setMultiLine (false); andrewm@46: downVelocity1Editor->setReturnKeyStartsNewLine (false); andrewm@46: downVelocity1Editor->setReadOnly (false); andrewm@46: downVelocity1Editor->setScrollbarsShown (true); andrewm@46: downVelocity1Editor->setCaretVisible (true); andrewm@46: downVelocity1Editor->setPopupMenuEnabled (true); andrewm@46: downVelocity1Editor->setText (String::empty); andrewm@46: andrewm@46: addAndMakeVisible (downVelocity2Editor = new TextEditor ("down velocity 2 editor")); andrewm@46: downVelocity2Editor->setMultiLine (false); andrewm@46: downVelocity2Editor->setReturnKeyStartsNewLine (false); andrewm@46: downVelocity2Editor->setReadOnly (false); andrewm@46: downVelocity2Editor->setScrollbarsShown (true); andrewm@46: downVelocity2Editor->setCaretVisible (true); andrewm@46: downVelocity2Editor->setPopupMenuEnabled (true); andrewm@46: downVelocity2Editor->setText (String::empty); andrewm@46: andrewm@46: addAndMakeVisible (downVelocity3Editor = new TextEditor ("down velocity 3 editor")); andrewm@46: downVelocity3Editor->setMultiLine (false); andrewm@46: downVelocity3Editor->setReturnKeyStartsNewLine (false); andrewm@46: downVelocity3Editor->setReadOnly (false); andrewm@46: downVelocity3Editor->setScrollbarsShown (true); andrewm@46: downVelocity3Editor->setCaretVisible (true); andrewm@46: downVelocity3Editor->setPopupMenuEnabled (true); andrewm@46: downVelocity3Editor->setText (String::empty); andrewm@46: andrewm@46: addAndMakeVisible (upEnableButton = new ToggleButton ("up enable button")); andrewm@46: upEnableButton->setButtonText (TRANS("Enable")); andrewm@46: upEnableButton->addListener (this); andrewm@46: andrewm@46: addAndMakeVisible (downEnableButton = new ToggleButton ("down enable button")); andrewm@46: downEnableButton->setButtonText (TRANS("Enable")); andrewm@46: downEnableButton->addListener (this); andrewm@46: andrewm@46: andrewm@46: //[UserPreSize] andrewm@46: for(int i = 0; i < factory_.getNumConfigurations(); i++) { andrewm@46: presetComboBox->addItem(factory_.getConfigurationName(i).c_str(), i+1); andrewm@46: } andrewm@46: andrewm@46: windowLengthEditor->addListener(this); andrewm@46: upMinSpeedEditor->addListener(this); andrewm@46: downMinSpeedEditor->addListener(this); andrewm@46: upNote1Editor->addListener(this); andrewm@46: upNote2Editor->addListener(this); andrewm@46: upNote3Editor->addListener(this); andrewm@46: upVelocity1Editor->addListener(this); andrewm@46: upVelocity2Editor->addListener(this); andrewm@46: upVelocity3Editor->addListener(this); andrewm@46: downNote1Editor->addListener(this); andrewm@46: downNote2Editor->addListener(this); andrewm@46: downNote3Editor->addListener(this); andrewm@46: downVelocity1Editor->addListener(this); andrewm@46: downVelocity2Editor->addListener(this); andrewm@46: downVelocity3Editor->addListener(this); andrewm@46: //[/UserPreSize] andrewm@46: andrewm@46: setSize (342, 328); andrewm@46: andrewm@46: andrewm@46: //[Constructor] You can add your own custom stuff here.. andrewm@46: //[/Constructor] andrewm@46: } andrewm@46: andrewm@46: TouchkeyReleaseAngleMappingExtendedEditor::~TouchkeyReleaseAngleMappingExtendedEditor() andrewm@46: { andrewm@46: //[Destructor_pre]. You can add your own custom destruction code here.. andrewm@46: //[/Destructor_pre] andrewm@46: andrewm@46: titleLabel = nullptr; andrewm@46: presetLabel = nullptr; andrewm@46: presetComboBox = nullptr; andrewm@46: presetLabel2 = nullptr; andrewm@46: windowLengthEditor = nullptr; andrewm@46: presetLabel3 = nullptr; andrewm@46: presetLabel4 = nullptr; andrewm@46: upMinSpeedEditor = nullptr; andrewm@46: presetLabel5 = nullptr; andrewm@46: upNote1Editor = nullptr; andrewm@46: presetLabel6 = nullptr; andrewm@46: upNote2Editor = nullptr; andrewm@46: upNote3Editor = nullptr; andrewm@46: presetLabel7 = nullptr; andrewm@46: upVelocity1Editor = nullptr; andrewm@46: upVelocity2Editor = nullptr; andrewm@46: upVelocity3Editor = nullptr; andrewm@46: presetLabel8 = nullptr; andrewm@46: downMinSpeedEditor = nullptr; andrewm@46: presetLabel9 = nullptr; andrewm@46: downNote1Editor = nullptr; andrewm@46: presetLabel10 = nullptr; andrewm@46: downNote2Editor = nullptr; andrewm@46: downNote3Editor = nullptr; andrewm@46: presetLabel11 = nullptr; andrewm@46: downVelocity1Editor = nullptr; andrewm@46: downVelocity2Editor = nullptr; andrewm@46: downVelocity3Editor = nullptr; andrewm@46: upEnableButton = nullptr; andrewm@46: downEnableButton = nullptr; andrewm@46: andrewm@46: andrewm@46: //[Destructor]. You can add your own custom destruction code here.. andrewm@46: //[/Destructor] andrewm@46: } andrewm@46: andrewm@46: //============================================================================== andrewm@46: void TouchkeyReleaseAngleMappingExtendedEditor::paint (Graphics& g) andrewm@46: { andrewm@46: //[UserPrePaint] Add your own custom painting code here.. andrewm@46: //[/UserPrePaint] andrewm@46: andrewm@46: g.fillAll (Colour (0xffd2d2d2)); andrewm@46: andrewm@46: //[UserPaint] Add your own custom painting code here.. andrewm@46: //[/UserPaint] andrewm@46: } andrewm@46: andrewm@46: void TouchkeyReleaseAngleMappingExtendedEditor::resized() andrewm@46: { andrewm@46: titleLabel->setBounds (8, 8, 424, 24); andrewm@46: presetLabel->setBounds (8, 40, 56, 24); andrewm@46: presetComboBox->setBounds (64, 40, 264, 24); andrewm@46: presetLabel2->setBounds (8, 80, 112, 24); andrewm@46: windowLengthEditor->setBounds (120, 80, 56, 24); andrewm@46: presetLabel3->setBounds (176, 80, 136, 24); andrewm@46: presetLabel4->setBounds (8, 112, 136, 24); andrewm@46: upMinSpeedEditor->setBounds (144, 136, 56, 24); andrewm@46: presetLabel5->setBounds (8, 136, 136, 24); andrewm@46: upNote1Editor->setBounds (144, 160, 56, 24); andrewm@46: presetLabel6->setBounds (8, 160, 136, 24); andrewm@46: upNote2Editor->setBounds (208, 160, 56, 24); andrewm@46: upNote3Editor->setBounds (272, 160, 56, 24); andrewm@46: presetLabel7->setBounds (8, 184, 136, 24); andrewm@46: upVelocity1Editor->setBounds (144, 184, 56, 24); andrewm@46: upVelocity2Editor->setBounds (208, 184, 56, 24); andrewm@46: upVelocity3Editor->setBounds (272, 184, 56, 24); andrewm@46: presetLabel8->setBounds (8, 216, 160, 24); andrewm@46: downMinSpeedEditor->setBounds (144, 240, 56, 24); andrewm@46: presetLabel9->setBounds (8, 240, 136, 24); andrewm@46: downNote1Editor->setBounds (144, 264, 56, 24); andrewm@46: presetLabel10->setBounds (8, 264, 136, 24); andrewm@46: downNote2Editor->setBounds (208, 264, 56, 24); andrewm@46: downNote3Editor->setBounds (272, 264, 56, 24); andrewm@46: presetLabel11->setBounds (8, 288, 136, 24); andrewm@46: downVelocity1Editor->setBounds (144, 288, 56, 24); andrewm@46: downVelocity2Editor->setBounds (208, 288, 56, 24); andrewm@46: downVelocity3Editor->setBounds (272, 288, 56, 24); andrewm@46: upEnableButton->setBounds (208, 112, 72, 24); andrewm@46: downEnableButton->setBounds (208, 216, 72, 24); andrewm@46: //[UserResized] Add your own custom resize handling here.. andrewm@46: //[/UserResized] andrewm@46: } andrewm@46: andrewm@46: void TouchkeyReleaseAngleMappingExtendedEditor::comboBoxChanged (ComboBox* comboBoxThatHasChanged) andrewm@46: { andrewm@46: //[UsercomboBoxChanged_Pre] andrewm@46: //[/UsercomboBoxChanged_Pre] andrewm@46: andrewm@46: if (comboBoxThatHasChanged == presetComboBox) andrewm@46: { andrewm@46: //[UserComboBoxCode_presetComboBox] -- add your combo box handling code here.. andrewm@46: int index = presetComboBox->getSelectedItemIndex(); andrewm@46: factory_.setCurrentConfiguration(index); andrewm@46: //[/UserComboBoxCode_presetComboBox] andrewm@46: } andrewm@46: andrewm@46: //[UsercomboBoxChanged_Post] andrewm@46: //[/UsercomboBoxChanged_Post] andrewm@46: } andrewm@46: andrewm@46: void TouchkeyReleaseAngleMappingExtendedEditor::buttonClicked (Button* buttonThatWasClicked) andrewm@46: { andrewm@46: //[UserbuttonClicked_Pre] andrewm@46: //[/UserbuttonClicked_Pre] andrewm@46: andrewm@46: if (buttonThatWasClicked == upEnableButton) andrewm@46: { andrewm@46: //[UserButtonCode_upEnableButton] -- add your button handler code here.. andrewm@46: factory_.setUpMessagesEnabled(upEnableButton->getToggleState()); andrewm@46: //[/UserButtonCode_upEnableButton] andrewm@46: } andrewm@46: else if (buttonThatWasClicked == downEnableButton) andrewm@46: { andrewm@46: //[UserButtonCode_downEnableButton] -- add your button handler code here.. andrewm@46: factory_.setDownMessagesEnabled(downEnableButton->getToggleState()); andrewm@46: //[/UserButtonCode_downEnableButton] andrewm@46: } andrewm@46: andrewm@46: //[UserbuttonClicked_Post] andrewm@46: //[/UserbuttonClicked_Post] andrewm@46: } andrewm@46: andrewm@46: andrewm@46: andrewm@46: //[MiscUserCode] You can add your own definitions of your custom methods or any other code here... andrewm@46: andrewm@46: void TouchkeyReleaseAngleMappingExtendedEditor::textEditorReturnKeyPressed(TextEditor &editor) andrewm@46: { andrewm@46: if(&editor == windowLengthEditor) { andrewm@46: float windowLength = atof(windowLengthEditor->getText().toUTF8()); andrewm@46: factory_.setWindowSize(windowLength); andrewm@46: } andrewm@46: else if(&editor == upMinSpeedEditor) { andrewm@46: float speed = atof(upMinSpeedEditor->getText().toUTF8()); andrewm@46: factory_.setUpMinimumAngle(speed); andrewm@46: } andrewm@46: else if(&editor == downMinSpeedEditor) { andrewm@46: float speed = atof(downMinSpeedEditor->getText().toUTF8()); andrewm@46: factory_.setDownMinimumAngle(speed); andrewm@46: } andrewm@46: else { andrewm@46: // All the other editors are int values andrewm@46: int value = atoi(editor.getText().toUTF8()); andrewm@46: andrewm@46: if(&editor == upNote1Editor) andrewm@46: factory_.setUpNote(0, value); andrewm@46: else if(&editor == upNote2Editor) andrewm@46: factory_.setUpNote(1, value); andrewm@46: else if(&editor == upNote3Editor) andrewm@46: factory_.setUpNote(2, value); andrewm@46: else if(&editor == upVelocity1Editor) andrewm@46: factory_.setUpVelocity(0, value); andrewm@46: else if(&editor == upVelocity2Editor) andrewm@46: factory_.setUpVelocity(1, value); andrewm@46: else if(&editor == upVelocity3Editor) andrewm@46: factory_.setUpVelocity(2, value); andrewm@46: else if(&editor == downNote1Editor) andrewm@46: factory_.setDownNote(0, value); andrewm@46: else if(&editor == downNote2Editor) andrewm@46: factory_.setDownNote(1, value); andrewm@46: else if(&editor == downNote3Editor) andrewm@46: factory_.setDownNote(2, value); andrewm@46: else if(&editor == downVelocity1Editor) andrewm@46: factory_.setDownVelocity(0, value); andrewm@46: else if(&editor == downVelocity2Editor) andrewm@46: factory_.setDownVelocity(1, value); andrewm@46: else if(&editor == downVelocity3Editor) andrewm@46: factory_.setDownVelocity(2, value); andrewm@46: } andrewm@46: } andrewm@46: andrewm@46: void TouchkeyReleaseAngleMappingExtendedEditor::textEditorEscapeKeyPressed(TextEditor &editor) andrewm@46: { andrewm@46: andrewm@46: } andrewm@46: andrewm@46: void TouchkeyReleaseAngleMappingExtendedEditor::textEditorFocusLost(TextEditor &editor) andrewm@46: { andrewm@46: textEditorReturnKeyPressed(editor); andrewm@46: } andrewm@46: andrewm@46: void TouchkeyReleaseAngleMappingExtendedEditor::synchronize() andrewm@46: { andrewm@46: // Set the title label andrewm@46: titleLabel->setText(getDescriptionHelper("Release Angle Mapping"), dontSendNotification); andrewm@46: andrewm@46: // Update the editors to reflect the current status andrewm@46: if(!windowLengthEditor->hasKeyboardFocus(true)) { andrewm@46: float value = factory_.getWindowSize(); andrewm@46: char st[16]; andrewm@46: #ifdef _MSC_VER andrewm@46: _snprintf_s(st, 16, _TRUNCATE, "%.0f", value); andrewm@46: #else andrewm@46: snprintf(st, 16, "%.0f", value); andrewm@46: #endif andrewm@46: windowLengthEditor->setText(st); andrewm@46: } andrewm@46: andrewm@46: if(!upMinSpeedEditor->hasKeyboardFocus(true)) { andrewm@46: float value = factory_.getUpMinimumAngle(); andrewm@46: char st[16]; andrewm@46: #ifdef _MSC_VER andrewm@46: _snprintf_s(st, 16, _TRUNCATE, "%.2f", value); andrewm@46: #else andrewm@46: snprintf(st, 16, "%.2f", value); andrewm@46: #endif andrewm@46: andrewm@46: upMinSpeedEditor->setText(st); andrewm@46: } andrewm@46: andrewm@46: if(!downMinSpeedEditor->hasKeyboardFocus(true)) { andrewm@46: float value = factory_.getDownMinimumAngle(); andrewm@46: char st[16]; andrewm@46: #ifdef _MSC_VER andrewm@46: _snprintf_s(st, 16, _TRUNCATE, "%.2f", value); andrewm@46: #else andrewm@46: snprintf(st, 16, "%.2f", value); andrewm@46: #endif andrewm@46: andrewm@46: downMinSpeedEditor->setText(st); andrewm@46: } andrewm@46: andrewm@46: char st[16]; andrewm@46: andrewm@46: if(!upNote1Editor->hasKeyboardFocus(true)) { andrewm@46: intToString(st, factory_.getUpNote(0)); andrewm@46: upNote1Editor->setText(st); andrewm@46: } andrewm@46: if(!upNote2Editor->hasKeyboardFocus(true)) { andrewm@46: intToString(st, factory_.getUpNote(1)); andrewm@46: upNote2Editor->setText(st); andrewm@46: } andrewm@46: if(!upNote3Editor->hasKeyboardFocus(true)) { andrewm@46: intToString(st, factory_.getUpNote(2)); andrewm@46: upNote3Editor->setText(st); andrewm@46: } andrewm@46: if(!upVelocity1Editor->hasKeyboardFocus(true)) { andrewm@46: intToString(st, factory_.getUpVelocity(0)); andrewm@46: upVelocity1Editor->setText(st); andrewm@46: } andrewm@46: if(!upVelocity2Editor->hasKeyboardFocus(true)) { andrewm@46: intToString(st, factory_.getUpVelocity(1)); andrewm@46: upVelocity2Editor->setText(st); andrewm@46: } andrewm@46: if(!upVelocity3Editor->hasKeyboardFocus(true)) { andrewm@46: intToString(st, factory_.getUpVelocity(2)); andrewm@46: upVelocity3Editor->setText(st); andrewm@46: } andrewm@46: if(!downNote1Editor->hasKeyboardFocus(true)) { andrewm@46: intToString(st, factory_.getDownNote(0)); andrewm@46: downNote1Editor->setText(st); andrewm@46: } andrewm@46: if(!downNote2Editor->hasKeyboardFocus(true)) { andrewm@46: intToString(st, factory_.getDownNote(1)); andrewm@46: downNote2Editor->setText(st); andrewm@46: } andrewm@46: if(!downNote3Editor->hasKeyboardFocus(true)) { andrewm@46: intToString(st, factory_.getDownNote(2)); andrewm@46: downNote3Editor->setText(st); andrewm@46: } andrewm@46: if(!downVelocity1Editor->hasKeyboardFocus(true)) { andrewm@46: intToString(st, factory_.getDownVelocity(0)); andrewm@46: downVelocity1Editor->setText(st); andrewm@46: } andrewm@46: if(!downVelocity2Editor->hasKeyboardFocus(true)) { andrewm@46: intToString(st, factory_.getDownVelocity(1)); andrewm@46: downVelocity2Editor->setText(st); andrewm@46: } andrewm@46: if(!downVelocity3Editor->hasKeyboardFocus(true)) { andrewm@46: intToString(st, factory_.getDownVelocity(2)); andrewm@46: downVelocity3Editor->setText(st); andrewm@46: } andrewm@46: andrewm@46: upEnableButton->setToggleState(factory_.getUpMessagesEnabled(), dontSendNotification); andrewm@46: downEnableButton->setToggleState(factory_.getDownMessageEnabled(), dontSendNotification); andrewm@46: andrewm@46: int configuration = factory_.getCurrentConfiguration(); andrewm@46: if(configuration >= 0) andrewm@46: presetComboBox->setSelectedItemIndex(configuration, dontSendNotification); andrewm@46: else andrewm@46: presetComboBox->setText(""); andrewm@46: } andrewm@46: andrewm@46: // Return a human-readable description of this mapping for the window andrewm@46: String TouchkeyReleaseAngleMappingExtendedEditor::getDescription() { andrewm@46: return getDescriptionHelper("Release Angle"); andrewm@46: } andrewm@46: andrewm@46: // Return a human-readable description of this mapping for the window andrewm@46: String TouchkeyReleaseAngleMappingExtendedEditor::getDescriptionHelper(String baseName) { andrewm@46: String desc = baseName; andrewm@46: andrewm@46: desc += " (Zone "; andrewm@46: andrewm@46: int zone = factory_.segment().outputPort(); andrewm@46: desc += zone; andrewm@46: desc += ", #"; andrewm@46: andrewm@46: int mappingNumber = factory_.segment().indexOfMappingFactory(&factory_); andrewm@46: desc += mappingNumber; andrewm@46: desc += ")"; andrewm@46: andrewm@46: return desc; andrewm@46: } andrewm@46: andrewm@46: // Cross-platform helper function to deal with weird Visual Studio definitions... andrewm@46: void TouchkeyReleaseAngleMappingExtendedEditor::intToString(char *st, int value) { andrewm@46: #ifdef _MSC_VER andrewm@46: _snprintf_s(st, 16, _TRUNCATE, "%d", value); andrewm@46: #else andrewm@46: snprintf(st, 16, "%d", value); andrewm@46: #endif andrewm@46: } andrewm@46: andrewm@46: //[/MiscUserCode] andrewm@46: andrewm@46: andrewm@46: //============================================================================== andrewm@46: #if 0 andrewm@46: /* -- Introjucer information section -- andrewm@46: andrewm@46: This is where the Introjucer stores the metadata that describe this GUI layout, so andrewm@46: make changes in here at your peril! andrewm@46: andrewm@46: BEGIN_JUCER_METADATA andrewm@46: andrewm@46: andrewm@46: andrewm@46: andrewm@46: andrewm@46: END_JUCER_METADATA andrewm@46: */ andrewm@46: #endif andrewm@46: andrewm@46: andrewm@46: //[EndFile] You can add extra defines here... andrewm@50: #endif // TOUCHKEYS_NO_GUI andrewm@46: //[/EndFile]