XenevaOS
Loading...
Searching...
No Matches
XenevaOS
Libs
Chitralekha
widgets
sidebar.h
Go to the documentation of this file.
1
32
#ifndef __SIDEBAR_H__
33
#define __SIDEBAR_H__
34
35
#include "
scrollbar.h
"
36
#include "
window.h
"
37
#include "
icon.h
"
38
39
#ifdef __cplusplus
40
XE_EXTERN
{
41
#endif
42
43
#define SIDEBAR_MAX_LABEL 64
44
#define SIDEBAR_ROW_HEIGHT 28
45
#define SIDEBAR_HEADER 22
46
#define SIDEBAR_ICON_SIZE 16
47
#define SIDEBAR_INDENT 10
48
49
typedef
struct
_sidebar_item_
{
50
char
label
[
SIDEBAR_MAX_LABEL
];
51
ChIcon
*
icon
;
52
int
iconW
,
iconH
;
53
54
void
*
data
;
55
void (*
OnSelect
)(
struct
_sidebar_item_
* item,
ChWindow
*
win
);
56
int
selected
;
57
}
ChSidebarItem
;
58
59
typedef
struct
_sidebar_section_
{
60
char
title
[
SIDEBAR_MAX_LABEL
];
61
ChSidebarItem
*
items
;
62
int
itemCount
;
63
int
collapsed
;
64
}
ChSidebarSection
;
65
66
typedef
struct
_sidebar_
{
67
ChWidget
base
;
68
69
ChSidebarSection
*
sections
;
70
int
sectionCount
;
71
72
int
scrollOfsetY
;
73
int
contentHeight
;
74
75
uint32_t
bgColor
;
76
uint32_t
selectedColor
;
77
uint32_t
hoverColor
;
78
uint32_t
textColor
;
79
uint32_t
headerTextColor
;
80
uint32_t
selectedTextColor
;
81
82
83
int
hoverSectionIdx
;
84
int
hoverItemIdx
;
85
}
ChSidebar
;
86
87
95
XE_EXPORT
ChSidebar
*
ChSidebarCreate
(
int
x,
int
y,
int
w,
int
h);
96
97
XE_EXPORT
ChSidebarSection
*
ChSidebarAddSection
(
ChSidebar
* sb,
const
char
* title);
98
99
XE_EXPORT
ChSidebarItem
*
ChSidebarAddItem
(
ChSidebarSection
* sec,
const
char
* label,
ChIcon
* icon,
100
int
iconW,
int
iconH,
void
* udata);
101
102
103
#ifdef __cplusplus
104
}
105
#endif
106
107
#endif
window.h
XE_EXPORT
#define XE_EXPORT
Definition
_xeneva.h:46
XE_EXTERN
#define XE_EXTERN
Definition
_xeneva.h:50
uint32_t
unsigned int uint32_t
Definition
acefiex.h:163
icon.h
win
ChWindow * win
Definition
namdapha.cpp:54
scrollbar.h
ChSidebarAddItem
XE_EXPORT ChSidebarItem * ChSidebarAddItem(ChSidebarSection *sec, const char *label, ChIcon *icon, int iconW, int iconH, void *udata)
Definition
sidebar.cpp:90
ChSidebarAddSection
XE_EXPORT ChSidebarSection * ChSidebarAddSection(ChSidebar *sb, const char *title)
Definition
sidebar.cpp:71
ChSidebarSection
struct _sidebar_section_ ChSidebarSection
SIDEBAR_MAX_LABEL
#define SIDEBAR_MAX_LABEL
Definition
sidebar.h:43
ChSidebarCreate
XE_EXPORT ChSidebar * ChSidebarCreate(int x, int y, int w, int h)
ChSidebarCreate – create a new sidebar.
Definition
sidebar.cpp:45
ChSidebarItem
struct _sidebar_item_ ChSidebarItem
ChSidebar
struct _sidebar_ ChSidebar
_ChWidget_
Definition
window.h:115
_chwin_
Definition
window.h:91
_icon_
Definition
icon.h:57
_sidebar_
Definition
sidebar.h:66
_sidebar_::hoverSectionIdx
int hoverSectionIdx
Definition
sidebar.h:83
_sidebar_::sectionCount
int sectionCount
Definition
sidebar.h:70
_sidebar_::scrollOfsetY
int scrollOfsetY
Definition
sidebar.h:72
_sidebar_::textColor
uint32_t textColor
Definition
sidebar.h:78
_sidebar_::sections
ChSidebarSection * sections
Definition
sidebar.h:69
_sidebar_::contentHeight
int contentHeight
Definition
sidebar.h:73
_sidebar_::hoverColor
uint32_t hoverColor
Definition
sidebar.h:77
_sidebar_::selectedTextColor
uint32_t selectedTextColor
Definition
sidebar.h:80
_sidebar_::hoverItemIdx
int hoverItemIdx
Definition
sidebar.h:84
_sidebar_::base
ChWidget base
Definition
sidebar.h:67
_sidebar_::headerTextColor
uint32_t headerTextColor
Definition
sidebar.h:79
_sidebar_::bgColor
uint32_t bgColor
Definition
sidebar.h:75
_sidebar_::selectedColor
uint32_t selectedColor
Definition
sidebar.h:76
_sidebar_item_
Definition
sidebar.h:49
_sidebar_item_::icon
ChIcon * icon
Definition
sidebar.h:51
_sidebar_item_::iconW
int iconW
Definition
sidebar.h:52
_sidebar_item_::data
void * data
Definition
sidebar.h:54
_sidebar_item_::iconH
int iconH
Definition
sidebar.h:52
_sidebar_item_::selected
int selected
Definition
sidebar.h:56
_sidebar_item_::label
char label[SIDEBAR_MAX_LABEL]
Definition
sidebar.h:50
_sidebar_item_::OnSelect
void(* OnSelect)(struct _sidebar_item_ *item, ChWindow *win)
Definition
sidebar.h:55
_sidebar_section_
Definition
sidebar.h:59
_sidebar_section_::title
char title[SIDEBAR_MAX_LABEL]
Definition
sidebar.h:60
_sidebar_section_::itemCount
int itemCount
Definition
sidebar.h:62
_sidebar_section_::collapsed
int collapsed
Definition
sidebar.h:63
_sidebar_section_::items
ChSidebarItem * items
Definition
sidebar.h:61
Generated by
1.9.8