Atrinik Client 2.5
Data Fields
list_struct Struct Reference

#include <list.h>

Data Fields

struct list_structnext
struct list_structprev
uint32 id
int x
int y
int px
int py
int width
uint32 max_rows
uint32 rows
uint32 cols
int spacing
uint32col_widths
int * col_spacings
char ** col_names
uint8col_centered
char *** text
sint16 row_height_adjust
sint16 frame_offset
uint16 header_height
uint32 row_highlighted
uint32 row_selected
uint32 row_offset
uint32 click_tick
sint32 repeat_key
uint32 repeat_key_ticks
uint8 focus
uint8 scrollbar_dragging
uint8 scrollbar
int scrollbar_h
int scrollbar_y
int font
SDL_Surface * surface
uint64 text_flags
void(* draw_frame_func )(struct list_struct *list)
void(* row_color_func )(struct list_struct *list, int row, SDL_Rect box)
void(* row_highlight_func )(struct list_struct *list, SDL_Rect box)
void(* row_selected_func )(struct list_struct *list, SDL_Rect box)
void(* handle_esc_func )(struct list_struct *list)
void(* handle_enter_func )(struct list_struct *list)
int(* key_event_func )(struct list_struct *list, SDLKey key)
const char *(* text_color_hook )(struct list_struct *list, const char *default_color, uint32 row, uint32 col)
void(* post_column_func )(struct list_struct *list, uint32 row, uint32 col)
void(* handle_mouse_row_func )(struct list_struct *list, uint32 row, SDL_Event *event)

Detailed Description

One list.

Definition at line 34 of file list.h.


Field Documentation

Used for figuring out whether a double click occurred (keeps last ticks value).

Definition at line 125 of file list.h.

An array of which columns are centered.

Definition at line 86 of file list.h.

An array of pointers to the column names.

Definition at line 83 of file list.h.

An array of the column spacings.

Definition at line 80 of file list.h.

An array of the column widths.

Definition at line 77 of file list.h.

Number of columns in a row.

Definition at line 71 of file list.h.

Function that will draw frame (and/or other effects) right before the column names and the actual rows.

Parameters:
listList.

Definition at line 163 of file list.h.

If 1, this list has the active focus.

Definition at line 136 of file list.h.

Font used, one of FONT_xxx. Default is FONT_SANS10.

Definition at line 151 of file list.h.

Frame offset (used when drawing the frame around the rows and when coloring the row entries).

Definition at line 100 of file list.h.

Function to handle enter key being pressed on a selected row, or a row being double clicked.

Parameters:
listList.

Definition at line 193 of file list.h.

Function to handle ESC key being pressed while the list had focus.

Parameters:
listList.

Definition at line 187 of file list.h.

Height of the header with column names.

Definition at line 103 of file list.h.

ID of the list, one of List IDs.

Definition at line 43 of file list.h.

int(* list_struct::key_event_func)(struct list_struct *list, SDLKey key)

Custom function to call for handling keyboard events.

Parameters:
listList.
keyKey ID.
Return values:
-1Did not handle the event.
0Handled the event.
1Handled the event, and allow keyboard repeating.

Definition at line 202 of file list.h.

Maximum number of visible rows.

Definition at line 65 of file list.h.

Next list in a linked list.

Definition at line 37 of file list.h.

Previous list in a linked list.

Definition at line 40 of file list.h.

Parent X position, ie, X position of the surface the list is being drawn on.

Definition at line 54 of file list.h.

Parent Y position, ie, Y position of the surface the list is being drawn on.

Definition at line 59 of file list.h.

Which key to repeat. If -1, no key.

Definition at line 128 of file list.h.

Used for figuring out how many key repeats to simulate (keeps the ticks value).

Definition at line 133 of file list.h.

void(* list_struct::row_color_func)(struct list_struct *list, int row, SDL_Rect box)

Function that will color the specified row.

Parameters:
listList.
rowRow number, 0-[max visible rows].
boxContains base x/y/width/height information to use.

Definition at line 170 of file list.h.

How many pixels to adjust the height of a row by.

Definition at line 95 of file list.h.

void(* list_struct::row_highlight_func)(struct list_struct *list, SDL_Rect box)

Function to highlight a row (due to mouse being over it).

Parameters:
listList.
boxContains base x/y/width/height information to use.

Definition at line 176 of file list.h.

Currently highlighted row ID + 1, therefore, 0 means no highlighted row.

Definition at line 108 of file list.h.

Row offset used for scrolling.

  • 0 = Row #0 is shown first in the list.
  • 10 = Row #10 is shown first in the list.

Definition at line 120 of file list.h.

Currently selected row ID + 1, therefore, 0 means no selected row.

Definition at line 113 of file list.h.

void(* list_struct::row_selected_func)(struct list_struct *list, SDL_Rect box)

Function to color a selected row.

Parameters:
listList.
boxContains base x/y/width/height information to use.

Definition at line 182 of file list.h.

Number of rows.

Definition at line 68 of file list.h.

Does the list use scrollbars?

Definition at line 142 of file list.h.

Is the scrollbar being dragged?

Definition at line 139 of file list.h.

Scrollbar height.

Definition at line 145 of file list.h.

Scrollbar Y position modifier.

Definition at line 148 of file list.h.

Spacing between column names and the actual rows start.

Definition at line 74 of file list.h.

SDL_Surface* list_struct::surface

Surface used to draw the list on.

Definition at line 154 of file list.h.

Array of arrays of pointers to the text. In other words:

row -> col -> text.

Definition at line 92 of file list.h.

const char*(* list_struct::text_color_hook)(struct list_struct *list, const char *default_color, uint32 row, uint32 col)

Hook to use for setting text color based on row/column.

Parameters:
listList.
default_colorColor that will be used by default.
rowText row.
colColumn.
Returns:
Color to use for the text.

Definition at line 211 of file list.h.

Additional text API flags.

Definition at line 157 of file list.h.

List's maximum width.

Definition at line 62 of file list.h.

X position of the list.

Definition at line 46 of file list.h.

Y position of the list.

Definition at line 49 of file list.h.


The documentation for this struct was generated from the following file: