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 » Grid In-Place control Collapse All
Subject Author Date
Offer Har Jun 5, 2007 - 1:33 PM

Dear Support,

Is there sample code for customizing CExtGridWnd In-Place controls?
I need a Lat/Long cells and would like to use my existing control as the In-Place control.

Thanks,
Ron.

Offer Har Jun 6, 2007 - 1:45 PM

Dear Support,

Is there any sample of such implementation, besides the standard edit control?
The lat-long controls are build of 4 section:
hemisphere (N-S or E-W), degrees, minutes and seconds. There are separator symbols between them.
In the old grid we used, the in-place control could be any CWnd derived control that we wanted, and was created like a normal control (Create), which allowed us to derive the already existing Lat-Long control we had, and add some minor modifications, like handling escape to terminate the in-place edit control.
From what I understand it’s more complicated in your grid control - correct me if I’m wrong.

Thanks,
Ron.

Technical Support Jun 7, 2007 - 10:32 AM

The inplace editor can be any CWnd-derived window. You can find the example in Prof-UIS itself. The CExtGridCellDateTime and CExtGridCellDuration cells use the CExtDurationWnd class as the inplace editor, CExtGridCellSlider uses CSliderCtrl, and CExtGridCellIPAddress uses CIPAddressCtrl.

Technical Support Jun 6, 2007 - 8:24 AM

To create a custom cell with an inplace editor, you should override the CExtGridCell::OnInplaceControlCreate() virtual method which is used for creating the inplace control. You could derive your editor class from CExtGridInplaceEdit. So basically you need to copy the body of the CExtGridCell::OnInplaceControlCreate() method into your overridden method and replace CExtGridInplaceEdit with CYourGridInplaceEdit (your class).

Please note there is a virtual method OnInplaceControlWindowProc() in the CExtGridCell class, which is spying on the window procedure of the in-place editor and returns true if a Windows message has been handled by the cell object. So you can override this method to handle any message sent from the in-place edit control. This means that probably you may not have to create your own inplace edit control.

Of course we can implement the Lat/Long cell ourselves for being part of Prof-UIS if you provide us with a specification of this cell type.

Offer Har Jun 13, 2007 - 10:51 AM

Dear Support,

I am trying to implement my own cell, per your explanations.
I get this error:

z:\Infra\TestGrid\TestGridDlg.cpp(12) : error C2665: ’CExtGridCell::operator new’ : none of the 2 overloads can convert parameter 2 from type ’const char [34]’
z:\3rdParty\Prof-UIS\Include\ExtGridWnd.h(1799): could be ’void *CExtGridCell::operator new(size_t,IMalloc *,bool)’
while trying to match the argument list ’(size_t, const char [34], int)’

When adding:
IMPLEMENT_SERIAL( CExtGridCellLat, CExtGridCellEx, VERSIONABLE_SCHEMA|1 );

The error is inside the macro. My cell derives from CExtGridCellEx.

Any ideas what is causing this error?

Thanks,
Ron.

Technical Support Jun 14, 2007 - 7:13 AM

The compilation of CExtGridCell derived classes may fail because there is a problem with IMPLEMENT_SERIAL and grid cells. This problem is caused by a conflict of C++ new operators defined locally in the CExtGridCell class. CExtGridCell defines its own new and new operators with parameters. The solution is easy. Please open the cpp file that implements your cell class and move the IMPLEMENT_SERIAL macro to the top of the file before the definition of the debug version of the new operator:

#include "StdAfx.h"
. . .
IMPLEMENT_SERIAL(...
. . .
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
. . .


Offer Har Jun 14, 2007 - 8:20 PM

Dear Support,

Thanks - this solved that problem.
However we find it too complicated to implement a custom cell type.
We started with the date-time as reference, but we ended up copying hundreds of lines of code, without knowing what they do, and without time to go and read all this code... and we also got some strange behavior that are too complicated to even start and fix.

In previous grids we used, it was very easy to do this task, but here it doesn’t seem so.

Will it be possible that for one of the coming releases you will enable a custom cell to be more easily be created.
Please accompany this with a tutorial on how to create a custom cell time.

Please let me know what you think, and weather you are going to place this in your to-do list.
In the meanwhile we will not be able to use the Prof-UIS grid in some projects, which we find very sad...

Thanks,
Ron.

Technical Support Jun 15, 2007 - 12:09 PM

Thank you for your feedback. We agree that a tutorial would be helpful and added this to our task list.