You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
/// Controls how the View's <see cref="Frame"/> is computed during <see cref="LayoutSubviews"/>. If the style is set to
210
-
/// <see cref="LayoutStyle.Absolute"/>,
211
-
/// LayoutSubviews does not change the <see cref="Frame"/>. If the style is <see cref="LayoutStyle.Computed"/>
212
-
/// the <see cref="Frame"/> is updated using
221
+
/// <see cref="LayoutStyle.Absolute"/>, LayoutSubviews does not change the <see cref="Frame"/>.
222
+
/// If the style is <see cref="LayoutStyle.Computed"/> the <see cref="Frame"/> is updated using
213
223
/// the <see cref="X"/>, <see cref="Y"/>, <see cref="Width"/>, and <see cref="Height"/> properties.
214
224
/// </summary>
225
+
/// <remarks>
226
+
/// <para>
227
+
/// Setting this property to <see cref="LayoutStyle.Absolute"/> will cause <see cref="Frame"/> to determine the
228
+
/// size and position of the view. <see cref="X"/> and <see cref="Y"/> will be set to <see cref="Dim.DimAbsolute"/> using <see cref="Frame"/>.
229
+
/// </para>
230
+
/// <para>
231
+
/// Setting this property to <see cref="LayoutStyle.Computed"/> will cause the view to use the <see cref="LayoutSubviews"/> method to
232
+
/// size and position of the view. If either of the <see cref="X"/> and <see cref="Y"/> properties are `null` they will be set to <see cref="Pos.PosAbsolute"/> using
233
+
/// the current value of <see cref="Frame"/>.
234
+
/// If either of the <see cref="Width"/> and <see cref="Height"/> properties are `null` they will be set to <see cref="Dim.DimAbsolute"/> using <see cref="Frame"/>.
235
+
/// </para>
236
+
/// </remarks>
215
237
/// <value>The layout style.</value>
216
238
publicLayoutStyleLayoutStyle{
217
-
get=>_layoutStyle;
239
+
get{
240
+
return_layoutStyle;
241
+
//if ((X == null || X is Pos.PosAbsolute) && (Y == null || Y is Pos.PosAbsolute) &&
242
+
//(Width == null || Width is Dim.DimAbsolute) && (Height == null || Height is Dim.DimAbsolute)) {
243
+
// return LayoutStyle.Absolute;
244
+
//} else {
245
+
// return LayoutStyle.Computed;
246
+
//}
247
+
}
218
248
set{
219
249
_layoutStyle=value;
250
+
//switch (_layoutStyle) {
251
+
//case LayoutStyle.Absolute:
252
+
// X = Frame.X;
253
+
// Y = Frame.Y;
254
+
// Width = Frame.Width;
255
+
// Height = Frame.Height;
256
+
// break;
257
+
258
+
//case LayoutStyle.Computed:
259
+
// X ??= Frame.X;
260
+
// Y ??= Frame.Y;
261
+
// Width ??= Frame.Width;
262
+
// Height ??= Frame.Height;
263
+
// break;
264
+
//}
220
265
SetNeedsLayout();
221
266
}
222
267
}
223
268
224
269
/// <summary>
225
-
/// The view's content area.
226
-
/// <para>
227
-
/// SubViews are positioned relative to Bounds.
228
-
/// </para>
270
+
/// The bounds represent the View-relative rectangle used for this view; the area inside of the view where subviews and content are presented.
271
+
/// </summary>
272
+
/// <value>The rectangle describing the location and size of the area where the views' subviews and content are drawn.</value>
273
+
/// <remarks>
229
274
/// <para>
230
-
/// Drawing is clipped to Bounds (<see cref="Draw()"/> clips drawing to Bounds.<see cref="Rect.Size">Size</see>).
275
+
/// If <see cref="LayoutStyle"/> is <see cref="LayoutStyle.Computed"/> the value of Bounds is indeterminate until the
276
+
/// view has been initialized (<see creft="IsInitialized"/> is true) and <see cref="LayoutSubviews"/> has been called.
231
277
/// </para>
232
278
/// <para>
233
-
/// Mouse events are reported relative to Bounds.
279
+
/// Updates to the Bounds updates <see cref="Frame"/>, and has the same side effects as updating the <see cref="Frame"/>.
234
280
/// </para>
235
-
/// </summary>
236
-
/// <value>The view's content area.</value>
237
-
/// <remarks>
238
281
/// <para>
239
-
/// The <see cref="Rect.Location"/> of Bounds is always (0, 0). To obtain the offset of the Bounds from the Frame use
240
-
/// <see cref="GetBoundsOffset"/>.
282
+
/// Altering the Bounds will eventually (when the view is next drawn) cause the <see cref="LayoutSubview(View, Rect)"/>
283
+
/// and <see cref="OnDrawContent(Rect)"/> methods to be called.
241
284
/// </para>
242
285
/// <para>
243
-
/// When using <see cref="LayoutStyle.Computed"/>, Bounds is not valid until after the view has been initialized (after <see cref="EndInit"/> has been called and <see cref="Initialized"/>
244
-
/// has fired). Accessing this property before the view is initialized is considered an error./>
286
+
/// Because <see cref="Bounds"/> coordinates are relative to the upper-left corner of the <see cref="View"/>,
287
+
/// the coordinates of the upper-left corner of the rectangle returned by this property are (0,0).
288
+
/// Use this property to obtain the size of the area of the view for tasks such as drawing the view's contents.
245
289
/// </para>
246
290
/// </remarks>
247
291
publicvirtualRectBounds{
@@ -280,12 +324,21 @@ Rect FrameGetInsideBounds ()
280
324
Pos_x,_y;
281
325
282
326
/// <summary>
283
-
/// Gets or sets the X position for the view (the column). Only used if the <see cref="LayoutStyle"/> is <see cref="Terminal.Gui.LayoutStyle.Computed"/>.
327
+
/// Gets or sets the X position for the view (the column).
284
328
/// </summary>
285
-
/// <value>The X Position.</value>
329
+
/// <value>The <see cref="Pos"/> object representing the X position.</value>
286
330
/// <remarks>
287
331
/// <para>
288
-
/// If <see cref="LayoutStyle"/> is <see cref="Terminal.Gui.LayoutStyle.Absolute"/> changing this property has no effect and its value is indeterminate.
332
+
/// If <see cref="LayoutStyle"/> is <see cref="LayoutStyle.Computed"/> the value is indeterminate until the
333
+
/// view has been initialized (<see creft="IsInitialized"/> is true) and <see cref="LayoutSubviews"/> has been called.
334
+
/// </para>
335
+
/// <para>
336
+
/// Changing this property will eventually (when the view is next drawn) cause the <see cref="LayoutSubview(View, Rect)"/> and
337
+
/// <see cref="OnDrawContent(Rect)"/> methods to be called.
338
+
/// </para>
339
+
/// <para>
340
+
/// If <see cref="LayoutStyle"/> is <see cref="LayoutStyle.Absolute"/> changing this property will cause the <see cref="Frame"/> to be updated. If
341
+
/// the new value is not of type <see cref="Pos.PosAbsolute"/> the <see cref="LayoutStyle"/> will change to <see cref="LayoutStyle.Computed"/>.
289
342
/// </para>
290
343
/// <para>
291
344
/// <see langword="null"/> is the same as <c>Pos.Absolute(0)</c>.
@@ -306,14 +359,22 @@ public Pos X {
306
359
}
307
360
}
308
361
309
-
310
362
/// <summary>
311
-
/// Gets or sets the Y position for the view (the row). Only used if the <see cref="LayoutStyle"/> is <see cref="Terminal.Gui.LayoutStyle.Computed"/>.
363
+
/// Gets or sets the Y position for the view (the row).
312
364
/// </summary>
313
-
/// <value>The X Position.</value>
365
+
/// <value>The <see cref="Pos"/> object representing the Y position.</value>
314
366
/// <remarks>
315
367
/// <para>
316
-
/// If <see cref="LayoutStyle"/> is <see cref="Terminal.Gui.LayoutStyle.Absolute"/> changing this property has no effect and its value is indeterminate.
368
+
/// If <see cref="LayoutStyle"/> is <see cref="LayoutStyle.Computed"/> the value is indeterminate until the
369
+
/// view has been initialized (<see creft="IsInitialized"/> is true) and <see cref="LayoutSubviews"/> has been called.
370
+
/// </para>
371
+
/// <para>
372
+
/// Changing this property will eventually (when the view is next drawn) cause the <see cref="LayoutSubview(View, Rect)"/> and
373
+
/// <see cref="OnDrawContent(Rect)"/> methods to be called.
374
+
/// </para>
375
+
/// <para>
376
+
/// If <see cref="LayoutStyle"/> is <see cref="LayoutStyle.Absolute"/> changing this property will cause the <see cref="Frame"/> to be updated. If
377
+
/// the new value is not of type <see cref="Pos.PosAbsolute"/> the <see cref="LayoutStyle"/> will change to <see cref="LayoutStyle.Computed"/>.
317
378
/// </para>
318
379
/// <para>
319
380
/// <see langword="null"/> is the same as <c>Pos.Absolute(0)</c>.
@@ -333,19 +394,25 @@ public Pos Y {
333
394
OnResizeNeeded();
334
395
}
335
396
}
397
+
336
398
Dim_width,_height;
337
399
338
400
/// <summary>
339
-
/// Gets or sets the width of the view. Only used when <see cref="LayoutStyle"/> is <see cref="Terminal.Gui.LayoutStyle.Computed"/>.
401
+
/// Gets or sets the width of the view.
340
402
/// </summary>
341
-
/// <value>The width.</value>
403
+
/// <value>The <see cref="Dim"/> object representing the width of the view (the number of columns).</value>
342
404
/// <remarks>
343
405
/// <para>
344
-
/// If <see cref="LayoutStyle"/> is <see cref="Terminal.Gui.LayoutStyle.Absolute"/> changing this property
345
-
/// has no effect and its value is indeterminate.
406
+
/// If <see cref="LayoutStyle"/> is <see cref="LayoutStyle.Computed"/> the value is indeterminate until the
407
+
/// view has been initialized (<see creft="IsInitialized"/> is true) and <see cref="LayoutSubviews"/> has been called.
408
+
/// </para>
409
+
/// <para>
410
+
/// Changing this property will eventually (when the view is next drawn) cause the <see cref="LayoutSubview(View, Rect)"/>
411
+
/// and <see cref="OnDrawContent(Rect)"/> methods to be called.
346
412
/// </para>
347
413
/// <para>
348
-
/// <see langword="null"/> is the same as <c>Dim.Fill (0)</c>.
414
+
/// If <see cref="LayoutStyle"/> is <see cref="LayoutStyle.Absolute"/> changing this property will cause the <see cref="Frame"/> to be updated. If
415
+
/// the new value is not of type <see cref="Dim.DimAbsolute"/> the <see cref="LayoutStyle"/> will change to <see cref="LayoutStyle.Computed"/>.
349
416
/// </para>
350
417
/// </remarks>
351
418
publicDimWidth{
@@ -372,16 +439,21 @@ public Dim Width {
372
439
}
373
440
374
441
/// <summary>
375
-
/// Gets or sets the height of the view. Only used when <see cref="LayoutStyle"/> is <see cref="Terminal.Gui.LayoutStyle.Computed"/>.
442
+
/// Gets or sets the height of the view.
376
443
/// </summary>
377
-
/// <value>The width.</value>
444
+
/// <value>The <see cref="Dim"/> object representing the height of the view (the number of rows).</value>
378
445
/// <remarks>
379
446
/// <para>
380
-
/// If <see cref="LayoutStyle"/> is <see cref="Terminal.Gui.LayoutStyle.Absolute"/> changing this property
381
-
/// has no effect and its value is indeterminate.
447
+
/// If <see cref="LayoutStyle"/> is <see cref="LayoutStyle.Computed"/> the value is indeterminate until the
448
+
/// view has been initialized (<see creft="IsInitialized"/> is true) and <see cref="LayoutSubviews"/> has been called.
449
+
/// </para>
450
+
/// <para>
451
+
/// Changing this property will eventually (when the view is next drawn) cause the <see cref="LayoutSubview(View, Rect)"/>
452
+
/// and <see cref="OnDrawContent(Rect)"/> methods to be called.
382
453
/// </para>
383
454
/// <para>
384
-
/// <see langword="null"/> is the same as <c>Dim.Fill (0)</c>.
455
+
/// If <see cref="LayoutStyle"/> is <see cref="LayoutStyle.Absolute"/> changing this property will cause the <see cref="Frame"/> to be updated. If
456
+
/// the new value is not of type <see cref="Dim.DimAbsolute"/> the <see cref="LayoutStyle"/> will change to <see cref="LayoutStyle.Computed"/>.
385
457
/// </para>
386
458
/// </remarks>
387
459
publicDimHeight{
@@ -658,7 +730,7 @@ int GetNewDimension (Dim d, int location, int dimension, int autosize)
0 commit comments