示例#1
0
        public TilesetViewer(string name)
            : base(name)
        {
            base.BackColor = Color.White;

            vScroll = new VScrollBar("vScroll");
            vScroll.Visible = false;
            vScroll.BackColor = Color.Transparent;
            vScroll.ValueChanged += new EventHandler<ValueChangedEventArgs>(vScroll_ValueChanged);

            hScroll = new HScrollBar("hScroll");
            hScroll.Visible = false;
            hScroll.BackColor = Color.Transparent;
            hScroll.ValueChanged += new EventHandler<ValueChangedEventArgs>(hScroll_ValueChanged);

            base.Click += new EventHandler<SdlDotNet.Widgets.MouseButtonEventArgs>(TilesetViewer_Click);
            base.MouseEnter += new EventHandler(TilesetViewer_MouseEnter);
            base.MouseLeave += new EventHandler(TilesetViewer_MouseLeave);

            selectedTile = new Point(0, 0);

            this.AddWidget(vScroll);
            this.AddWidget(hScroll);

            base.Paint += new EventHandler(TilesetViewer_Paint);
        }
示例#2
0
        public void HScrollBarFirstLineButtonAccessibleObject_Invoke_DoesNotWork_OutOfRange(RightToLeft rightToLeft, int value, int maximum)
        {
            using HScrollBar scrollBar = GetHScrollBar(createControl: true, rightToLeft, minimum: 0, maximum, value);
            ScrollBarFirstLineButtonAccessibleObject accessibleObject = GetFirstLineButton(scrollBar);

            Assert.Equal(value, scrollBar.Value);

            accessibleObject.Invoke();

            Assert.Equal(value, scrollBar.Value);
            Assert.True(scrollBar.IsHandleCreated);
        }
示例#3
0
        private void sectionHScrollBar_ValueChanged(object sender, EventArgs e)
        {
            HScrollBar hScrollBar = (HScrollBar)sender;

            if (hScrollBar == null)
            {
                return;
            }
            var currentValue = hScrollBar.Value;

            sectionCountLabel.Text = currentValue.ToString();
        }
示例#4
0
    public void on_apply()
    {
        //DIFFICULTY
        HScrollBar hsb_dif = (HScrollBar)GetNode("Settings/VBoxContainer/St_difficulty/HScrollBar");

        globale.difficulty = (int)hsb_dif.Value;
        //Save Settings
        ProjectSettings.Save();
        globale.SaveGame();
        //
        //popup.Popup_();
    }
示例#5
0
文件: Grid.cs 项目: mjaric/nfx
        public Grid() : base()
        {
            //SetStyle(ControlStyles.OptimizedDoubleBuffer, true); //the CellView is already dbl buffered
            SetStyle(ControlStyles.UserPaint, true);
            SetStyle(ControlStyles.AllPaintingInWmPaint, true); //no ERASE BACKGROUND

            SetStyle(ControlStyles.UserMouse, true);


            UpdateStyles();

            m_Style         = new Style(this, null);
            m_HeaderStyle   = new Style(this, null);
            m_SelectedStyle = new Style(this, null);

            BuildDefaultStyle(m_Style);
            BuildDefaultHeaderStyle(m_HeaderStyle);
            BuildDefaultSelectedStyle(m_SelectedStyle);



            m_CellView = new CellView()
            {
                Parent = this, TabStop = false
            };


            m_HScrollBar = new HScrollBar()
            {
                Parent = this, TabStop = false, Minimum = 0, SmallChange = 1, LargeChange = 1
            };
            m_HScrollBar.ValueChanged += m_HScrollBar_Scroll;

            m_VScrollBar = new VScrollBar()
            {
                Parent = this, TabStop = false, Minimum = 0, SmallChange = 1
            };
            m_VScrollBar.ValueChanged += m_VScrollBar_Scroll;

            m_DataSourceChangedNotificationTimer          = new Timer();
            m_DataSourceChangedNotificationTimer.Interval = REBUILD_TIMEOUT_MS;
            m_DataSourceChangedNotificationTimer.Enabled  = false;
            m_DataSourceChangedNotificationTimer.Tick    += new EventHandler((o, e) =>
            {
                if (m_RepositioningColumn != null || m_ResizingColumn != null)
                {
                    return;                                                                                                //while grid is being manipulated dont flush timer just yet
                }
                m_DataSourceChangedNotificationTimer.Stop();
                notifyDataSourceChanged(m_DataSourceChangedNotificationRow);
                m_DataSourceChangedNotificationRow = null;
            });
        }
示例#6
0
 private void InitializeComponent()
 {
     this.vScrollBar     = new System.Windows.Forms.VScrollBar();
     this.hScrollBar     = new System.Windows.Forms.HScrollBar();
     this.diagramControl = new XSDDiagram.DiagramControl();
     this.SuspendLayout();
     //
     // vScrollBar
     //
     this.vScrollBar.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
                                                                    | System.Windows.Forms.AnchorStyles.Right)));
     this.vScrollBar.Location      = new System.Drawing.Point(437, 0);
     this.vScrollBar.Name          = "vScrollBar";
     this.vScrollBar.Size          = new System.Drawing.Size(17, 348);
     this.vScrollBar.SmallChange   = 5;
     this.vScrollBar.TabIndex      = 0;
     this.vScrollBar.ValueChanged += new System.EventHandler(this.vScrollBar_ValueChanged);
     //
     // hScrollBar
     //
     this.hScrollBar.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
                                                                    | System.Windows.Forms.AnchorStyles.Right)));
     this.hScrollBar.Location      = new System.Drawing.Point(0, 348);
     this.hScrollBar.Name          = "hScrollBar";
     this.hScrollBar.Size          = new System.Drawing.Size(437, 17);
     this.hScrollBar.SmallChange   = 5;
     this.hScrollBar.TabIndex      = 1;
     this.hScrollBar.ValueChanged += new System.EventHandler(this.vScrollBar_ValueChanged);
     //
     // diagramControl
     //
     this.diagramControl.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
                                                                         | System.Windows.Forms.AnchorStyles.Left)
                                                                        | System.Windows.Forms.AnchorStyles.Right)));
     this.diagramControl.Location   = new System.Drawing.Point(0, 0);
     this.diagramControl.Margin     = new System.Windows.Forms.Padding(0);
     this.diagramControl.Name       = "diagramControl";
     this.diagramControl.Size       = new System.Drawing.Size(437, 348);
     this.diagramControl.TabIndex   = 2;
     this.diagramControl.MouseDown += new System.Windows.Forms.MouseEventHandler(this.diagramControl_MouseDown);
     this.diagramControl.MouseMove += new System.Windows.Forms.MouseEventHandler(this.diagramControl_MouseMove);
     this.diagramControl.Resize    += new System.EventHandler(this.diagramControl_Resize);
     this.diagramControl.MouseUp   += new System.Windows.Forms.MouseEventHandler(this.diagramControl_MouseUp);
     //
     // DiagramControlContainer
     //
     this.Controls.Add(this.diagramControl);
     this.Controls.Add(this.hScrollBar);
     this.Controls.Add(this.vScrollBar);
     this.Name = "DiagramControlContainer";
     this.Size = new System.Drawing.Size(454, 365);
     this.ResumeLayout(false);
 }
示例#7
0
 //public GameTreeNavigationController(IGameTreeNavigator<TGameTree, TGameState, TGameAction, TNode> navigator, HScrollBar scrollBar)
 public GameTreeNavigationController(IObservableGameTreeNavigator <TNode, TState, TAction> navigator, HScrollBar scrollBar)
 {
     this.scrollBar               = scrollBar;
     this.scrollBar.Minimum       = 0;
     this.scrollBar.Maximum       = 0;
     scrollBarPreviousValue       = -1;
     this.scrollBar.Value         = 0;
     this.scrollBar.ValueChanged += ScrollBar_ValueChanged;
     this.navigator1              = navigator;
     this.navigator1.Forwarded   += OnForwarded;
     this.navigator1.Navigated   += OnNavigated;
 }
示例#8
0
        public void HScrollBarFirstLineButtonAccessibleObject_Invoke_DoesNotWork_IfHandleIsNotCreated(RightToLeft rightToLeft, int minimum, int maximum, int value)
        {
            using HScrollBar scrollBar = GetHScrollBar(createControl: false, rightToLeft, minimum, maximum, value);
            ScrollBarFirstLineButtonAccessibleObject accessibleObject = GetFirstLineButton(scrollBar);

            Assert.Equal(value, scrollBar.Value);

            accessibleObject.Invoke();

            Assert.Equal(value, scrollBar.Value);
            Assert.False(scrollBar.IsHandleCreated);
        }
示例#9
0
 /// <summary>
 /// Required method for Designer support - do not modify
 /// the contents of this method with the code editor.
 /// </summary>
 void InitializeComponent()
 {
     components        = new Container();
     vScrollBar1       = new VScrollBar();
     hScrollBar1       = new HScrollBar();
     pointToolTip      = new ToolTip(components);
     contextMenuStrip1 = new ContextMenuStrip(components);
     SuspendLayout();
     //
     // vScrollBar1
     //
     vScrollBar1.Location = new System.Drawing.Point(128, 0);
     vScrollBar1.Name     = "vScrollBar1";
     vScrollBar1.Size     = new System.Drawing.Size(17, 128);
     vScrollBar1.TabIndex = 0;
     //this.vScrollBar1.MouseCaptureChanged += new System.EventHandler( this.ScrollBarMouseCaptureChanged );
     vScrollBar1.Scroll += vScrollBar1_Scroll;
     //
     // hScrollBar1
     //
     hScrollBar1.Location = new System.Drawing.Point(0, 128);
     hScrollBar1.Name     = "hScrollBar1";
     hScrollBar1.Size     = new System.Drawing.Size(128, 17);
     hScrollBar1.TabIndex = 1;
     //this.hScrollBar1.MouseCaptureChanged += new System.EventHandler( this.ScrollBarMouseCaptureChanged );
     hScrollBar1.Scroll += hScrollBar1_Scroll;
     //
     // pointToolTip
     //
     pointToolTip.AutoPopDelay = 5000;
     pointToolTip.InitialDelay = 100;
     pointToolTip.ReshowDelay  = 0;
     //
     // contextMenuStrip1
     //
     contextMenuStrip1.Name     = "contextMenuStrip1";
     contextMenuStrip1.Size     = new System.Drawing.Size(61, 4);
     contextMenuStrip1.Opening += contextMenuStrip1_Opening;
     //
     // ZedGraphControl
     //
     AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
     AutoScaleMode       = AutoScaleMode.Font;
     ContextMenuStrip    = contextMenuStrip1;
     Controls.Add(hScrollBar1);
     Controls.Add(vScrollBar1);
     Name        = "ZedGraphControl";
     Resize     += ZedGraphControl_ReSize;
     KeyUp      += ZedGraphControl_KeyUp;
     KeyDown    += ZedGraphControl_KeyDown;
     MouseWheel += ZedGraphControl_MouseWheel;
     ResumeLayout(false);
 }
        public void HScrollBarThumbAccessibleObject_FragmentNavigate_ReturnNull_HandleIsNotCreated(RightToLeft rightToLeft, int minimum, int maximum, int value)
        {
            using HScrollBar scrollBar = GetHScrollBar(createControl: false, rightToLeft, minimum, maximum, value);
            ScrollBarThumbAccessibleObject accessibleObject = GetThumb(scrollBar);

            Assert.Null(accessibleObject.FragmentNavigate(UiaCore.NavigateDirection.Parent));
            Assert.Null(accessibleObject.FragmentNavigate(UiaCore.NavigateDirection.NextSibling));
            Assert.Null(accessibleObject.FragmentNavigate(UiaCore.NavigateDirection.PreviousSibling));
            Assert.Null(accessibleObject.FragmentNavigate(UiaCore.NavigateDirection.FirstChild));
            Assert.Null(accessibleObject.FragmentNavigate(UiaCore.NavigateDirection.LastChild));
            Assert.False(scrollBar.IsHandleCreated);
        }
示例#11
0
        public void HScrollBarLinePageButtonAccessibleObject_Invoke_DoesNotWork_MinimumEqualsMaximum(RightToLeft rightToLeft, int minimum, int maximum, int value)
        {
            using HScrollBar scrollBar = GetHScrollBar(createControl: true, rightToLeft, minimum, maximum, value);
            ScrollBarLastLineButtonAccessibleObject accessibleObject = GetLastLineButton(scrollBar);

            Assert.Equal(value, scrollBar.Value);

            accessibleObject.Invoke();

            Assert.Equal(value, scrollBar.Value);
            Assert.True(scrollBar.IsHandleCreated);
        }
 //mapWriteSceneを生成するだけ
 public MapEditControl(Panel mwp, HScrollBar hScroll, VScrollBar vScroll, Size mapSize, int mapChipSize)
 {
     MapDataControl = new MapDataControl(mapSize, mapChipSize);
     mws            =
         new MapWriteScene(mwp, mapChipSize);
     mws.UpdateLocalPosEvent += () => MapDataControl.MapShowArea.UpdateShowMapImage(mws);
     MapWriteScroll           = new MapWriteScroll(hScroll, vScroll, mws, mapSize, mapChipSize);
     MapDataControl.
     setChangeListEvent(
         () =>
         MapWriteScroll.SetScrollMaximum(mapSize, mapChipSize));
 }
示例#13
0
        public void formLoadTest()
        {
            Button NewGameButton = new Button();

            NewGameButton.Name = "NewGameButton";
            SettingsForm newGame = new SettingsForm(NewGameButton);

            newGame.Form4_Load(NewGameButton, null);
            foreach (Control c in newGame.Controls)
            {
                if (c.GetType() == typeof(TextBox))
                {
                    TextBox text = (TextBox)c;
                    text.Text = 10.ToString();
                }
            }
            foreach (Control c in newGame.Controls)
            {
                if (c.GetType() == typeof(HScrollBar))
                {
                    HScrollBar sbar = (HScrollBar)c;
                    Assert.AreEqual(sbar.Value, 10);
                }
            }
            bool visible = true;

            Assert.AreEqual(visible, newGame.visibility);

            Button CustomButton = new Button();

            CustomButton.Name = "CustomMapEditorButton";
            SettingsForm CustomGame = new SettingsForm(CustomButton);

            CustomGame.Form4_Load(CustomButton, null);
            foreach (Control c in CustomGame.Controls)
            {
                if (c.GetType() == typeof(TextBox))
                {
                    TextBox text = (TextBox)c;
                    text.Text = 10.ToString();
                }
            }
            foreach (Control c in CustomGame.Controls)
            {
                if (c.GetType() == typeof(HScrollBar))
                {
                    HScrollBar sbar = (HScrollBar)c;
                    Assert.AreEqual(sbar.Value, 10);
                }
            }
            visible = false;
            Assert.AreEqual(visible, CustomGame.visibility);
        }
示例#14
0
        /// <summary>
        /// Updates vertical and horizontal scrollbars to correspond to the current visible and canvas
        /// dimensions</summary>
        /// <param name="vScrollBar">Vertical ScrollBar, or null if none</param>
        /// <param name="hScrollBar">Horizontal ScrollBar, or null if none</param>
        protected virtual void UpdateScrollBars(VScrollBar vScrollBar, HScrollBar hScrollBar)
        {
            Size       canvasSizeInPixels = GetCanvasSize();
            RectangleF clientRect         = VisibleClientRectangle;
            Size       viewSizeInPixels   = new Size((int)clientRect.Width, (int)clientRect.Height);

            WinFormsUtil.UpdateScrollbars(
                vScrollBar,
                hScrollBar,
                viewSizeInPixels,
                canvasSizeInPixels);
        }
示例#15
0
        /*
         * Constructors
         */

        public TimeSlider()
        {
            _scrollbar = new HScrollBar();
            this.Controls.Add(_scrollbar);
            _scrollbar.Location = new Point(0, 0);

            _scrollbar.ValueChanged += new EventHandler(_scrollbar_ValueChanged);

            this.Resize += new EventHandler(this.Resized);

            refreshType();
        }
        public void HScrollBarAccessibleObject_GetPropertyValue_ControlType_IsExpected_ForCustomRole(AccessibleRole role)
        {
            using HScrollBar scrollBar = new HScrollBar();
            scrollBar.AccessibleRole   = role;

            object actual = scrollBar.AccessibilityObject.GetPropertyValue(UiaCore.UIA.ControlTypePropertyId);

            UiaCore.UIA expected = AccessibleRoleControlTypeMap.GetControlType(role);

            Assert.Equal(expected, actual);
            Assert.False(scrollBar.IsHandleCreated);
        }
示例#17
0
        /// <summary>
        ///     Initialize Parameters
        /// </summary>
        private void InitializeParameters()
        {
            SetStyle(ControlStyles.AllPaintingInWmPaint | ControlStyles.OptimizedDoubleBuffer | ControlStyles.Opaque,
                     true);

            // Caption
            stringFormatCaption = new StringFormat
            {
                Alignment     = StringAlignment.Center,
                LineAlignment = StringAlignment.Center,
                Trimming      = StringTrimming.EllipsisCharacter,
                FormatFlags   = StringFormatFlags.NoWrap
            };

            fontCaption   = new Font(Font.FontFamily, 9);
            captionHeight = Math.Max(fontCaption.Height, 18);
            rectCaption   = new RectangleF(0, 0, ClientSize.Width, captionHeight);

            // Data row
            stringFormatData = new StringFormat {
                Trimming = StringTrimming.EllipsisCharacter
            };
            fontData  = new Font(Font.FontFamily, 9);
            rowHeight = fontData.Height + 4;

            Padding = new Padding(Border, (int)captionHeight, Border, Border);

            hScrollBar = new HScrollBar
            {
                Parent      = this,
                Dock        = DockStyle.Bottom,
                Enabled     = false,
                Visible     = false,
                SmallChange = 10,
                LargeChange = 30
            };
            hScrollBar.Scroll += ScrollBarScroll;

            vScrollBar = new VScrollBar
            {
                Parent      = this,
                Dock        = DockStyle.Right,
                TabStop     = true,
                Enabled     = false,
                Visible     = false,
                SmallChange = 1,
                LargeChange = 3,
                Maximum     = 20
            };
            vScrollBar.Scroll += ScrollBarScroll;

            MouseUp += InfoPanelMouseUp;
        }
示例#18
0
        private void hScrollBarScroll(object sender, ScrollEventArgs e)
        {
            cGL.intOptionC = 0;
            HScrollBar hb = (HScrollBar)sender;
            int        n  = int.Parse(hb.Name.Substring(hb.Name.Length - 1));

            cGL.ScrollValue[n - 1] = (hb.Value - 100) / 10.0f;
            if (e != null)
            {
                cGL.Draw();
            }
        }
示例#19
0
        public static void SetScrollBarVisibilityAndMaxMin <TControl>(this TControl control, Size contentSize, Size clientSize) where TControl : Control, IZoomable
        {
            #region determine if the scroll bar should be visible or not
            HScrollBar horizontalScrollBar = control.HorizontalScrollBar;
            VScrollBar verticalScrollBar   = control.VerticalScrollBar;
            bool       horizontalVisible   = false;
            bool       verticalVisible     = false;
            float      _zoomScale          = (float)control.ZoomScale;
            // If the image is wider than the PictureBox, show the HScrollBar.
            horizontalScrollBar.Visible =
                (int)(contentSize.Width * _zoomScale) > clientSize.Width;

            // If the image is taller than the PictureBox, show the VScrollBar.
            verticalScrollBar.Visible =
                (int)(contentSize.Height * _zoomScale) > clientSize.Height + (horizontalScrollBar.Visible ? horizontalScrollBar.Height : 0);

            if (!horizontalScrollBar.Visible)
            {
                horizontalScrollBar.Visible =
                    (int)(contentSize.Width * _zoomScale) > clientSize.Width + (verticalScrollBar.Visible ? verticalScrollBar.Width : 0);
            }

            #endregion

            // Set the Maximum, LargeChange and SmallChange properties.
            if (horizontalScrollBar.Visible)
            {  // If the offset does not make the Maximum less than zero, set its value.
                horizontalScrollBar.Maximum =
                    contentSize.Width -
                    (int)(Math.Max(0, clientSize.Width - (verticalScrollBar.Visible ? verticalScrollBar.Width : 0)) / _zoomScale);
            }
            else
            {
                horizontalScrollBar.Maximum = 0;
            }
            horizontalScrollBar.LargeChange = (int)Math.Max(horizontalScrollBar.Maximum / 10, 1);
            horizontalScrollBar.SmallChange = (int)Math.Max(horizontalScrollBar.Maximum / 20, 1);

            if (verticalScrollBar.Visible)
            {  // If the offset does not make the Maximum less than zero, set its value.
                verticalScrollBar.Maximum =
                    contentSize.Height -
                    (int)(Math.Max(0, clientSize.Height - (horizontalScrollBar.Visible ? horizontalScrollBar.Height : 0)) / _zoomScale);
            }
            else
            {
                verticalScrollBar.Maximum = 0;
            }
            verticalScrollBar.Minimum     = 0;
            verticalScrollBar.LargeChange = (int)Math.Max(verticalScrollBar.Maximum / 10, 1);
            verticalScrollBar.SmallChange = (int)Math.Max(verticalScrollBar.Maximum / 20, 1);
        }
示例#20
0
 /// <summary>
 /// Remove the horizontal scrollbar
 /// </summary>
 protected virtual void RemoveHScrollBar()
 {
     if (m_HScroll != null)
     {
         HScrollBar l_tmp = m_HScroll;
         m_HScroll           = null;
         l_tmp.ValueChanged -= new EventHandler(HScroll_Change);
         Controls.Remove(l_tmp);
         l_tmp.Dispose();
         l_tmp = null;
     }
     m_OldHScrollValue = 0;
 }
 /// <summary>
 /// Remove the horizontal scrollbar
 /// </summary>
 protected virtual void RemoveHScrollBar()
 {
     if (horizontalScroll != null)
     {
         HScrollBar l_tmp = horizontalScroll;
         horizontalScroll    = null;
         l_tmp.ValueChanged -= new EventHandler(HScroll_Change);
         Controls.Remove(l_tmp);
         l_tmp.Dispose();
         l_tmp = null;
     }
     oldHorizontalScrollValue = 0;
 }
        public void HScrollBarThumbAccessibleObject_FragmentNavigate_ReturnExpected_MinimumEqualsMaximum(RightToLeft rightToLeft, int minimum, int maximum, int value)
        {
            using HScrollBar scrollBar = GetHScrollBar(createControl: true, rightToLeft, minimum, maximum, value);
            var scrollBarAccessibleObject = (ScrollBar.ScrollBarAccessibleObject)scrollBar.AccessibilityObject;
            ScrollBarThumbAccessibleObject accessibleObject = scrollBarAccessibleObject.ThumbAccessibleObject;

            Assert.Equal(scrollBarAccessibleObject, accessibleObject.FragmentNavigate(UiaCore.NavigateDirection.Parent));
            Assert.Equal(scrollBarAccessibleObject.FirstLineButtonAccessibleObject, accessibleObject.FragmentNavigate(UiaCore.NavigateDirection.PreviousSibling));
            Assert.Equal(scrollBarAccessibleObject.LastLineButtonAccessibleObject, accessibleObject.FragmentNavigate(UiaCore.NavigateDirection.NextSibling));
            Assert.Null(accessibleObject.FragmentNavigate(UiaCore.NavigateDirection.FirstChild));
            Assert.Null(accessibleObject.FragmentNavigate(UiaCore.NavigateDirection.LastChild));
            Assert.True(scrollBar.IsHandleCreated);
        }
示例#23
0
 public Form1()
 {
     player       = new Player(this);
     nameLabel2   = new Label();
     activePL     = new Playlist();
     timePassed   = 0;
     positionBar2 = new HScrollBar();
     InitializeComponent();
     lastfm       = new LastFmWrapper();
     button1.Text = "ON";
     eqEnabled    = true;
     player.player2.EnableEqualizer(eqEnabled);
 }
示例#24
0
        //public int Zoom { get; set; }
        #endregion

        #region Function define

        private void Init()
        {
            this.AllowDrop = true;
            _document      = new Document();

            this.SetStyle(ControlStyles.DoubleBuffer, true);
            this.SetStyle(ControlStyles.UserPaint, true);
            this.SetStyle(ControlStyles.AllPaintingInWmPaint, true);

            // load scroll bars
            _HScrollBar = new HScrollBar();
            _VScrollBar = new VScrollBar();
        }
示例#25
0
 public void SetScrollsAndLabel(Rectangle area, HScrollBar hScroll, VScrollBar vScroll, bool smallChange, Label label)
 {
     Area           = area;
     HScroll        = hScroll;
     VScroll        = vScroll;
     Label          = label;
     ReferencePoint = new Point(-HScroll.Value, -VScroll.Value);
     if (!smallChange)
     {
         HScroll.SmallChange = BaseFormat.FontHeight;
         VScroll.SmallChange = BaseFormat.FontHeight;
     }
 }
示例#26
0
        private void sbVerticalViewAngle_Scroll(object sender, ScrollEventArgs e)
        {
            if (!(sender is HScrollBar))
            {
                return;
            }
            HScrollBar control  = sender as HScrollBar;
            float      newValue = ((float)control.Value) / 100;

            GlobalProperties.CurrentVerticalViewAngle = newValue;
            lblVerticalViewAngle.Text = "Vertical View Angle: " + newValue + "°";
            cGL.Draw();
        }
示例#27
0
        private void hScrollBar1_Scroll(object sender, ScrollEventArgs e)
        {
            HScrollBar sndr = sender as HScrollBar;

            if (sndr != null)
            {
                if (pictureBox1.Width - sndr.Parent.Width > 0)
                {
                    sndr.Maximum = pictureBox1.Width - sndr.Parent.Width;
                }
                pictureBox1.Left = 0 - sndr.Value;
            }
        }
示例#28
0
 internal wTreeScroll(wTree ownerTree, VScrollBar scroll_Vertical, HScrollBar scroll_Horizontal)
 {
     _ownerTree                = ownerTree;
     this.Scroll_Horizontal    = scroll_Horizontal;
     this.Scroll_Vertical      = scroll_Vertical;
     Scroll_Vertical.Visible   = false;
     Scroll_Vertical.Scroll   += Scroll_Vertical_Scroll;
     Scroll_Horizontal.Visible = false;
     Scroll_Horizontal.Scroll += Scroll_Horizontal_Scroll;
     Scroll_Vertical.Maximum   = 0;
     Scroll_Vertical.Minimum   = 0;
     MouseWheelHandler.Add(_ownerTree, wTree_MouseWheel);
 }
示例#29
0
        private void HorizontalScrollBar_VisibleChanged(object sender, EventArgs e)
        {
            HScrollBar hscroll = (HScrollBar)sender;

            if (hscroll.Visible)
            {
                _HScrollBar1.Visible = true;
            }
            else
            {
                _HScrollBar1.Visible = false;
            }
        }
示例#30
0
 private void InitializeComponent()
 {
     Cursor                = Cursors.HSplit;
     scrollBar             = new HScrollBar();
     scrollBar.Maximum     = 100;
     scrollBar.LargeChange = 20;
     scrollBar.Dock        = DockStyle.Bottom;
     scrollBar.Scroll     += (sender, e) =>
     {
         Console.WriteLine("scrollBar.Value: {0}", scrollBar.Value);
     };
     Controls.Add(scrollBar);
 }
示例#31
0
        public void HScrollBarLastLineButtonAccessibleObject_FragmentNavigate_ReturnsExpected_HandleIsNotCreated(RightToLeft rightToLeft, int minimum, int maximum, int value)
        {
            using HScrollBar scrollBar = GetHScrollBar(createControl: false, rightToLeft, minimum, maximum, value);
            var scrollBarAccessibleObject = (ScrollBar.ScrollBarAccessibleObject)scrollBar.AccessibilityObject;
            ScrollBarLastLineButtonAccessibleObject accessibleObject = GetLastLineButton(scrollBar);

            Assert.Null(accessibleObject.FragmentNavigate(UiaCore.NavigateDirection.Parent));
            Assert.Null(accessibleObject.FragmentNavigate(UiaCore.NavigateDirection.NextSibling));
            Assert.Null(accessibleObject.FragmentNavigate(UiaCore.NavigateDirection.PreviousSibling));
            Assert.Null(accessibleObject.FragmentNavigate(UiaCore.NavigateDirection.FirstChild));
            Assert.Null(accessibleObject.FragmentNavigate(UiaCore.NavigateDirection.LastChild));
            Assert.False(scrollBar.IsHandleCreated);
        }
示例#32
0
        public winArrowPanel()
            : base("winArrowPanel")
        {
            this.Windowed = true;
            this.ShowInWindowSwitcher = false;
            this.Size = new System.Drawing.Size(200, 230);
            this.Location = new System.Drawing.Point(210, WindowSwitcher.GameWindow.ActiveTeam.Y + WindowSwitcher.GameWindow.ActiveTeam.Height + 0);
            this.AlwaysOnTop = true;
            this.TitleBar.CloseButton.Visible = true;
            this.TitleBar.Font = Graphics.FontManager.LoadFont("tahoma", 10);
            this.TitleBar.Text = "Arrow Panel";

            pnlArrowList = new Panel("pnlArrowList");
            pnlArrowList.Size = new System.Drawing.Size(200, 230);
            pnlArrowList.Location = new Point(0, 0);
            pnlArrowList.BackColor = Color.White;
            pnlArrowList.Visible = true;

            pnlArrowEditor = new Panel("pnlArrowEditor");
            pnlArrowEditor.Size = new System.Drawing.Size(230, 261);
            pnlArrowEditor.Location = new Point(0, 0);
            pnlArrowEditor.BackColor = Color.White;
            pnlArrowEditor.Visible = false;

            lbxArrowList = new ListBox("lbxArrowList");
            lbxArrowList.Location = new Point(10, 10);
            lbxArrowList.Size = new Size(180, 140);
            for (int i = 0; i < 10; i++) {
                lbiArrow = new ListBoxTextItem(Graphics.FontManager.LoadFont("tahoma", 10), (i + 1) + ": " + Arrows.ArrowHelper.Arrows[(i + 1) + 10 * currentTen].Name);
                lbxArrowList.Items.Add(lbiArrow);
            }

            btnBack = new Button("btnBack");
            btnBack.Location = new Point(10, 160);
            btnBack.Font = Graphics.FontManager.LoadFont("tahoma", 10);
            btnBack.Size = new System.Drawing.Size(64, 16);
            btnBack.Visible = true;
            btnBack.Text = "<--";
            btnBack.Click += new EventHandler<MouseButtonEventArgs>(btnBack_Click);

            btnForward = new Button("btnForward");
            btnForward.Location = new Point(126, 160);
            btnForward.Font = Graphics.FontManager.LoadFont("tahoma", 10);
            btnForward.Size = new System.Drawing.Size(64, 16);
            btnForward.Visible = true;
            btnForward.Text = "-->";
            btnForward.Click += new EventHandler<MouseButtonEventArgs>(btnForward_Click);

            btnEdit = new Button("btnEdit");
            btnEdit.Location = new Point(10, 190);
            btnEdit.Font = Graphics.FontManager.LoadFont("tahoma", 10);
            btnEdit.Size = new System.Drawing.Size(64, 16);
            btnEdit.Visible = true;
            btnEdit.Text = "Edit";
            btnEdit.Click += new EventHandler<MouseButtonEventArgs>(btnEdit_Click);

            btnCancel = new Button("btnCancel");
            btnCancel.Location = new Point(126, 190);
            btnCancel.Font = Graphics.FontManager.LoadFont("tahoma", 10);
            btnCancel.Size = new System.Drawing.Size(64, 16);
            btnCancel.Visible = true;
            btnCancel.Text = "Cancel";
            btnCancel.Click += new EventHandler<MouseButtonEventArgs>(btnCancel_Click);

            //btnAddNew = new Button("btnAddNew");
            //btnAddNew.Location = new Point();
            //btnAddNew.Font = Graphics.FontManager.LoadFont("tahoma", 10);
            //btnAddNew.Size = new System.Drawing.Size(64, 16);
            //btnAddNew.Visible = true;
            //btnAddNew.Text = "Add New";
            //btnAddNew.Click += new EventHandler<MouseButtonEventArgs>(btnAddNew_Click);

            btnEditorCancel = new Button("btnEditorCancel");
            btnEditorCancel.Location = new Point(120, 215);
            btnEditorCancel.Font = Graphics.FontManager.LoadFont("tahoma", 10);
            btnEditorCancel.Size = new System.Drawing.Size(64, 16);
            btnEditorCancel.Visible = true;
            btnEditorCancel.Text = "Cancel";
            btnEditorCancel.Click += new EventHandler<MouseButtonEventArgs>(btnEditorCancel_Click);

            btnEditorOK = new Button("btnEditorOK");
            btnEditorOK.Location = new Point(20, 215);
            btnEditorOK.Font = Graphics.FontManager.LoadFont("tahoma", 10);
            btnEditorOK.Size = new System.Drawing.Size(64, 16);
            btnEditorOK.Visible = true;
            btnEditorOK.Text = "OK";
            btnEditorOK.Click += new EventHandler<MouseButtonEventArgs>(btnEditorOK_Click);

            lblName = new Label("lblName");
            lblName.Font = Graphics.FontManager.LoadFont("Tahoma", 10);
            lblName.Text = "Arrow Name:";
            lblName.AutoSize = true;
            lblName.Location = new Point(10, 4);

            txtName = new TextBox("txtName");
            txtName.Size = new Size(200, 16);
            txtName.Location = new Point(10, 16);
            txtName.Font = Graphics.FontManager.LoadFont("Tahoma", 12);

            lblSprite = new Label("lblSprite");
            lblSprite.Font = Graphics.FontManager.LoadFont("Tahoma", 10);
            lblSprite.Text = "Arrow Sprite:";
            lblSprite.AutoSize = true;
            lblSprite.Location = new Point(10, 36);

            pic = new PictureBox("pic");
            pic.Location = new Point(10, 48);
            pic.Size = new Size(32, 32);

            hsbPic = new HScrollBar("hsbPic");
            hsbPic.Maximum = MaxInfo.MAX_ARROWS;
            hsbPic.Location = new Point(10, 90);
            hsbPic.Size = new Size(200, 12);
            hsbPic.ValueChanged +=new EventHandler<ValueChangedEventArgs>(hsbPic_ValueChanged);

            lblRange = new Label("lblRange");
            lblRange.AutoSize = true;
            lblRange.Font = Graphics.FontManager.LoadFont("PMDCP", 18);
            lblRange.Location = new Point(10, 115);
            lblRange.Text = "Range: -1";

            hsbRange = new HScrollBar("hsbRange");
            hsbRange.Maximum = 50;
            hsbRange.Location = new Point(10, 140);
            hsbRange.Size = new Size(200, 12);
            hsbRange.ValueChanged += new EventHandler<ValueChangedEventArgs>(hsbRange_ValueChanged);

            lblAmount = new Label("lblAmount");
            lblAmount.AutoSize = true;
            lblAmount.Font = Graphics.FontManager.LoadFont("PMDCP", 18);
            lblAmount.Location = new Point(10, 165);
            lblAmount.Text = "Amount: -1";

            hsbAmount = new HScrollBar("hsbAmount");
            hsbAmount.Maximum = 15;
            hsbAmount.Location = new Point(10, 190);
            hsbAmount.Size = new Size(200, 12);
            hsbAmount.ValueChanged += new EventHandler<ValueChangedEventArgs>(hsbAmount_ValueChanged);

            pnlArrowList.AddWidget(lbxArrowList);
            pnlArrowList.AddWidget(btnBack);
            pnlArrowList.AddWidget(btnForward);
            //pnlArrowList.AddWidget(btnAddNew);
            pnlArrowList.AddWidget(btnEdit);
            pnlArrowList.AddWidget(btnCancel);

            pnlArrowEditor.AddWidget(lblName);
            pnlArrowEditor.AddWidget(txtName);
            pnlArrowEditor.AddWidget(lblSprite);
            pnlArrowEditor.AddWidget(pic);
            pnlArrowEditor.AddWidget(hsbPic);
            pnlArrowEditor.AddWidget(lblRange);
            pnlArrowEditor.AddWidget(hsbRange);
            pnlArrowEditor.AddWidget(lblAmount);
            pnlArrowEditor.AddWidget(hsbAmount);
            pnlArrowEditor.AddWidget(btnEditorCancel);
            pnlArrowEditor.AddWidget(btnEditorOK);

            this.AddWidget(pnlArrowList);
            this.AddWidget(pnlArrowEditor);

            RefreshArrowList();
            this.LoadComplete();
        }
示例#33
0
    override protected void CreateChildren()
    {
        base.CreateChildren();

        TitleLabel titleLabel = new TitleLabel
        {
            Text = "Scrollbar Demo",
            StyleName = "title",
            Right = 20,
            Top = 20
        };
        AddChild(titleLabel);

        #region Scroller

        Scroller scroller = new Scroller
        {
            SkinClass = typeof (ScrollerSkin2),
            Left = 0,
            Right = 0,
            Top = 0,
            Bottom = 0,
        };
        //scroller.SetStyle("horizontalScrollPolicy", ScrollPolicy.On);
        //scroller.SetStyle("verticalScrollPolicy", ScrollPolicy.On);
        AddChild(scroller);

        Group viewport = new Group
        {
            Layout = new VerticalLayout
            {
                HorizontalAlign = HorizontalAlign.Left,
                PaddingLeft = 10,
                PaddingRight = 10,
                PaddingTop = 10,
                PaddingBottom = 10,
                Gap = 10
            }
        };
        scroller.Viewport = viewport;

        #endregion

        #region Vertical scrollbars

        HGroup hGroup = new HGroup {Gap = 10, Id = "hbox2", PercentHeight = 100};
        viewport.AddChild(hGroup);

        VScrollBar s = new VScrollBar {PercentHeight = 100, Maximum = 300};
        s.Change += delegate(Event e)
        {
            Debug.Log("Change: " + e);
        };
        hGroup.AddChild(s);

        s = new VScrollBar {PercentHeight = 100, Maximum = 400, PageSize = 100};
        hGroup.AddChild(s);

        s = new VScrollBar {SkinClass = typeof (VScrollBarSkin2), PercentHeight = 100, Maximum = 1000, PageSize = 100};
        hGroup.AddChild(s);

        s = new VScrollBar {SkinClass = typeof (VScrollBarSkin2), Height = 400, Maximum = 400, PageSize = 100};
        hGroup.AddChild(s);

        s = new VScrollBar {SkinClass = typeof (VScrollBarSkin3), PercentHeight = 100, Maximum = 200, PageSize = 100};
        hGroup.AddChild(s);

        s = new VScrollBar {SkinClass = typeof (VScrollBarSkin3), Height = 400, Maximum = 300, PageSize = 100};
        hGroup.AddChild(s);

        #endregion

        #region Horizontal scrollbars

        Label label = new Label {Text = "Will change the skin on drag: "};
        viewport.AddChild(label);

        HScrollBar scrollBar1 = new HScrollBar {Width = 300, Maximum = 300, PageSize = 100};
        scrollBar1.Change += delegate(Event e)
        {
            scrollBar1.SkinClass = typeof (HScrollBarSkin3);
        };
        viewport.AddChild(scrollBar1);

        label = new Label {Text = "Will change the skin on drag: "};
        viewport.AddChild(label);

        _scrollbar2 = new HScrollBar {PercentWidth = 100, Maximum = 500, Value = 200, PageSize = 100};
        _scrollbar2.Change += delegate(Event e)
        {
            _scrollbar2.SkinClass = typeof (HScrollBarSkin3);
        };
        viewport.AddChild(_scrollbar2);

        HScrollBar scrollbar3 = new HScrollBar
        {
            SkinClass = typeof (HScrollBarSkin2),
            MinWidth = 600,
            Maximum = 1000,
            PageSize = 100
        };
        viewport.AddChild(scrollbar3);

        HScrollBar scrollbar4 = new HScrollBar
        {
            SkinClass = typeof (HScrollBarSkin3),
            MinWidth = 700,
            Maximum = 300,
            PageSize = 100
        };
        viewport.AddChild(scrollbar4);

        HScrollBar scrollbar5 = new HScrollBar
        {
            PercentWidth = 100,
            MinWidth = 600,
            SkinClass = typeof (HScrollBarSkin3),
            Maximum = 1000,
            PageSize = 100
        };
        viewport.AddChild(scrollbar5);

        #endregion

    }
        public void InitMapEditorWidgets()
        {
            mapEditor_Menu = new Panel("mapEditor_Menu");
            mapEditor_Menu.Location = new Point(0, this.shortcutBar.Y);
            mapEditor_Menu.Size = this.shortcutBar.Size;
            mapEditor_Menu.BackColor = Color.Transparent;

            tilesetViewer = new Widgets.TilesetViewer("tilesetViewer");
            tilesetViewer.Location = new Point(0, this.pnlTeam.Height + 32);
            tilesetViewer.Size = new Size(this.mapViewer.X, Screen.Height - pnlTeam.Height - shortcutBar.Height - 32);
            tilesetViewer.ActiveTilesetSurface = Graphics.GraphicsManager.Tiles[0];
            tilesetViewer.Visible = false;

            btnTerrain = new Button("btnTerrain");
            btnTerrain.Font = Graphics.FontManager.LoadFont("PMU", 18);
            btnTerrain.Location = new Point(0, this.pnlTeam.Height);
            btnTerrain.Size = new System.Drawing.Size(this.mapViewer.X / 2, 32);
            btnTerrain.Text = "Terrain";
            btnTerrain.Selected = true;
            btnTerrain.Click += new EventHandler<SdlDotNet.Widgets.MouseButtonEventArgs>(btnTerrain_Click);
            btnTerrain.Visible = false;
            Skins.SkinManager.LoadButtonGui(btnTerrain);

            btnAttributes = new Button("btnAttributes");
            btnAttributes.Font = Graphics.FontManager.LoadFont("PMU", 18);
            btnAttributes.Location = new Point(this.mapViewer.X / 2, this.pnlTeam.Height);
            btnAttributes.Size = new System.Drawing.Size(this.mapViewer.X / 2, 32);
            btnAttributes.Text = "Attributes";
            btnAttributes.Selected = false;
            btnAttributes.Click += new EventHandler<SdlDotNet.Widgets.MouseButtonEventArgs>(btnAttributes_Click);
            btnAttributes.Visible = false;
            Skins.SkinManager.LoadButtonGui(btnAttributes);

            #region Attributes Widgets

            pnlAttributes = new Panel("pnlAttributes");
            pnlAttributes.Size = tilesetViewer.Size;
            pnlAttributes.Location = tilesetViewer.Location;
            pnlAttributes.BackColor = Color.White;
            pnlAttributes.Visible = false;

            #region Attribute Options

            pnlAttOptions = new Panel("pnlAttOptions");
            pnlAttOptions.Size = tilesetViewer.Size;
            pnlAttOptions.Location = new Point(0, this.pnlTeam.Height);
            pnlAttOptions.BackColor = Color.White;
            pnlAttOptions.Visible = false;

            btnTitle = new Button("btnTitle");
            btnTitle.Location = new Point(0, 0);
            btnTitle.Size = new Size(134, 32);
            btnTitle.Font = Graphics.FontManager.LoadFont("PMU", 18);
            btnTitle.Visible = false;
            Skins.SkinManager.LoadButtonGui(btnTitle);

            lbl1 = new Label("lbl1");
            lbl1.AutoSize = true;
            lbl1.Font = Graphics.FontManager.LoadFont("PMU", 18);
            lbl1.Location = new Point(0, 35);
            lbl1.Visible = false;

            lbl2 = new Label("lbl2");
            lbl2.AutoSize = true;
            lbl2.Font = Graphics.FontManager.LoadFont("PMU", 18);
            lbl2.Visible = false;

            lbl3 = new Label("lbl3");
            lbl3.AutoSize = true;
            lbl3.Font = Graphics.FontManager.LoadFont("PMU", 18);
            lbl3.Visible = false;

            lbl4 = new Label("lbl4");
            lbl4.AutoSize = true;
            lbl4.Font = Graphics.FontManager.LoadFont("PMU", 18);
            lbl4.Visible = false;

            lblMode = new Label("lblMode");
            lblMode.AutoSize = true;
            lblMode.Font = Graphics.FontManager.LoadFont("PMU", 18);
            lblMode.Location = new Point();
            lblMode.Visible = false;

            txt1 = new TextBox("txt1");
            txt1.Size = new Size(134, 18);
            txt1.Visible = false;

            txt2 = new TextBox("txt2");
            txt2.Size = new Size(134, 18);
            txt2.Visible = false;

            txt3 = new TextBox("txt3");
            txt3.Size = new Size(134, 18);
            txt3.Visible = false;

            hsb1 = new HScrollBar("hsb1");
            hsb1.Size = new Size(134, 20);
            hsb1.Visible = false;
            hsb1.ValueChanged += new EventHandler<ValueChangedEventArgs>(hsb1_ValueChanged);

            hsb2 = new HScrollBar("hsb2");
            hsb2.Size = new Size(134, 20);
            hsb2.Visible = false;
            hsb2.ValueChanged += new EventHandler<ValueChangedEventArgs>(hsb2_ValueChanged);

            hsb3 = new HScrollBar("hsb3");
            hsb3.Size = new Size(134, 20);
            hsb3.Visible = false;
            hsb3.ValueChanged += new EventHandler<ValueChangedEventArgs>(hsb3_ValueChanged);

            picSprite = new PictureBox("picSprite");
            picSprite.Size = new Size(32, 64);
            picSprite.BlitToBuffer(Graphics.GraphicsManager.GetSpriteSheet(hsb1.Value).GetSheet(Graphics.FrameType.Idle, Enums.Direction.Down), new Rectangle(96, 0, 32, 64));

            picSprite.Location = new Point(140, 35);
            picSprite.BackColor = Color.White;
            picSprite.BorderStyle = SdlDotNet.Widgets.BorderStyle.FixedSingle;
            picSprite.Visible = false;

            picSprite2 = new PictureBox("picSprite2");
            picSprite2.Size = new Size(32, 64);
            picSprite2.BlitToBuffer(Graphics.GraphicsManager.GetSpriteSheet(hsb2.Value).GetSheet(Graphics.FrameType.Idle, Enums.Direction.Down), new Rectangle(96, 0, 32, 64));

            picSprite2.Location = new Point(75, 130);
            picSprite2.BackColor = Color.White;
            picSprite2.BorderStyle = SdlDotNet.Widgets.BorderStyle.FixedSingle;
            picSprite2.Visible = false;

            lstSound = new ListBox("lstSound");
            lstSound.Location = new Point(10, 60);
            lstSound.Size = new Size(180, 140);
            {
                SdlDotNet.Graphics.Font font = Logic.Graphics.FontManager.LoadFont("PMU", 18);
                string[] sfxFiles = System.IO.Directory.GetFiles(IO.Paths.SfxPath);
                for (int i = 0; i < sfxFiles.Length; i++) {
                    lstSound.Items.Add(new ListBoxTextItem(font, System.IO.Path.GetFileName(sfxFiles[i])));
                }
            }
            lstSound.Visible = false;

            chkTake = new CheckBox("chkTake");
            chkTake.BackColor = Color.Transparent;
            chkTake.Size = new System.Drawing.Size(125, 17);
            chkTake.Font = Logic.Graphics.FontManager.LoadFont("tahoma", 8);
            chkTake.Text = "Take away key upon use";
            chkTake.Visible = false;

            chkHidden = new CheckBox("chkHidden");
            chkHidden.BackColor = Color.Transparent;
            chkHidden.Size = new System.Drawing.Size(125, 17);
            chkHidden.Font = Logic.Graphics.FontManager.LoadFont("tahoma", 8);
            chkHidden.Text = "Hidden";
            chkHidden.Visible = false;
            chkHidden.CheckChanged += new EventHandler(chkHidden_CheckChanged);

            nudStoryLevel = new NumericUpDown("nudStoryLevel");
            nudStoryLevel.Size = new Size(134, 20);
            nudStoryLevel.Font = Graphics.FontManager.LoadFont("PMU", 18);
            nudStoryLevel.Visible = false;

            optAllow = new RadioButton("optAllow");
            optAllow.Size = new Size(75, 17);
            optAllow.Location = new Point(0, 200);
            optAllow.Font = Graphics.FontManager.LoadFont("tahoma", 12);
            optAllow.Text = "Allow";
            optAllow.Visible = false;
            optAllow.CheckChanged += new EventHandler(optAllow_CheckChanged);

            optBlock = new RadioButton("optBlock");
            optBlock.Size = new Size(75, 17);
            optBlock.Location = new Point(100, 200);
            optBlock.Font = Graphics.FontManager.LoadFont("tahoma", 12);
            optBlock.Text = "Block";
            optBlock.Visible = false;
            optBlock.CheckChanged += new EventHandler(optBlock_CheckChanged);

            btnOK = new Button("btnOK");
            btnOK.Location = new Point(this.mapViewer.X / 4, Screen.Height - shortcutBar.Height - 32);
            btnOK.Size = new System.Drawing.Size(this.mapViewer.X / 2, 32);
            btnOK.Font = Graphics.FontManager.LoadFont("PMU", 18);
            btnOK.Text = "Ok";
            btnOK.Visible = false;
            btnOK.Click += new EventHandler<MouseButtonEventArgs>(btnOK_Click);
            Skins.SkinManager.LoadButtonGui(btnOK);

            /*btnBack = new Button("btnBack");
            btnBack.Location = new Point(0, Screen.Height - shortcutBar.Height - 32);
            btnBack.Size = new System.Drawing.Size(this.mapViewer.X / 2, 32);
            btnBack.Font = Graphics.FontManager.LoadFont("PMU", 18);
            btnBack.Text = "Back";
            btnBack.Visible = false;
            btnBack.Click +=new EventHandler<MouseButtonEventArgs>(btnBack_Click);
            Skins.SkinManager.LoadButtonGui(btnBack);*/

            pnlAttOptions.AddWidget(lbl1);
            pnlAttOptions.AddWidget(lbl2);
            pnlAttOptions.AddWidget(lbl3);
            pnlAttOptions.AddWidget(lbl4);
            pnlAttOptions.AddWidget(lblMode);
            pnlAttOptions.AddWidget(txt1);
            pnlAttOptions.AddWidget(txt2);
            pnlAttOptions.AddWidget(txt3);
            pnlAttOptions.AddWidget(hsb1);
            pnlAttOptions.AddWidget(hsb2);
            pnlAttOptions.AddWidget(hsb3);
            pnlAttOptions.AddWidget(picSprite);
            pnlAttOptions.AddWidget(picSprite2);
            pnlAttOptions.AddWidget(lstSound);
            pnlAttOptions.AddWidget(chkTake);
            pnlAttOptions.AddWidget(chkHidden);
            pnlAttOptions.AddWidget(nudStoryLevel);
            pnlAttOptions.AddWidget(optAllow);
            pnlAttOptions.AddWidget(optBlock);
            pnlAttOptions.AddWidget(btnTitle);

            #endregion

            optBlocked = new RadioButton("optBlocked");
            optBlocked.BackColor = Color.Transparent;
            optBlocked.Font = Graphics.FontManager.LoadFont("tahoma", 12);
            optBlocked.Location = new Point(8, 6);
            optBlocked.Size = new System.Drawing.Size(95, 17);
            optBlocked.Text = "Blocked";
            optBlocked.Checked = true;

            optNpcAvoid = new RadioButton("optNpcAvoid");
            optNpcAvoid.BackColor = Color.Transparent;
            optNpcAvoid.Font = Graphics.FontManager.LoadFont("tahoma", 12);
            optNpcAvoid.Location = new Point(8, 75);
            optNpcAvoid.Size = new System.Drawing.Size(95, 17);
            optNpcAvoid.Text = "Npc Avoid";

            optNotice = new RadioButton("optNotice");
            optNotice.BackColor = Color.Transparent;
            optNotice.Font = Graphics.FontManager.LoadFont("tahoma", 12);
            optNotice.Location = new Point(8, 236);
            optNotice.Size = new System.Drawing.Size(95, 17);
            optNotice.Text = "Notice";
            optNotice.Click += new EventHandler<MouseButtonEventArgs>(optNotice_CheckChanged);

            optSign = new RadioButton("optSign");
            optSign.BackColor = Color.Transparent;
            optSign.Font = Graphics.FontManager.LoadFont("tahoma", 12);
            optSign.Location = new Point(105, 6);
            optSign.Size = new System.Drawing.Size(95, 17);
            optSign.Text = "Sign";
            optSign.Click += new EventHandler<MouseButtonEventArgs>(optSign_CheckChanged);

            optHeal = new RadioButton("optHeal");
            optHeal.BackColor = Color.Transparent;
            optHeal.Font = Graphics.FontManager.LoadFont("tahoma", 12);
            optHeal.Location = new Point(8, 144);
            optHeal.Size = new System.Drawing.Size(95, 17);
            optHeal.Text = "Heal";

            optKill = new RadioButton("optKill");
            optKill.BackColor = Color.Transparent;
            optKill.Font = Graphics.FontManager.LoadFont("tahoma", 12);
            optKill.Location = new Point(8, 167);
            optKill.Size = new System.Drawing.Size(95, 17);
            optKill.Text = "Kill";

            optGuildBlock = new RadioButton("optGuildBlock");
            optGuildBlock.BackColor = Color.Transparent;
            optGuildBlock.Font = Graphics.FontManager.LoadFont("tahoma", 12);
            optGuildBlock.Location = new Point(105, 98);
            optGuildBlock.Size = new System.Drawing.Size(95, 17);
            optGuildBlock.Text = "Guild";
            //optGuildBlock.Click += new EventHandler<MouseButtonEventArgs>(optGuildBlock_CheckChanged);

            optLevelBlock = new RadioButton("optLevelBlock");
            optLevelBlock.BackColor = Color.Transparent;
            optLevelBlock.Font = Graphics.FontManager.LoadFont("tahoma", 12);
            optLevelBlock.Location = new Point(105, 144);
            optLevelBlock.Size = new System.Drawing.Size(95, 17);
            optLevelBlock.Text = "Level Block";
            optLevelBlock.Click += new EventHandler<MouseButtonEventArgs>(optLevelBlock_CheckChanged);

            optSpriteChange = new RadioButton("optSpriteChange");
            optSpriteChange.BackColor = Color.Transparent;
            optSpriteChange.Font = Graphics.FontManager.LoadFont("tahoma", 12);
            optSpriteChange.Location = new Point(8, 282);
            optSpriteChange.Size = new System.Drawing.Size(112, 17);
            optSpriteChange.Text = "New Sprite";
            optSpriteChange.Click += new EventHandler<MouseButtonEventArgs>(optSpriteChange_CheckChanged);

            optWarp = new RadioButton("optWarp");
            optWarp.BackColor = Color.Transparent;
            optWarp.Font = Graphics.FontManager.LoadFont("tahoma", 12);
            optWarp.Location = new Point(8, 29);
            optWarp.Size = new System.Drawing.Size(95, 17);
            optWarp.Text = "Warp";
            optWarp.CheckChanged += new EventHandler(optWarp_CheckChanged);

            optItem = new RadioButton("optItem");
            optItem.BackColor = Color.Transparent;
            optItem.Font = Graphics.FontManager.LoadFont("tahoma", 12);
            optItem.Location = new Point(8, 52);
            optItem.Size = new System.Drawing.Size(95, 17);
            optItem.Text = "Item";
            optItem.CheckChanged += new EventHandler(optItem_CheckChanged);

            optKey = new RadioButton("optKey");
            optKey.BackColor = Color.Transparent;
            optKey.Font = Graphics.FontManager.LoadFont("tahoma", 12);
            optKey.Location = new Point(8, 98);
            optKey.Size = new System.Drawing.Size(95, 17);
            optKey.Text = "Key";
            optKey.CheckChanged += new EventHandler(optKey_CheckChanged);

            optKeyOpen = new RadioButton("optKeyOpen");
            optKeyOpen.BackColor = Color.Transparent;
            optKeyOpen.Font = Graphics.FontManager.LoadFont("tahoma", 12);
            optKeyOpen.Location = new Point(8, 121);
            optKeyOpen.Size = new System.Drawing.Size(95, 17);
            optKeyOpen.Text = "Key Open";
            optKeyOpen.CheckChanged += new EventHandler(optKeyOpen_CheckChanged);

            optSound = new RadioButton("optSound");
            optSound.BackColor = Color.Transparent;
            optSound.Font = Graphics.FontManager.LoadFont("tahoma", 12);
            optSound.Location = new Point(8, 190);
            optSound.Size = new System.Drawing.Size(95, 17);
            optSound.Text = "Sound";
            optSound.CheckChanged += new EventHandler(optSound_CheckChanged);

            optScripted = new RadioButton("optScripted");
            optScripted.BackColor = Color.Transparent;
            optScripted.Font = Graphics.FontManager.LoadFont("tahoma", 12);
            optScripted.Location = new Point(8, 213);
            optScripted.Size = new System.Drawing.Size(95, 17);
            optScripted.Text = "Scripted";
            optScripted.CheckChanged += new EventHandler(optScripted_CheckChanged);

            optDoor = new RadioButton("optDoor");
            optDoor.BackColor = Color.Transparent;
            optDoor.Font = Graphics.FontManager.LoadFont("tahoma", 12);
            optDoor.Location = new Point(8, 259);
            optDoor.Size = new System.Drawing.Size(95, 17);
            optDoor.Text = "Door";

            optShop = new RadioButton("optShop");
            optShop.BackColor = Color.Transparent;
            optShop.Font = Graphics.FontManager.LoadFont("tahoma", 12);
            optShop.Location = new Point(105, 29);
            optShop.Size = new System.Drawing.Size(95, 17);
            optShop.Text = "Shop";
            optShop.CheckChanged += new EventHandler(optShop_CheckChanged);

            optArena = new RadioButton("optArena");
            optArena.BackColor = Color.Transparent;
            optArena.Font = Graphics.FontManager.LoadFont("tahoma", 12);
            optArena.Location = new Point(105, 52);
            optArena.Size = new System.Drawing.Size(95, 17);
            optArena.Text = "Arena";
            optArena.CheckChanged += new EventHandler(optArena_CheckChanged);

            optBank = new RadioButton("optBank");
            optBank.BackColor = Color.Transparent;
            optBank.Font = Graphics.FontManager.LoadFont("tahoma", 12);
            optBank.Location = new Point(105, 75);
            optBank.Size = new System.Drawing.Size(95, 17);
            optBank.Text = "Bank";
            optBank.CheckChanged += new EventHandler(optBank_CheckChanged);

            optSpriteBlock = new RadioButton("optSpriteBlock");
            optSpriteBlock.BackColor = Color.Transparent;
            optSpriteBlock.Font = Graphics.FontManager.LoadFont("tahoma", 12);
            optSpriteBlock.Location = new Point(105, 121);
            optSpriteBlock.Size = new System.Drawing.Size(105, 17);
            optSpriteBlock.Text = "Sprite Block";
            optSpriteBlock.CheckChanged += new EventHandler(optSpriteBlock_CheckChanged);

            optAssembly = new RadioButton("optAssembly");
            optAssembly.BackColor = Color.Transparent;
            optAssembly.Font = Graphics.FontManager.LoadFont("tahoma", 12);
            optAssembly.Location = new Point(8, 328);
            optAssembly.Size = new System.Drawing.Size(145, 17);
            optAssembly.Text = "Assembly";

            optEvolution = new RadioButton("optEvolution");
            optEvolution.BackColor = Color.Transparent;
            optEvolution.Font = Graphics.FontManager.LoadFont("tahoma", 12);
            optEvolution.Location = new Point(105, 167);
            optEvolution.Size = new System.Drawing.Size(95, 17);
            optEvolution.Text = "Evolution";

            optStory = new RadioButton("optStory");
            optStory.BackColor = Color.Transparent;
            optStory.Font = Graphics.FontManager.LoadFont("tahoma", 12);
            optStory.Location = new Point(105, 190);
            optStory.Size = new System.Drawing.Size(95, 17);
            optStory.Text = "Story";
            optStory.CheckChanged += new EventHandler(optStory_CheckChanged);

            optLinkShop = new RadioButton("optLinkShop");
            optLinkShop.BackColor = Color.Transparent;
            optLinkShop.Font = Graphics.FontManager.LoadFont("tahoma", 12);
            optLinkShop.Location = new Point(105, 213);
            optLinkShop.Size = new System.Drawing.Size(95, 17);
            optLinkShop.Text = "Link Shop";
            optLinkShop.CheckChanged += new EventHandler(optLinkShop_CheckChanged);

            optMobileBlock = new RadioButton("optMobileBlock");
            optMobileBlock.BackColor = Color.Transparent;
            optMobileBlock.Font = Graphics.FontManager.LoadFont("tahoma", 12);
            optMobileBlock.Location = new Point(105, 236);
            optMobileBlock.Size = new System.Drawing.Size(105, 17);
            optMobileBlock.Text = "Mobile Block";
            optMobileBlock.CheckChanged += new EventHandler(optMobileBlock_CheckChanged);

            optMission = new RadioButton("optMission");
            optMission.BackColor = Color.Transparent;
            optMission.Font = Graphics.FontManager.LoadFont("tahoma", 12);
            optMission.Location = new Point(8, 351);
            optMission.Size = new System.Drawing.Size(115, 17);
            optMission.Text = "Mission Board";

            optScriptedSign = new RadioButton("optScriptedSign");
            optScriptedSign.BackColor = Color.Transparent;
            optScriptedSign.Font = Graphics.FontManager.LoadFont("tahoma", 12);
            optScriptedSign.Location = new Point(8, 305);
            optScriptedSign.Size = new System.Drawing.Size(105, 17);
            optScriptedSign.Text = "Scripted Sign";
            optScriptedSign.CheckChanged += new EventHandler(optScriptedSign_CheckChanged);

            optAmbiguous = new RadioButton("optAmbiguous");
            optAmbiguous.BackColor = Color.Transparent;
            optAmbiguous.Font = Graphics.FontManager.LoadFont("tahoma", 12);
            optAmbiguous.Location = new Point(105, 259);
            optAmbiguous.Size = new System.Drawing.Size(95, 17);
            optAmbiguous.Text = "Ambiguous";

            optSlippery = new RadioButton("optSlippery");
            optSlippery.BackColor = Color.Transparent;
            optSlippery.Font = Graphics.FontManager.LoadFont("tahoma", 12);
            optSlippery.Location = new Point(105, 282);
            optSlippery.Size = new System.Drawing.Size(95, 17);
            optSlippery.Text = "Slippery";
            optSlippery.CheckChanged += new EventHandler(optSlippery_CheckChanged);

            optSlow = new RadioButton("optSlow");
            optSlow.BackColor = Color.Transparent;
            optSlow.Font = Graphics.FontManager.LoadFont("tahoma", 12);
            optSlow.Location = new Point(105, 305);
            optSlow.Size = new System.Drawing.Size(95, 17);
            optSlow.Text = "Slow";
            optSlow.CheckChanged += new EventHandler(optSlow_CheckChanged);

            optDropShop = new RadioButton("optDropShop");
            optDropShop.BackColor = Color.Transparent;
            optDropShop.Font = Graphics.FontManager.LoadFont("tahoma", 12);
            optDropShop.Location = new Point(105, 328);
            optDropShop.Size = new System.Drawing.Size(95, 17);
            optDropShop.Text = "DropShop";
            optDropShop.CheckChanged += new EventHandler(optDropShop_CheckChanged);

            lblDungeonTileValue = new Label("lblDungeonTileValue");
            lblDungeonTileValue.AutoSize = true;
            lblDungeonTileValue.Font = Graphics.FontManager.LoadFont("PMU", 18);
            lblDungeonTileValue.Text = "Dungeon Tile Value:";
            lblDungeonTileValue.Location = new Point(8, 376);

            nudDungeonTileValue = new NumericUpDown("nudDungeonTileValue");
            nudDungeonTileValue.Size = new Size(134, 20);
            nudDungeonTileValue.Maximum = Int32.MaxValue;
            nudDungeonTileValue.Font = Graphics.FontManager.LoadFont("PMU", 18);
            nudDungeonTileValue.Location = new Point(10, 400);

            #region House Editor Attributes

            optRoomWarp = new RadioButton("optRoomWarp");
            optRoomWarp.BackColor = Color.Transparent;
            optRoomWarp.Font = Graphics.FontManager.LoadFont("tahoma", 12);
            optRoomWarp.Location = new Point(115, 6);
            optRoomWarp.Size = new System.Drawing.Size(95, 17);
            optRoomWarp.Text = "Warp to Room";

            #endregion

            tempArrayForMobility = new bool[16];

            pnlAttributes.AddWidget(optBlocked);
            pnlAttributes.AddWidget(optWarp);
            pnlAttributes.AddWidget(optItem);
            pnlAttributes.AddWidget(optNpcAvoid);
            pnlAttributes.AddWidget(optKey);
            pnlAttributes.AddWidget(optKeyOpen);
            pnlAttributes.AddWidget(optHeal);
            pnlAttributes.AddWidget(optKill);
            pnlAttributes.AddWidget(optSound);
            pnlAttributes.AddWidget(optScripted);
            pnlAttributes.AddWidget(optNotice);
            pnlAttributes.AddWidget(optDoor);
            pnlAttributes.AddWidget(optSign);
            pnlAttributes.AddWidget(optSpriteChange);
            pnlAttributes.AddWidget(optShop);
            pnlAttributes.AddWidget(optArena);
            pnlAttributes.AddWidget(optBank);
            pnlAttributes.AddWidget(optGuildBlock);
            pnlAttributes.AddWidget(optSpriteBlock);
            pnlAttributes.AddWidget(optMobileBlock);
            pnlAttributes.AddWidget(optLevelBlock);
            pnlAttributes.AddWidget(optAssembly);
            pnlAttributes.AddWidget(optEvolution);
            pnlAttributes.AddWidget(optStory);
            pnlAttributes.AddWidget(optLinkShop);
            pnlAttributes.AddWidget(optMission);
            pnlAttributes.AddWidget(optScriptedSign);
            pnlAttributes.AddWidget(optAmbiguous);
            pnlAttributes.AddWidget(optSlippery);
            pnlAttributes.AddWidget(optSlow);
            pnlAttributes.AddWidget(optDropShop);
            pnlAttributes.AddWidget(lblDungeonTileValue);
            pnlAttributes.AddWidget(nudDungeonTileValue);

            #endregion

            #region Mapping Widgets

            btnMapping = new Button("btnMapping");
            btnMapping.Size = new System.Drawing.Size(100, 30);
            btnMapping.Location = new Point(0, 0);
            btnMapping.Font = Graphics.FontManager.LoadFont("PMU.ttf", 24);
            btnMapping.Text = "Mapping";
            btnMapping.MouseHoverDelay = 100;
            btnMapping.Click += new EventHandler<SdlDotNet.Widgets.MouseButtonEventArgs>(btnMapping_Click);
            btnMapping.MouseHover += new EventHandler(btnMapping_MouseHover);
            Skins.SkinManager.LoadButtonGui(btnMapping);

            pnlMapping = new Panel("pnlMapping");
            pnlMapping.Size = new Size(150, 190);
            pnlMapping.Location = new Point(0, btnMapping.Y + mapEditor_Menu.Y - pnlMapping.Height);
            pnlMapping.BackColor = Color.White;
            pnlMapping.BorderStyle = SdlDotNet.Widgets.BorderStyle.FixedSingle;
            pnlMapping.SetAutoHide();

            btnMapProperties = new Button("btnMapProperties");
            btnMapProperties.Size = new System.Drawing.Size(100, 30);
            btnMapProperties.Location = new Point(DrawingSupport.GetCenter(pnlMapping.Width, btnMapProperties.Width), 10);
            btnMapProperties.Font = Graphics.FontManager.LoadFont("tahoma.ttf", 10);
            btnMapProperties.Text = "Properties";
            btnMapProperties.Click += new EventHandler<MouseButtonEventArgs>(btnMapProperties_Click);
            Skins.SkinManager.LoadButtonGui(btnMapProperties);

            btnHouseProperties = new Button("btnHouseProperties");
            btnHouseProperties.Size = new System.Drawing.Size(100, 30);
            btnHouseProperties.Location = new Point(DrawingSupport.GetCenter(pnlMapping.Width, btnMapProperties.Width), 10);
            btnHouseProperties.Font = Graphics.FontManager.LoadFont("tahoma.ttf", 10);
            btnHouseProperties.Text = "Music";
            btnHouseProperties.Click += new EventHandler<MouseButtonEventArgs>(btnHouseProperties_Click);
            Skins.SkinManager.LoadButtonGui(btnHouseProperties);

            btnLoadMap = new Button("btnLoadMap");
            btnLoadMap.Size = new System.Drawing.Size(100, 30);
            btnLoadMap.Location = new Point(DrawingSupport.GetCenter(pnlMapping.Width, btnLoadMap.Width), 40);
            btnLoadMap.Font = Graphics.FontManager.LoadFont("tahoma.ttf", 10);
            btnLoadMap.Text = "Load Map";
            btnLoadMap.Click += new EventHandler<SdlDotNet.Widgets.MouseButtonEventArgs>(btnLoadMap_Click);
            Skins.SkinManager.LoadButtonGui(btnLoadMap);

            btnSaveMap = new Button("btnSaveMap");
            btnSaveMap.Size = new System.Drawing.Size(100, 30);
            btnSaveMap.Location = new Point(DrawingSupport.GetCenter(pnlMapping.Width, btnSaveMap.Width), 70);
            btnSaveMap.Font = Graphics.FontManager.LoadFont("tahoma.ttf", 10);
            btnSaveMap.Text = "Save Map";
            btnSaveMap.Click += new EventHandler<SdlDotNet.Widgets.MouseButtonEventArgs>(btnSaveMap_Click);
            Skins.SkinManager.LoadButtonGui(btnSaveMap);

            btnTakeScreenshot = new Button("btnTakeScreenshot");
            btnTakeScreenshot.Size = new System.Drawing.Size(100, 30);
            btnTakeScreenshot.Location = new Point(DrawingSupport.GetCenter(pnlMapping.Width, btnTakeScreenshot.Width), 100);
            btnTakeScreenshot.Font = Graphics.FontManager.LoadFont("tahoma.ttf", 10);
            btnTakeScreenshot.Text = "Take Screenshot";
            btnTakeScreenshot.Click += new EventHandler<SdlDotNet.Widgets.MouseButtonEventArgs>(btnTakeScreenshot_Click);
            Skins.SkinManager.LoadButtonGui(btnTakeScreenshot);

            btnExit = new Button("btnExit");
            btnExit.Size = new System.Drawing.Size(100, 30);
            btnExit.Location = new Point(DrawingSupport.GetCenter(pnlMapping.Width, btnExit.Width), 130);
            btnExit.Font = Graphics.FontManager.LoadFont("tahoma.ttf", 10);
            btnExit.Text = "Exit";
            btnExit.Click += new EventHandler<SdlDotNet.Widgets.MouseButtonEventArgs>(btnExit_Click);
            Skins.SkinManager.LoadButtonGui(btnExit);

            pnlMapping.AddWidget(btnMapProperties);
            pnlMapping.AddWidget(btnHouseProperties);
            pnlMapping.AddWidget(btnLoadMap);
            pnlMapping.AddWidget(btnSaveMap);
            pnlMapping.AddWidget(btnTakeScreenshot);
            pnlMapping.AddWidget(btnExit);

            #endregion

            #region Layer Widgets

            btnLayers = new Button("btnLayers");
            btnLayers.Size = new System.Drawing.Size(100, 30);
            btnLayers.Location = new Point(100, 0);
            btnLayers.Font = Graphics.FontManager.LoadFont("PMU.ttf", 24);
            btnLayers.Text = "Layers";
            btnLayers.MouseHoverDelay = 100;
            btnLayers.Click += new EventHandler<SdlDotNet.Widgets.MouseButtonEventArgs>(btnLayers_Click);
            btnLayers.MouseHover += new EventHandler(btnLayers_MouseHover);
            Skins.SkinManager.LoadButtonGui(btnLayers);

            pnlLayers = new Panel("pnlLayers");
            pnlLayers.Size = new Size(350, 100);
            pnlLayers.Location = new Point(100, btnLayers.Y + mapEditor_Menu.Y - pnlLayers.Height);
            pnlLayers.BackColor = Color.White;
            pnlLayers.BorderStyle = SdlDotNet.Widgets.BorderStyle.FixedSingle;
            pnlLayers.SetAutoHide();

            optGround = new RadioButton("optGround");
            optGround.BackColor = Color.Transparent;
            optGround.Location = new Point(8, 19);
            optGround.Size = new Size(60, 17);
            optGround.Font = Logic.Graphics.FontManager.LoadFont("tahoma", 8);
            optGround.Text = "Ground";
            optGround.Checked = true;

            optMask = new RadioButton("optMask");
            optMask.BackColor = Color.Transparent;
            optMask.Location = new Point(74, 19);
            optMask.Size = new Size(51, 17);
            optMask.Font = Logic.Graphics.FontManager.LoadFont("tahoma", 8);
            optMask.Text = "Mask";

            optMask2 = new RadioButton("optMask2");
            optMask2.BackColor = Color.Transparent;
            optMask2.Location = new Point(131, 19);
            optMask2.Size = new Size(60, 17);
            optMask2.Font = Logic.Graphics.FontManager.LoadFont("tahoma", 8);
            optMask2.Text = "Mask 2";

            optFringe = new RadioButton("optFringe");
            optFringe.BackColor = Color.Transparent;
            optFringe.Location = new Point(197, 19);
            optFringe.Size = new Size(54, 17);
            optFringe.Font = Logic.Graphics.FontManager.LoadFont("tahoma", 8);
            optFringe.Text = "Fringe";

            optFringe2 = new RadioButton("optFringe2");
            optFringe2.BackColor = Color.Transparent;
            optFringe2.Location = new Point(257, 19);
            optFringe2.Size = new Size(63, 17);
            optFringe2.Font = Logic.Graphics.FontManager.LoadFont("tahoma", 8);
            optFringe2.Text = "Fringe 2";

            chkAnim = new CheckBox("chkAnim");
            chkAnim.BackColor = Color.Transparent;
            chkAnim.Location = new Point(8, 50);
            chkAnim.Size = new Size(70, 17);
            chkAnim.Font = Logic.Graphics.FontManager.LoadFont("tahoma", 8);
            chkAnim.Text = "Animation";

            btnFill = new Button("btnFill");
            btnFill.Location = new Point(8, 70);
            btnFill.Size = new System.Drawing.Size(30, 20);
            btnFill.Text = "Fill";
            btnFill.Font = Logic.Graphics.FontManager.LoadFont("tahoma", 8);
            btnFill.Click += new EventHandler<SdlDotNet.Widgets.MouseButtonEventArgs>(btnFill_Click);
            Skins.SkinManager.LoadButtonGui(btnFill);

            btnClear = new Button("btnClear");
            btnClear.Location = new Point(40, 70);
            btnClear.Size = new System.Drawing.Size(30, 20);
            btnClear.Text = "Clear";
            btnClear.Font = Logic.Graphics.FontManager.LoadFont("tahoma", 8);
            btnClear.Click += new EventHandler<SdlDotNet.Widgets.MouseButtonEventArgs>(btnClear_Click);
            Skins.SkinManager.LoadButtonGui(btnClear);

            btnEyeDropper = new Button("btnEyeDropper");
            btnEyeDropper.Location = new Point(72, 70);
            btnEyeDropper.Size = new System.Drawing.Size(100, 20);
            btnEyeDropper.Text = "Eye Dropper";
            btnEyeDropper.Click += new EventHandler<MouseButtonEventArgs>(btnEyeDropper_Click);
            Skins.SkinManager.LoadButtonGui(btnEyeDropper);

            pnlLayers.AddWidget(optGround);
            pnlLayers.AddWidget(optMask);
            pnlLayers.AddWidget(optMask2);
            pnlLayers.AddWidget(optFringe);
            pnlLayers.AddWidget(optFringe2);
            pnlLayers.AddWidget(chkAnim);
            pnlLayers.AddWidget(btnFill);
            pnlLayers.AddWidget(btnClear);
            pnlLayers.AddWidget(btnEyeDropper);

            #endregion

            #region Tileset Widgets

            btnTileset = new Button("btnTileset");
            btnTileset.Size = new System.Drawing.Size(100, 30);
            btnTileset.Location = new Point(200, 0);
            btnTileset.Font = Graphics.FontManager.LoadFont("PMU.ttf", 24);
            btnTileset.Text = "Tilesets";
            btnTileset.MouseHoverDelay = 100;
            btnTileset.Click += new EventHandler<SdlDotNet.Widgets.MouseButtonEventArgs>(btnTileset_Click);
            btnTileset.MouseHover += new EventHandler(btnTileset_MouseHover);
            Skins.SkinManager.LoadButtonGui(btnTileset);

            pnlTileset = new Panel("pnlTileset");
            pnlTileset.Size = new Size(300, 100);
            pnlTileset.Location = new Point(200, btnTileset.Y + mapEditor_Menu.Y - pnlTileset.Height);
            pnlTileset.BackColor = Color.White;
            pnlTileset.BorderStyle = SdlDotNet.Widgets.BorderStyle.FixedSingle;
            pnlTileset.SetAutoHide();

            hTilesetSelect = new HScrollBar("hTilesetSelect");
            hTilesetSelect.Location = new Point(5, 60);
            hTilesetSelect.Size = new Size(290, 12);
            hTilesetSelect.Maximum = 10;
            hTilesetSelect.ValueChanged += new EventHandler<ValueChangedEventArgs>(hTilesetSelect_ValueChanged);

            lblSelectedTileset = new Label("lblSelectedTileset");
            lblSelectedTileset.AutoSize = true;
            lblSelectedTileset.Location = new Point(5, 75);
            lblSelectedTileset.Font = Graphics.FontManager.LoadFont("tahoma.ttf", 10);
            lblSelectedTileset.Text = "Tileset -1";

            btnLoadTileset = new Button("btnLoadTileset");
            btnLoadTileset.Size = new System.Drawing.Size(30, 20);
            btnLoadTileset.Location = new Point(265, 75);
            btnLoadTileset.Text = "Load";
            btnLoadTileset.Click += new EventHandler<SdlDotNet.Widgets.MouseButtonEventArgs>(btnLoadTileset_Click);
            Skins.SkinManager.LoadButtonGui(btnLoadTileset);

            picTilesetPreview = new PictureBox[8];

            for (int i = 0; i < picTilesetPreview.Length; i++) {
                picTilesetPreview[i] = new PictureBox("picTilesetPreview" + i);
                picTilesetPreview[i].Location = new Point(5 + (i * 37), 10);
                picTilesetPreview[i].Size = new System.Drawing.Size(32, 32);
                picTilesetPreview[i].BackColor = Color.White;
                picTilesetPreview[i].BorderStyle = SdlDotNet.Widgets.BorderStyle.FixedSingle;
            }

            pnlTileset.AddWidget(hTilesetSelect);
            pnlTileset.AddWidget(lblSelectedTileset);
            pnlTileset.AddWidget(btnLoadTileset);

            for (int i = 0; i < picTilesetPreview.Length; i++) {
                pnlTileset.AddWidget(picTilesetPreview[i]);
            }

            #endregion

            #region Settings Widgets

            btnSettings = new Button("btnSettings");
            btnSettings.Size = new System.Drawing.Size(100, 30);
            btnSettings.Location = new Point(300, 0);
            btnSettings.Font = Graphics.FontManager.LoadFont("PMU.ttf", 24);
            btnSettings.Text = "Settings";
            btnSettings.MouseHoverDelay = 100;
            btnSettings.Click += new EventHandler<SdlDotNet.Widgets.MouseButtonEventArgs>(btnSettings_Click);
            btnSettings.MouseHover += new EventHandler(btnSettings_MouseHover);
            Skins.SkinManager.LoadButtonGui(btnSettings);

            pnlSettings = new Panel("pnlOptions");
            pnlSettings.Size = new Size(200, 200);
            pnlSettings.Location = new Point(300, btnSettings.Y + mapEditor_Menu.Y - pnlSettings.Height);
            pnlSettings.BackColor = Color.White;
            pnlSettings.BorderStyle = SdlDotNet.Widgets.BorderStyle.FixedSingle;
            pnlSettings.SetAutoHide();

            lblDisplaySettings = new Label("lblDisplaySettings");
            lblDisplaySettings.AutoSize = true;
            lblDisplaySettings.Location = new Point(5, 5);
            lblDisplaySettings.Font = Graphics.FontManager.LoadFont("tahoma.ttf", 12);
            lblDisplaySettings.Text = "Display Settings";

            chkDisplayMapGrid = new CheckBox("chkDisplayMapGrid");
            chkDisplayMapGrid.Location = new Point(5, 25);
            chkDisplayMapGrid.Size = new System.Drawing.Size(125, 17);
            chkDisplayMapGrid.BackColor = Color.Transparent;
            chkDisplayMapGrid.Font = Graphics.FontManager.LoadFont("tahoma.ttf", 10);
            chkDisplayMapGrid.Text = "Map Grid";
            chkDisplayMapGrid.Checked = IO.Options.MapGrid;
            chkDisplayMapGrid.CheckChanged += new EventHandler(chkDisplayMapGrid_CheckChanged);

            chkDisplayAttributes = new CheckBox("chkDisplayAttributes");
            chkDisplayAttributes.Location = new Point(5, 45);
            chkDisplayAttributes.Size = new System.Drawing.Size(125, 17);
            chkDisplayAttributes.BackColor = Color.Transparent;
            chkDisplayAttributes.Font = Graphics.FontManager.LoadFont("tahoma.ttf", 10);
            chkDisplayAttributes.Text = "Attributes";
            chkDisplayAttributes.Checked = IO.Options.DisplayAttributes;
            chkDisplayAttributes.CheckChanged += new EventHandler(chkDisplayAttributes_CheckChanged);

            chkDisplayDungeonValues = new CheckBox("chkDisplayDungeonValues");
            chkDisplayDungeonValues.Location = new Point(5, 65);
            chkDisplayDungeonValues.Size = new System.Drawing.Size(125, 17);
            chkDisplayDungeonValues.BackColor = Color.Transparent;
            chkDisplayDungeonValues.Font = Graphics.FontManager.LoadFont("tahoma.ttf", 10);
            chkDisplayDungeonValues.Text = "DungeonValues";
            chkDisplayDungeonValues.Checked = IO.Options.DisplayDungeonValues;
            chkDisplayDungeonValues.CheckChanged += new EventHandler(chkDisplayDungeonValues_CheckChanged);

            lblMappingSettings = new Label("lblMappingSettings");
            lblMappingSettings.AutoSize = true;
            lblMappingSettings.Location = new Point(5, 85);
            lblMappingSettings.Font = Graphics.FontManager.LoadFont("tahoma.ttf", 12);
            lblMappingSettings.Text = "Mapping Settings";

            chkDragAndPlace = new CheckBox("chkDragAndPlace");
            chkDragAndPlace.Location = new Point(5, 105);
            chkDragAndPlace.Size = new System.Drawing.Size(125, 17);
            chkDragAndPlace.BackColor = Color.Transparent;
            chkDragAndPlace.Font = Graphics.FontManager.LoadFont("tahoma.ttf", 10);
            chkDragAndPlace.Text = "Drag and Place";
            chkDragAndPlace.Checked = IO.Options.DragAndPlace;
            chkDragAndPlace.CheckChanged += new EventHandler(chkDragAndPlace_CheckChanged);

            pnlSettings.AddWidget(lblDisplaySettings);
            pnlSettings.AddWidget(chkDisplayMapGrid);
            pnlSettings.AddWidget(chkDisplayAttributes);
            pnlSettings.AddWidget(chkDisplayDungeonValues);
            pnlSettings.AddWidget(lblMappingSettings);
            pnlSettings.AddWidget(chkDragAndPlace);

            #endregion

            Screen.AddWidget(tilesetViewer);
            Screen.AddWidget(btnTerrain);
            Screen.AddWidget(btnAttributes);
            Screen.AddWidget(btnOK);
            //this.AddWidget(btnBack);

            Screen.AddWidget(pnlAttributes);
            Screen.AddWidget(pnlAttOptions);

            mapEditor_Menu.AddWidget(btnMapping);
            Screen.AddWidget(pnlMapping);

            mapEditor_Menu.AddWidget(btnLayers);
            Screen.AddWidget(pnlLayers);

            mapEditor_Menu.AddWidget(btnTileset);
            Screen.AddWidget(pnlTileset);

            mapEditor_Menu.AddWidget(btnSettings);
            Screen.AddWidget(pnlSettings);

            mapEditor_Menu.Visible = false;
            Screen.AddWidget(mapEditor_Menu);

            hTilesetSelect_ValueChanged(hTilesetSelect, new ValueChangedEventArgs(0, 0));
        }
示例#35
0
    override protected void CreateChildren()
    {
        base.CreateChildren();

        /**
         * Note: this demo HAS the overall scroller, but the stage itself SEEMS not to scroll
         * That's because we pushed the scrolled 150 px from both right and bottom
         * so we could place additional scrollbars there.
         * */

        #region Scroller + viewport

        Scroller scroller = new Scroller
        {
            SkinClass = typeof (ScrollerSkin2),
            Left = 10,
            Right = 150,
            Top = 10,
            Bottom = 150
        };
        //scroller.SetStyle("horizontalScrollPolicy", ScrollPolicy.On);
        //scroller.SetStyle("verticalScrollPolicy", ScrollPolicy.On);
        AddChild(scroller);

        Group viewport = new Group();
        scroller.Viewport = viewport;

        #endregion
        
        #region Horizontal scrollers

        HGroup hGroup = new HGroup { Gap = 10 };
        viewport.AddChild(hGroup);

        VGroup hScrollers = new VGroup
                                {
                                    PercentWidth = 100,
                                    Gap = 10,
                                    Left = 10,
                                    Right = 150,
                                    Bottom = 10
                                };
        AddChild(hScrollers);

        HScrollBar hScroll = new HScrollBar
                                    {
                                        SkinClass = typeof(HScrollBarSkin3),
                                        PercentWidth = 100,
                                        Maximum = 600,
                                        Viewport = viewport,
                                        MouseWheelScrollsHorizontally = true
                                    };
        hScrollers.AddChild(hScroll);

        hScroll = new HScrollBar
                        {
                            SkinClass = typeof(HScrollBarSkin2),
                            PercentWidth = 100,
                            Maximum = 600,
                            Viewport = viewport,
                        };
        hScrollers.AddChild(hScroll);

        hScroll = new HScrollBar
                        {
                            PercentWidth = 100,
                            Maximum = 600,
                            Viewport = viewport,
                        };
        hScrollers.AddChild(hScroll);

        #endregion

        #region Vertical scrollers

        HGroup vScrollers = new HGroup
                                {
                                    PercentHeight = 100,
                                    Gap = 10,
                                    Right = 10,
                                    Top = 10,
                                    Bottom = 150
                                };
        AddChild(vScrollers);

        VScrollBar vScroll = new VScrollBar
                                    {
                                        SkinClass = typeof(VScrollBarSkin3), PercentHeight = 100, Maximum = 600,
                                        Viewport = viewport
                                    };
        vScrollers.AddChild(vScroll);

        vScroll = new VScrollBar
        {
            SkinClass = typeof(VScrollBarSkin2),
            PercentHeight = 100,
            Maximum = 600,
            Viewport = viewport
        };
        vScrollers.AddChild(vScroll);

        vScroll = new VScrollBar
        {
            PercentHeight = 100,
            Maximum = 600,
            Viewport = viewport
        };
        vScrollers.AddChild(vScroll);

        #endregion

        #region Content

        VGroup vGroup = new VGroup
        {
            Id = "vGroup",
            VerticalAlign = VerticalAlign.Middle,
            HorizontalCenter = 0,
            VerticalCenter = 0,
            PaddingLeft = 10,
            PaddingRight = 10,
            PaddingTop = 10,
            PaddingBottom = 10,
            Gap = 10
        };

        vGroup.SetStyle("showBackground", true);
        vGroup.SetStyle("backgroundColor", Color.white);
        hGroup.AddChild(vGroup);

        HGroup hgroup = new HGroup();
        vGroup.AddChild(hgroup);

        _btn = new Button
        {
            Text = "Default button",
            FocusEnabled = false,
            Icon = ImageLoader.Instance.Load("Icons/page_white_text"),
            MinWidth = 200,
            MinHeight = 150
        };
        /* Let's just add a panel to the bottom row on double-clicking this button */
        _btn.DoubleClick += delegate { AddPanel(); };
        hgroup.AddChild(_btn);

        _btn = new Button
        {
            Text = "Default toggle",
            FocusEnabled = false,
            ToggleMode = true,
            Selected = true,
            Icon = ImageLoader.Instance.Load("Icons/page_white_text")
        };
        hgroup.AddChild(_btn);

        _btn = new Button
        {
            Text = "Styled button",
            SkinClass = typeof (ButtonSkin2),
            FocusEnabled = false,
            Icon = ImageLoader.Instance.Load("Icons/page_white_text"),
            MinWidth = 200,
            MinHeight = 150
        };
        hgroup.AddChild(_btn);

        _btn = new Button
        {
            Text = "Styled toggle",
            SkinClass = typeof (ButtonSkin2),
            FocusEnabled = false,
            ToggleMode = true,
            Selected = true,
            Icon = ImageLoader.Instance.Load("Icons/page_white_text")
        };
        hgroup.AddChild(_btn);

        // nice buttons 1st row

        hgroup = new HGroup();
        vGroup.AddChild(hgroup);

        _btn = new Button
        {
            Text = "Option 1",
            SkinClass = typeof (ButtonSkin4),
            FocusEnabled = false,
            Icon = ImageLoader.Instance.Load("IconsBig/arkshany-bookmarks"),
            MinWidth = 200,
            MinHeight = 200
        };
        hgroup.AddChild(_btn);

        _btn = new Button
        {
            Text = "Option 2",
            SkinClass = typeof (ButtonSkin4),
            FocusEnabled = false,
            Icon = ImageLoader.Instance.Load("IconsBig/arkshany-bookmarks"),
            MinWidth = 200,
            MinHeight = 200
        };
        hgroup.AddChild(_btn);

        _btn = new Button
        {
            Text = "Option 3",
            SkinClass = typeof (ButtonSkin4),
            FocusEnabled = false,
            Icon = ImageLoader.Instance.Load("IconsBig/arkshany-bookmarks"),
            MinWidth = 200,
            MinHeight = 200,
            ToggleMode = true,
            Selected = true
        };
        hgroup.AddChild(_btn);

        // nice buttons 2nd row

        hgroup = new HGroup();
        vGroup.AddChild(hgroup);

        _btn = new MyButton
        {
            Text = "Option 1",
            SkinClass = typeof (ButtonSkin5),
            FocusEnabled = false,
            Icon = ImageLoader.Instance.Load("IconsBig/applications-games"),
            MinWidth = 200,
            MinHeight = 200
        };
        hgroup.AddChild(_btn);

        _btn = new MyButton2
        {
            Text = "Option 2",
            SkinClass = typeof (ButtonSkin5),
            FocusEnabled = false,
            Icon = ImageLoader.Instance.Load("IconsBig/gconfeditor"),
            MinWidth = 200,
            MinHeight = 200
        };
        hgroup.AddChild(_btn);

        _btn = new Button
        {
            Text = "Option 3 (disabled)",
            SkinClass = typeof (ButtonSkin5),
            FocusEnabled = false,
            Icon = ImageLoader.Instance.Load("IconsBig/gtk-floppy"),
            MinWidth = 200,
            MinHeight = 200,
            Enabled = false
        };
        hgroup.AddChild(_btn);

        // new row
        hgroup = new HGroup();
        vGroup.AddChild(hgroup);

        // image
        var image = new Image
        {
            Texture = (Texture) Resources.Load("eDriven/Editor/Logo/logo2")
        };
        hgroup.AddChild(image);

        // panel 1
        _panel = new Panel
        {
            Title = "Panel 1",
            MinWidth = 200,
            MinHeight = 300
        };
        hgroup.AddChild(_panel);

        // panel 2
        _panel = new Panel
        {
            SkinClass = typeof (PanelSkin3),
            Title = "Panel 2",
            MinWidth = 200,
            MinHeight = 300
        };
        hgroup.AddChild(_panel);

        // panel 3
        _panel = new Panel
        {
            SkinClass = typeof (PanelSkin4),
            Title = "Panel 3",
            MinWidth = 200,
            MinHeight = 300
        };
        hgroup.AddChild(_panel);

        #endregion

        // new row (placeholder)
        _hgroup = new HGroup();
        vGroup.AddChild(_hgroup);
    }
示例#36
0
        public winEmotionPanel()
            : base("winEmotionPanel")
        {
            this.Windowed = true;
                this.ShowInWindowSwitcher = false;
                this.Size = new System.Drawing.Size(200, 230);
                this.Location = new System.Drawing.Point(210, WindowSwitcher.GameWindow.ActiveTeam.Y + WindowSwitcher.GameWindow.ActiveTeam.Height + 0);
                this.AlwaysOnTop = true;
                this.TitleBar.CloseButton.Visible = true;
                this.TitleBar.Font = Graphics.FontManager.LoadFont("tahoma", 10);
                this.TitleBar.Text = "Emotion Panel";

                pnlEmoteList = new Panel("pnlEmoteList");
                pnlEmoteList.Size = new System.Drawing.Size(200, 230);
                pnlEmoteList.Location = new Point(0, 0);
                pnlEmoteList.BackColor = Color.White;
                pnlEmoteList.Visible = true;

                pnlEmoteEditor = new Panel("pnlEmoteEditor");
                pnlEmoteEditor.Size = new System.Drawing.Size(230, 166);
                pnlEmoteEditor.Location = new Point(0, 0);
                pnlEmoteEditor.BackColor = Color.White;
                pnlEmoteEditor.Visible = false;

                lbxEmotionList = new ListBox("lbxEmotionList");
                lbxEmotionList.Location = new Point(10, 10);
                lbxEmotionList.Size = new Size(180, 140);
                for (int i = 0; i < 10; i++) {
                    lbiEmote = new ListBoxTextItem(Graphics.FontManager.LoadFont("tahoma", 10), i + ": ---");
                    lbxEmotionList.Items.Add(lbiEmote);
                }

                btnEdit = new Button("btnEdit");
                btnEdit.Location = new Point(10, 190);
                btnEdit.Font = Graphics.FontManager.LoadFont("tahoma", 10);
                btnEdit.Size = new System.Drawing.Size(64, 16);
                btnEdit.Visible = true;
                btnEdit.Text = "Edit";
                btnEdit.Click += new EventHandler<MouseButtonEventArgs>(btnEdit_Click);

                btnCancel = new Button("btnCancel");
                btnCancel.Location = new Point(126, 190);
                btnCancel.Font = Graphics.FontManager.LoadFont("tahoma", 10);
                btnCancel.Size = new System.Drawing.Size(64, 16);
                btnCancel.Visible = true;
                btnCancel.Text = "Cancel";
                btnCancel.Click += new EventHandler<MouseButtonEventArgs>(btnCancel_Click);

                //btnAddNew = new Button("btnAddNew");
                //btnAddNew.Location = new Point();
                //btnAddNew.Font = Graphics.FontManager.LoadFont("tahoma", 10);
                //btnAddNew.Size = new System.Drawing.Size(64, 16);
                //btnAddNew.Visible = true;
                //btnAddNew.Text = "Add New";
                //btnAddNew.Click += new EventHandler<MouseButtonEventArgs>(btnAddNew_Click);

                btnEditorCancel = new Button("btnEditorCancel");
                btnEditorCancel.Location = new Point(120, 125);
                btnEditorCancel.Font = Graphics.FontManager.LoadFont("tahoma", 10);
                btnEditorCancel.Size = new System.Drawing.Size(64, 16);
                btnEditorCancel.Visible = true;
                btnEditorCancel.Text = "Cancel";
                btnEditorCancel.Click += new EventHandler<MouseButtonEventArgs>(btnEditorCancel_Click);

                btnEditorOK = new Button("btnEditorOK");
                btnEditorOK.Location = new Point(20, 125);
                btnEditorOK.Font = Graphics.FontManager.LoadFont("tahoma", 10);
                btnEditorOK.Size = new System.Drawing.Size(64, 16);
                btnEditorOK.Visible = true;
                btnEditorOK.Text = "OK";
                btnEditorOK.Click += new EventHandler<MouseButtonEventArgs>(btnEditorOK_Click);

                lblENum = new Label("lblENum");
                lblENum.Font = Graphics.FontManager.LoadFont("Tahoma", 10);
                lblENum.Text = "Emoticon: ";
                lblENum.AutoSize = true;
                lblENum.Location = new Point(10, 4);

                txtCommand = new TextBox("txtCommand");
                txtCommand.Size = new Size(200, 16);
                txtCommand.Location = new Point(10, 94);
                txtCommand.Font = Graphics.FontManager.LoadFont("Tahoma", 12);

                lblCommand = new Label("lblCommand");
                lblCommand.Font = Graphics.FontManager.LoadFont("Tahoma", 10);
                lblCommand.Text = "Command:";
                lblCommand.AutoSize = true;
                lblCommand.Location = new Point(10, 80);

                picEmote = new PictureBox("picEmote");
                picEmote.Location = new Point(10, 18);
                picEmote.Size = new Size(32, 32);

                hsbENum = new HScrollBar("hsbPic");
                hsbENum.Maximum = MaxInfo.MaxEmoticons;
                hsbENum.Location = new Point(10, 54);
                hsbENum.Size = new Size(200, 12);
                hsbENum.ValueChanged += new EventHandler<ValueChangedEventArgs>(hsbENum_ValueChanged);

                pnlEmoteList.AddWidget(lbxEmotionList);
                //pnlEmoteList.AddWidget(btnAddNew); Needed?
                pnlEmoteList.AddWidget(btnEdit);
                pnlEmoteList.AddWidget(btnCancel);

                pnlEmoteEditor.AddWidget(hsbENum);
                pnlEmoteEditor.AddWidget(lblENum);
                pnlEmoteEditor.AddWidget(picEmote);
                pnlEmoteEditor.AddWidget(lblCommand);
                pnlEmoteEditor.AddWidget(txtCommand);
                pnlEmoteEditor.AddWidget(btnEditorCancel);
                pnlEmoteEditor.AddWidget(btnEditorOK);

                this.AddWidget(pnlEmoteList);
                this.AddWidget(pnlEmoteEditor);

                RefreshEmoteList();
                this.LoadComplete();
        }