private GUIButton BuildButton( string instancetitle, string caption, string imagesource, GUIEnumerations.ButtonType?buttontype, GUIEnumerations.ButtonDock?dock, bool?trimcaption) { GUIEnumerations.ButtonType button_type = buttontype.HasValue ? buttontype.Value : GUIEnumerations.ButtonType.Momentary; GUIEnumerations.ButtonDock dock_type = dock.HasValue ? dock.Value : GUIEnumerations.ButtonDock.Bottom; caption = string.IsNullOrEmpty(caption) ? string.Empty : caption; imagesource = string.IsNullOrEmpty(imagesource) ? string.Empty : imagesource; GUIButton guibutton_example = new GUIButton( button_type, dock_type, caption, imagesource, trimcaption ); guibutton_example.Margin = new Thickness(10); AddToGrid(instancetitle, guibutton_example); return(guibutton_example); }
public GUIButton( GUIEnumerations.ButtonType button_type, GUIEnumerations.ButtonDock dock, string caption_text, string image_source, bool?trimcaption) { InitializeComponent(); _button_type = button_type; _caption_content = caption_text; _picture_source = image_source; _trim_caption = trimcaption.HasValue ? trimcaption.Value : _trim_caption; _dock = dock; BuildButton(); }
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); } }