XenevaOS
Loading...
Searching...
No Matches
Classes | Typedefs | Enumerations | Functions
scrollbar.h File Reference
#include "base.h"
#include "../chitralekha.h"
#include "window.h"
#include <_xeneva.h>
Include dependency graph for scrollbar.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  _scroll_bar_
 

Typedefs

typedef struct _scroll_bar_ ChScrollBar
 

Enumerations

enum  _orientation_ { SCROLLBAR_ORIENTATION_VERTICAL , SCROLLBAR_ORIENTATION_HORIZONTAL }
 
enum  {
  SB_STATE_IDLE , SB_STATE_HOVER_THUMB , SB_STATE_DRAGGING , SB_STATE_HOVER_ARRDEC ,
  SB_STATE_HOVER_ARRINC
}
 

Functions

XE_EXPORT ChScrollBarChCreateScrollBar (int x, int y, int width, int height, uint8_t orientation)
 ChCreateScrollBar – create a scrollbar.
 
XE_EXPORT void ChScrollBarInit (ChScrollBar *sb, int x, int y, int width, int height, uint8_t orientation)
 
XE_EXPORT void ChScrollBarSetValue (ChScrollBar *sb, int value)
 
XE_EXPORT void ChScrollBarSetRange (ChScrollBar *sb, int min_val, int max_val, int page_size)
 

Detailed Description

BSD 2-Clause License

Copyright (c) 2022-2026, Manas Kamal Choudhury All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:

  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

Typedef Documentation

◆ ChScrollBar

typedef struct _scroll_bar_ ChScrollBar

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
SB_STATE_IDLE 
SB_STATE_HOVER_THUMB 
SB_STATE_DRAGGING 
SB_STATE_HOVER_ARRDEC 
SB_STATE_HOVER_ARRINC 

◆ _orientation_

Enumerator
SCROLLBAR_ORIENTATION_VERTICAL 
SCROLLBAR_ORIENTATION_HORIZONTAL 

Function Documentation

◆ ChCreateScrollBar()

XE_EXPORT ChScrollBar * ChCreateScrollBar ( int  x,
int  y,
int  width,
int  height,
uint8_t  orientation 
)

ChCreateScrollBar – create a scrollbar.

Parameters
x– x location within the window
y– y location within the window
width– width of the viewport
height– height of the viewport
orientation– scrollbar type, either VERTICAL or HORIZONTAL

Re calculate the thumb

◆ ChScrollBarInit()

XE_EXPORT void ChScrollBarInit ( ChScrollBar sb,
int  x,
int  y,
int  width,
int  height,
uint8_t  orientation 
)

Re calculate the thumb

◆ ChScrollBarSetRange()

XE_EXPORT void ChScrollBarSetRange ( ChScrollBar sb,
int  min_val,
int  max_val,
int  page_size 
)

◆ ChScrollBarSetValue()

XE_EXPORT void ChScrollBarSetValue ( ChScrollBar sb,
int  value 
)