28#define _Class _PageView
43 if (this->currentPage == NULL) {
68 if (subview == this->currentPage) {
79 return $$(Array, arrayWithArray, (Array *) self->
subviews);
82#pragma mark - PageView
105 if (subview == ((
PageView *) data)->currentPage) {
141#pragma mark - Class lifecycle
148 ((ViewInterface *) clazz->interface)->addSubview =
addSubview;
149 ((ViewInterface *) clazz->interface)->init =
init;
151 ((ViewInterface *) clazz->interface)->visibleSubviews =
visibleSubviews;
153 ((PageViewInterface *) clazz->interface)->initWithFrame =
initWithFrame;
154 ((PageViewInterface *) clazz->interface)->setCurrentPage =
setCurrentPage;
166 clazz = _initialize(&(
const ClassDef) {
168 .superclass =
_View(),
170 .interfaceOffset = offsetof(
PageView, interface),
171 .interfaceSize =
sizeof(PageViewInterface),
static void setCurrentPage_enumerate(const Array *array, ident obj, ident data)
ArrayEnumerator for setCurrentPage.
static void initialize(Class *clazz)
PageViews manage their subviews as pages in a book.
Box * initWithFrame(Box *self, const SDL_Rect *frame)
Initializes this Box with the given frame.
CollectionView * init(CollectionView *self, const SDL_Rect *frame)
Initializes this CollectionView with the specified frame and style.
void(* didSetCurrentPage)(PageView *pageView)
Called when the current page is set.
PageViews manage their subviews as pages in a book.
Class * _PageView(void)
The PageView archetype.
void setCurrentPage(PageView *self, View *currentPage)
Presents the specified subview as the current page of this PageView.
View * currentPage
The index of the current page.
PageViewDelegate delegate
The delegate.
Views are the fundamental building blocks of ObjectivelyMVC user interfaces.
MutableArray * subviews
The immediate subviews.
_Bool needsLayout
If true, this View will layout its subviews before it is drawn.
_Bool hidden
If true, this View is not drawn.
Class * _View(void)
The View archetype.
Array * visibleSubviews(const View *self)
void addSubview(View *self, View *subview)
Adds a subview to this view, to be drawn above its siblings.
void addClassName(View *self, const char *className)
Adds the given class name to this View.
void removeSubview(View *self, View *subview)
Removes the given subview from this View.