CrabUI
Loading...
Searching...
No Matches
CrabUI.CUILayout Class Referenceabstract

Base class for all layouts. More...

Inheritance diagram for CrabUI.CUILayout:
CrabUI.CUILayoutGrid CrabUI.CUILayoutHorizontalList CrabUI.CUILayoutSimple CrabUI.CUILayoutVerticalList

Public Member Functions

void ForceMarkUnchanged ()
 This is just for debug, don't use it.
 
 CUILayout (CUIComponent host)
 
override string ToString ()
 

Static Public Member Functions

static CUILayout Parse (string raw)
 

Public Attributes

CUIComponent Host
 

Protected Attributes

bool changed = true
 
bool absoluteChanged = true
 
bool decorChanged = true
 

Properties

bool Changed [get, set]
 
bool SelfAndParentChanged [set]
 It doesn't optimize anything.
 
bool ChildChanged [set]
 
bool AbsoluteChanged [get, set]
 
bool DecorChanged [get, set]
 

Detailed Description

Base class for all layouts.

Definition at line 17 of file CUILayout.cs.

Constructor & Destructor Documentation

◆ CUILayout() [1/2]

CrabUI.CUILayout.CUILayout ( )

Definition at line 160 of file CUILayout.cs.

160{ }

◆ CUILayout() [2/2]

CrabUI.CUILayout.CUILayout ( CUIComponent host)

Definition at line 161 of file CUILayout.cs.

162 {
163 Host = host;
164 }

Member Function Documentation

◆ ForceMarkUnchanged()

void CrabUI.CUILayout.ForceMarkUnchanged ( )

This is just for debug, don't use it.

Definition at line 29 of file CUILayout.cs.

30 {
31 decorChanged = false;
32 changed = false;
33 absoluteChanged = false;
34
35 foreach (CUIComponent child in Host.Children)
36 {
37 child.Layout.ForceMarkUnchanged();
38 }
39 }

◆ Parse()

static CUILayout CrabUI.CUILayout.Parse ( string raw)
static

Definition at line 167 of file CUILayout.cs.

168 {
169 if (raw != null)
170 {
171 raw = raw.Trim();
172 if (CUIReflection.CUILayoutTypes.ContainsKey(raw))
173 {
174 return (CUILayout)Activator.CreateInstance(CUIReflection.CUILayoutTypes[raw]);
175 }
176 }
177 return new CUILayoutSimple();
178 }

Member Data Documentation

◆ absoluteChanged

bool CrabUI.CUILayout.absoluteChanged = true
protected

Definition at line 106 of file CUILayout.cs.

◆ changed

bool CrabUI.CUILayout.changed = true
protected

Definition at line 50 of file CUILayout.cs.

◆ decorChanged

bool CrabUI.CUILayout.decorChanged = true
protected

Definition at line 116 of file CUILayout.cs.

◆ Host

CUIComponent CrabUI.CUILayout.Host

Definition at line 19 of file CUILayout.cs.

Property Documentation

◆ AbsoluteChanged

bool CrabUI.CUILayout.AbsoluteChanged
getset

Definition at line 106 of file CUILayout.cs.

107 {
108 get => absoluteChanged;
109 set
110 {
111 if (!value) absoluteChanged = false;
112 if (value && Host.Parent != null) Host.Parent.Layout.absoluteChanged = true;
113 //if (value && Host.Parent != null) Host.Parent.Layout.propagateAbsoluteChangedUp();
114 }
115 }

◆ Changed

bool CrabUI.CUILayout.Changed
getset

Definition at line 50 of file CUILayout.cs.

51 {
52 get => changed;
53 set
54 {
55 changed = value;
56 if (value)
57 {
58 if (Host.Parent != null) Host.Parent.Layout.propagateChangedDown();
59 else propagateChangedDown();
60 }
61 }
62 }

◆ ChildChanged

bool CrabUI.CUILayout.ChildChanged
set

Definition at line 93 of file CUILayout.cs.

94 {
95 set
96 {
97 if (value) propagateChangedDown();
98 }
99 }

◆ DecorChanged

bool CrabUI.CUILayout.DecorChanged
getset

Definition at line 116 of file CUILayout.cs.

117 {
118 get => decorChanged;
119 set
120 {
121 decorChanged = value;
122 }
123 }

◆ SelfAndParentChanged

bool CrabUI.CUILayout.SelfAndParentChanged
set

It doesn't optimize anything.

Definition at line 76 of file CUILayout.cs.

77 {
78 set
79 {
80 if (value)
81 {
82 changed = true;
83 DecorChanged = true;
84 if (Host.Parent != null)
85 {
86 Host.Parent.Layout.changed = true;
87 Host.Parent.Layout.propagateDecorChangedDown();
88 }
89 }
90 }
91 }

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