Esempio n. 1
0
//************************************
// Method:    RetrieveWndStyles
// FullName:  Window::RetrieveWndStyles
// Access:    protected 
// Returns:   void
// Qualifier:
//************************************
void Window::RetrieveWndStyles()
{
    // Parse out class style and store it in string
    GetStyleParser().GetClassStyleAsString( GetClass().style, GetClassStyleString() );

    // Ge normal window style
    GetStyleParser().GetWindowStyleAsString( GetStyle(), GetWindowStyleString() );

    // Get control specific style if any
    GetStyleParser().GetStyleStringForWindowByClassName( GetStyle(), 
                                                         GetClassName(),
                                                         GetWindowStyleString() );

    // Get default extended style for a window
    GetStyleParser().GetWindowStyleExAsString( GetStyleEx(), GetWindowStyleExString() );

    // Style extended, do special handling for list control
    DWORD dwStyleEx = 0;

    // Specialized extended style handling for some controls like
    // list view, comboex, tab controls etc
    if( IsListControl() )
    {
        Utils::SndMsgTimeOutHelper( GetHandle(), LVM_GETEXTENDEDLISTVIEWSTYLE, 0, 0, dwStyleEx );
    }
    else if( IsComboExControl() )
    {
        Utils::SndMsgTimeOutHelper( GetHandle(), CBEM_GETEXTENDEDSTYLE, 0, 0, dwStyleEx );
    }
    else if( IsTabControl() )
    {
        Utils::SndMsgTimeOutHelper( GetHandle(), TCM_GETEXTENDEDSTYLE, 0, 0, dwStyleEx );
    }
    else
    {
        dwStyleEx = GetStyleEx();
    }// End if

    // Parse out window style ex and store it in string
    GetStyleParser().GetStyleExStringForWindowByClassName( dwStyleEx, 
                                                           GetClassName(),
                                                           GetWindowStyleExString() );
}// End RetrieveWndStyles
Esempio n. 2
0
// Fix for 4665745.
// Override WmPrint to catch when the list control (not wrapper) should
// operate WM_PRINT to be compatible with the "smooth scrolling" feature.
MsgRouting AwtList::WmPrint(HDC hDC, LPARAM flags)
{
    if (!isWrapperPrint &&
        (flags & PRF_CLIENT) &&
        (GetStyleEx() & WS_EX_CLIENTEDGE))
    {
        int nOriginalDC = ::SaveDC(hDC);
        DASSERT(nOriginalDC != 0);
        // Save a copy of the DC for WmPrintClient
        VERIFY(::SaveDC(hDC));
        DefWindowProc(WM_PRINT, (WPARAM) hDC,
            (flags & (PRF_CLIENT | PRF_CHECKVISIBLE | PRF_ERASEBKGND)));
        VERIFY(::RestoreDC(hDC, nOriginalDC));

        flags &= ~PRF_CLIENT;
    }

    return AwtComponent::WmPrint(hDC, flags);
}
Esempio n. 3
0
void CExtGridCellNumberEx::TextGet( CExtSafeString & strCopy ) const
{
	ASSERT_VALID( this );
	if(		(GetStyleEx()&__EGCS_EX_UNDEFINED_ROLE) != 0 
		||	IsEmpty()
		)
	{
		strCopy = _T("");
		return;
	}
	strCopy.Empty();

VARIANT varCopy;
	::VariantInit( &varCopy );
HRESULT hr = 
		::VariantCopy( 
			&varCopy, 
			LPVARIANT( LPCVARIANT( this ) )
			);
	if(		FAILED(hr)
		||	(!OnTextGetPrepareVariant( &varCopy ))
		)
	{
		ASSERT( FALSE );
		return;
	}

CExtSafeString sNumberText;
bool bRet = OnQueryNumberText( &varCopy, sNumberText );
	
	::VariantClear( &varCopy );
	
	if( !bRet )
		return;

	UINT nNumDigits = OnQueryNumDigits();
//    if( ! OnQueryTrailingZeroes() )
    {
        INT nPosPoint = sNumberText.ReverseFind( _T('.') );
        UINT nNumDigitsReal = 0;
        if( nPosPoint >= 0 )
            nNumDigitsReal = min( sNumberText.GetLength() - 1 - nPosPoint, 9 );
        if( nNumDigitsReal < nNumDigits )
            nNumDigits = nNumDigitsReal;
    }


NUMBERFMT fmt;
	memset( &fmt, 0, sizeof(NUMBERFMT) );

	fmt.NumDigits = nNumDigits;
	fmt.LeadingZero = OnQueryLeadingZero();
	fmt.NegativeOrder = OnQueryNegativeOrder();

CExtSafeString sGrouping;
	OnQueryGrouping( sGrouping );
	sGrouping.Remove( _T(';') );
	sGrouping.TrimRight( _T('0') );
	fmt.Grouping = _ttoi( sGrouping );
	
CExtSafeString sDecimalSep;
	OnQueryDecimalSeparator( sDecimalSep );
	fmt.lpDecimalSep = sDecimalSep.GetBuffer( sDecimalSep.GetLength() );
	sDecimalSep.ReleaseBuffer();
	
CExtSafeString sThousandSep;
	OnQueryThousandSeparator( sThousandSep );
	fmt.lpThousandSep = sThousandSep.GetBuffer( sThousandSep.GetLength() );
	sThousandSep.ReleaseBuffer();

	VERIFY(
		g_ResourceManager->GetNumberFormat(
			  0,
			  sNumberText,
			  &fmt,
			  strCopy.GetBuffer( 100 ),
			  100
			) != 0
		);
	strCopy.ReleaseBuffer();
}