ObjectivelyMVC
Object oriented MVC framework for SDL3 and GNU C
Loading...
Searching...
No Matches
ViewConstraint Struct Reference

A constraint offered by an ancestor View to a descendant during View::sizeThatSatisfies. More...

#include <View.h>

Public Types

enum  { ViewConstraintEqual , ViewConstraintMax , ViewConstraintUnspecified }
 

Data Fields

enum ViewConstraint:: { ... }  mode
 
int value
 The constraint value; a size in pixels.
 

Detailed Description

A constraint offered by an ancestor View to a descendant during View::sizeThatSatisfies.

Definition at line 131 of file View.h.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
ViewConstraintEqual 

The offered value is final; the View must resolve to exactly this size.

ViewConstraintMax 

The offered value is an upper bound; the View may resolve to any size up to it.

Remarks
Do not use this for a View's own already-resolved frame (e.g. re-deriving a constraint to re-layout a View standalone): a ViewAutoresizingWidth/Height axis whose sizeThatFits value is smaller than that frame would shrink to it, discarding a size a parent previously forced with ViewConstraintEqual. Use ViewConstraintEqual instead to treat an existing frame as authoritative.
ViewConstraintUnspecified 

No bound is offered; the ancestor is itself unresolved for this axis.

Definition at line 132 of file View.h.

132 {
137
147
152 } mode;
@ ViewConstraintMax
The offered value is an upper bound; the View may resolve to any size up to it.
Definition View.h:146
@ ViewConstraintUnspecified
No bound is offered; the ancestor is itself unresolved for this axis.
Definition View.h:151
@ ViewConstraintEqual
The offered value is final; the View must resolve to exactly this size.
Definition View.h:136
enum ViewConstraint::@3 mode

Field Documentation

◆ []

enum { ... } ViewConstraint::mode

◆ value

int ViewConstraint::value

The constraint value; a size in pixels.

Definition at line 157 of file View.h.


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