Exemple #1
0
void CComboBoxExt::OnTimer(UINT nIDEvent) 
{
	// TODO: Add your message handler code here and/or call default
	if (nIDEvent== 1001)
	{
		CPoint pt(GetMessagePos());
		CRect m_rc;
		ScreenToClient(&pt);
		GetClientRect(m_rc);
		if (!m_rc.PtInRect(pt) && m_bPress!=TRUE)
		{
		 	KillTimer(1001);
			m_bOverCombo=FALSE;
			CClientDC dc(this);
			if (m_bPress==FALSE)
		 		DrawCombo(CM_NORMAL,&dc);			
			else
				DrawCombo(CM_ONFOCUS,&dc);	
			m_bPress=FALSE;
			dc.DeleteDC();
		}
		
	}
	
		Default(); 
}
void CXTFlatComboBox::OnNoFlickerPaint(CDC* pDC)   
{   
    ASSERT(pDC != NULL);   
       
    // Get the client area to paint.    
    CRect rcClient;   
    GetClientRect(&rcClient);   
   
    CDC memDC; // memory device context.    
   
    // Create the memory DC, set Map Mode    
    memDC.CreateCompatibleDC(pDC);   
    memDC.SetMapMode(pDC->GetMapMode());   
   
    // Create a bitmap big enough to hold the window's image    
    CBitmap bitmap;   
    bitmap.CreateCompatibleBitmap(pDC, rcClient.Width(), rcClient.Height());   
   
    // Select the bitmap into the memory DC    
    CBitmap* pOldBitmap = memDC.SelectObject(&bitmap);   
   
    // Repaint the background, this takes the place of WM_ERASEBKGND.    
    memDC.FillSolidRect(rcClient, m_clr3DFace);   
   
    // Let the window do its default painting...    
    CWnd::DefWindowProc( WM_PAINT, (WPARAM)memDC.m_hDC, 0 );   
   
    if (m_bFlatLook)   
    {   
        if (PointInRect() || m_bHasFocus) {   
            DrawCombo(&memDC, RAISED, m_clr3DShadow, m_clr3DHilight);   
        }   
        else {   
            DrawCombo(&memDC, NORMAL, m_clr3DFace, m_clr3DFace);   
        }   
    }   
   
    // Blt it    
    pDC->BitBlt(rcClient.left, rcClient.top, rcClient.Width(), rcClient.Height(),   
        &memDC, rcClient.left, rcClient.top, SRCCOPY);               
   
    // Select the original bitmap back in    
    memDC.SelectObject(pOldBitmap);   
   
    // Clean up    
    bitmap.DeleteObject();   
    memDC.DeleteDC();   
}   
void CXTFlatComboBox::OnTimer(UINT nIDEvent)    
{   
    UNREFERENCED_PARAMETER(nIDEvent);   
       
    if (m_bFlatLook)   
    {   
        CClientDC dc(this);   
   
        // OnLButtonDown, show PRESSED.    
        if (m_bLBtnDown==TRUE)   
        {   
            KillTimer (1);   
   
            if (m_bPainted == TRUE)   
            {   
                DrawCombo(&dc, PRESSED, m_clr3DShadow, m_clr3DHilight);   
                m_bPainted = FALSE;   
            }   
        }   
           
        // If mouse leaves, show flat.    
        else if (!PointInRect() && !m_bHasFocus)   
        {   
            KillTimer (1);   
   
            if (m_bPainted == TRUE)   
            {   
                DrawCombo(&dc, NORMAL, m_clr3DFace, m_clr3DFace);   
                m_bPainted = FALSE;   
            }   
   
        }   
   
        // On mouse over, show RAISED.    
        else   
        {   
            if (m_bPainted == TRUE)   
            {   
                return;   
            }   
            else   
            {   
                m_bPainted = TRUE;   
                DrawCombo(&dc, RAISED, m_clr3DShadow, m_clr3DHilight);   
            }   
        }   
    }   
}   
Exemple #4
0
void CGuiComboFont::OnPaint() 
{
	CPaintDC dc(this); // device context for painting
   /*
    * Se hace un llamamdo a la función definida por defecto
    * para el procesamiento de mensajes que la aplicación definitivamente
    * no esta interesado en manejar
	**/ 
	m_clrBtnFace=GuiDrawLayer::GetRGBColorFace(GuiDrawLayer::m_Style);
	CComboBox::DefWindowProc(WM_PAINT, (WPARAM)dc.m_hDC, 0);
	if (m_bPress != TRUE)
		DrawCombo(CM_NORMAL, &dc);
	else
		DrawCombo(CM_SELECCIONADO, &dc);
	// Do not call CComboBox::OnPaint() for painting messages
}
Exemple #5
0
void CComboBoxExt::OnSetFocus(HWND pOldWnd) 
{
	Default(); 
	CClientDC dc(this);
	DrawCombo(CM_SELECCIONADO,&dc);			
	dc.DeleteDC();
	
}
void CCJFlatComboBox::OnPaint() 
{
	ModifyStyleEx (WS_EX_DLGMODALFRAME | WS_EX_CLIENTEDGE | WS_EX_STATICEDGE,
		0, SWP_FRAMECHANGED);
	
	Default();

	CPoint pt;
	GetCursorPos(&pt);

	CRect rcItem;
	GetWindowRect(&rcItem);

	if ((rcItem.PtInRect(pt)) || m_bHasFocus)
		DrawCombo( raised, m_clrBtnShadow, m_clrBtnHilite );
	else
		DrawCombo( normal, m_clrBtnFace, m_clrBtnFace );
}
Exemple #7
0
BOOL CComboBoxExt::OnPaint(HDC hDC) 
{
	CPaintDC dc(this); // device context for painting
	/*
	 * Se hace un llamamdo a la función definida por defecto
	 * para el procesamiento de mensajes que la aplicación definitivamente
	 * no esta interesado en manejar
	 **/ 
	m_clrBtnFace=CDrawLayer::GetRGBColorFace();
	//CComboBox::DefWindowProc(m_hWnd,WM_PAINT,(WPARAM)dc.m_hDC,0);
	if (m_bPress != TRUE)
		DrawCombo(CM_NORMAL,&dc);
	else
		DrawCombo(CM_SELECCIONADO,&dc);
	dc.DeleteDC();
	// Do not call CComboBox::OnPaint() for painting messages
	return TRUE;
}
void CCJComboBox::OnTimer(UINT nIDEvent) 
{
	POINT pt;
	GetCursorPos(&pt);
	CRect rcItem;
	GetWindowRect(&rcItem);

	static bool bPainted = false;

	// OnLButtonDown, show pressed.
	if (m_bLBtnDown==true) {
		KillTimer (1);
		if (bPainted == true) {
			DrawCombo(FC_DRAWPRESSD, ::GetSysColor(COLOR_BTNSHADOW),
				::GetSysColor(COLOR_BTNHIGHLIGHT));
			bPainted = false;
		}
		return;
	}

	// If mouse leaves, show flat.
	if (!rcItem.PtInRect(pt) && GetFocus() != this) {
		KillTimer (1);
		if (bPainted == true) {
			DrawCombo(FC_DRAWNORMAL, ::GetSysColor(COLOR_BTNFACE),
				::GetSysColor(COLOR_BTNFACE));
			bPainted = false;
		}
		return;
	}

	// On mouse over, show raised.
	else {
		if (bPainted == true)
			return;
		else {
			bPainted = true;
			DrawCombo(FC_DRAWRAISED, ::GetSysColor(COLOR_BTNSHADOW),
				::GetSysColor(COLOR_BTNHIGHLIGHT));
		}
	}
	
	CComboBox::OnTimer(nIDEvent);
}
void CXTFlatComboBox::OnKillFocus()    
{   
    if (m_bFlatLook)   
    {   
        m_bHasFocus = FALSE;   
   
        CClientDC dc(this);   
        DrawCombo(&dc, NORMAL, m_clr3DFace, m_clr3DFace);       
    }   
}   
Exemple #10
0
void CXTFlatComboBox::OnSetFocus()   
{   
    if (m_bFlatLook)   
    {   
        m_bHasFocus = TRUE;   
   
        CClientDC dc(this);   
        DrawCombo(&dc, RAISED, m_clr3DShadow, m_clr3DHilight);   
    }   
}   
Exemple #11
0
void CGuiComboFont::OnLButtonDown(UINT nFlags, CPoint point) 
{
	// TODO: Add your message handler code here and/or call default
	
	m_bOverCombo = TRUE;
	m_bPress = TRUE;
	CClientDC dc(this);
	DrawCombo(CM_SELECCIONADO, &dc);			
	CComboBox::OnLButtonDown(nFlags, point);
}
Exemple #12
0
void CCJFlatComboBox::OnTimer(UINT nIDEvent) 
{
	POINT pt;
	GetCursorPos(&pt);
	CRect rcItem;
	GetWindowRect(&rcItem);

	// OnLButtonDown, show pressed.
	if (m_bLBtnDown==TRUE) {
		KillTimer (1);
		if (m_bPainted == TRUE) {
			DrawCombo(FC_DRAWPRESSD, ::GetSysColor(COLOR_BTNSHADOW),
				::GetSysColor(COLOR_BTNHIGHLIGHT));
			m_bPainted = FALSE;
		}
		return;
	}

	// If mouse leaves, show flat.
	if (!rcItem.PtInRect(pt)) {
		KillTimer (1);
		if (m_bPainted == TRUE) {
			DrawCombo(FC_DRAWNORMAL, ::GetSysColor(COLOR_BTNFACE),
				::GetSysColor(COLOR_BTNFACE));
			m_bPainted = FALSE;
		}
		return;
	}

	// On mouse over, show raised.
	else {
		if (m_bPainted == TRUE)
			return;
		else {
			m_bPainted = TRUE;
			DrawCombo(FC_DRAWRAISED, ::GetSysColor(COLOR_BTNSHADOW),
				::GetSysColor(COLOR_BTNHIGHLIGHT));
		}
	}
	
	CComboBox::OnTimer(nIDEvent);
}
Exemple #13
0
void CCJFlatComboBox::OnPaint() 
{
	ModifyStyleEx (WS_EX_DLGMODALFRAME | WS_EX_CLIENTEDGE | WS_EX_STATICEDGE,
		0, SWP_FRAMECHANGED);
	
	Default();

	CPoint pt;
	GetCursorPos(&pt);

	CRect rcItem;
	GetWindowRect(&rcItem);

	if ((rcItem.PtInRect(pt)) || (::GetFocus() == m_hWnd))
		DrawCombo(FC_DRAWRAISED, ::GetSysColor(COLOR_BTNSHADOW),
			::GetSysColor(COLOR_BTNHIGHLIGHT));
	else
		DrawCombo(FC_DRAWNORMAL, ::GetSysColor(COLOR_BTNFACE),
			::GetSysColor(COLOR_BTNFACE));
}
Exemple #14
0
BOOL CComboBoxExt::OnLButtonDown(UINT nFlags, CPoint point) 
{
	// TODO: Add your message handler code here and/or call default
	
	m_bOverCombo=TRUE;
	m_bPress=TRUE;
	CClientDC dc(this);
	DrawCombo(CM_SELECCIONADO,&dc);			
	Default();
	dc.DeleteDC();
	return TRUE;
}
Exemple #15
0
void CFlatComboBox::OnTimer(UINT nIDEvent) 
{
	if (m_pToolBar->CoolLookEnabled() && !GetCtrlManager().IsEnabled()) {
	POINT pt;
	CRect rcItem;
		
		GetCursorPos(&pt);
		GetWindowRect(&rcItem);

	// OnLButtonDown, show pressed.
		if (m_bLBtnDown) {
			KillTimer (1);
			if (m_bPainted) {
				DrawCombo(FC_DRAWPRESSD, ::GetSysColor(COLOR_BTNSHADOW), ::GetSysColor(COLOR_BTNHIGHLIGHT));
				m_bPainted = false;
			}
			return;
		}

	// If mouse leaves, show flat.
		if (!rcItem.PtInRect(pt)) {
			KillTimer (1);
			if (m_bPainted) {
				DrawCombo(FC_DRAWNORMAL, ::GetSysColor(COLOR_BTNFACE), ::GetSysColor(COLOR_BTNFACE));
				m_bPainted = false;
			}
			return;
		}
		else {
		// On mouse over, show raised.
			if (m_bPainted)
				return;
			else {
				m_bPainted = true;
				DrawCombo (FC_DRAWRAISED, ::GetSysColor(COLOR_BTNSHADOW), ::GetSysColor(COLOR_BTNHIGHLIGHT));
			}
		}
	}
	SECComboBtn::OnTimer(nIDEvent);
}
Exemple #16
0
void CCJFlatComboBox::OnTimer(UINT nIDEvent) 
{
	POINT pt;
	GetCursorPos(&pt);
	CRect rcItem;
	GetWindowRect(&rcItem);

	// OnLButtonDown, show pressed.
	if (m_bLBtnDown==TRUE) {
		KillTimer (1);
		if (m_bPainted == TRUE) {
			DrawCombo( pressed, m_clrBtnShadow, m_clrBtnHilite );
			m_bPainted = FALSE;
		}
		return;
	}

	// If mouse leaves, show flat.
	if (!rcItem.PtInRect(pt) && !m_bHasFocus) {
		KillTimer (1);
		if (m_bPainted == TRUE) {
			DrawCombo( normal, m_clrBtnFace, m_clrBtnFace );
			m_bPainted = FALSE;
		}
		return;
	}

	// On mouse over, show raised.
	else {
		if (m_bPainted == TRUE)
			return;
		else {
			m_bPainted = TRUE;
			DrawCombo( raised, m_clrBtnShadow, m_clrBtnHilite );
		}
	}
	
	CComboBox::OnTimer(nIDEvent);
}
Exemple #17
0
// void CGuiComboFont::OnKillFocus(CWnd* pNewWnd) //version 6
void CGuiComboFont::OnCbnKillfocus() // version 7.0
{
    CClientDC dc(this);
	DrawCombo(CM_NORMAL, &dc);
	
	if (!(GetStyle() & CBS_DROPDOWNLIST))
	{
		CString sCad;
		GetWindowText(sCad);
		AddString(sCad);
	}
	
	m_bPress = FALSE;
	m_bOverCombo = FALSE;
}
Exemple #18
0
void CFlatComboBox::OnPaint() 
{
//	SECComboBtn::OnPaint();
//	if (m_pToolBar->CoolLookEnabled())
//		DrawCombo (FC_DRAWNORMAL, ::GetSysColor(COLOR_BTNFACE), ::GetSysColor(COLOR_BTNFACE));

	if (m_pToolBar->CoolLookEnabled() && !GetCtrlManager().IsEnabled()) {
		ModifyStyleEx (WS_EX_DLGMODALFRAME | WS_EX_CLIENTEDGE | WS_EX_STATICEDGE, 0, SWP_FRAMECHANGED);
		
		SECComboBtn::OnPaint();

	CPoint pt;
	CRect rcItem;

		GetCursorPos(&pt);
		GetWindowRect(&rcItem);

		if ((rcItem.PtInRect(pt)) || (::GetFocus() == m_edit.m_hWnd))
			DrawCombo(FC_DRAWRAISED, ::GetSysColor(COLOR_BTNSHADOW), ::GetSysColor(COLOR_BTNHIGHLIGHT));
		else
			DrawCombo(FC_DRAWNORMAL, ::GetSysColor(COLOR_BTNFACE), ::GetSysColor(COLOR_BTNFACE));
	} else
		SECComboBtn::OnPaint();
}
Exemple #19
0
BOOL CGuiComboFont::OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message) 
{
	// TODO: Add your message handler code here and/or call default
	CPoint ptCurPos;
	CRect m_rcCli;
	GetCursorPos(&ptCurPos);
	ScreenToClient(&ptCurPos);
	GetClientRect(&m_rcCli);
	if (m_rcCli.PtInRect(ptCurPos) && m_bOverCombo == FALSE && m_bPress == FALSE)
	{
		m_bOverCombo = TRUE;
		CClientDC dc(this);
		DrawCombo(CM_ONFOCUS, &dc);			
		SetTimer(1, 10, NULL);
		OnTimer(1);
		return TRUE;
	}
	
	return CComboBox::OnSetCursor(pWnd, nHitTest, message);
}
Exemple #20
0
BOOL CComboBoxExt::OnSetCursor(HWND pWnd, UINT nHitTest, UINT message) 
{
	// TODO: Add your message handler code here and/or call default
	CPoint ptCurPos;
	CRect m_rcCli;
	GetCursorPos (&ptCurPos);
	ScreenToClient (&ptCurPos);
	GetClientRect(&m_rcCli);
	if (m_rcCli.PtInRect (ptCurPos) && m_bOverCombo==FALSE && m_bPress==FALSE)
		{
			m_bOverCombo=TRUE;
			CClientDC dc(this);
			DrawCombo(CM_ONFOCUS,&dc);			
			SetTimer(1001,10,NULL);
			dc.DeleteDC();
			//OnTimer(1001);
			return TRUE;
		}
	
			
	return 	Default(); 
}
Exemple #21
0
void CGuiComboFont::OnSetFocus(CWnd* pOldWnd) 
{
	CComboBox::OnSetFocus(pOldWnd);
	CClientDC dc(this);
	DrawCombo(CM_SELECCIONADO, &dc);			
}
Exemple #22
0
void CCJFlatComboBox::OnSetFocus(CWnd* pOldWnd) 
{
	CComboBox::OnSetFocus(pOldWnd);
	DrawCombo(FC_DRAWRAISED, ::GetSysColor(COLOR_BTNSHADOW),
		::GetSysColor(COLOR_BTNHIGHLIGHT));
}
Exemple #23
0
void CFlatComboBox::OnEnable(BOOL bEnable) 
{
	SECComboBtn::OnEnable(bEnable);
	if (!bEnable && m_pToolBar->CoolLookEnabled() && !GetCtrlManager().IsEnabled()) 
		DrawCombo(FC_DRAWNORMAL, ::GetSysColor(COLOR_BTNFACE), ::GetSysColor(COLOR_BTNFACE));	
}
Exemple #24
0
void CFlatComboBox::OnKillFocus(CWnd* pNewWnd) 
{
	SECComboBtn::OnKillFocus(pNewWnd);
	if (m_pToolBar->CoolLookEnabled() && !GetCtrlManager().IsEnabled()) 
		DrawCombo(FC_DRAWNORMAL, ::GetSysColor(COLOR_BTNFACE), ::GetSysColor(COLOR_BTNFACE));	
}
Exemple #25
0
void CFlatComboBox::OnSetFocus(CWnd* pOldWnd) 
{
	SECComboBtn::OnSetFocus(pOldWnd);
	if (m_pToolBar->CoolLookEnabled() && !GetCtrlManager().IsEnabled()) 
		DrawCombo(FC_DRAWRAISED, ::GetSysColor(COLOR_BTNSHADOW), ::GetSysColor(COLOR_BTNHIGHLIGHT));
}
Exemple #26
0
void CCJFlatComboBox::OnKillFocus(CWnd* pNewWnd) 
{
	CComboBox::OnKillFocus(pNewWnd);
	DrawCombo(FC_DRAWNORMAL, ::GetSysColor(COLOR_BTNFACE),
		::GetSysColor(COLOR_BTNFACE));	
}
Exemple #27
0
void CCJFlatComboBox::OnKillFocus() 
{
	m_bHasFocus = FALSE;
	DrawCombo( normal, m_clrBtnFace, m_clrBtnFace );
}
Exemple #28
0
void CCJFlatComboBox::OnSetFocus()
{
	m_bHasFocus = TRUE;
	DrawCombo( raised, m_clrBtnShadow, m_clrBtnHilite );
}