MiniGUI API Reference (MiniGUI-Threads)  v5.0.6
A mature and proven cross-platform GUI system for embedded and smart IoT devices
Data Structures | Macros | Typedefs | Functions
Scroll bar operations

Data Structures

struct  _SCROLLINFO
 

Macros

#define SB_ARROW_LTUP   0x0001
 
#define SB_ARROW_BTDN   0x0002
 
#define SB_ARROW_BOTH   (SB_ARROW_LTUP | SB_ARROW_BTDN)
 

Typedefs

typedef struct _SCROLLINFO SCROLLINFO
 

Functions

MG_EXPORT BOOL GUIAPI EnableScrollBar (HWND hWnd, int iSBar, BOOL bEnable)
 Enables or disables one scroll bar arrows. More...
 
MG_EXPORT BOOL GUIAPI GetScrollPos (HWND hWnd, int iSBar, int *pPos)
 Retrieve the current position of the scroll box (thumb) in the specified scroll bar. More...
 
MG_EXPORT BOOL GUIAPI GetScrollRange (HWND hWnd, int iSBar, int *pMinPos, int *pMaxPos)
 Retrieve the minimum and maximum position values for the specified scroll bar. More...
 
MG_EXPORT BOOL GUIAPI SetScrollPos (HWND hWnd, int iSBar, int iNewPos)
 Set the position of the scroll box (thumb) of the specified scroll bar. More...
 
MG_EXPORT BOOL GUIAPI SetScrollRange (HWND hWnd, int iSBar, int iMinPos, int iMaxPos)
 Set the minimum and maximum position values for the specified scroll bar. More...
 
MG_EXPORT BOOL GUIAPI ShowScrollBar (HWND hWnd, int iSBar, BOOL bShow)
 Shows or hides the specified scroll bar. More...
 
MG_EXPORT BOOL GUIAPI SetScrollInfo (HWND hWnd, int iSBar, const SCROLLINFO *lpsi, BOOL fRedraw)
 Set the parameters of a scroll bar. More...
 
MG_EXPORT BOOL GUIAPI GetScrollInfo (HWND hWnd, int iSBar, PSCROLLINFO lpsi)
 Retrieve the parameters of a scroll bar. More...
 

Detailed Description

Macro Definition Documentation

◆ SB_ARROW_BOTH

#define SB_ARROW_BOTH   (SB_ARROW_LTUP | SB_ARROW_BTDN)

left,up, right or bottom arrow

Definition at line 9557 of file window.h.

◆ SB_ARROW_BTDN

#define SB_ARROW_BTDN   0x0002

right or bottom arrow

Definition at line 9554 of file window.h.

◆ SB_ARROW_LTUP

#define SB_ARROW_LTUP   0x0001

left or up arrow

Definition at line 9551 of file window.h.

Typedef Documentation

◆ SCROLLINFO

typedef struct _SCROLLINFO SCROLLINFO

Scroll bar information structure.

Function Documentation

◆ EnableScrollBar()

BOOL GUIAPI EnableScrollBar ( HWND  hWnd,
int  iSBar,
BOOL  bEnable 
)

Enables or disables one scroll bar arrows.

This function enables or disables one scroll bar arrows.

Parameters
hWndThe handle to the window.
iSBarIndicates to enable or disable which scroll bar, can be one of the following values:
  • SB_HORZ
    The horizontal scroll bar.
  • SB_VERT
    The vertical scroll bar.
bEnableIndicates whether to enable or disable the scroll bar.
Returns
TRUE on success, FALSE on error.
See also
ShowScrollBar

◆ GetScrollInfo()

BOOL GUIAPI GetScrollInfo ( HWND  hWnd,
int  iSBar,
PSCROLLINFO  lpsi 
)

Retrieve the parameters of a scroll bar.

This function retrieves the parameters of a scroll bar, including the minimum and maximum scrolling positions, the page size, and the position of the scroll box (thumb).

Parameters
hWndThe handle to the window.
iSBarIndicates to enable or disable which scroll bar, can be one of the following values:
  • SB_HORZ
    The horizontal scroll bar.
  • SB_VERT
    The vertical scroll bar.
lpsiThe pointer to a structure of SCROLLINFO which receives the parameters.
Returns
TRUE on success, FALSE on error.
See also
SetScrollInfo, SCROLLINFO

◆ GetScrollPos()

BOOL GUIAPI GetScrollPos ( HWND  hWnd,
int  iSBar,
int *  pPos 
)

Retrieve the current position of the scroll box (thumb) in the specified scroll bar.

This function retrieves the current position of the scroll box (thumb) in the specified scroll bar. The current position is a relative value that depends on the current scrolling range.

Parameters
hWndThe handle to the window.
iSBarIndicates to enable or disable which scroll bar, can be one of the following values:
  • SB_HORZ
    The horizontal scroll bar.
  • SB_VERT
    The vertical scroll bar.
pPosThe pointer to a integer which receives the position value.
Returns
TRUE on success, FALSE on error.
See also
SetScrollPos

◆ GetScrollRange()

BOOL GUIAPI GetScrollRange ( HWND  hWnd,
int  iSBar,
int *  pMinPos,
int *  pMaxPos 
)

Retrieve the minimum and maximum position values for the specified scroll bar.

This function retrieves the minimum and maximum position values for the specified scroll bar.

Parameters
hWndThe handle to the window.
iSBarIndicates to enable or disable which scroll bar, can be one of the following values:
  • SB_HORZ
    The horizontal scroll bar.
  • SB_VERT
    The vertical scroll bar.
pMinPosThe pointer to a integer which receives the minimum position value.
pMaxPosThe pointer to a integer which receives the maximum position value.
Returns
TRUE on success, FALSE on error.
See also
SetScrollRange

◆ SetScrollInfo()

BOOL GUIAPI SetScrollInfo ( HWND  hWnd,
int  iSBar,
const SCROLLINFO lpsi,
BOOL  fRedraw 
)

Set the parameters of a scroll bar.

This function sets the parameters of a scroll bar, including the minimum and maximum scrolling positions, the page size, and the position of the scroll box (thumb). The function also redraws the scroll bar, if requested.

Parameters
hWndThe handle to the window.
iSBarIndicates to enable or disable which scroll bar, can be one of the following values:
  • SB_HORZ
    The horizontal scroll bar.
  • SB_VERT
    The vertical scroll bar.
lpsiThe pointer to the structure of scroll bar information.
fRedrawA boolean indicates whether to redraw the scroll bar.
Returns
TRUE on success, FALSE on error.
See also
GetScrollInfo, SCROLLINFO

◆ SetScrollPos()

BOOL GUIAPI SetScrollPos ( HWND  hWnd,
int  iSBar,
int  iNewPos 
)

Set the position of the scroll box (thumb) of the specified scroll bar.

This function sets the position of the scroll box (thumb) of the specified scroll bar, and if needed, redraws the scroll bar to reflect the new position of the scroll box.

Parameters
hWndThe handle to the window.
iSBarIndicates to enable or disable which scroll bar, can be one of the following values:
  • SB_HORZ
    The horizontal scroll bar.
  • SB_VERT
    The vertical scroll bar.
iNewPosThe new position value.
Returns
TRUE on success, FALSE on error.
See also
GetScrollPos

◆ SetScrollRange()

BOOL GUIAPI SetScrollRange ( HWND  hWnd,
int  iSBar,
int  iMinPos,
int  iMaxPos 
)

Set the minimum and maximum position values for the specified scroll bar.

This function sets the minimum and maximum position values for the specified scroll bar, and if needed, redraws the scroll bar to reflect the new position values of the scroll box.

Parameters
hWndThe handle to the window.
iSBarIndicates to enable or disable which scroll bar, can be one of the following values:
  • SB_HORZ
    The horizontal scroll bar.
  • SB_VERT
    The vertical scroll bar.
iMinPosThe new minimum position value.
iMaxPosThe new maximum position value.
Returns
TRUE on success, FALSE on error.
See also
GetScrollRange

◆ ShowScrollBar()

BOOL GUIAPI ShowScrollBar ( HWND  hWnd,
int  iSBar,
BOOL  bShow 
)

Shows or hides the specified scroll bar.

This function shows or hides the specified scroll bar.

Parameters
hWndThe handle to the window.
iSBarIndicates to enable or disable which scroll bar, can be one of the following values:
  • SB_HORZ
    The horizontal scroll bar.
  • SB_VERT
    The vertical scroll bar.
bShowIndicates whether show or hide the scrollbar.
Returns
TRUE on success, FALSE on error.
See also
EnableScrollBar