VisColorPaletteBase
Namespace: PPJ.Runtime.Vis
Assembly: PPJ.Runtime.Vis.50 (5.0.0.0)
Provides a selectable color grid and optional palette command buttons.
- C#
- VB.NET
public class VisColorPaletteBase : SalUserControl
Public Class VisColorPaletteBase
Inherits SalUserControl
Example:
void SelectRed(PPJ.Runtime.Vis.VisColorPaletteBase palette)
{
int index = palette.Colors.Add(System.Drawing.Color.Red);
palette.SelectedIndex = index;
}
Constructors
VisColorPaletteBase()
Initializes the color grid and palette button panel.
Properties
Buttons
PaletteButtonCollection: Gets the palette command-button collection.
Colors
ColorCollection: Gets the mutable palette color collection.
PreferredSize
Size: Gets the size for an eight-column palette including buttons, padding, and border.
When no color rows exist, returns the current control size.
SelectedColor
Color: Gets or selects a color from the palette.
The setter selects the first equal color. A color absent from Colors resolves to -1 and can cause the SelectedIndex setter to throw. The getter requires a valid selected index.
SelectedIndex
Int32: Gets or sets the selected color index. (Default: 0)
Changing the index refreshes the control and raises SelectedIndexChanged. Negative values and values greater than Count are rejected; Count itself is accepted even though it is not a valid color index.
Methods
OnButtonClicked(sender, e)
Raises ButtonClicked, posts SAM_Click with the button identifier, and handles the custom-color button.
| Parameter | Type | Description |
|---|---|---|
| sender | Object | The PaletteButton that was clicked. |
| e | EventArgs | The click event data. |
OnFontChanged(e)
Scales color cells from the default 8.25-point font size and refreshes the layout.
| Parameter | Type | Description |
|---|---|---|
| e | EventArgs | The font-change event data. |
OnGotFocus(e)
Raises the base event and moves focus to the color grid.
| Parameter | Type | Description |
|---|---|---|
| e | EventArgs | The focus event data. |
OnResize(e)
Raises the base event, lays out the color grid, and refreshes the palette.
| Parameter | Type | Description |
|---|---|---|
| e | EventArgs | The resize event data. |
OnSelectedIndexChanged(e)
Raises SelectedIndexChanged.
| Parameter | Type | Description |
|---|---|---|
| e | EventArgs | The selection event data. |
ProcessCmdKey(msg, keyData)
Handles arrow-key color navigation and Space activation within the palette.
| Parameter | Type | Description |
|---|---|---|
| msg | Message | The keyboard message. |
| keyData | Keys | The key and modifier flags. |
Returns: Boolean. True for a handled palette command; otherwise, the base result.
Up from the first command button returns focus to the color grid.
Events
ButtonClicked
EventHandler Occurs when a palette command button is clicked.
SelectedIndexChanged
EventHandler Occurs after the selected color index changes.
Inherited By
| Name | Description |
|---|---|
| VisColorPalette | Exposes SAL color and command operations for a selectable color palette. |
Implements
| Name | Description |
|---|---|
| ISalWindow |