Professional UI Solutions
Site Map   /  Register
 
 

Forum

Please Log In to post a new message or reply to an existing one. If you are not registered, please register.

NOTE: Some forums may be read-only if you are not currently subscribed to our technical support services.

Forums » Prof-UIS Tech Support » Problem description for property grid cell Collapse All
Subject Author Date
Brian Horn Apr 4, 2007 - 11:11 PM


We are using the CExtPropertyGridCtrl for displaying the proprties
We have used the edit box type cell creation as below
CExtGridCellString *pValue =

STATIC_DOWNCAST(

CExtGridCellString,

ValueActiveGetByRTC( RUNTIME_CLASS(CExtGridCellString) )

);

pValue->TextSet(_T("Edit text"));

pValue->ModifyStyle( iStyle );



When user attempt to enter a decimal point while using the grid it does not accept that as input.

It accepts digits and alphabets but not the decimal point as input from the user.

However the grid allows setting the value to something like aˆ? 0.01aˆ? by using the TextSet method in the code.

You can reply on ayubkhan.pathan@mscsoftware.com

Regards,
Ayub/Ajit

Brian Horn Apr 16, 2007 - 4:06 AM

We did modify the code and build it still the problem is there. Surprisingly it is working fine with sample application even without above changes. Identical code we added in our application and it is not accepting dot (.) character. It accepts all other special characters. Is there any method by which we can set property to enable this?

Please help.

Regards,
Ayub

Technical Support Apr 16, 2007 - 11:01 AM

The bug is fixed. Please open the CExtGridWnd::OnGbwBeginEdit() method and find the following code snippet at the end of the method:

if(    (!bCtrl) && (!bShift) && int(msg.wParam) == VK_DELETE )
{
    ::PeekMessage(&msg,NULL,msg.message,msg.message,PM_REMOVE);
    if( msg.message == WM_KEYDOWN )
    {
        LPTSTR strEmpty = _T(""); 
        INT nSelStart = 0, nSelEnd = 0;
        ::SendMessage( msg.hwnd, EM_GETSEL, reinterpret_cast < WPARAM > ( &nSelStart ), 
                 reinterpret_cast < LPARAM > ( &nSelEnd ) );
        if( nSelStart == nSelEnd )
            ::SendMessage( msg.hwnd, EM_SETSEL, WPARAM( nSelStart ), LPARAM( nSelStart + 1 ) );
        ::SendMessage( msg.hwnd, EM_REPLACESEL, 1, reinterpret_cast < LPARAM > ( strEmpty ) );
    }
    continue;
}
Please replace it with this
if(    (!bCtrl) && (!bShift) && int(msg.wParam) == VK_DELETE )
{
    if( msg.message != WM_CHAR )
    {
        ::PeekMessage(&msg,NULL,msg.message,msg.message,PM_REMOVE);
        if( msg.message == WM_KEYDOWN )
        {
            LPTSTR strEmpty = _T(""); 
            INT nSelStart = 0, nSelEnd = 0;
            ::SendMessage( msg.hwnd, EM_GETSEL, reinterpret_cast < WPARAM > ( &nSelStart ), 
                 reinterpret_cast < LPARAM > ( &nSelEnd ) );
            if( nSelStart == nSelEnd )
                ::SendMessage( msg.hwnd, EM_SETSEL, WPARAM( nSelStart ), LPARAM( nSelStart + 1 ) );
            ::SendMessage( msg.hwnd, EM_REPLACESEL, 1, reinterpret_cast < LPARAM > ( strEmpty ) );
        }
        continue;
    }
}


Technical Support Apr 5, 2007 - 4:14 AM

This bug is already fixed. Please open the CExtGridWnd::OnGbwBeginEdit() method and find the following code snippet

if(    (!bCtrl) && (!bShift) && int(msg.wParam) == VK_DELETE )
{
    ::PeekMessage(&msg,NULL,msg.message,msg.message,PM_REMOVE);
    if( msg.message == WM_KEYDOWN )
    {
        LPTSTR strEmpty = _T(""); 
        INT nSelStart = 0, nSelEnd = 0;
        ::SendMessage( msg.hwnd, EM_GETSEL, reinterpret_cast < WPARAM > ( &nSelStart ), reinterpret_cast < LPARAM > ( &nSelEnd ) );
        if( nSelStart == nSelEnd )
            ::SendMessage( msg.hwnd, EM_SETSEL, WPARAM( nSelStart ), LPARAM( nSelStart + 1 ) );
        ::SendMessage( msg.hwnd, EM_REPLACESEL, 1, reinterpret_cast < LPARAM > ( strEmpty ) );
    }
    continue;
}
Replace it with the following code
if(    (!bCtrl) && (!bShift) && int(msg.wParam) == VK_DELETE )
{
    if( msg.message != WM_CHAR )
    {
        ::PeekMessage(&msg,NULL,msg.message,msg.message,PM_REMOVE);
        if( msg.message == WM_KEYDOWN )
        {
            LPTSTR strEmpty = _T(""); 
            INT nSelStart = 0, nSelEnd = 0;
            ::SendMessage( msg.hwnd, EM_GETSEL, reinterpret_cast < WPARAM > ( &nSelStart ), reinterpret_cast < LPARAM > ( &nSelEnd ) );
            if( nSelStart == nSelEnd )
                ::SendMessage( msg.hwnd, EM_SETSEL, WPARAM( nSelStart ), LPARAM( nSelStart + 1 ) );
            ::SendMessage( msg.hwnd, EM_REPLACESEL, 1, reinterpret_cast < LPARAM > ( strEmpty ) );
        }
        continue;
    }
}

Suhai Gyorgy Apr 5, 2007 - 1:02 AM

First of all, would you show what’s value of iStyle?