Example #1
1
 public Value(GLib.GType gtype)
 {
     type = IntPtr.Zero;
     pad1 = new Padding ();
     pad2 = new Padding ();
     g_value_init (ref this, gtype.Val);
 }
Example #2
0
		public static Container AddDockedControl (this Panel container, Control control, Padding? padding = null)
		{
			container.Content = control;
			if (padding != null)
				container.Padding = padding.Value;
			return container;
		}
Example #3
0
 public static Rectangle InflateRect(Rectangle rect, Padding padding) {
     rect.X -= padding.Left;
     rect.Y -= padding.Top;
     rect.Width += padding.Horizontal;
     rect.Height += padding.Vertical;
     return rect;
 }
Example #4
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ButtonBar"/> class. 
 /// </summary>
 public ButtonBar()
 {
     TabStop = true;
     Padding = new Padding(3, 3, 3, 3);
     SetStyle(ControlStyles.AllPaintingInWmPaint, true);
     SetStyle(ControlStyles.UserPaint, true);
     SetStyle(ControlStyles.DoubleBuffer, true);
     SetStyle(ControlStyles.ResizeRedraw, true);
     SetStyle(ControlStyles.Selectable, true);
     SetStyle(ControlStyles.SupportsTransparentBackColor, true);
     BackColor = Color.Transparent;
     items = new GenericCollection<BarItem>();
     items.Inserted += OnItemsInserted;
     items.Removed += OnItemsRemoved;
     items.Changed += OnItemsChanged;
     items.Inserting += OnItemsInserting;
     items.Changing += OnItemsChanging;
     items.Removing += OnItemsRemoving;
     items.Clearing += OnItemsClearing;
     toolTip = new ToolTip();
     appearance = new Appearance();
     appearance.AppearanceChanged += OnAppearanceChanged;
     currentAppearance = new Appearance();
     themeProperty = new ThemeProperty();
     themeProperty.ThemeChanged += OnAppearanceChanged;
     showScroll = false;
     useMnemonic = true;
     showBorders = true;
     Height = 200;
     InitializeDefaultScheme();
     SetThemeDefaults();
 }
        public void restoreMaxiState()
        {
            mini = false;
            // Maxi form settings
            Padding = new Padding(2, 24, 2, 2);
            if (GPMBrowser != null)
            {
                GPMBrowser.SetZoomLevel(0);
            }
            FormBorderStyle = FormBorderStyle.Sizable;
            MaximumSize = new Size();
            // Force it to be always bigger than the mini player
            MinimumSize = new Size(301, 301);
            MaximizeBox = true;
            handleZoom = false;
            // Restore Maxi size and pos
            Size savedSize = Properties.Settings.Default.MaxiSize;
            Point savedPoint = Properties.Settings.Default.MaxiPoint;
            if (savedSize.Height == -1 && savedSize.Width == -1)
            {
                savedSize = new Size(1080, 720);
            }
            savedPoint = (onScreen(savedPoint) ? savedPoint : new Point(-1, -1));
            if (savedPoint.X == -1 && savedPoint.Y == -1)
            {
                savedPoint = topLeft(savedSize);
            }
            Location = savedPoint;

            FormBorderStyle = FormBorderStyle.None;
            Size = savedSize;
            FormBorderStyle = FormBorderStyle.Sizable;
        }
 public DraggableUserControl()
 {
     //Font = new Font("Arial", 10);
     this.InitializeComponent();
     Margin = new Padding(0);
     AllowDrag = true;
 }
Example #7
0
 public DarkToolStrip()
 {
     Renderer = new DarkToolStripRenderer();
     Padding = new Padding(5, 0, 1, 0);
     AutoSize = false;
     Size = new Size(1, 28);
 }
        public CriteriaControls()
        {
            toolTip = new ToolTip();

            Height = 400;
            Margin = new Padding(0);
        }
Example #9
0
 public CustomListItem(object tag, Font font, Color fore, Padding padding)
 {
     Tag = tag;
     Font = font;
     ForeColor = fore;
     itemBorder = padding;
 }
Example #10
0
File: Pane.cs Project: rsdn/janus
		/// <summary>
		/// See <see cref="Control.OnLayout"/>
		/// </summary>
		protected override void OnLayout(LayoutEventArgs e)
		{
			base.OnLayout(e);
			_caption.Width = Width - 2;
			Padding = new Padding(1, _caption.Height + 2, 1, 1);
			_caption.Top = 1;
		}
        public void restoreMiniState()
        {
            int ratioX = MaterialSkin.Utilities.DPIMath.ratioX(this);
            int ratioY = MaterialSkin.Utilities.DPIMath.ratioY(this);
            mini = true;
            // Mini form settings
            Padding = new Padding(2 * ratioX, 2 * ratioY, 2 * ratioX, 2 * ratioY);
            ClientSize = new Size(300 * ratioX, 300 * ratioY);
            MaximizeBox = false;
            MaximumSize = new Size(300 * ratioX, 300 * ratioY);
            MinimumSize = new Size(100 * ratioX, 100 * ratioY);
            handleZoom = true;
            FormBorderStyle = FormBorderStyle.None;

            // Restore Mini size and pos
            Size savedSize = Properties.Settings.Default.MiniSize;
            Point savedPoint = Properties.Settings.Default.MiniPoint;
            savedPoint = (onScreen(savedPoint) ? savedPoint : new Point(-1, -1));
            if (savedSize.Height == -1 && savedSize.Width == -1)
            {
                savedSize = new Size(300 * ratioX, 300 * ratioY);
            }
            if (savedPoint.X == -1 && savedPoint.Y == -1)
            {
                savedPoint = topLeft(savedSize);
            }
            Location = savedPoint;
            Size = savedSize;
            setZoomRatio();

            TopMost = Properties.Settings.Default.MiniAlwaysOnTop;
        }
Example #12
0
        public BottomBar()
        {
            Button1 = new Button();
            Button1.Click += Button1_Click;
            Button1.TabIndex = 1;
            Controls.Add(Button1);

            Button2 = new Button();
            Button2.Click += Button2_Click;
            Button2.TabIndex = 2;
            Controls.Add(Button2);

            Button3 = new Button();
            Button3.Click += Button3_Click;
            Button3.TabIndex = 3;
            Controls.Add(Button3);

            Button4 = new Button();
            Button4.Click += Button4_Click;
            Button4.TabIndex = 4;
            Controls.Add(Button4);

            SizeChanged += OnSizeChanged;
            MarginChanged += OnMarginChanged;
            Dock = DockStyle.Bottom;
            BackColor = Color.AliceBlue;
            Margin = new Padding(10);
            Font = new Font("Verdana", 9F, FontStyle.Regular);
            ButtonBarButtons = BottomBarButtons.UserDefined;
            ButtonWidth = 90;
            ButtonHeight = 25;
        }
        public FileBrowserItem(ItemType tp, string path, Bitmap img, FileBrowser parent)
        {
            Type = tp;
            FullPath = path;
            Owner = parent;
            Margin = new Padding(0);
            FullImage = img; // FullImage - contains image in natural size.
            BackgroundImageLayout = ImageLayout.None;
            Click += ClickEvent;
            MouseEnter += OnMouseEnter;
            MouseLeave += OnMouseLeave;

            Text = new Label
            {
                Parent = this,
                AutoSize = false,
                AutoEllipsis = true
            };

            SetVariables(img, parent);
            Text.BackColor = Color.Transparent;
            if (Type == ItemType.Folder || Type == ItemType.File)
                Text.Text = Path.GetFileName(path);
            if (Type == ItemType.Drive)
                Text.Text = FullPath;
            Text.BringToFront();
            Text.Click += ClickEvent;
            Text.MouseEnter += OnMouseEnter;
            Text.MouseLeave += OnMouseLeave; 
        }
 //Constactor
 public TabPagePrivateChatServer(string clientName, string clientNamePrivate)
 {
     ClientName = clientName;
     ClientNamePrivate = clientNamePrivate;
     // RchTxtPrivChat
     _RichTextPrivChtServer.BackColor = Color.White;
     _RichTextPrivChtServer.ForeColor = Color.Black;
     _RichTextPrivChtServer.Location = new Point(0, 3);
     _RichTextPrivChtServer.Name = clientName + " - " + clientNamePrivate + "TabPagePrivateChatServer";
     _RichTextPrivChtServer.ReadOnly = true;
     _RichTextPrivChtServer.ScrollBars = RichTextBoxScrollBars.Vertical;
     _RichTextPrivChtServer.Size = new Size(541, 312);
     _RichTextPrivChtServer.TabIndex = 12;
     _RichTextPrivChtServer.Text = "";
     _RichTextPrivChtServer.TextChanged += RichTextPrivChtServerTextChanged;
     // TabPagePrivateChat
     Controls.Add(_RichTextPrivChtServer);
     Location = new Point(4, 28);
     Name = ClientName + " - " + ClientNamePrivate;
     Padding = new Padding(3);
     Size = new Size(541, 402);
     //this.TabIndex = 1;//mke it more accurate
     Text = ClientName + " - " + ClientNamePrivate;
     UseVisualStyleBackColor = true;
     //PrivateReceivedMessageEvent += TabPagePrivateReceivedReceivedMessage;
 }
Example #15
0
		public buttonArea() {
			Size = new Size(200, 50);
			FlowDirection = FlowDirection.RightToLeft;
			Padding = new Padding(0, 10, 12, 0);
			Dock = DockStyle.Bottom;
			Paint += buttonArea_Paint;
		}
Example #16
0
		public flatButton() {
			Font = SystemFonts.MessageBoxFont;
			Padding = new Padding(6);
			_buttonState = buttonStates.Normal;
			DoubleBuffered = true;
			TextAlign = ContentAlignment.MiddleCenter;
		}
Example #17
0
        public ScrollablePanel()
        {
            //BackColor = Color.PaleTurquoise;
            Padding = new Padding(0);
            Margin = new Padding(2);
            Size = new Size(110, 100);

            //BorderStyle = BorderStyle.Fixed3D;

            _vScrollBar1.Dock = DockStyle.Right;
            //_vScrollBar1.Scroll += (sender, e) => { VerticalScroll.Value = _vScrollBar1.Value; };
            //_vScrollBar1.Scroll += (sender, e) => { _itemPanel.VerticalScroll.Value = _vScrollBar1.Value; };
            //Controls.Add(_vScrollBar1);

            _dateLabel.Dock = DockStyle.Top;
            _dateLabel.BackColor = Color.Black;
            _dateLabel.ForeColor = Color.White;
            _dateLabel.TextAlign = ContentAlignment.TopCenter;
            _dateLabel.Font = new Font("Microsoft Sans Serif", 12, FontStyle.Bold);
            _dateLabel.Text = Date;
            Controls.Add(_dateLabel);

            _itemList.Top = _dateLabel.Height;
            _itemList.Left = 0;
            _itemList.Width = _dateLabel.Width;
            _itemList.IntegralHeight = false;
            _itemList.Height = Height - _dateLabel.Height;
            _itemList.Parent = this;
            //_itemList.BackColor = Color.Transparent;
            Controls.Add(_itemList);
        }
        public MaterialFlatButton()
        {
            Primary = false;

            animationManager = new AnimationManager(false)
            {
                Increment = 0.03,
                AnimationType = AnimationType.EaseOut
            };
            hoverAnimationManager = new AnimationManager
            {
                Increment = 0.07,
                AnimationType = AnimationType.Linear
            };

            hoverAnimationManager.OnAnimationProgress += sender => Invalidate();
            animationManager.OnAnimationProgress += sender => Invalidate();

            AutoSizeMode = AutoSizeMode.GrowAndShrink;
            AutoSize = true;
            UseActive = true;
            Active = false;
            Margin = new Padding(4, 6, 4, 6);
            Padding = new Padding(0);
        }
        internal bool m_Alt; // for alternate coloring

        /// <summary>
        /// Initializes a new instance of the <see cref="CategoryButton"/> class.
        /// </summary>
        /// <param name="parent">Parent control.</param>
        public CategoryButton(Base parent) : base(parent)
        {
            Alignment = Pos.Left | Pos.CenterV;
            m_Alt = false;
            IsToggle = true;
            TextPadding = new Padding(3, 0, 3, 0);
        }
Example #20
0
 public ControlPanel()
 {
     DoubleBuffered = true;
     FlarePadding = 0;
     Padding = new Padding(0);
     Margin = new Padding(0);
 }
Example #21
0
        public MonthView()
        {
            SetStyle(ControlStyles.Opaque, true);
            DoubleBuffered = true;

            _dayNamesFormat = "ddd";
            _monthTitleFormat = "MMMM yyyy";
            _selectionMode = MonthViewSelection.Manual;
            _workWeekStart = DayOfWeek.Monday;
            _workWeekEnd = DayOfWeek.Friday;
            _weekStart = DayOfWeek.Sunday;
            _dayNamesVisible = true;
            _dayNamesLength = 2;
            _viewStart = DateTime.Now;
            _itemPadding = new Padding(2);
            _monthTitleColor = SystemColors.ActiveCaption;
            _monthTitleColorInactive = SystemColors.InactiveCaption;
            _monthTitleTextColor = SystemColors.ActiveCaptionText;
            _monthTitleTextColorInactive = SystemColors.InactiveCaptionText;
            _dayBackgroundColor = Color.Empty;
            _daySelectedBackgroundColor = SystemColors.Highlight;
            _dayTextColor = SystemColors.WindowText;
            _daySelectedTextColor = SystemColors.HighlightText;
            _arrowsColor = SystemColors.Window;
            _arrowsSelectedColor = Color.Gold;
            _dayGrayedText = SystemColors.GrayText;
            _todayBorderColor = Color.Maroon;

            UpdateMonthSize();
            UpdateMonths();
        }
Example #22
0
			public MARGINS(Padding t)
			{
				this.Left = (int)t.Left;
				this.Right = (int)t.Right;
				this.Top = (int)t.Top;
				this.Bottom = (int)t.Bottom;
			}
Example #23
0
 public NameLabel()
 {
     Size = new Size(100, 20);
     AutoSize = true;
     Font = new Font("Microsoft Sans Serif", 11.25F, FontStyle.Bold, GraphicsUnit.Point, 0);
     Margin = new Padding(0, 10, 5, 10);
 }
        public DialogNotifier( NotifierDialogData data )
        {
            InitializeComponent();

            DialogData = data.Clone();

            Text = DialogData.Title;
            Font = Utility.Configuration.Config.UI.MainFont;
            Icon = Resource.ResourceManager.Instance.AppIcon;
            Padding = new Padding( 4 );

            //SetStyle( ControlStyles.UserPaint, true );
            //SetStyle( ControlStyles.SupportsTransparentBackColor, true );
            ForeColor = DialogData.ForeColor;
            BackColor = DialogData.BackColor;

            if ( DialogData.DrawsImage && DialogData.Image != null ) {
                ClientSize = DialogData.Image.Size;
            }

            if ( !DialogData.HasFormBorder )
                FormBorderStyle = System.Windows.Forms.FormBorderStyle.None;

            var o = ElectronicObserver.Observer.APIObserver.Instance;
            o.APIList["api_port/port"].ResponseReceived += CloseOnPort;
            data.CloseAll += data_CloseAll;
        }
        public void restoreMiniState()
        {
            mini = true;
            // Mini form settings
            Padding = new Padding(2);
            ClientSize = new Size(300, 300);
            MaximizeBox = false;
            MaximumSize = new Size(300, 300);
            MinimumSize = new Size(100, 100);
            handleZoom = true;
            FormBorderStyle = FormBorderStyle.None;

            // Restore Mini size and pos
            Size savedSize = Properties.Settings.Default.MiniSize;
            Point savedPoint = Properties.Settings.Default.MiniPoint;
            savedPoint = (onScreen(savedPoint) ? savedPoint : new Point(-1, -1));
            if (savedSize.Height == -1 && savedSize.Width == -1)
            {
                savedSize = new Size(300, 300);
            }
            if (savedPoint.X == -1 && savedPoint.Y == -1)
            {
                savedPoint = topLeft(savedSize);
            }
            Location = savedPoint;
            Size = savedSize;
            setZoomRatio();
        }
		/// <summary>
		/// </summary>
		/// <param name="paintParams"></param>
		public void DrawShadow(NuGenPaintParams paintParams)
		{
			if (paintParams == null)
			{
				throw new ArgumentNullException("paintParams");
			}

			Graphics g = paintParams.Graphics;
			Rectangle bounds = paintParams.Bounds;

			int alpha = 0;
			Color baseColor = Color.Black;
			int alphaStep = 5;
			Padding deflatePadding = new Padding(1);

			using (NuGenGrfxMode mode = new NuGenGrfxMode(g))
			{
				NuGenControlPaint.SetGraphicsVeryHighQuality(g);

				using (Pen pen = new Pen(Color.FromArgb(alpha, baseColor)))
				{
					for (int i = 0; i <= _shadowStepCount; i++)
					{
						g.DrawRectangle(pen, bounds);
						pen.Color = Color.FromArgb(alpha += alphaStep, baseColor);
						bounds = NuGenControlPaint.DeflateRectangle(bounds, deflatePadding);

						if (i == 1)
						{
							alphaStep = 10;
						}
					}
				}
			}
		}
		public void Update(Graphics g, string text, Font font, Padding internalBounds,
			Rectangle bounds, Color color, TextFormatFlags formatFlags, IThemeTextOption[] options) {

			IntPtr compatHdc = this._TextHDC;

			if (bounds.Equals(_TextHDCBounds)) {
				//Same bounds, reuse HDC and Clear it
				IntPtr hClearBrush = Native.GDI.CreateSolidBrush(ColorTranslator.ToWin32(Color.Black));
				Native.RECT cleanRect = new Native.RECT(bounds);
				Native.GDI.FillRect(compatHdc, ref cleanRect, hClearBrush);
				Native.GDI.DeleteObject(hClearBrush);
			}
			else {
				//Other bounds, create new HDC
				IntPtr outputHdc = g.GetHdc();
				IntPtr DIB;
				compatHdc = CreateNewHDC(outputHdc, bounds, out DIB);

				//Store new data
				_TextHDC = compatHdc;
				_TextHDCBounds = bounds;

				//Clear up
				CleanUpHDC(DIB);
				g.ReleaseHdc(outputHdc);
			}

			DrawOnHDC(compatHdc, text, font, internalBounds, bounds, color, formatFlags, options);
		}
		public static ThemedText CreateWithGlow(Graphics g, string text, Font font, Padding internalBounds,
			Rectangle bounds, Color color, TextFormatFlags formatFlags, int glowSize) {

			return Create(g, text, font, internalBounds, bounds, color, formatFlags,
				new IThemeTextOption[] { new GlowOption(glowSize) }
			);
		}
 public void InitParent(Control control, Padding padding)
 {
     base.Parent = control.Parent;
     int childIndex = control.Parent.Controls.GetChildIndex(control);
     control.Parent.Controls.SetChildIndex(this, childIndex);
     base.Bounds = new Rectangle(control.Left - padding.Left, control.Top - padding.Top, (control.Size.Width + padding.Left) + padding.Right, (control.Size.Height + padding.Top) + padding.Bottom);
 }
Example #30
0
        public Window(Form targetForm, Theme theme, Size maximumSize, Padding margin)
        {
            // ...
            Suspend();

            // Properties first
            TargetForm = targetForm;
            Theme = theme;
            Margin = margin;

            // Throw an exception, if maximum size is less than bitmap
            if (maximumSize.Width < theme.Width || maximumSize.Height < theme.Height) {
                throw new Exception($"Maximum size of layered windows must be greater than bitmap size. MaximumSize: {maximumSize}; Bitmap.Size: Width={theme.Width}, Height={theme.Height};");
            }

            // Think about Window class as a single window, it's definetly larger than target form.
            maximumSize = new Size(
                maximumSize.Width + theme.Metrics.Left.Width + theme.Metrics.Right.Width + Math.Abs(margin.Horizontal),
                maximumSize.Height + theme.Metrics.Top.Height + theme.Metrics.Bottom.Height + Math.Abs(margin.Vertical)
            );

            // Creating each side with specific surface sizes depending on how they will be used
            _left = new WindowSide(this, new Size(theme.Metrics.Left.Width, maximumSize.Height));
            _right = new WindowSide(this, new Size(theme.Metrics.Right.Width, maximumSize.Height));

            // Horizontal sides
            _top = new WindowSide(this, new Size(maximumSize.Width, theme.Metrics.Top.Height));
            _bottom = new WindowSide(this, new Size(maximumSize.Width, theme.Metrics.Bottom.Height));

            // ...
            Resume(false);
        }
Example #31
0
 public override void DisableResizing()
 {
     base.DisableResizing();
     Padding = new Padding(6, 0, 6, 0);
 }
Example #32
0
 /// <summary>
 /// Prints a cell created with this frame.
 /// </summary>
 /// <param name="printContext">The context used to print the cell.</param>
 /// <param name="cellView">The cell to print.</param>
 /// <param name="origin">The location where to start printing.</param>
 /// <param name="size">The printing size, padding included.</param>
 /// <param name="padding">The padding to use when printing.</param>
 public virtual void Print(ILayoutPrintContext printContext, ILayoutCellView cellView, Point origin, Size size, Padding padding)
 {
     printContext.PrintSymbol(Symbol, origin, size, padding);
 }