Esempio n. 1
0
 public void CopyFrom(ButtonDescription old)
 {
     text       = old.text;
     action     = new PadAction(old.action);
     x          = old.x;
     y          = old.y;
     width      = old.width;
     height     = old.height;
     image      = old.image;
     id         = old.ID;
     FontSize   = old.FontSize;
     FontColor  = old.FontColor;
     FontFamily = old.FontFamily;
     FontWeight = old.FontWeight;
 }
Esempio n. 2
0
        public KeyDialog(PadLayout layout, PadProfile profile, ButtonDescription button, ButtonPreviewFunction preview)
        {
            this.layout  = layout;
            this.profile = profile;
            this.preview = preview;

            InitializeComponent();


            SetupFontWeightBox();
            SetupFontFamilyBox();

            Button = button;

            SetupVKeys();

            ActionTypeCombo.SelectedIndex = (int)Button.Action.ActionType;
            UpdateForActionType();
        }
Esempio n. 3
0
        public static void Style(Button b, ButtonDescription desc, bool reload = false)
        {
            b.FontSize   = desc.FontSize;
            b.Foreground = new SolidColorBrush(desc.FontColor.ToColor());
            b.FontFamily = new FontFamily(desc.FontFamily);
            b.FontWeight = desc.FontWeight.FontWeight();
            TextBlock tb = new TextBlock();

            tb.Text          = desc.Text;
            tb.TextAlignment = TextAlignment.Center;

            b.Content = tb;


            if (desc.Image != null && desc.Image.Length > 0)
            {
                if (File.Exists(desc.Image))
                {
                    BitmapImage img = ImageManager.Instance.Get(desc.Image, reload);
                    b.Background = new ImageBrush(img);
                }
            }
        }
Esempio n. 4
0
 public ButtonDescription(ButtonDescription old)
 {
     CopyFrom(old);
 }