/********************************************************************* * * LISTVIEW_Callback */ void LISTVIEW_Callback (WM_MESSAGE *pMsg) { LISTVIEW_Handle hObj; LISTVIEW_Obj* pObj; WM_SCROLL_STATE ScrollState; hObj = pMsg->hWin; /* Let widget handle the standard messages */ if (WIDGET_HandleActive(hObj, pMsg) == 0) { return; } pObj = (LISTVIEW_Obj *)GUI_ALLOC_h2p(hObj); /* Don't use use WIDGET_H2P because WIDGET_INIT_ID() has not be called at this point */ switch (pMsg->MsgId) { case WM_NOTIFY_CLIENTCHANGE: case WM_SIZE: if (pMsg->hWinSrc && (pMsg->hWinSrc == pObj->hHeader)) { LISTVIEW__UpdateScrollParas(hObj, pObj); } return; case WM_NOTIFY_PARENT: switch (pMsg->Data.v) { case WM_NOTIFICATION_CHILD_DELETED: /* make sure we do not send any messages to the header child once it has been deleted */ if (pMsg->hWinSrc == pObj->hHeader) { pObj->hHeader = 0; } break; case WM_NOTIFICATION_VALUE_CHANGED: if (pMsg->hWinSrc == WM_GetScrollbarV(hObj)) { WM_GetScrollState(pMsg->hWinSrc, &ScrollState); pObj->ScrollStateV.v = ScrollState.v; LISTVIEW__InvalidateInsideArea(hObj, pObj); _NotifyOwner(hObj, WM_NOTIFICATION_SCROLL_CHANGED); } else if (pMsg->hWinSrc == WM_GetScrollbarH(hObj)) { WM_GetScrollState(pMsg->hWinSrc, &ScrollState); pObj->ScrollStateH.v = ScrollState.v; LISTVIEW__UpdateScrollParas(hObj, pObj); HEADER_SetScrollPos(pObj->hHeader, pObj->ScrollStateH.v); _NotifyOwner(hObj, WM_NOTIFICATION_SCROLL_CHANGED); } break; case WM_NOTIFICATION_SCROLLBAR_ADDED: #if WIDGET_USE_PARENT_EFFECT WIDGET_SetEffect(pMsg->hWinSrc, pObj->Widget.pEffect); #endif LISTVIEW__UpdateScrollParas(hObj, pObj); break; case WM_NOTIFICATION_RELEASED: if ((pMsg->hWinSrc == pObj->hHeader) && (pObj->hSort)) { int Column; LISTVIEW_SORT * pSort; LISTVIEW_COLUMN * pColumn; WM_SetFocus(hObj); Column = HEADER_GetSel(pObj->hHeader); if (Column >= 0) { pColumn = (LISTVIEW_COLUMN *)GUI_ARRAY_GetpItem(&pObj->ColumnArray, Column); if (pColumn->fpCompare) { pSort = (LISTVIEW_SORT *)GUI_ALLOC_h2p(pObj->hSort); if (pSort) { // ReverseSort if (pObj->SortIndex == Column) { pSort->Reverse ^= 1; pObj->ReverseSort = 1; pObj->IsSorted = 0; } else { pSort->Reverse = 0; pObj->SortIndex = Column; pObj->IsPresorted = 0; } /* if (pObj->SortIndex == Column) { pSort->Reverse ^= 1; } else { pSort->Reverse = 0; pObj->SortIndex = Column; } pObj->IsPresorted = 0; */ LISTVIEW__InvalidateInsideArea(hObj, pObj); } } } } break; } return; case WM_PAINT: _Paint(hObj, pObj, pMsg); return; case WM_TOUCH: _OnTouch(hObj, pObj, pMsg); return; /* Important: message handled ! */ case WM_KEY: if (((const WM_KEY_INFO*)(pMsg->Data.p))->PressedCnt > 0) { int Key; Key = ((const WM_KEY_INFO*)(pMsg->Data.p))->Key; if (_AddKey(hObj, pObj, Key)) { return; } } break; /* No return here ... WM_DefaultProc needs to be called */ case WM_DELETE: _FreeAttached(pObj); break; /* No return here ... WM_DefaultProc needs to be called */ } WM_DefaultProc(pMsg); }
void _HYGWindow::_Update (Ptr) { _Paint (nil); }
/********************************************************************* * * xIconSelBtn_Callback */ void xIconSelBtn_Callback(WM_MESSAGE * pMsg) { xIconSelBtn_Handle hWin; WM_KEY_INFO *pKeyInfo; int Notification; hWin = pMsg->hWin; switch (pMsg->MsgId) { case WM_PAINT: _Paint(hWin); break; case WM_KEY: pKeyInfo = (WM_KEY_INFO *)pMsg->Data.p; switch(pKeyInfo->Key) { //case GUI_KEY_ESCAPE: // if(pKeyInfo->PressedCnt >0) // { // DEBUGOUT("xIconSelBtn <- KEY_ESCAPE\r\n"); // tWidget.eButtonState = xKB_BTN_FOCUSED; // BUTTON_SetUserData(hWin, &tWidget, sizeof(xBUTTON_Obj)); // WM_SetFocus(hWin); // WM_InvalidateWindow(hWin); // } // break; case GUI_KEY_ENTER: if(pKeyInfo->PressedCnt >0) { DEBUGOUT("xIconSelBtn(0x%08x) <- KEY_ENTER\r\n",hWin); xIconSelBtn_PopupWin(hWin); } break; case GUI_KEY_LEFT: if(pKeyInfo->PressedCnt >0) { DEBUGOUT("xIconSelBtn(0x%08x) <- KEY_LEFT\r\n",hWin); xIconSelBtn_Dec(hWin); } break; case GUI_KEY_RIGHT: if(pKeyInfo->PressedCnt >0) { DEBUGOUT("xIconSelBtn(0x%08x) <- KEY_RIGHT\r\n",hWin); xIconSelBtn_Inc(hWin); } break; default: WM_DefaultProc(pMsg); break; } break; default: WM_DefaultProc(pMsg); } }
/********************************************************************* * * _LISTVIEW_Callback */ static void _LISTVIEW_Callback (WM_MESSAGE *pMsg) { LISTVIEW_Handle hObj; LISTVIEW_Obj* pObj; WM_SCROLL_STATE ScrollState; hObj = pMsg->hWin; /* Let widget handle the standard messages */ if (WIDGET_HandleActive(hObj, pMsg) == 0) { return; } pObj = LISTVIEW_H2P(hObj); switch (pMsg->MsgId) { case WM_NOTIFY_CLIENTCHANGE: case WM_SIZE: LISTVIEW__UpdateScrollParas(hObj, pObj); return; case WM_NOTIFY_PARENT: switch (pMsg->Data.v) { case WM_NOTIFICATION_CHILD_DELETED: /* make sure we do not send any messages to the header child once it has been deleted */ if (pMsg->hWinSrc == pObj->hHeader) { pObj->hHeader = 0; } break; case WM_NOTIFICATION_VALUE_CHANGED: if (pMsg->hWinSrc == WM_GetScrollbarV(hObj)) { WM_GetScrollState(pMsg->hWinSrc, &ScrollState); pObj->ScrollStateV.v = ScrollState.v; LISTVIEW__InvalidateInsideArea(hObj, pObj); _NotifyOwner(hObj, WM_NOTIFICATION_SCROLL_CHANGED); } else if (pMsg->hWinSrc == WM_GetScrollbarH(hObj)) { WM_GetScrollState(pMsg->hWinSrc, &ScrollState); pObj->ScrollStateH.v = ScrollState.v; LISTVIEW__UpdateScrollParas(hObj, pObj); HEADER_SetScrollPos(pObj->hHeader, pObj->ScrollStateH.v); _NotifyOwner(hObj, WM_NOTIFICATION_SCROLL_CHANGED); } break; case WM_NOTIFICATION_SCROLLBAR_ADDED: LISTVIEW__UpdateScrollParas(hObj, pObj); break; } return; case WM_PAINT: _Paint(hObj, pObj, pMsg); return; case WM_TOUCH: _OnTouch(hObj, pObj, pMsg); return; /* Important: message handled ! */ case WM_KEY: if (((const WM_KEY_INFO*)(pMsg->Data.p))->PressedCnt > 0) { int Key; Key = ((const WM_KEY_INFO*)(pMsg->Data.p))->Key; if ( _AddKey( hObj, Key ) ){ return; } } break; /* No return here ... WM_DefaultProc needs to be called */ case WM_DELETE: _FreeAttached(pObj); break; /* No return here ... WM_DefaultProc needs to be called */ } WM_DefaultProc(pMsg); }
//__________________________________________________________________ void _HYPlatformPullDown::_Update (Ptr p) { _Paint (p); }
//__________________________________________________________________ void _HYPlatformButtonBar::_Update (Ptr p) { _Paint (p); }