📄 badctrls.h
字号:
void bad_button_change_state(p_bad_button o, l_int newstate);
/* changes button's style (see BBS_xx values) */
void bad_button_change_style(p_bad_button o, l_int newstyle);
/* changes button's caption (you don't need to allocate memory here) */
void bad_button_change_caption(p_bad_button o, l_text newcap);
/* creates a t_bad_button object in area defined by "r", using caption "cap",
style "style" and message "msg".
this automatically allocates memory for the caption.
*/
p_bad_button _bad_button_init(p_bad_button o, t_rect r, l_text cap, l_int style, l_dword msg);
extern p_bad_button (*bad_button_init)(p_bad_button o, t_rect r, l_text cap, l_int style, l_dword msg);
/* t_bad_vtrackbar */
typedef struct t_bad_vtrackbar
{
struct t_view obclass;
l_long min; /* minimum value that the trackbar can take */
l_long max; /* maximum value that... */
l_long pos; /* position of the track */
l_dword message; /* if trackbar is changed this
message occurs */
l_bool pressed; /* true if track is pressed */
l_char reserved[8];
void (*change_pos)(p_bad_vtrackbar o, l_long newpos);
} t_bad_vtrackbar;
#define BAD_VTRACKBAR(o) ((p_bad_vtrackbar)(o))
/* functions for bad_vtrackbar */
/* changes track's position */
void bad_vtrackbar_change_pos(p_bad_vtrackbar o, l_long pos);
/* changes control's state and redraws the control */
void bad_vtrackbar_set_state(p_object o, l_dword st, l_bool set);
/* handles events for trackbar */
void bad_vtrackbar_translate_event(p_object o, t_event *event);
/* draws the trackbar */
void bad_vtrackbar_draw(p_view o);
/* creates a t_bad_vtrackbar object in area defined by "r".
default values are:
minimum possible value = 0
maximum possible value = 100
position = 0
*/
p_bad_vtrackbar _bad_vtrackbar_init(p_bad_vtrackbar o, t_rect r, l_dword msg);
extern p_bad_vtrackbar (*bad_vtrackbar_init)(p_bad_vtrackbar o, t_rect r, l_dword msg);
/* t_bad_tabbook */
typedef struct t_bad_tabbook
{
struct t_view obclass;
l_text title[64] ; /* titles for tabs */
p_view tab[64]; /* tabs */
l_int active; /* active tab */
l_int tabs; /* count of tabs */
l_char reserved[24];
void (*select_tab)(p_bad_tabbook o, l_int newtab);
void (*add_tab)(p_bad_tabbook o, l_text title);
void (*remove_tab)(p_bad_tabbook o, l_int tab);
void (*on_changed)(p_bad_tabbook o, l_int newtab); /* if not NULL, called
when selected tab is changed to
another tab */
} t_bad_tabbook;
#define BAD_TABBOOK(o) ((p_bad_tabbook)(o))
/* functions for bad_tabbook */
/* changes active tab */
void bad_tabbook_select_tab(p_bad_tabbook o, l_int newtab);
/* adds a new tab to tab book with title `title' note that
t_bad_tabbook can have up to 64 tabs (actually there isn't
enough room to display 64 tabs but anyway - later i'll add
scrolling buttons). To insert controls in tabs just use
tab[] array in t_bad_tabbook struct. */
void bad_tabbook_add_tab(p_bad_tabbook o, l_text title);
/* removes the tab `tab' from tab book */
void bad_tabbook_remove_tab(p_bad_tabbook o, l_int tab);
/* creates a t_bad_tabbook object in area defined by "r" with one
tab named "untitled". Because every tab book must have at least one
tab (else why to exist?), you must define a title for the first tab.
Title is defined in ftitle parameter. */
p_bad_tabbook _bad_tabbook_init(p_bad_tabbook o, t_rect r, l_text ftitle);
extern p_bad_tabbook (*bad_tabbook_init)(p_bad_tabbook o, t_rect r, l_text ftitle);
/* t_bad_iconbox */
typedef struct t_bad_iconbox_item *p_bad_iconbox_item;
typedef struct t_bad_iconbox_item
{
BITMAP *icon;
l_text caption;
l_bool selected;
l_char reserved[24];
} t_bad_iconbox_item;
typedef struct t_bad_iconbox
{
struct t_view obclass;
p_list icons;
t_point caption_size;
t_point spacing;
l_int count, index;
l_big flags;
t_rect selection;
p_bad_vscrollbar scr;
l_ptr data; /* pointer to user-defined data */
void (*add)(p_bad_iconbox o, BITMAP *icon, l_text caption);
void (*remove)(p_bad_iconbox o, l_int item); /* isn't working */
void (*clear)(p_bad_iconbox o); /* isn't working */
void (*on_dclick)(p_bad_iconbox o, l_int item); /* NULL by default - set
a function to this field
to know when an icon is
doubleclicked */
l_char reserved[512];
} t_bad_iconbox;
#define BAD_ICONBOX(o) ((p_bad_iconbox)(o))
/* returns true if mouse is under icon "item" in icon box "o" */
l_bool bad_iconbox_mouse_under_icon_at(p_bad_iconbox o, l_int item);
/* adds icon "icon" (size 32x32) in icon box with caption "caption" */
void bad_iconbox_add(p_bad_iconbox o, BITMAP *icon, l_text caption);
/* frees allocated memory for Iconbox */
l_bool bad_iconbox_done(p_object o);
/* creates a t_bad_iconbox object in area defined by "r" with "flags".
An iconbox is a box that contains moveable icons.
*/
p_bad_iconbox _bad_iconbox_init(p_bad_iconbox o, t_rect r, l_big flags);
extern p_bad_iconbox (*bad_iconbox_init)(p_bad_iconbox o, t_rect r, l_big flags);
/* t_bad_vcrollbar */
typedef struct t_bad_vscrollbar
{
struct t_view obclass;
l_int max; /* maximum value */
l_int pos; /* position of the scrollbar */
l_int change; /* change value (when edges are pressed) */
l_int delta; /* bar delta (contains the size of the bar) */
l_int bar_pos; /* bar's position */
l_int flags;
l_char reserved[8];
/* if scrollbar's position has changed, this function is called */
void (*on_scroll)(p_bad_vscrollbar o, l_int pos);
void (*change_pos)(p_bad_vscrollbar o, l_int newpos);
void (*change_max)(p_bad_vscrollbar o, l_int newmax);
} t_bad_vscrollbar;
#define BAD_VSCROLLBAR(o) ((p_bad_vscrollbar)(o))
/* functions for bad_vscrollbar */
/* draws bad_vscrollbar */
void bad_vscrollbar_draw(p_view o);
/* changes bar's position */
void bad_vscrollbar_change_pos(p_bad_vscrollbar o, l_int newpos);
/* changes scrollbar's maximum value and recalculates delta (bar's size) */
void bad_vscrollbar_change_max(p_bad_vscrollbar o, l_int newmax);
/* creates a t_bad_vscrollbar object in area defined by "r".
default values are:
maximum value = 100
position = 0
change value = 5
on_change = NULL
*/
p_bad_vscrollbar _bad_vscrollbar_init(p_bad_vscrollbar o, t_rect r, l_int flags);
extern p_bad_vscrollbar (*bad_vscrollbar_init)(p_bad_vscrollbar o, t_rect r, l_int flags);
#ifdef __cplusplus
}
#endif
#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -