示例#1
0
        public ValueDisplay(Window parent)
            : base(parent, WxDefaultPosition, WxDefaultSize, WindowStyles.BorderSimple)
        {
            BackgroundColour = Colour.WhiteColour;

            var sizer = new FlexGridSizer(2, 5, 5);

            Font displayFont = new Font(30, FontFamily.wxDefault, FontStyle.Normal, FontWeight.Normal);

            _text = new StaticText(this, "10.000", WxDefaultPosition, WxDefaultSize, WindowStyles.AlignRight | WindowStyles.StaticTextNoAutoResize);
            _text.SetFont(displayFont);
            sizer.Add(_text);

            _unit = new StaticText(this, "mV");
            sizer.Add(_unit, 1, SizerFlag.AlignBottom | SizerFlag.AlignRight | SizerFlag.Right | SizerFlag.Bottom, 5);

            SetSizer(sizer);
            sizer.SetSizeHints(this);
        }
示例#2
0
        public ValueDisplay(Window parent)
            : base(parent, WxDefaultPosition, WxDefaultSize, WindowStyles.BorderSimple)
        {
            BackgroundColour = Colour.WhiteColour;

            var sizer = new FlexGridSizer(2, 5, 5);

            Font displayFont = new Font(30, FontFamily.wxDefault, FontStyle.Normal, FontWeight.Normal);

            _text = new StaticText(this, "10.000", WxDefaultPosition, WxDefaultSize, WindowStyles.AlignRight | WindowStyles.StaticTextNoAutoResize);
            _text.SetFont(displayFont);
            sizer.Add(_text);

            _unit = new StaticText(this, "mV");
            sizer.Add(_unit, 1, SizerFlag.AlignBottom | SizerFlag.AlignRight | SizerFlag.Right | SizerFlag.Bottom, 5);

            SetSizer(sizer);
            sizer.SetSizeHints(this);
        }