コード例 #1
0
        /// <summary> Static constructor for a vertically oriented box. </summary>
        /// <param name="display">The display pointer, that specifies the connection to the X server. <see cref="IntPtr"/> </param>
        /// <param name="screenNumber"> The appropriate screen number on the host server. <see cref="System.Int32"/> </param>
        /// <param name="parentWindow"> The X11 *** parent *** window for X11 calls. This widget has no X11 *** own *** window. <see cref="IntPtr"/> </param>
        public static XrwBox NewVBox(IntPtr display, X11.TInt screenNumber, IntPtr parentWindow)
        {
            XrwBox b = new XrwBox(display, screenNumber, parentWindow);

            b._orientation = TOrientation.Vertical;
            return(b);
        }
コード例 #2
0
        /// <summary> Initialize local ressources for all constructors. </summary>
        public void InitializeMessageBoxResources()
        {
            XrwBox vboxMain = XrwBox.NewVBox(_display, _screenNumber, _window);

            vboxMain.BorderWidth = 0;
            vboxMain.VertSpacing = 0;
            AddChild(vboxMain);
            vboxMain.Show();

            XrwBox hboxContentArea = XrwBox.NewHBox(_display, _screenNumber, _window);

            hboxContentArea.ExpandToAvailableHeight = true;
            vboxMain.AddChild(hboxContentArea);
            hboxContentArea.Show();

            X11Graphic graphic = null;

            if (_image != X11Graphic.StockIcon.None)
            {
                graphic = new X11Graphic(_display, _screenNumber, _image);
            }
            XrwLabel _labelMessage = new XrwLabel(_display, _screenNumber, _window, _message, graphic, false, null, false);

            _labelMessage.FrameType               = TFrameType.Sunken;
            _labelMessage.FrameWidth              = XrwTheme.InteractingFrameWidth;
            _labelMessage.HorzTextAlign           = 0.0F;
            _labelMessage.ExpandToAvailableHeight = true;
            hboxContentArea.AddChild(_labelMessage);
            _labelMessage.Show();

            XrwBox hboxActionArea = XrwBox.NewHBox(_display, _screenNumber, _window);

            hboxActionArea.BorderWidth = 2;
            hboxActionArea.ChildAlign  = 1.0F;
            hboxActionArea.BorderColor = hboxActionArea.BackgroundColor;
            vboxMain.AddChild(hboxActionArea);
            hboxActionArea.Show();

            X11Graphic cancelGraphic = XrwTheme.GetGraphic(_display, _screenNumber, X11Graphic.StockIcon.Cancel16TrueColor);
            XrwCommand cbCancel      = new XrwCommand(_display, _screenNumber, _window, "Cancel", cancelGraphic, true, null, false);

            cbCancel.ExpandToMaxSiblingWidth = true;
            cbCancel.HorzTextAlign           = 0.5F;
            cbCancel.ButtonRelease          += HandleCbCancelButtonRelease;
            hboxActionArea.AddChild(cbCancel);
            cbCancel.Show();

            X11Graphic okGraphic = XrwTheme.GetGraphic(_display, _screenNumber, X11Graphic.StockIcon.Ok16TrueColor);
            XrwCommand cbOk      = new XrwCommand(_display, _screenNumber, _window, "OK", okGraphic, true, null, false);

            cbOk.ExpandToMaxSiblingWidth = true;
            cbOk.HorzTextAlign           = 0.5F;
            cbOk.ButtonRelease          += HandleCbOkButtonRelease;
            hboxActionArea.AddChild(cbOk);
            cbOk.Show();

            CalculateChildLayout();
            _assignedSize         = vboxMain.AssignedSize;
            _assignedSize.Width  += 2 * _borderWidth;
            _assignedSize.Height += 2 * _borderWidth;

            TPoint position = new TPoint(0, 0);

            MoveResize(ref position, ref _assignedSize);

            X11lib.XSetWMName(_display, _window, _title);
        }
コード例 #3
0
        /// <summary> Static constructor for a horizontally oriented box. </summary>
        /// <param name="display">The display pointer, that specifies the connection to the X server. <see cref="IntPtr"/> </param>
        /// <param name="screenNumber"> The appropriate screen number on the host server. <see cref="System.Int32"/> </param>
        /// <param name="parentWindow"> The X11 *** parent *** window for X11 calls. This widget has no X11 *** own *** window. <see cref="IntPtr"/> </param>
        public static XrwBox NewHBox(IntPtr display, X11.TInt screenNumber, IntPtr parentWindow)
        {
            XrwBox b = new XrwBox(display, screenNumber, parentWindow);

            return(b);
        }