private void SinglePanel_ButtonStateChanged(object sender, SelectionChangedEventArgs e) { GUITogglePanel panel = sender as GUITogglePanel; GUIButton button = e.ButtonChanged; button.UpdateCaption(null, null, "State is now" + button.CurrentState); }
private void TestMultiple() { GUITogglePanel ssbp = new GUITogglePanel(); for (int x = 0; x < 11; x++) { BuildToggle(GUIEnumerations.ButtonType.Toggle, GUITogglePanelSelectionType.Multiple); } ssbp.AddButtons(_multi_buttons, GUITogglePanelSelectionType.Multiple); ssbp.OnSelectionChanged += MutiPanel_ButtonStateChanged; Surface.Children.Add(ssbp); }
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); }