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 General Discussion » Cells with multiple lines. Collapse All
Subject Author Date
a a Feb 10, 2006 - 6:08 AM

Is it possible to make a cell with multiple lines? Or something similar?
(I would like to put a piece of text with line returns, with variable number of lines.)


Thanks.

Alex Yemelianov Mar 21, 2008 - 8:03 AM

How to make the cell multiline for CExtReportGridWnd?

Technical Support Mar 22, 2008 - 12:16 PM

To make any cell multiline, please use the __EGCS_EX_WRAP_TEXT extended cell style. The number of wrapped lines depends on the column width, row height and text length.

pCell->ModifyStyleEx( __EGCS_EX_WRAP_TEXT ); 
When making the text multiline, do not forget to use a CRLF special symbol, e.g.
pCell->TextSet( 
  _T("Line1\r\nLine2\r\nLine3\r\nLine4\r\nLine5") 
  ); 
Please note you can use the CExtGridWnd::BestFitRow() and CExtGridWnd::BestFitColumn() methods with which you can measure and adjust the rows heights and columns widths.


Technical Support Feb 14, 2006 - 6:28 AM

The multiline feature is already supported. Please contact us via email to get instructions how to download the update.

a a Feb 15, 2006 - 1:46 AM

Hi.


I just tried the latest version. The RGBA feature is OK.


I also tried __EGCS_EX_WRAP_TEXT with this version. (I guess it’s the good one)


It seemed using ModifyStyleEx was not enough...
Do we have to add some code to make the multiline fully work? And is there no further options for the multiline?
I mean, with the (SHIFT +) ENTER button handled for the user’s input, a way to set the number of lines displayed, scroll bars, etc...
(like multiline in java UIs).


Thanks.

Technical Support Feb 15, 2006 - 10:14 AM

To make the cell multiline, it is enough to apply the __EGCS_EX_WRAP_TEXT style:

pCell->ModifyStyleEx( __EGCS_EX_WRAP_TEXT );
To set multiline text, do not forget to use the CRLF special symbol, e.g.
pCell->TextSet( 
  _T("Line1\r\nLine2\r\nLine3\r\nLine4\r\nLine5")
);
When you are typing in some text in the editor and want to insert a new line, just use the Ctrl+Enter key combination, which is standard for multiline edit controls.

The scrollbars are not yet supported in the inplace editor.

a a Feb 15, 2006 - 6:38 PM

Okay.


By applying __EGCS_EX_WRAP_TEXT, the cell is indeed multiline, but you can only see the first line.


I meant, for instance, how can the user edit the second line?
Is there a way to scroll down? A way to auto-scroll so that the caret stays visible? A way to make more than 1 line visible?


I have no idea how to control the multiline cell programmatically. Could you post a little sample?


Thanks.

Technical Support Feb 16, 2006 - 11:18 AM

It seems you cannot see the rest of the multiline text because the cell height is not enough. You need to increase the row height.
As for auto scroll, the inplace edit features the ES_AUTOVSCROLL style which enables it to automatically scroll text up.

a a Feb 16, 2006 - 10:20 PM

How do you increase the cell’s height?


I also tried overriding the string cell class to set ES_AUTOVSCROLL in the OnInplaceControlCreate method (after a call to the parent method), but the scrolling didn’t work... Where and how should I use ES_AUTOVSCROLL?

Technical Support Feb 17, 2006 - 7:13 AM

You don’t need to apply ES_AUTOVSCROLL because this is performed automatically. Plese download this sample that shows how to use multiline cells. Here is how it looks like:

Multiline grid cell





a a Feb 19, 2006 - 5:58 PM

Hi.


I just tried the sample, but it seems there is no auto-scroll.
Press CTRL+ENTER at the end of the line 3. You won’t be able to see the caret, thus you won’t see what you’re typing in line 4.


Besides, is there a way to modify the height of a cell used in the property grid?

Technical Support Feb 21, 2006 - 11:27 AM

We confirm that the multiline cell inplace editor works not like it should work. We have improved the multiline support and added the CExtPropertyItem::HeigtPxGet() and CExtPropertyItem::HeigtPxSet() methods for specifying a custom height for any property item. Please download the update from our ftp site.

a a Feb 21, 2006 - 7:39 PM

Thanks.
It works perfeclty now.


 

Mac Will Feb 10, 2006 - 7:25 AM

http://www.prof-uis.com/Forum_View.aspx?CID=29&M=2907

no semi colon after the ’and’ sign. i don’t know why it adds that semi colon

Mac Will Feb 10, 2006 - 7:22 AM

http://www.prof-uis.com/Forum_View.aspx?CID=29&M=2907

says:

Technical Support
Subject: Re:multiline cells in grid control          May 6, 2005 - 4:15 AM

Thank you for the interesting question. The grid cells always paint the text value in a single line. The CDC::DrawText() method is used for rendering text. You can create your own cell class and override the CExtGridCell::OnQueryDrawTextFlags() virtual method. Your method should call the parent and remove the DT_SINGLELINE flag from the returned value before passing it to the caller.

Hope that helps
Mac

Technical Support Feb 10, 2006 - 9:06 AM

All string cell in the grid window is designed to be single-line. So, you need to use your own cell class and override the CExtGridCell::OnQueryDrawTextFlags() virtual method. Invoke the parent method in it so that you can retrieve the default text flags. Then remove the DT_SINGLELINE flag from the returned value. You also need to override the CExtGridCell::OnMeasureTextSize() virtual method, which measures the text. That is enough to get multiline text in the cells. The CExtGridCell::OnInplaceControlCreate() virtual method can also be overridden to make the in-place editor window created by default by applying the ES_MULTILINE style.

Anyway, it seems we need to support multiline cells so we decided to make this feature available in the next release. If you need it earlier, please contact us by e-mail if you have a valid tech support subscription.

Technical Support Feb 10, 2006 - 9:10 AM

We will add the __EGCS_EX_WRAP_TEXT extended cell style to wrap text into multiple lines in a cell. The number of wrapped lines depends on the column width and on the length of the cell content. Of course, the CRLF (\r\n) symbol will also be allowed.