public void SetupRenderer(bool enableVisualStyles = true) { SetStyle(ControlStyles.AllPaintingInWmPaint, true); SetStyle(ControlStyles.ContainerControl, true); SetStyle(ControlStyles.OptimizedDoubleBuffer, true); SetStyle(ControlStyles.ResizeRedraw, true); SetStyle(ControlStyles.Selectable, true); SetStyle(ControlStyles.SupportsTransparentBackColor, true); SetStyle(ControlStyles.UserMouse, true); SetStyle(ControlStyles.UserPaint, true); SetStyle(ControlStyles.Selectable, true); _style[COMBOBOXPARTS.CP_DROPDOWNBUTTON].SetPadding(COMBOBOXPARTS.CP_DROPDOWNBUTTONLEFT, COMBOBOXPARTS.CP_DROPDOWNBUTTONRIGHT); _state = new KVisualStateTracker <State>(this, State.Normal, State.Disabled); _state.Root.WithHot(State.Hot); _state.Root.WithFocus(State.Pressed); _stateButton = _state.Root.AddPart().WithPressed(State.Pressed); _stateButton.Clicked += Button_Clicked; _stateButton.WithFocus(State.Hot); // TODO if (enableVisualStyles && Application.RenderWithVisualStyles) }
public Part(KVisualStateTracker <StateTypeId> tracker, Part parent) { this._tracker = parent._tracker; this._parent = parent; }
public Part(KVisualStateTracker <StateTypeId> tracker, StateTypeId?normalState, StateTypeId?disabledState) { this._tracker = tracker; this._normalState = normalState; this._disabledState = disabledState; }