1 | import { Message } from '@lumino/messaging';
|
2 | import { PanelLayout } from './panellayout';
|
3 | import { Widget } from './widget';
|
4 |
|
5 |
|
6 |
|
7 | export declare class BoxLayout extends PanelLayout {
|
8 | |
9 |
|
10 |
|
11 |
|
12 |
|
13 | constructor(options?: BoxLayout.IOptions);
|
14 | /**
|
15 | * Dispose of the resources held by the layout.
|
16 | */
|
17 | dispose(): void;
|
18 | /**
|
19 | * Get the layout direction for the box layout.
|
20 | */
|
21 | /**
|
22 | * Set the layout direction for the box layout.
|
23 | */
|
24 | direction: BoxLayout.Direction;
|
25 | /**
|
26 | * Get the content alignment for the box layout.
|
27 | *
|
28 | * #### Notes
|
29 | * This is the alignment of the widgets in the layout direction.
|
30 | *
|
31 | * The alignment has no effect if the widgets can expand to fill the
|
32 | * entire box layout.
|
33 | */
|
34 | /**
|
35 | * Set the content alignment for the box layout.
|
36 | *
|
37 | * #### Notes
|
38 | * This is the alignment of the widgets in the layout direction.
|
39 | *
|
40 | * The alignment has no effect if the widgets can expand to fill the
|
41 | * entire box layout.
|
42 | */
|
43 | alignment: BoxLayout.Alignment;
|
44 | /**
|
45 | * Get the inter-element spacing for the box layout.
|
46 | */
|
47 | /**
|
48 | * Set the inter-element spacing for the box layout.
|
49 | */
|
50 | spacing: number;
|
51 | /**
|
52 | * Perform layout initialization which requires the parent widget.
|
53 | */
|
54 | protected init(): void;
|
55 | /**
|
56 | * Attach a widget to the parent's DOM node.
|
57 | *
|
58 | * @param index - The current index of the widget in the layout.
|
59 | *
|
60 | * @param widget - The widget to attach to the parent.
|
61 | *
|
62 | * #### Notes
|
63 | * This is a reimplementation of the superclass method.
|
64 | */
|
65 | protected attachWidget(index: number, widget: Widget): void;
|
66 | /**
|
67 | * Move a widget in the parent's DOM node.
|
68 | *
|
69 | * @param fromIndex - The previous index of the widget in the layout.
|
70 | *
|
71 | * @param toIndex - The current index of the widget in the layout.
|
72 | *
|
73 | * @param widget - The widget to move in the parent.
|
74 | *
|
75 | * #### Notes
|
76 | * This is a reimplementation of the superclass method.
|
77 | */
|
78 | protected moveWidget(fromIndex: number, toIndex: number, widget: Widget): void;
|
79 | /**
|
80 | * Detach a widget from the parent's DOM node.
|
81 | *
|
82 | * @param index - The previous index of the widget in the layout.
|
83 | *
|
84 | * @param widget - The widget to detach from the parent.
|
85 | *
|
86 | * #### Notes
|
87 | * This is a reimplementation of the superclass method.
|
88 | */
|
89 | protected detachWidget(index: number, widget: Widget): void;
|
90 | /**
|
91 | * A message handler invoked on a `'before-show'` message.
|
92 | */
|
93 | protected onBeforeShow(msg: Message): void;
|
94 | /**
|
95 | * A message handler invoked on a `'before-attach'` message.
|
96 | */
|
97 | protected onBeforeAttach(msg: Message): void;
|
98 | /**
|
99 | * A message handler invoked on a `'child-shown'` message.
|
100 | */
|
101 | protected onChildShown(msg: Widget.ChildMessage): void;
|
102 | /**
|
103 | * A message handler invoked on a `'child-hidden'` message.
|
104 | */
|
105 | protected onChildHidden(msg: Widget.ChildMessage): void;
|
106 | /**
|
107 | * A message handler invoked on a `'resize'` message.
|
108 | */
|
109 | protected onResize(msg: Widget.ResizeMessage): void;
|
110 | /**
|
111 | * A message handler invoked on an `'update-request'` message.
|
112 | */
|
113 | protected onUpdateRequest(msg: Message): void;
|
114 | /**
|
115 | * A message handler invoked on a `'fit-request'` message.
|
116 | */
|
117 | protected onFitRequest(msg: Message): void;
|
118 | /**
|
119 | * Fit the layout to the total size required by the widgets.
|
120 | */
|
121 | private _fit;
|
122 | /**
|
123 | * Update the layout position and size of the widgets.
|
124 | *
|
125 | * The parent offset dimensions should be `-1` if unknown.
|
126 | */
|
127 | private _update;
|
128 | private _fixed;
|
129 | private _spacing;
|
130 | private _dirty;
|
131 | private _sizers;
|
132 | private _items;
|
133 | private _box;
|
134 | private _alignment;
|
135 | private _direction;
|
136 | }
|
137 | /**
|
138 | * The namespace for the `BoxLayout` class statics.
|
139 | */
|
140 | export declare namespace BoxLayout {
|
141 | |
142 |
|
143 |
|
144 | type Direction = 'left-to-right' | 'right-to-left' | 'top-to-bottom' | 'bottom-to-top';
|
145 | |
146 |
|
147 |
|
148 | type Alignment = 'start' | 'center' | 'end' | 'justify';
|
149 | |
150 |
|
151 |
|
152 | interface IOptions {
|
153 | |
154 |
|
155 |
|
156 |
|
157 |
|
158 | direction?: Direction;
|
159 | |
160 |
|
161 |
|
162 |
|
163 |
|
164 | alignment?: Alignment;
|
165 | |
166 |
|
167 |
|
168 |
|
169 |
|
170 | spacing?: number;
|
171 | }
|
172 | |
173 |
|
174 |
|
175 |
|
176 |
|
177 |
|
178 |
|
179 | function getStretch(widget: Widget): number;
|
180 | |
181 |
|
182 |
|
183 |
|
184 |
|
185 |
|
186 |
|
187 | function setStretch(widget: Widget, value: number): void;
|
188 | |
189 |
|
190 |
|
191 |
|
192 |
|
193 |
|
194 |
|
195 | function getSizeBasis(widget: Widget): number;
|
196 | |
197 |
|
198 |
|
199 |
|
200 |
|
201 |
|
202 |
|
203 | function setSizeBasis(widget: Widget, value: number): void;
|
204 | }
|
205 |
|
\ | No newline at end of file |