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 » OnButtonPressed in CExtGridCell Collapse All
Subject Author Date
Andrew Cochran Aug 14, 2006 - 3:55 AM

Hi, I have problems with OnButtonPressed method of CExtGridCell class.
I need to have a cell with no inplace control to disable editing, but there must be an ellipsis button for user to call dialog by pressing it. I dirived my own class from CExtGridCellString, set following styles for cell

ModifyStyle( __EGCS_NO_INPLACE_CONTROL | __EGCS_BUTTON_ELLIPSIS , 0L);

in a constructor of my class. Everithing is working and looking fine, but OnButtonPressed handler is called not only when the ellipsis button is pressed. It is called even if any click in any region of cell is made (for ex., in the middle or at left). When the inplace editing control is present - everething is good. But I need the cell without it an with ellipsis button, and I have to no exactly whether ellipsis button is pressed or another part of cell.
Please, help me... How can I do my needs?

Technical Support Aug 14, 2006 - 6:52 AM

Thank you for the good question. If a grid cell has the __EGCS_NO_INPLACE_CONTROL cell style with no __EGCS_READ_ONLY applied, a single click is interpreted as a click on the drop-down cell button if the __EGCS_BUTTON_DROPDOWN cell style is specified or as a click on the ellipsis cell button if the __EGCS_BUTTON_ELLIPSIS cell style is specified. The drop-down button has a higher priority. This behavior is convenient in most of cases, especially for grid cells inside the property grid control. You can change this behavior by overriding the CExtGridCell::OnClick() virtual method and analyzing the htInfo parameter which describes the click related hit-testing information. If the htInfo.m_nButtonType property is not equal to the INT(CExtGridCell::__EBTT_ELLIPSIS) value, then your OnClick() method should return true. Your OnClick() method should invoke the parent class method and return the returned value otherwise.

Andrew Cochran Aug 15, 2006 - 2:39 AM

Thanks BIG! Now the problem is solved!