???duilib??UISlider?????4??Bug
???????????? ???????[ 2014/11/13 15:36:50 ] ??????????????? ??????
?????????????????????????????????????????????????????CSliderUI?????????????????????CSliderUI????? CSliderUI????????????????????м???????
????????1??????????????CSliderUI?????λ?ò?????valuechanged?????????????????????????????bug????
????????2?????CSliderUI?????λ??????????????????λ???????????????????????????
????????3?????????????????SetValue??????們???λ?????????????????????????????????????????
????????4?????黬??????????????????????????????????????????????????????????????????????????????????????? ?
?????????????????μ????DUI_MSGTYPE_VALUECHANGED_MOVE?????????????????UIDefine.h?????
????#define DUI_MSGTYPE_VALUECHANGED_MOVE (_T("movevaluechanged"))
????????????Ч?????????CSliderUI???????????????????????sendmove??棬????ü?
????????????????????????????“2014.7.28 redrain”?????????????????????
??????θ?????????????е???????????????????????в?????????????????
????//=====================================================================================================
???????????д??????????????е???????????????DoEvent?????ж??Щ?????????????μ??
????????1??????????????????CSliderUI?????λ?ò?????valuechanged????????????????????????????????????UIEVENT_BUTTONUP
???????????????????????????
if( event.Type == UIEVENT_BUTTONUP )
{
int nValue;
if( (m_uButtonState & UISTATE_CAPTURED) != 0 ) {
m_uButtonState &= ~UISTATE_CAPTURED;
}
if( m_bHorizontal ) {
if( event.ptMouse.x >= m_rcItem.right - m_szThumb.cx / 2 ) nValue = m_nMax;
else if( event.ptMouse.x <= m_rcItem.left + m_szThumb.cx / 2 ) nValue = m_nMin;
else nValue = m_nMin + (m_nMax - m_nMin) * (event.ptMouse.x - m_rcItem.left - m_szThumb.cx / 2 ) / (m_rcItem.right - m_rcItem.left - m_szThumb.cx);
}
else {
if( event.ptMouse.y >= m_rcItem.bottom - m_szThumb.cy / 2 ) nValue = m_nMin;
else if( event.ptMouse.y <= m_rcItem.top + m_szThumb.cy / 2 ) nValue = m_nMax;
else nValue = m_nMin + (m_nMax - m_nMin) * (m_rcItem.bottom - event.ptMouse.y - m_szThumb.cy / 2 ) / (m_rcItem.bottom - m_rcItem.top - m_szThumb.cy);
}
if(m_nValue !=nValue && nValue>=m_nMin && nValue<=m_nMax)
{
m_nValue =nValue;
m_pManager->SendNotify(this?? DUI_MSGTYPE_VALUECHANGED);
Invalidate();
}
return;
}
??????????????????????????е?m_nValue !=nValue??????DUI_MSGTYPE_VALUECHANGED????????????????????????????????????????????????????????????????????з?????????????????????????????????
??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11