示例#1
0
        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)
        }
示例#2
0
 public Part(KVisualStateTracker <StateTypeId> tracker, Part parent)
 {
     this._tracker = parent._tracker;
     this._parent  = parent;
 }
示例#3
0
 public Part(KVisualStateTracker <StateTypeId> tracker, StateTypeId?normalState, StateTypeId?disabledState)
 {
     this._tracker       = tracker;
     this._normalState   = normalState;
     this._disabledState = disabledState;
 }