示例#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
     );
示例#2
0
文件: ScrollBar.cs 项目: wt616/JxqyHD
        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();
        }
示例#3
0
 public ScrollBar(ScrollBarType type)
 {
     this.Type = type;
     ScrollBarThumb thumb = new ScrollBarThumb(type);
     this.Add(thumb);
     this.thumb = thumb;
 }
示例#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;
 }
示例#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);
        }
示例#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();
        }
示例#7
0
 static extern bool EnableScrollBar(IntPtr hWnd, ScrollBarType wSBflags, ScrollBarArrows wArrows);
示例#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));
    }
示例#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));
 }
示例#11
0
 public int GetScrollBarPosition(ScrollBarType sbt)
 {
     return(GetScrollPos(Handle, (int)sbt) << 16);
 }
示例#12
0
 private static extern void Internal_CreateInstance(GUIScrollArea instance, ScrollBarType vertBarType, ScrollBarType horzBarType,
     string scrollBarStyle, string scrollAreaStyle, params GUIOption[] options);
示例#13
0
		static extern int SetScrollInfo(IntPtr hwnd, ScrollBarType fnBar, SCROLLINFO lpsi, bool fRedraw);
示例#14
0
		static extern bool EnableScrollBar(IntPtr hWnd, ScrollBarType wSBflags, ScrollBarArrows wArrows);
示例#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;
		}
示例#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
     );
示例#17
0
 internal static extern int GetScrollPos(IntPtr hWnd, ScrollBarType nBar);
示例#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
     );
示例#19
0
 internal static extern bool GetScrollInfo(IntPtr hWnd, ScrollBarType fnBar, ref SCROLLINFO si);
示例#20
0
 static extern int SetScrollInfo(IntPtr hwnd, ScrollBarType fnBar, SCROLLINFO lpsi, bool fRedraw);
示例#21
0
 static extern int GetScrollInfo(IntPtr hwnd, ScrollBarType fnBar, SCROLLINFO lpsi);
示例#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);
 }
示例#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);
 }
示例#24
0
 public UIScrollBar(Rect frame, float contentSize, ScrollBarType type) : base(frame)
 {
     this.mSize = Mathf.Clamp01(contentSize);
     this.mType = type;
     Init();
 }
示例#25
0
		static extern int GetScrollInfo(IntPtr hwnd, ScrollBarType fnBar, SCROLLINFO lpsi);
 public int GetScrollBarPosition(ScrollBarType sbt)
 {
     return GetScrollPos(Handle, (int)sbt) << 16;
 }
示例#27
0
 private static extern void Internal_CreateInstance(GUIScrollArea instance, ScrollBarType vertBarType, ScrollBarType horzBarType,
                                                    string scrollBarStyle, string scrollAreaStyle, params GUIOption[] options);
示例#28
0
 internal static extern bool GetScrollInfo(IntPtr hWnd, ScrollBarType fnBar, ref SCROLLINFO si);
示例#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);
 }
示例#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
     );