153 references to TextImageRelation
System.Windows.Forms (55)
System\Windows\Forms\Controls\Buttons\ButtonBase.cs (4)
23
private
TextImageRelation
_textImageRelation =
TextImageRelation
.Overlay;
699
[DefaultValue(
TextImageRelation
.Overlay)]
703
public
TextImageRelation
TextImageRelation
System\Windows\Forms\Controls\Buttons\ButtonInternal\ButtonBaseAdapter.cs (1)
584
TextImageRelation =
TextImageRelation
.Overlay,
System\Windows\Forms\Controls\Buttons\ButtonInternal\ButtonBaseAdapter.LayoutOptions.cs (33)
38
public
TextImageRelation
TextImageRelation { get; set; }
309
private
TextImageRelation
RtlTranslateRelation(
TextImageRelation
relation)
316
case
TextImageRelation
.ImageBeforeText:
317
return
TextImageRelation
.TextBeforeImage;
318
case
TextImageRelation
.TextBeforeImage:
319
return
TextImageRelation
.ImageBeforeText;
450
/// Maps an image align to the set of <see cref="Forms.
TextImageRelation
"/>s that represent the same edge.
451
/// For example, <see cref="ContentAlignment.TopLeft"/> maps to <see cref="
TextImageRelation
.ImageAboveText"/>
452
/// and <see cref="
TextImageRelation
.ImageBeforeText"/>.
454
private static readonly
TextImageRelation
[] s_imageAlignToRelation =
456
TextImageRelation
.ImageAboveText |
TextImageRelation
.ImageBeforeText, // TopLeft
457
TextImageRelation
.ImageAboveText, // TopCenter
458
TextImageRelation
.ImageAboveText |
TextImageRelation
.TextBeforeImage, // TopRight
460
TextImageRelation
.ImageBeforeText, // MiddleLeft
462
TextImageRelation
.TextBeforeImage, // MiddleRight
464
TextImageRelation
.TextAboveImage |
TextImageRelation
.ImageBeforeText, // BottomLeft
465
TextImageRelation
.TextAboveImage, // BottomCenter
466
TextImageRelation
.TextAboveImage |
TextImageRelation
.TextBeforeImage // BottomRight
469
private static
TextImageRelation
ImageAlignToRelation(ContentAlignment alignment)
472
private static
TextImageRelation
TextAlignToRelation(ContentAlignment alignment)
480
TextImageRelation
textImageRelation = RtlTranslateRelation(TextImageRelation);
490
if (ImageSize == Size.Empty || Text is null || Text.Length == 0 || textImageRelation ==
TextImageRelation
.Overlay)
575
if (textImageRelation is
TextImageRelation
.TextBeforeImage or
TextImageRelation
.ImageBeforeText)
585
if (textImageRelation is
TextImageRelation
.TextAboveImage or
TextImageRelation
.ImageAboveText)
595
if (textImageRelation ==
TextImageRelation
.ImageBeforeText && layout.ImageBounds.Size.Width != 0)
604
if (textImageRelation ==
TextImageRelation
.ImageAboveText && layout.ImageBounds.Size.Height != 0)
System\Windows\Forms\Controls\ToolStrips\ToolStripControlHost.cs (1)
428
public new
TextImageRelation
TextImageRelation
System\Windows\Forms\Controls\ToolStrips\ToolStripItem.cs (4)
38
private
TextImageRelation
_textImageRelation =
TextImageRelation
.ImageBeforeText;
1929
[DefaultValue(
TextImageRelation
.ImageBeforeText)]
1933
public
TextImageRelation
TextImageRelation
System\Windows\Forms\Controls\ToolStrips\ToolStripSeparator.cs (1)
229
public new
TextImageRelation
TextImageRelation
System\Windows\Forms\Layout\LayoutUtils.cs (11)
200
public static
TextImageRelation
GetOppositeTextImageRelation(
TextImageRelation
relation)
202
return (
TextImageRelation
)GetOppositeAnchor((AnchorStyles)relation);
390
public static Size AddAlignedRegion(Size textSize, Size imageSize,
TextImageRelation
relation)
471
public static bool IsHorizontalRelation(
TextImageRelation
relation)
473
return (relation & (
TextImageRelation
.TextBeforeImage |
TextImageRelation
.ImageBeforeText)) != 0;
483
public static bool IsVerticalRelation(
TextImageRelation
relation)
485
return (relation & (
TextImageRelation
.TextAboveImage |
TextImageRelation
.ImageAboveText)) != 0;
570
public static Size SubAlignedRegion(Size currentSize, Size contentSize,
TextImageRelation
relation)
System.Windows.Forms.Tests (98)
System\Windows\Forms\ButtonBaseTests.cs (38)
112
Assert.Equal(
TextImageRelation
.Overlay, control.TextImageRelation);
3500
foreach (
TextImageRelation
value in Enum.GetValues(typeof(
TextImageRelation
)))
3509
public void ButtonBase_TextImageRelation_Set_GetReturnsExpected(bool autoSize,
TextImageRelation
value)
3532
yield return new object[] { true,
TextImageRelation
.ImageAboveText, 1 };
3533
yield return new object[] { true,
TextImageRelation
.ImageBeforeText, 1 };
3534
yield return new object[] { true,
TextImageRelation
.Overlay, 0 };
3535
yield return new object[] { true,
TextImageRelation
.TextAboveImage, 1 };
3536
yield return new object[] { true,
TextImageRelation
.ImageBeforeText, 1 };
3538
yield return new object[] { false,
TextImageRelation
.ImageAboveText, 0 };
3539
yield return new object[] { false,
TextImageRelation
.ImageBeforeText, 0 };
3540
yield return new object[] { false,
TextImageRelation
.Overlay, 0 };
3541
yield return new object[] { false,
TextImageRelation
.TextAboveImage, 0 };
3542
yield return new object[] { false,
TextImageRelation
.ImageBeforeText, 0 };
3547
public void ButtonBase_TextImageRelation_SetWithParent_GetReturnsExpected(bool autoSize,
TextImageRelation
value, int expectedParentLayoutCallCount)
3595
yield return new object[] { autoSize,
TextImageRelation
.ImageAboveText, 1 };
3596
yield return new object[] { autoSize,
TextImageRelation
.ImageBeforeText, 1 };
3597
yield return new object[] { autoSize,
TextImageRelation
.Overlay, 0 };
3598
yield return new object[] { autoSize,
TextImageRelation
.TextAboveImage, 1 };
3599
yield return new object[] { autoSize,
TextImageRelation
.ImageBeforeText, 1 };
3605
public void ButtonBase_TextImageRelation_SetWithHandle_GetReturnsExpected(bool autoSize,
TextImageRelation
value, int expectedInvalidatedCallCount)
3641
yield return new object[] { true,
TextImageRelation
.ImageAboveText, 1, 1 };
3642
yield return new object[] { true,
TextImageRelation
.ImageBeforeText, 1, 1 };
3643
yield return new object[] { true,
TextImageRelation
.Overlay, 0, 0 };
3644
yield return new object[] { true,
TextImageRelation
.TextAboveImage, 1, 1 };
3645
yield return new object[] { true,
TextImageRelation
.ImageBeforeText, 1, 1 };
3647
yield return new object[] { false,
TextImageRelation
.ImageAboveText, 0, 1 };
3648
yield return new object[] { false,
TextImageRelation
.ImageBeforeText, 0, 1 };
3649
yield return new object[] { false,
TextImageRelation
.Overlay, 0, 0 };
3650
yield return new object[] { false,
TextImageRelation
.TextAboveImage, 0, 1 };
3651
yield return new object[] { false,
TextImageRelation
.ImageBeforeText, 0, 1 };
3656
public void ButtonBase_TextImageRelation_SetWithParentWithHandle_GetReturnsExpected(bool autoSize,
TextImageRelation
value, int expectedParentLayoutCallCount, int expectedInvalidatedCallCount)
3715
[InvalidEnumData<
TextImageRelation
>]
3716
[InlineData((
TextImageRelation
)3)]
3717
[InlineData((
TextImageRelation
)5)]
3718
[InlineData((
TextImageRelation
)6)]
3719
[InlineData((
TextImageRelation
)7)]
3720
public void ButtonBase_TextImageRelation_SetInvalid_ThrowsInvalidEnumArgumentException(
TextImageRelation
value)
System\Windows\Forms\ButtonTests.cs (1)
110
Assert.Equal(
TextImageRelation
.Overlay, control.TextImageRelation);
System\Windows\Forms\CheckBoxTests.cs (1)
112
Assert.Equal(
TextImageRelation
.Overlay, control.TextImageRelation);
System\Windows\Forms\RadioButtonTests.cs (1)
110
Assert.Equal(
TextImageRelation
.Overlay, control.TextImageRelation);
System\Windows\Forms\ToolStripButtonTests.cs (6)
88
Assert.Equal(
TextImageRelation
.ImageBeforeText, item.TextImageRelation);
169
Assert.Equal(
TextImageRelation
.ImageBeforeText, item.TextImageRelation);
256
Assert.Equal(
TextImageRelation
.ImageBeforeText, item.TextImageRelation);
346
Assert.Equal(
TextImageRelation
.ImageBeforeText, item.TextImageRelation);
434
Assert.Equal(
TextImageRelation
.ImageBeforeText, item.TextImageRelation);
532
Assert.Equal(
TextImageRelation
.ImageBeforeText, item.TextImageRelation);
System\Windows\Forms\ToolStripControlHostTests.cs (9)
117
Assert.Equal(
TextImageRelation
.ImageBeforeText, item.TextImageRelation);
2362
[EnumData<
TextImageRelation
>]
2363
public void ToolStripControlHost_TextImageRelation_Set_GetReturnsExpected(
TextImageRelation
value)
2378
[InvalidEnumData<
TextImageRelation
>]
2379
[InlineData((
TextImageRelation
)3)]
2380
[InlineData((
TextImageRelation
)5)]
2381
[InlineData((
TextImageRelation
)6)]
2382
[InlineData((
TextImageRelation
)7)]
2383
public void ToolStripControlHost_TextImageRelation_SetInvalid_ThrowsInvalidEnumArgumentException(
TextImageRelation
value)
System\Windows\Forms\ToolStripDropDownItemTests.cs (4)
88
Assert.Equal(
TextImageRelation
.ImageBeforeText, item.TextImageRelation);
177
Assert.Equal(
TextImageRelation
.ImageBeforeText, item.TextImageRelation);
276
Assert.Equal(
TextImageRelation
.ImageBeforeText, item.TextImageRelation);
384
Assert.Equal(
TextImageRelation
.ImageBeforeText, item.TextImageRelation);
System\Windows\Forms\ToolStripItemTests.cs (27)
87
Assert.Equal(
TextImageRelation
.ImageBeforeText, item.TextImageRelation);
172
Assert.Equal(
TextImageRelation
.ImageBeforeText, item.TextImageRelation);
267
Assert.Equal(
TextImageRelation
.ImageBeforeText, item.TextImageRelation);
8818
[EnumData<
TextImageRelation
>]
8819
public void ToolStripItem_TextImageRelation_Set_GetReturnsExpected(
TextImageRelation
value)
8833
[InlineData(
TextImageRelation
.Overlay, 1)]
8834
[InlineData(
TextImageRelation
.ImageBeforeText, 0)]
8835
[InlineData(
TextImageRelation
.TextBeforeImage, 1)]
8836
[InlineData(
TextImageRelation
.ImageAboveText, 1)]
8837
[InlineData(
TextImageRelation
.TextAboveImage, 1)]
8838
public void ToolStripItem_TextImageRelation_SetWithOwner_GetReturnsExpected(
TextImageRelation
value, int expectedParentLayoutCallCount)
8876
[InlineData(
TextImageRelation
.Overlay, 1)]
8877
[InlineData(
TextImageRelation
.ImageBeforeText, 0)]
8878
[InlineData(
TextImageRelation
.TextBeforeImage, 1)]
8879
[InlineData(
TextImageRelation
.ImageAboveText, 1)]
8880
[InlineData(
TextImageRelation
.TextAboveImage, 1)]
8881
public void ToolStripItem_TextImageRelation_SetWithOwnerWithHandle_GetReturnsExpected(
TextImageRelation
value, int expectedParentLayoutCallCount)
8932
[EnumData<
TextImageRelation
>]
8933
public void ToolStripItem_TextImageRelation_SetWithParent_GetReturnsExpected(
TextImageRelation
value)
8964
[EnumData<
TextImageRelation
>]
8965
public void ToolStripItem_TextImageRelation_SetWithParentWithHandle_GetReturnsExpected(
TextImageRelation
value)
9009
[InvalidEnumData<
TextImageRelation
>]
9010
[InlineData((
TextImageRelation
)3)]
9011
[InlineData((
TextImageRelation
)5)]
9012
[InlineData((
TextImageRelation
)6)]
9013
[InlineData((
TextImageRelation
)7)]
9014
public void ToolStripItem_TextImageRelation_SetInvalid_ThrowsInvalidEnumArgumentException(
TextImageRelation
value)
System\Windows\Forms\ToolStripMenuItemTests.cs (2)
97
Assert.Equal(
TextImageRelation
.ImageBeforeText, item.TextImageRelation);
305
TextImageRelation =
TextImageRelation
.ImageAboveText,
System\Windows\Forms\ToolStripSeparatorTests.cs (9)
85
Assert.Equal(
TextImageRelation
.ImageBeforeText, item.TextImageRelation);
679
[EnumData<
TextImageRelation
>]
680
public void ToolStripSeparator_TextImageRelation_Set_GetReturnsExpected(
TextImageRelation
value)
694
[InvalidEnumData<
TextImageRelation
>]
695
[InlineData((
TextImageRelation
)3)]
696
[InlineData((
TextImageRelation
)5)]
697
[InlineData((
TextImageRelation
)6)]
698
[InlineData((
TextImageRelation
)7)]
699
public void ToolStripSeparator_TextImageRelation_SetInvalid_ThrowsInvalidEnumArgumentException(
TextImageRelation
value)