Button
An Omniview Button is an object that combines text, a rectangle and pre-defined transforms. The internal transforms are:
- Border color transform when the mouse is within the object
- Border, fill and text color transforms when the object is disabled.
Property | Description |
---|---|
BorderColor | Color of the button border |
BorderThickness | Thickness of the button border |
ContentMargin | [DEPRECATED] |
CornerRadius | Radius of the corner of the button |
DisabledBorderColor | Alternate border color used when Enabled = False |
DisabledColor | Alternate fill color used when Enabled = False |
DisabledTextColor | Alternate text color used when Enabled = False |
Fill | Button fill color. |
HorizontalContentAlignment | [DEPRECATED] |
MouseOverColor | Alternate border color used when the mouse is within the button boundaries. Only used when a mouse button event has been set. |
Padding | Minimum distance between the text and the edge of the button. Options:
|
Symbol | [DEPRECATED] |
Text | String that will appear inside the button. |
TextAlignment | A pair of values denoting the horizontal and vertical alignment. E.g. "Top,Right" Horizontal options:
|
TextColor | Text color |
VerticalContentAlignment | [DEPRECATED] |
View Example
- Note: Text and Enabled properties manually changed for example. Transforms on these properties would be used to get the same result.
{
"$type": "Button",
"Name": "Button2",
"Height": 40,
"Width": 100,
"X": "0",
"Y": "60",
"Enabled":"False",
"TextAlignment":"Middle,Center",
"Padding":"5",
"BorderColor":"#FF0000",
"BorderThickness": 2,
"CornerRadius":20,
"DisabledBorderColor":"#000080",
"DisabledColor":"#0000FF",
"DisabledTextColor":"#C0C0C0",
"Fill":"#C0C0C0",
"MouseOverColor":"#00FF00",
"Text":"Disabled",
"TextColor": "#FF0000",
"MouseRightButtonDownExpression":"Omniview.DisplayView('Main.ovv')"
}
Python Example
from Omniview.Python import *
myButton = Button()
myButton.X = 0
myButton.Y = 300
myButton.Width = 100
myButton.Height = 35
myButton.CornerRadius=2
myButton.Fill = Color("#F0F0E0")
myButton.Text = "FILL ENABLE"
Omniview.Windows[0].Content.AddViewObject(myButton)