-
-
Notifications
You must be signed in to change notification settings - Fork 93
Layout2D
- Add Layout2d class;
- Add to widget property Layout2d;
- Add new widget "Root";
- Add new static class ExpressionParser;
- Add new private method "Desktop.UpdateRecursiveLayout(List widgets)";
- Add new public method "Desktop.GetWidget(Func<Widget,bool> Filter)". Recursively searches for a widget that matches the filter.
- Add new public method "Desktop.GetWidgetByID(string ID)". Recursively searches for a widget that matches the ID.
- Add new example Layout2d.
Method changed "Descktop.UpdateLayout()". Now it updates the layout recursively.
Layout2d - a mechanism that allows you to arrange widgets, as well as its size dynamically, depending on external variables. Each Widget contains Layout2d. If you want to operate widgets as before, just do not set a value for it; if you have already set it, just apply layout2d = Layout2D.NullLayout; In Layout2d, you set a condition for different widget values, such as position and size. Any condition begins with this.N =, where N is the value that we will calculate.
The following external variables are available for use:
This widget:
- "this.h" or "this.height" - get current widget height.
- "this.w" or "this.width" - get current widget width.
- "this.X" or "this.left" or "this.l" - get current widget left.
- "this.Y" or "this.top" or "this.t" - get current widget top.
Window variables:
- "W.h" or "W.height" - get window height.
- "W.w" or "W.width" -get window width.
Parrent variables:
- "&.w" or "&.width" - get parent width.
- "&.h" or "&.height" - get parent height.
- "&.X" or "&.l" or "&.left" - get parent left.
- "&.Y" or "&.t" or "&.top" - get parent top.
You can also get the value of the widget by its ID:
- "[id].w" or "[id].width" - get [id].width.
- "[id].h" or "[id].height" - get [id].height.
- "[id].X" or "[id].l" or "&.left" - get [id].left.
- "[id].Y" or "[id].t" or "&.top" - get [id].top.
Expression example: "this.X=W.w/3;this.Y=W.h*0.5"