void Renderer6::Render() const { glClearColor(0.5f, 0.5f, 0.5f, 1.0f); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); DrawBones(); DrawSkin(); }
LRESULT CSkinTabCtrl::OnMouseMoveLeave(UINT uMsg, WPARAM wParam, LPARAM lParam) { if (-1 != m_CurHorver) { m_CurHorver = -1; DrawSkin(TRUE); } return CSkinWnd::CallWindowProc(uMsg, wParam, lParam); }
LRESULT CSkinTabCtrl::OnSize(UINT uMsg, WPARAM wParam, LPARAM lParam) { RECT rcClient; GetClientRect(m_hWnd, &rcClient); int ccx = rcClient.right - rcClient.left; int ccy = rcClient.bottom - rcClient.top; m_MemDC.CreateMemDC(ccx, ccy); DrawSkin(); return CSkinWnd::CallWindowProc(uMsg, wParam, lParam); }
int CSkinTabCtrl::SetSelected(int Index) { ASSERT(m_hWnd != NULL && m_ItemCount < MAX_TABITEM - 1); ASSERT(Index < (int)m_ItemCount); int nIndex = m_CurSelected; m_CurSelected = Index; DrawSkin(TRUE); SendNotifyMessage( SKINMGR_TCN_SELCHANGE, m_CurSelected ); return nIndex; }
BOOL CSkinTabCtrl::AddItem(LPCTSTR lpszCaption, HICON hIcon/* = 0*/) { ASSERT(m_hWnd != NULL && m_ItemCount < MAX_TABITEM - 1); size_t nLength; if ( lpszCaption && ( nLength = _tcslen(lpszCaption) ) ) { m_pItems[m_ItemCount].lpszCaption = (LPTSTR)malloc( (nLength + 1) * sizeof(TCHAR) ); _tcscpy_s( m_pItems[m_ItemCount].lpszCaption, (nLength + 1), lpszCaption ); } m_pItems[m_ItemCount].hIcon = hIcon; int nLeft = m_ItemCount * (TABITEM_WIDTH + TABITEM_DISTANCE); SetRect(&m_pItems[m_ItemCount].rc, nLeft, 0, nLeft + TABITEM_WIDTH, TABITEM_HEIGHT); m_ItemCount++; if ( -1 == m_CurSelected ) SetSelected(0); else DrawSkin(TRUE); return TRUE; }
LRESULT CSkinTabCtrl::OnMouseMove(UINT uMsg, WPARAM wParam, LPARAM lParam) { if ( (wParam & MK_LBUTTON) == MK_LBUTTON || (wParam & MK_RBUTTON) == MK_RBUTTON ) return CSkinWnd::CallWindowProc(uMsg, wParam, lParam); TRACKMOUSEEVENT tm = { sizeof(TRACKMOUSEEVENT), TME_LEAVE, m_hWnd, 0 }; _TrackMouseEvent(&tm); int nHitTest = HitTest( GET_X_LPARAM(lParam), GET_Y_LPARAM(lParam)); if (m_CurHorver != nHitTest) { m_CurHorver = nHitTest; DrawSkin(TRUE); } return CSkinWnd::CallWindowProc(uMsg, wParam, lParam); }
BOOL CSkinTabCtrl::Create(LPCTSTR lpszClassName, LPCTSTR lpWindowName, DWORD dwStyle, int x, int y, int nWidth, int nHeight, HWND hWndParent, UINT nID) { ASSERT(lpszClassName != NULL); if ( !PreRegisterClass(lpszClassName) ) return FALSE; HWND hWnd = ::CreateWindow(lpszClassName, lpWindowName, dwStyle, x, y, nWidth, nHeight, hWndParent, (HMENU)(ULONG_PTR)nID, theInstance, NULL); if ( !hWnd ) return FALSE; CSkinWnd::Attach(hWnd); RECT rcClient; GetClientRect(m_hWnd, &rcClient); int ccx = rcClient.right - rcClient.left; int ccy = rcClient.bottom - rcClient.top; m_MemDC.CreateMemDC(ccx, ccy); DrawSkin(TRUE); return TRUE; }
void SButtonEx::OnPaint(IRenderTarget *pRT) { DrawSkin(m_pbkgndSkin, pRT); DrawSkin(m_pBgSkin, pRT); SWindow::OnPaint(pRT); }