Ejemplo n.º 1
0
        private uint GetSelectedItem(RibbonComboBox combo)
        {
            Settings settings = Settings.Instance;

            switch (combo.CommandID)
            {
            case Cmd.cmdComboPower:
                return(GetSelectedItem(settings.PowerSmooth));

            case Cmd.cmdComboLRBalance:
                return(GetSelectedItem(settings.LRBalanceSmooth));

            case Cmd.cmdComboLTorque:
                return(GetSelectedItem(settings.TorqueLeftSmooth));

            case Cmd.cmdComboRTorque:
                return(GetSelectedItem(settings.TorqueRightSmooth));

            case Cmd.cmdComboLSmoothness:
                return(GetSelectedItem(settings.SmoothnessLeftSmooth));

            case Cmd.cmdComboRSmoothness:
                return(GetSelectedItem(settings.SmoothnessRightSmooth));

            default:
                return(0);
            }
        }
Ejemplo n.º 2
0
        private void SetComboValues(RibbonComboBox comboBox)
        {
            IUICollection itemsSource = comboBox.ItemsSource;

            itemsSource.Add(new GalleryItemPropertySet()
            {
                Label = "0", CategoryID = Constants.UI_Collection_InvalidIndex
            });
            itemsSource.Add(new GalleryItemPropertySet()
            {
                Label = "3", CategoryID = Constants.UI_Collection_InvalidIndex
            });
            itemsSource.Add(new GalleryItemPropertySet()
            {
                Label = "10", CategoryID = Constants.UI_Collection_InvalidIndex
            });
            itemsSource.Add(new GalleryItemPropertySet()
            {
                Label = "15", CategoryID = Constants.UI_Collection_InvalidIndex
            });
            itemsSource.Add(new GalleryItemPropertySet()
            {
                Label = "30", CategoryID = Constants.UI_Collection_InvalidIndex
            });
            comboBox.SelectedItem = GetSelectedItem(comboBox);
        }
Ejemplo n.º 3
0
        private void Combo_ItemsSourceReady(object sender, EventArgs e)
        {
            RibbonComboBox combo = sender as RibbonComboBox;

            if (combo != null)
            {
                SetComboValues(combo);
            }
        }
Ejemplo n.º 4
0
        private void ComboSettings_ExecuteEvent(object sender, ExecuteEventArgs e)
        {
            try
            {
                Settings       settings = Settings.Instance;
                RibbonComboBox combo    = sender as RibbonComboBox;
                switch (combo.CommandID)
                {
                case Cmd.cmdComboPower:
                    settings.PowerSmooth = int.Parse(combo.StringValue);
                    //_modifiedSettings = true;
                    break;

                case Cmd.cmdComboLRBalance:
                    settings.LRBalanceSmooth = int.Parse(combo.StringValue);
                    //_modifiedSettings = true;
                    break;

                case Cmd.cmdComboLTorque:
                    settings.TorqueLeftSmooth = int.Parse(combo.StringValue);
                    //_modifiedSettings = true;
                    break;

                case Cmd.cmdComboRTorque:
                    settings.TorqueRightSmooth = int.Parse(combo.StringValue);
                    //_modifiedSettings = true;
                    break;

                case Cmd.cmdComboLSmoothness:
                    settings.SmoothnessLeftSmooth = int.Parse(combo.StringValue);
                    //_modifiedSettings = true;
                    break;

                case Cmd.cmdComboRSmoothness:
                    settings.SmoothnessRightSmooth = int.Parse(combo.StringValue);
                    //_modifiedSettings = true;
                    break;

                default:
                    break;
                }
            }
            catch
            {
                throw;
            }
        }
Ejemplo n.º 5
0
 public RibbonItems(Ribbon ribbon)
 {
     if (ribbon == null)
     {
         throw new ArgumentNullException(nameof(ribbon), "Parameter is null");
     }
     this.Ribbon            = ribbon;
     ApplicationMenu        = new RibbonApplicationMenu(ribbon, Cmd.cmdApplicationMenu);
     RecentItems            = new RibbonRecentItems(ribbon, Cmd.cmdRecentItems);
     ButtonNew              = new RibbonButton(ribbon, Cmd.cmdButtonNew);
     ButtonOpen             = new RibbonButton(ribbon, Cmd.cmdButtonOpen);
     ButtonSave             = new RibbonButton(ribbon, Cmd.cmdButtonSave);
     ButtonExitMenu         = new RibbonButton(ribbon, Cmd.cmdButtonExitMenu);
     HelpButton             = new RibbonHelpButton(ribbon, Cmd.cmdHelpButton);
     QAT                    = new RibbonQuickAccessToolbar(ribbon, Cmd.cmdQAT, Cmd.cmdCustomizeQAT);
     ButtonPrint            = new RibbonButton(ribbon, Cmd.cmdButtonPrint);
     ButtonUndo             = new RibbonButton(ribbon, Cmd.cmdButtonUndo);
     TabHome                = new RibbonTab(ribbon, Cmd.cmdTabHome);
     GroupClipboard         = new RibbonGroup(ribbon, Cmd.cmdGroupClipboard);
     ButtonPaste            = new RibbonSplitButton(ribbon, Cmd.cmdButtonPaste);
     ButtonPaste2           = new RibbonButton(ribbon, Cmd.cmdButtonPaste2);
     Menu1                  = new RibbonMenuGroup(ribbon, Cmd.cmdMenu1);
     ButtonMenuPaste        = new RibbonButton(ribbon, Cmd.cmdButtonMenuPaste);
     ButtonMenuPasteSpecial = new RibbonButton(ribbon, Cmd.cmdButtonMenuPasteSpecial);
     ButtonMenuPasteLink    = new RibbonButton(ribbon, Cmd.cmdButtonMenuPasteLink);
     ButtonCut              = new RibbonButton(ribbon, Cmd.cmdButtonCut);
     ButtonCopy             = new RibbonButton(ribbon, Cmd.cmdButtonCopy);
     ButtonCopyFormat       = new RibbonButton(ribbon, Cmd.cmdButtonCopyFormat);
     GroupFont              = new RibbonGroup(ribbon, Cmd.cmdGroupFont);
     FontControl            = new RibbonFontControl(ribbon, Cmd.cmdFontControl);
     GroupParagraph         = new RibbonGroup(ribbon, Cmd.cmdGroupParagraph);
     ButtonP101             = new RibbonSplitButton(ribbon, Cmd.cmdButtonP101);
     ButtonP1               = new RibbonButton(ribbon, Cmd.cmdButtonP1);
     ButtonP102             = new RibbonSplitButton(ribbon, Cmd.cmdButtonP102);
     ButtonP2               = new RibbonButton(ribbon, Cmd.cmdButtonP2);
     ButtonP3               = new RibbonDropDownButton(ribbon, Cmd.cmdButtonP3);
     ButtonP4               = new RibbonButton(ribbon, Cmd.cmdButtonP4);
     ButtonP5               = new RibbonButton(ribbon, Cmd.cmdButtonP5);
     ButtonP6               = new RibbonButton(ribbon, Cmd.cmdButtonP6);
     ButtonP7               = new RibbonButton(ribbon, Cmd.cmdButtonP7);
     ButtonP108             = new RibbonSplitButton(ribbon, Cmd.cmdButtonP108);
     ButtonP8               = new RibbonButton(ribbon, Cmd.cmdButtonP8);
     ButtonP109             = new RibbonSplitButton(ribbon, Cmd.cmdButtonP109);
     ButtonP9               = new RibbonButton(ribbon, Cmd.cmdButtonP9);
     ButtonP10              = new RibbonButton(ribbon, Cmd.cmdButtonP10);
     ButtonP11              = new RibbonButton(ribbon, Cmd.cmdButtonP11);
     ButtonP12              = new RibbonButton(ribbon, Cmd.cmdButtonP12);
     ButtonP13              = new RibbonButton(ribbon, Cmd.cmdButtonP13);
     ButtonP14              = new RibbonButton(ribbon, Cmd.cmdButtonP14);
     GroupStyles            = new RibbonGroup(ribbon, Cmd.cmdGroupStyles);
     InRibbonGallery        = new RibbonInRibbonGallery(ribbon, Cmd.cmdInRibbonGallery);
     ButtonStyles1          = new RibbonButton(ribbon, Cmd.cmdButtonStyles1);
     ButtonStyles2          = new RibbonButton(ribbon, Cmd.cmdButtonStyles2);
     ButtonStyles3          = new RibbonButton(ribbon, Cmd.cmdButtonStyles3);
     ButtonChangeStyles     = new RibbonDropDownButton(ribbon, Cmd.cmdButtonChangeStyles);
     ButtonMenuStyleSet     = new RibbonButton(ribbon, Cmd.cmdButtonMenuStyleSet);
     ButtonMenuColors       = new RibbonDropDownColorPicker(ribbon, Cmd.cmdButtonMenuColors);
     ButtonMenuFont         = new RibbonButton(ribbon, Cmd.cmdButtonMenuFont);
     ButtonMenuSetAsDefault = new RibbonButton(ribbon, Cmd.cmdButtonMenuSetAsDefault);
     GroupEditing           = new RibbonGroup(ribbon, Cmd.cmdGroupEditing);
     ButtonFind             = new RibbonButton(ribbon, Cmd.cmdButtonFind);
     ButtonReplace          = new RibbonButton(ribbon, Cmd.cmdButtonReplace);
     ButtonGoto             = new RibbonButton(ribbon, Cmd.cmdButtonGoto);
     ButtonSelect           = new RibbonDropDownButton(ribbon, Cmd.cmdButtonSelect);
     ButtonMenuSelect1      = new RibbonButton(ribbon, Cmd.cmdButtonMenuSelect1);
     ButtonMenuSelect2      = new RibbonButton(ribbon, Cmd.cmdButtonMenuSelect2);
     ButtonMenuSelect3      = new RibbonButton(ribbon, Cmd.cmdButtonMenuSelect3);
     TabInsert              = new RibbonTab(ribbon, Cmd.cmdTabInsert);
     GroupPages             = new RibbonGroup(ribbon, Cmd.cmdGroupPages);
     GroupTables            = new RibbonGroup(ribbon, Cmd.cmdGroupTables);
     GroupIllustrations     = new RibbonGroup(ribbon, Cmd.cmdGroupIllustrations);
     TabPageLayout          = new RibbonTab(ribbon, Cmd.cmdTabPageLayout);
     Group1                 = new RibbonGroup(ribbon, Cmd.cmdGroup1);
     Combo1                 = new RibbonComboBox(ribbon, Cmd.cmdCombo1);
     Button1                = new RibbonButton(ribbon, Cmd.cmdButton1);
     Combo2                 = new RibbonComboBox(ribbon, Cmd.cmdCombo2);
     Button2                = new RibbonButton(ribbon, Cmd.cmdButton2);
     Hidden1                = new RibbonButton(ribbon, Cmd.cmdHidden1);
     Group2                 = new RibbonGroup(ribbon, Cmd.cmdGroup2);
     Hidden2                = new RibbonButton(ribbon, Cmd.cmdHidden2);
     Group3                 = new RibbonGroup(ribbon, Cmd.cmdGroup3);
     ButtonLabel            = new RibbonButton(ribbon, Cmd.cmdButtonLabel);
     Group4                 = new RibbonGroup(ribbon, Cmd.cmdGroup4);
     Group5                 = new RibbonGroup(ribbon, Cmd.cmdGroup5);
     ButtonDate             = new RibbonButton(ribbon, Cmd.cmdButtonDate);
 }
Ejemplo n.º 6
0
 public RibbonItems(Ribbon ribbon)
 {
     if (ribbon == null)
     {
         throw new ArgumentNullException(nameof(ribbon), "Parameter is null");
     }
     this.Ribbon              = ribbon;
     Application              = new RibbonApplicationMenu(ribbon, Cmd.cmdApplication);
     ButtonOpen               = new RibbonButton(ribbon, Cmd.cmdButtonOpen);
     ButtonSaveGpx            = new RibbonButton(ribbon, Cmd.cmdButtonSaveGpx);
     ButtonAbout              = new RibbonButton(ribbon, Cmd.cmdButtonAbout);
     ButtonExit               = new RibbonButton(ribbon, Cmd.cmdButtonExit);
     ButtonHelp               = new RibbonHelpButton(ribbon, Cmd.cmdButtonHelp);
     QAT                      = new RibbonQuickAccessToolbar(ribbon, Cmd.cmdQAT);
     ButtonSession            = new RibbonButton(ribbon, Cmd.cmdButtonSession);
     ButtonLaps               = new RibbonButton(ribbon, Cmd.cmdButtonLaps);
     ButtonMap                = new RibbonButton(ribbon, Cmd.cmdButtonMap);
     ToggleSettings           = new RibbonToggleButton(ribbon, Cmd.cmdToggleSettings);
     TabGroupSettings         = new RibbonTabGroup(ribbon, Cmd.cmdTabGroupSettings);
     TabSettings              = new RibbonTab(ribbon, Cmd.cmdTabSettings);
     GroupApp                 = new RibbonGroup(ribbon, Cmd.cmdGroupApp);
     CheckCurrentAppSize      = new RibbonCheckBox(ribbon, Cmd.cmdCheckCurrentAppSize);
     GroupMapControl          = new RibbonGroup(ribbon, Cmd.cmdGroupMapControl);
     SpinnerMapWidth          = new RibbonSpinner(ribbon, Cmd.cmdSpinnerMapWidth);
     SpinnerMapHeight         = new RibbonSpinner(ribbon, Cmd.cmdSpinnerMapHeight);
     Hidden1                  = new RibbonButton(ribbon, Cmd.cmdHidden1);
     GroupSettings            = new RibbonGroup(ribbon, Cmd.cmdGroupSettings);
     ButtonSaveSettings       = new RibbonButton(ribbon, Cmd.cmdButtonSaveSettings);
     TabChart                 = new RibbonTab(ribbon, Cmd.CmdTabChart);
     GroupChartSelect         = new RibbonGroup(ribbon, Cmd.cmdGroupChartSelect);
     ComboSelect              = new RibbonComboBox(ribbon, Cmd.cmdComboSelect);
     ToggleSmooth             = new RibbonToggleButton(ribbon, Cmd.cmdToggleSmooth);
     GroupChartSpeed          = new RibbonGroup(ribbon, Cmd.cmdGroupChartSpeed);
     ButtonSpeed              = new RibbonCheckBox(ribbon, Cmd.cmdButtonSpeed);
     ButtonCadence            = new RibbonCheckBox(ribbon, Cmd.cmdButtonCadence);
     GroupChartPower          = new RibbonGroup(ribbon, Cmd.cmdGroupChartPower);
     ButtonPower              = new RibbonCheckBox(ribbon, Cmd.cmdButtonPower);
     ButtonLRBalance          = new RibbonCheckBox(ribbon, Cmd.cmdButtonLRBalance);
     ButtonHeartRate          = new RibbonCheckBox(ribbon, Cmd.cmdButtonHeartRate);
     GroupChartPower1         = new RibbonGroup(ribbon, Cmd.cmdGroupChartPower1);
     ComboPower               = new RibbonComboBox(ribbon, Cmd.cmdComboPower);
     ComboLRBalance           = new RibbonComboBox(ribbon, Cmd.cmdComboLRBalance);
     GroupChartEffectiveness  = new RibbonGroup(ribbon, Cmd.cmdGroupChartEffectiveness);
     ButtonLTorqueEff         = new RibbonCheckBox(ribbon, Cmd.cmdButtonLTorqueEff);
     ButtonRTorqueEff         = new RibbonCheckBox(ribbon, Cmd.cmdButtonRTorqueEff);
     GroupChartEffectiveness1 = new RibbonGroup(ribbon, Cmd.cmdGroupChartEffectiveness1);
     ComboLTorque             = new RibbonComboBox(ribbon, Cmd.cmdComboLTorque);
     ComboRTorque             = new RibbonComboBox(ribbon, Cmd.cmdComboRTorque);
     GroupChartSmoothness     = new RibbonGroup(ribbon, Cmd.cmdGroupChartSmoothness);
     ButtonLSmoothness        = new RibbonCheckBox(ribbon, Cmd.cmdButtonLSmoothness);
     ButtonRSmoothness        = new RibbonCheckBox(ribbon, Cmd.cmdButtonRSmoothness);
     GroupChartSmoothness1    = new RibbonGroup(ribbon, Cmd.cmdGroupChartSmoothness1);
     ComboLSmoothness         = new RibbonComboBox(ribbon, Cmd.cmdComboLSmoothness);
     ComboRSmoothness         = new RibbonComboBox(ribbon, Cmd.cmdComboRSmoothness);
     GroupChartClimbing       = new RibbonGroup(ribbon, Cmd.cmdGroupChartClimbing);
     ButtonAltitude           = new RibbonCheckBox(ribbon, Cmd.cmdButtonAltitude);
     ButtonGrade              = new RibbonCheckBox(ribbon, Cmd.cmdButtonGrade);
     GroupChartExtras         = new RibbonGroup(ribbon, Cmd.cmdGroupChartExtras);
     ButtonTemperature        = new RibbonCheckBox(ribbon, Cmd.cmdButtonTemperature);
     TabView                  = new RibbonTab(ribbon, Cmd.cmdTabView);
     GroupTotals              = new RibbonGroup(ribbon, Cmd.cmdGroupTotals);
     GroupExtras              = new RibbonGroup(ribbon, Cmd.cmdGroupExtras);
     ButtonMyExtras           = new RibbonButton(ribbon, Cmd.cmdButtonMyExtras);
     GroupMaps                = new RibbonGroup(ribbon, Cmd.cmdGroupMaps);
     GroupZones               = new RibbonGroup(ribbon, Cmd.cmdGroupZones);
     ButtonHeartRateZones     = new RibbonButton(ribbon, Cmd.cmdButtonHeartRateZones);
     ButtonPowerZones         = new RibbonButton(ribbon, Cmd.cmdButtonPowerZones);
     GroupIntern              = new RibbonGroup(ribbon, Cmd.cmdGroupIntern);
     ButtonActivity           = new RibbonButton(ribbon, Cmd.cmdButtonActivity);
     ButtonDeveloperDataId    = new RibbonButton(ribbon, Cmd.cmdButtonDeveloperDataId);
     ButtonDeviceInfo         = new RibbonButton(ribbon, Cmd.cmdButtonDeviceInfo);
     ButtonEvent              = new RibbonButton(ribbon, Cmd.cmdButtonEvent);
     ButtonFieldDescription   = new RibbonButton(ribbon, Cmd.cmdButtonFieldDescription);
     ButtonFileId             = new RibbonButton(ribbon, Cmd.cmdButtonFileId);
     ButtonSport              = new RibbonButton(ribbon, Cmd.cmdButtonSport);
     ButtonWorkout            = new RibbonButton(ribbon, Cmd.cmdButtonWorkout);
     ButtonWahooFF00          = new RibbonButton(ribbon, Cmd.cmdButtonWahooFF00);
     ButtonWahooFF01          = new RibbonButton(ribbon, Cmd.cmdButtonWahooFF01);
     Hidden2                  = new RibbonButton(ribbon, Cmd.cmdHidden2);
 }