Beispiel #1
0
 public void UpdateButton(Color?backgroundcolor, GUIEnumerations.ButtonDock?dock, bool?fixwhitespace)
 {
     _gui_panel_background = backgroundcolor.HasValue ? new SolidColorBrush(backgroundcolor.Value) : guiPanel.Background;
     _dock           = dock.HasValue ? dock.Value : _dock;
     _fix_whitespace = fixwhitespace.HasValue ? fixwhitespace.Value : _fix_whitespace;
     BuildButton();
 }
        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);
        }
Beispiel #3
0
 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();
 }