wangchyz / duilib_googlecode

从google code备份过来,仅作存档
https://github.com/duilib/duilib
8 stars 10 forks source link

Slider 在disable的状态下仍然可以通过鼠标点击来改变value #100

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
解决方法:

在Doevent里面 ButtonUP事件中加个判断. 如下:

if( event.Type == UIEVENT_BUTTONUP )
{
    int nValue;
    if( (m_uButtonState & UISTATE_CAPTURED) != 0 ) {
        m_uButtonState &= ~UISTATE_CAPTURED;
    }
    //fix bug: disable control is not working by ReadBai
    if( !IsEnabled() )
        return;

        .....

Original issue reported on code.google.com by pro...@gmail.com on 27 Feb 2014 at 3:46