Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » U++ Library support » ArrayCtrl, HeaderCtrl & GridCtrl » Row autoheight with LineEdit
Row autoheight with LineEdit [message #40842] Mon, 23 September 2013 08:30 Go to next message
iST1 is currently offline  iST1
Messages: 107
Registered: August 2013
Experienced Member
If we set LineEdit as row cell with Edit method and Editing(true), then how to increase row height to view all lines without Popup when hover?
Re: Row autoheight with LineEdit [message #40902 is a reply to message #40842] Sat, 05 October 2013 16:59 Go to previous messageGo to next message
iST1 is currently offline  iST1
Messages: 107
Registered: August 2013
Experienced Member
The possible solution is inheritance from from LineEdit and redefine NewScrollPos method, but my attempt failed:
class AppLineEdit : public LineEdit {
public:
	AppLineEdit(GridCtrl *grid) : grid_(grid) {}
		
	void NewScrollPos() {
		/*
		//how to get new heigth for SetRowHeight?		int ir = grid_->GetRowId() + 1;
		GridCtrl::ItemRect &row = grid_->GetRow(ir);
		Rect r = GetScreenView();
		grid_->SetRowHeight(ir, r.GetHeight());//2 * grid_->GetDefaultRowHeight());*/
	}
	
private:
	GridCtrl *grid_;
};
	
GUI_APP_MAIN
{	
	TopWindow wnd;
	GridCtrl grid;
	
	LineEdit edit(&grid);
	grid.AddColumn("Col1").Edit(edit);
	grid.Editing()
		.Sorting(false)
		.OneClickEdit();

	grid.AddRow();
	grid.Set(0, 0, "Row1");

	grid.AddRow();
	grid.Set(1, 0, "Row2");

	wnd.Add(grid.SizePos())	;
	wnd.Run();
}

[Updated on: Sat, 05 October 2013 17:00]

Report message to a moderator

Re: Row autoheight with LineEdit [message #40903 is a reply to message #40902] Sat, 05 October 2013 17:04 Go to previous messageGo to next message
iST1 is currently offline  iST1
Messages: 107
Registered: August 2013
Experienced Member
WrapText not suitable because multiline is need also in edit mode, and not only when viewing
Re: Row autoheight with LineEdit [message #41021 is a reply to message #40903] Mon, 21 October 2013 18:01 Go to previous messageGo to next message
iST1 is currently offline  iST1
Messages: 107
Registered: August 2013
Experienced Member
Any ideas? I do not have
Re: Row autoheight with LineEdit [message #41025 is a reply to message #41021] Mon, 21 October 2013 22:44 Go to previous messageGo to next message
unodgs is currently offline  unodgs
Messages: 1366
Registered: November 2005
Location: Poland
Ultimate Contributor

iST1 wrote on Mon, 21 October 2013 12:01

Any ideas? I do not have

I've got this working but only partially, it seems that some changes on LineEdit are required. Working on it..
Re: Row autoheight with LineEdit [message #41234 is a reply to message #41025] Sun, 17 November 2013 14:39 Go to previous message
iST1 is currently offline  iST1
Messages: 107
Registered: August 2013
Experienced Member
Hello unodgs, i wanted to ask whether can set this up?
Previous Topic: Getting row index from Display
Next Topic: GridCtrl and ThreeState option
Goto Forum:
  


Current Time: Thu Mar 28 18:07:29 CET 2024

Total time taken to generate the page: 0.00989 seconds