Ejemplo n.º 1
0
 internal static extern int SetScrollRange(
     IntPtr hWnd,                                 // handle to window
     ScrollBarType nBar,                          // scroll bar
     int nMinPos,                                 // minimum scrolling position
     int nMaxPos,                                 // maximum scrolling position
     [MarshalAs(UnmanagedType.Bool)] bool bRedraw // redraw flag
     );
Ejemplo n.º 2
0
        public ScrollBar(GuiItem parent,
                         int width,
                         int height,
                         Texture baseTexture,
                         ScrollBarType type,
                         GuiItem slider,
                         Vector2 positon,
                         int minValue,
                         int maxValue,
                         int value)
            : base(parent, positon, width, height, baseTexture)
        {
            Type   = type;
            Slider = slider;
            switch (type)
            {
            case ScrollBarType.Vertical:
                Length = height;
                break;

            case ScrollBarType.Horizontal:
                Length = width;
                break;

            default:
                throw new ArgumentOutOfRangeException("type");
            }
            MinValue = minValue;
            MaxValue = maxValue;
            Value    = value;
            RegisterEvent();
        }
Ejemplo n.º 3
0
 public ScrollBar(ScrollBarType type)
 {
     this.Type = type;
     ScrollBarThumb thumb = new ScrollBarThumb(type);
     this.Add(thumb);
     this.thumb = thumb;
 }
Ejemplo n.º 4
0
 public ScrollBar(ScrollBarType type, Rectangle backgroundRec, Rectangle foregroundRec, Texture2D backgroundTex, Texture2D foregroundTex)
     : base()
 {
     Type                 = type;
     Background           = new Panel(backgroundRec, backgroundTex);
     Bar                  = new Panel(foregroundRec, foregroundTex);
     Background.MainColor = Color.LightGray;
     Bar.MainColor        = Color.DarkGray;
 }
Ejemplo n.º 5
0
        private SCROLLINFO GetScrollInfo(ScrollBarType Type, ScrollInfoMask Mask)
        {
            SCROLLINFO ScrollInfo = new SCROLLINFO();

            ScrollInfo.cbSize = Marshal.SizeOf(VerticalScroll);
            ScrollInfo.fMask  = Mask;
            GetScrollInfo(Handle, ScrollBarType.SB_VERT, ScrollInfo);
            return(ScrollInfo);
        }
Ejemplo n.º 6
0
        /**
         * コンストラクタ
         * 指定のViewに張り付くタイプのスクロールバーを作成
         *
         * @param pageLen   1ページ分のコンテンツの長さ
         * @param contentLen  全体のコンテンツの長さ
         */
        public UScrollBar(ScrollBarType type, ScrollBarShowType showType,
                          PointF paretnPos, float x, float y,
                          int bgLength, int bgWidth,
                          long pageLen, long contentLen)
        {
            this.type     = type;
            this.showType = showType;
            if (showType == ScrollBarShowType.ShowAllways)
            {
                _isShow = true;
            }
            pos.X           = x;
            pos.Y           = y;
            topPos          = 0;
            barPos          = 0;
            this.parentPos  = paretnPos;
            this.bgWidth    = bgWidth;
            this.bgLength   = bgLength;
            this.contentLen = contentLen;
            this.pageLen    = pageLen;

            updateBarLength();

            if (showType == ScrollBarShowType.Show2)
            {
                bgColor  = Color.Black;
                barColor = BAR_COLOR;
            }
            else
            {
                bgColor  = SHOW_BAR_COLOR;
                barColor = SHOW_BG_COLOR;
            }

            updateSize();
        }
Ejemplo n.º 7
0
 static extern bool EnableScrollBar(IntPtr hWnd, ScrollBarType wSBflags, ScrollBarArrows wArrows);
Ejemplo n.º 8
0
    public void SetScrollBarPosition(ScrollBarType sbt, int Value)
    {
        uint wParam = (uint)ScrollBarCommands.SB_THUMBPOSITION | (uint)Value;

        SendMessage(Handle, (int)((sbt == ScrollBarType.SbVert) ? Message.WM_VSCROLL : Message.WM_HSCROLL), new IntPtr(wParam), new IntPtr(0));
    }
Ejemplo n.º 9
0
 internal static extern int GetScrollPos(IntPtr hWnd, ScrollBarType nBar);
 public void SetScrollBarPosition(ScrollBarType sbt, int Value)
 {
     uint wParam = (uint)ScrollBarCommands.SB_THUMBPOSITION | (uint)Value;
     SendMessage(Handle, (int)((sbt == ScrollBarType.SbVert) ? Message.WM_VSCROLL : Message.WM_HSCROLL), new IntPtr(wParam), new IntPtr(0));
 }
Ejemplo n.º 11
0
 public int GetScrollBarPosition(ScrollBarType sbt)
 {
     return(GetScrollPos(Handle, (int)sbt) << 16);
 }
Ejemplo n.º 12
0
 private static extern void Internal_CreateInstance(GUIScrollArea instance, ScrollBarType vertBarType, ScrollBarType horzBarType,
     string scrollBarStyle, string scrollAreaStyle, params GUIOption[] options);
Ejemplo n.º 13
0
		static extern int SetScrollInfo(IntPtr hwnd, ScrollBarType fnBar, SCROLLINFO lpsi, bool fRedraw);
Ejemplo n.º 14
0
		static extern bool EnableScrollBar(IntPtr hWnd, ScrollBarType wSBflags, ScrollBarArrows wArrows);
Ejemplo n.º 15
0
		private SCROLLINFO GetScrollInfo(ScrollBarType Type, ScrollInfoMask Mask)
		{
			SCROLLINFO ScrollInfo = new SCROLLINFO();
			ScrollInfo.cbSize = Marshal.SizeOf(VerticalScroll);
			ScrollInfo.fMask = Mask;
			GetScrollInfo(Handle, ScrollBarType.SB_VERT, ScrollInfo);
			return ScrollInfo;
		}
Ejemplo n.º 16
0
 internal static extern int SetScrollRange(
     IntPtr hWnd, // handle to window
     ScrollBarType nBar, // scroll bar
     int nMinPos, // minimum scrolling position
     int nMaxPos, // maximum scrolling position
     [MarshalAs(UnmanagedType.Bool)] bool bRedraw // redraw flag
     );
Ejemplo n.º 17
0
 internal static extern int GetScrollPos(IntPtr hWnd, ScrollBarType nBar);
Ejemplo n.º 18
0
 internal static extern int SetScrollPos(
     IntPtr hWnd, // handle to window
     ScrollBarType nBar, // scroll bar
     int nPos, // new position of scroll box
     [MarshalAs(UnmanagedType.Bool)] bool bRedraw // redraw flag
     );
Ejemplo n.º 19
0
 internal static extern bool GetScrollInfo(IntPtr hWnd, ScrollBarType fnBar, ref SCROLLINFO si);
Ejemplo n.º 20
0
 static extern int SetScrollInfo(IntPtr hwnd, ScrollBarType fnBar, SCROLLINFO lpsi, bool fRedraw);
Ejemplo n.º 21
0
 static extern int GetScrollInfo(IntPtr hwnd, ScrollBarType fnBar, SCROLLINFO lpsi);
Ejemplo n.º 22
0
 /// <summary>
 /// Creates a new scroll area.
 /// </summary>
 /// <param name="vertBarType">Type of the vertical scroll bar.</param>
 /// <param name="horzBarType">Type of the horizontal scroll bar.</param>
 /// <param name="scrollBarStyle">Optional style that controls the look of the scroll bars. Style will be retrieved
 ///                              from the active GUISkin. If not specified default element style is used.</param>
 /// <param name="style">Optional style to use for the element. Style controls the look of the element, as well as
 ///                     default layout options. Style will be retrieved from the active GUISkin. If not specified
 ///                     default element style is used.</param>
 /// <param name="options">Options that allow you to control how is the element positioned and sized. This will
 ///                       override any similar options set by style.</param>
 public GUIScrollArea(ScrollBarType vertBarType, ScrollBarType horzBarType, string scrollBarStyle,
                      string style, params GUIOption[] options)
 {
     Internal_CreateInstance(this, vertBarType, horzBarType, scrollBarStyle, style, options);
     _mainLayout = new GUILayoutY(this);
 }
Ejemplo n.º 23
0
 /// <summary>
 /// Creates a new scroll area.
 /// </summary>
 /// <param name="vertBarType">Type of the vertical scroll bar.</param>
 /// <param name="horzBarType">Type of the horizontal scroll bar.</param>
 /// <param name="options">Options that allow you to control how is the element positioned and sized. This will 
 ///                       override any similar options set by style.</param>
 public GUIScrollArea(ScrollBarType vertBarType, ScrollBarType horzBarType, params GUIOption[] options)
 {
     Internal_CreateInstance(this, vertBarType, horzBarType, "", "", options);
     _mainLayout = new GUILayoutY(this);
 }
Ejemplo n.º 24
0
 public UIScrollBar(Rect frame, float contentSize, ScrollBarType type) : base(frame)
 {
     this.mSize = Mathf.Clamp01(contentSize);
     this.mType = type;
     Init();
 }
Ejemplo n.º 25
0
		static extern int GetScrollInfo(IntPtr hwnd, ScrollBarType fnBar, SCROLLINFO lpsi);
 public int GetScrollBarPosition(ScrollBarType sbt)
 {
     return GetScrollPos(Handle, (int)sbt) << 16;
 }
Ejemplo n.º 27
0
 private static extern void Internal_CreateInstance(GUIScrollArea instance, ScrollBarType vertBarType, ScrollBarType horzBarType,
                                                    string scrollBarStyle, string scrollAreaStyle, params GUIOption[] options);
Ejemplo n.º 28
0
 internal static extern bool GetScrollInfo(IntPtr hWnd, ScrollBarType fnBar, ref SCROLLINFO si);
Ejemplo n.º 29
0
 /// <summary>
 /// Ths method allows the user to decide if a certain scroll bar should be hidden/shown for a control.
 /// </summary>
 /// <param name="handle">The handle to the control.</param>
 /// <param name="whatBar">The type of scroll bar to hide/show.</param>
 /// <param name="showBar">A value indicating whether the bar should be shown.</param>
 public static void ShowOrHideScrollBar(IntPtr handle, ScrollBarType whatBar, bool showBar)
 {
     Win32Services.ShowScrollBar(handle, (int)whatBar, showBar);
 }
Ejemplo n.º 30
0
 internal static extern int SetScrollPos(
     IntPtr hWnd,                                 // handle to window
     ScrollBarType nBar,                          // scroll bar
     int nPos,                                    // new position of scroll box
     [MarshalAs(UnmanagedType.Bool)] bool bRedraw // redraw flag
     );