ObjectivelyMVC 0.1.0
Object oriented MVC framework for OpenGL, SDL2 and GNU C
Public Member Functions | Data Fields | Protected Attributes
TableColumn Struct Reference

Columns provide alignment, spacing and sorting hints for TableView instances. More...

#include <TableColumn.h>

Inheritance diagram for TableColumn:

Public Member Functions

Class * _TableColumn (void)
 The TableColumn archetype. More...
 
TableColumninit (TableColumn *self)
 
TableColumninitWithIdentifier (TableColumn *self, const char *identifier)
 Initializes this TableColumn with the given identifier. More...
 

Data Fields

TableHeaderCellViewheaderCell
 The header cell. More...
 
char * identifier
 The identifier. More...
 
Object object
 The superclass. More...
 
Order order
 The sort order. More...
 

Protected Attributes

TableColumnInterface * interface
 The interface. More...
 

Detailed Description

Columns provide alignment, spacing and sorting hints for TableView instances.

Definition at line 45 of file TableColumn.h.

Member Function Documentation

◆ _TableColumn()

Class * _TableColumn ( void  )

The TableColumn archetype.

Returns
The TableColumn Class.

Definition at line 91 of file TableColumn.c.

91 {
92 static Class *clazz;
93 static Once once;
94
95 do_once(&once, {
96 clazz = _initialize(&(const ClassDef) {
97 .name = "TableColumn",
98 .superclass = _Object(),
99 .instanceSize = sizeof(TableColumn),
100 .interfaceOffset = offsetof(TableColumn, interface),
101 .interfaceSize = sizeof(TableColumnInterface),
103 });
104 });
105
106 return clazz;
107}
static void initialize(Class *clazz)
Definition: TableColumn.c:80
Columns provide alignment, spacing and sorting hints for TableView instances.
Definition: TableColumn.h:45
TableColumnInterface * interface
The interface.
Definition: TableColumn.h:56

◆ init()

TableColumn * init ( TableColumn self)

◆ initWithIdentifier()

TableColumn * initWithIdentifier ( TableColumn self,
const char *  identifier 
)

Initializes this TableColumn with the given identifier.

Parameters
selfThe TableColumn.
identifierThe column identifier.
Returns
The initialized TableColumn, or NULL on error.

Definition at line 56 of file TableColumn.c.

56 {
57
58 self = (TableColumn *) super(Object, self, init);
59 if (self) {
60
61 self->headerCell = $(alloc(TableHeaderCellView), initWithFrame, NULL);
62 assert(self->headerCell);
63
64 self->identifier = strdup(identifier);
65 assert(self->identifier);
66
67 self->headerCell->tableCellView.view.identifier = strdup(self->identifier);
68
69 $(((TableCellView *) self->headerCell)->text, setText, self->identifier);
70 }
71
72 return self;
73}
static Box * initWithFrame(Box *self, const SDL_Rect *frame)
Definition: Box.c:92
static void setText(Text *self, const char *text)
Definition: Text.c:261
Each row in a TableView is comprised of TableCellViews.
Definition: TableCellView.h:41
View view
The superclass.
Definition: TableCellView.h:46
char * identifier
The identifier.
Definition: TableColumn.h:66
TableHeaderCellView * headerCell
The header cell.
Definition: TableColumn.h:61
TableColumn * init(TableColumn *self)
Header cells provide clickable sort handles for TableView instances.
TableCellView tableCellView
The superclass.
char * identifier
An optional identifier.
Definition: View.h:201

Field Documentation

◆ headerCell

TableHeaderCellView* TableColumn::headerCell

The header cell.

Definition at line 61 of file TableColumn.h.

◆ identifier

char* TableColumn::identifier

The identifier.

Definition at line 66 of file TableColumn.h.

◆ interface

TableColumnInterface* TableColumn::interface
protected

The interface.

Definition at line 56 of file TableColumn.h.

◆ object

Object TableColumn::object

The superclass.

Definition at line 50 of file TableColumn.h.

◆ order

Order TableColumn::order

The sort order.

Definition at line 71 of file TableColumn.h.


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