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
Re: Row autoheight with LineEdit [message #40902 is a reply to message #40842] Sat, 05 October 2013 16:59 Go to previous messageGo to previous 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

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Getting row index from Display
Next Topic: GridCtrl and ThreeState option
Goto Forum:
  


Current Time: Fri Apr 26 03:07:15 CEST 2024

Total time taken to generate the page: 0.03273 seconds