private void BuildToggle(GUIEnumerations.ButtonType buttontype, GUITogglePanelSelectionType selectiontype) { GUIButton button = new GUIButton( buttontype, GUIElements.GUIEnumerations.ButtonDock.Top, selectiontype.ToString(), string.Format(@"{0}{1}", System.AppDomain.CurrentDomain.BaseDirectory, "mute.png"), null ); button.UpdateFrame(new Thickness(10), Brushes.Black, 0.6, Brushes.Black, new Thickness(1)); button.UpdateButton(Colors.Transparent, null, false); button.UpdatePicture(null, 20, 20); button.UpdateCaption(Colors.White, Colors.Black, string.Empty); if (selectiontype == GUITogglePanelSelectionType.Single) { _single_buttons.Add(button); } else { _multi_buttons.Add(button); } }
private void TestSingle() { GUITogglePanel ssbp = new GUITogglePanel(); for (int x = 0; x < 6; x++) { BuildToggle(GUIEnumerations.ButtonType.Toggle, GUITogglePanelSelectionType.Single); } gui_button = BuildButton( "Long Caption, Compensated", "This caption is long enough to upset the whitespace", string.Format(@"{0}{1}", System.AppDomain.CurrentDomain.BaseDirectory, "default-capture.jpg"), null, null, false ); gui_button.UpdateFrame(new Thickness(40), Brushes.Black, 0.6, Brushes.Red, new Thickness(4)); gui_button.UpdatePanelBorder(Brushes.Blue, new Thickness(4)); gui_button.UpdateButton(null, null, true); _single_buttons.Add(gui_button); gui_button = BuildButton( "Long Caption, Compensated", "This caption is long enough to upset the whitespace", string.Format(@"{0}{1}", System.AppDomain.CurrentDomain.BaseDirectory, "default-capture.jpg"), null, null, false ); gui_button.UpdateFrame(new Thickness(40), Brushes.Black, 0.6, Brushes.Red, new Thickness(4)); gui_button.UpdatePanelBorder(Brushes.Blue, new Thickness(4)); gui_button.UpdateButton(null, null, true); _single_buttons.Add(gui_button); ssbp.AddButtons(_single_buttons, GUITogglePanelSelectionType.Single); ssbp.OnSelectionChanged += SinglePanel_ButtonStateChanged; Surface.Children.Add(ssbp); }