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 );
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(); }
public ScrollBar(ScrollBarType type) { this.Type = type; ScrollBarThumb thumb = new ScrollBarThumb(type); this.Add(thumb); this.thumb = thumb; }
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; }
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); }
/** * コンストラクタ * 指定の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(); }
static extern bool EnableScrollBar(IntPtr hWnd, ScrollBarType wSBflags, ScrollBarArrows wArrows);
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)); }
internal static extern int GetScrollPos(IntPtr hWnd, ScrollBarType nBar);
public int GetScrollBarPosition(ScrollBarType sbt) { return(GetScrollPos(Handle, (int)sbt) << 16); }
private static extern void Internal_CreateInstance(GUIScrollArea instance, ScrollBarType vertBarType, ScrollBarType horzBarType, string scrollBarStyle, string scrollAreaStyle, params GUIOption[] options);
static extern int SetScrollInfo(IntPtr hwnd, ScrollBarType fnBar, SCROLLINFO lpsi, bool fRedraw);
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; }
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 );
internal static extern bool GetScrollInfo(IntPtr hWnd, ScrollBarType fnBar, ref SCROLLINFO si);
static extern int GetScrollInfo(IntPtr hwnd, ScrollBarType fnBar, SCROLLINFO lpsi);
/// <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); }
/// <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); }
public UIScrollBar(Rect frame, float contentSize, ScrollBarType type) : base(frame) { this.mSize = Mathf.Clamp01(contentSize); this.mType = type; Init(); }
public int GetScrollBarPosition(ScrollBarType sbt) { return GetScrollPos(Handle, (int)sbt) << 16; }
/// <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); }