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 » CExtGridCellNumber question/problem - recap Collapse All
Subject Author Date
Offer Har Apr 8, 2008 - 9:28 AM

 


Dear Support,


I would like to repeat this from a previous thread, which I never got an answer to:


Can you please add for the coming version passing of the parameters of grid, row & cell  to the OnValueIncrement() and OnValueDecrement() methods? If you say they are invoked from the the CExtGridCell::OnButtonPressing()  method, which does contain this information it does not seems to be too complicated. This is what I intend to do myself... If you want I can check it out and let you know if it works.


 


Ron.

Offer Har Apr 10, 2008 - 5:23 AM

I would like to show you another problem in this issue - when an increment button is pressed, the grid is receiving an OnGridCellInputComplete call, but the cell does not!


You can see it in CExtGridCell::OnButtonPressing:



 


...

switch( nButtonType )     {     case __EBTT_UPDOWN_UP:         if(        IsButtonEnabled(__EBTT_UPDOWN_UP)             &&    OnQueryEnabledIncrement()             )         {             if( OnValueIncrement() )             {                 wndGrid.OnGridCellInputComplete(                     *this,                     nColNo,                     nRowNo,                     nColType,                     nRowType                     );                 bRedrawCell = true;             }         }     break;     case __EBTT_UPDOWN_DOWN:         if(        IsButtonEnabled(__EBTT_UPDOWN_DOWN)             &&    OnQueryEnabledDecrement()             )         {             if( OnValueDecrement() )             {                 wndGrid.OnGridCellInputComplete(                     *this,                     nColNo,                     nRowNo,                     nColType,                     nRowType                     );                 bRedrawCell = true;             }         }     break; ...


 



 


I think that the cell should be notified here that the cell was changed. I am going to do it myself, but I think that this is a fix that should be added to the library.


 

Technical Support Apr 10, 2008 - 10:39 AM

We modified the grid code. Here are the details:

modified in CExtGridCell:
            virtual bool OnQueryEnabledIncrement(
                        const CExtGridWnd & wndGrid,
                        LONG nColNo,
                        LONG nRowNo,
                        INT nColType,
                        INT nRowType
                        ) const;
            virtual bool OnQueryEnabledDecrement(
                        const CExtGridWnd & wndGrid,
                        LONG nColNo,
                        LONG nRowNo,
                        INT nColType,
                        INT nRowType
                        ) const;
            virtual bool OnValueIncrement(
                        CExtGridWnd & wndGrid,
                        LONG nColNo,
                        LONG nRowNo,
                        INT nColType,
                        INT nRowType
                        );
            virtual bool OnValueDecrement(
                        CExtGridWnd & wndGrid,
                        LONG nColNo,
                        LONG nRowNo,
                        INT nColType,
                        INT nRowType
                        );
            virtual bool OnQueryButtonInfo(
                        INT nButtonType,
                        CExtGridWnd * pWndGrid = NULL,
                        LONG nColNo = 0,
                        LONG nRowNo = 0,
                        INT nColType = 0,
                        INT nRowType = 0,
                        bool * p_bEnabled,
                        bool * p_bPressed = NULL,
                        bool * p_bStayPressed = NULL,
                        UINT * p_nTimerElapseValue = NULL
                        ) const;
            bool IsButtonEnabled(
                        INT nButtonType, // e_button_type_t
                        CExtGridWnd * pWndGrid = NULL,
                        LONG nColNo = 0,
                        LONG nRowNo = 0,
                        INT nColType = 0,
                        INT nRowType = 0,
                        ) const;
            bool IsButtonPressed(
                        INT nButtonType, // e_button_type_t
                        CExtGridWnd * pWndGrid = NULL,
                        LONG nColNo = 0,
                        LONG nRowNo = 0,
                        INT nColType = 0,
                        INT nRowType = 0,
                        ) const;
            bool IsButtonStayPressed(
                        INT nButtonType, // e_button_type_t
                        CExtGridWnd * pWndGrid = NULL,
                        LONG nColNo = 0,
                        LONG nRowNo = 0,
                        INT nColType = 0,
                        INT nRowType = 0
                        ) const;

modified in CExtGridCellVariant:
            virtual bool OnValueIncrement(
                        LPVARIANT pvarValue,
                        CExtGridWnd & wndGrid,
                        LONG nColNo,
                        LONG nRowNo,
                        INT nColType,
                        INT nRowType
                        );
            virtual bool OnValueDecrement(
                        LPVARIANT pvarValue,
                        CExtGridWnd & wndGrid,
                        LONG nColNo,
                        LONG nRowNo,
                        INT nColType,
                        INT nRowType
                        );

modified in CExtGridCellComboBox::
            void _DoItemsIterate( 
                        CExtGridWnd & wndGrid,
                        LONG nColNo,
                        LONG nRowNo,
                        INT nColType,
                        INT nRowType,
                        HWND hWndInplaceControl,
                        bool bNext, 
                        bool bSetSel = false 
                        );

added into CExtGridWnd:
            virtual bool OnGridHookCellQueryEnabledIncrement(
                        LONG nColNo,
                        LONG nRowNo,
                        LONG nColType,
                        LONG nRowType,
                        const CExtGridCell & _cell,
                        bool & bEnabled
                        ) const;
            virtual bool OnGridHookCellQueryEnabledDecrement(
                        LONG nColNo,
                        LONG nRowNo,
                        LONG nColType,
                        LONG nRowType,
                        const CExtGridCell & _cell,
                        bool & bEnabled
                        ) const;
            virtual bool OnGridHookCellValueIncrement(
                        LONG nColNo,
                        LONG nRowNo,
                        LONG nColType,
                        LONG nRowType,
                        CExtGridCell & _cell,
                        bool & bResult
                        );
            virtual bool OnGridHookCellValueDecrement(
                        LONG nColNo,
                        LONG nRowNo,
                        LONG nColType,
                        LONG nRowType,
                        const CExtGridCell & _cell,
                        bool & bResult
                        );
            virtual bool OnGridHookCellQueryButtonInfo(
                        INT nButtonType,
                        const CExtGridCell & _cell,
                        LONG nColNo,
                        LONG nRowNo,
                        INT nColType,
                        INT nRowType,
                        bool * p_bEnabled,
                        bool * p_bPressed,
                        bool * p_bStayPressed,
                        UINT * p_nTimerElapseValue,
                        bool & bRetVal
                        ) const;