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 » How to create a Ctrl on selection? (Creating Ctrls for every column makes the program VERY slow so I prefer doing it just on the selected cell)
Re: How to create a Ctrl on selection? [message #52588 is a reply to message #52587] Thu, 24 October 2019 19:33 Go to previous messageGo to previous message
mirek is currently offline  mirek
Messages: 14265
Registered: November 2005
Ultimate Member
SidusBrist wrote on Thu, 24 October 2019 14:32
I tried but nothing happens... I click on the row but the box doesn't appear Sad

table.AddRowNumColumn(" ",45);
table.ColumnAt(0).SetDisplay(Single<WhiteFill>());
std::ifstream infile(pb);
std::string line;
while (std::getline(infile, line))
{
	std::istringstream iss(line);
	CobolField f(line.c_str());
	if (f.isField){
		fields.push_back(f);
		std::string columnDescription = "Da " + std::to_string(f.start+1) + " a " + std::to_string(f.end) + " per " + std::to_string(f.size) + " byte";
		if (f.shortenedName!="FILLER"){
			table.AddColumn(f.shortenedName,120);
		}
		else {
			table.AddColumn(f.shortenedName,40);
			table.HeaderTab(table.GetColumnCount()-1).SetInk(Color(196,196,196));
		}
		if (f.isK001){
			Font font = table.HeaderTab(table.GetColumnCount()-1).GetFont();
			font.Underline(true);
			table.HeaderTab(table.GetColumnCount()-1).SetFont(font);
		}
		table.ColumnAt(table.GetColumnCount()-1).Tip(columnDescription.c_str());
		if (f.isAlpha){
			table.ColumnAt(table.GetColumnCount()-1).Edit(editString);
		}
		else {
			if (f.nDecimals>0){
				table.ColumnAt(table.GetColumnCount()-1).Edit(editDouble);
			}
			else {
				table.ColumnAt(table.GetColumnCount()-1).Edit(editInt);
			}
		}
		table.Appending().Removing().Duplicating();
		CobolField::fieldStart = CobolField::fieldStart + f.size;
	}
	if (f.isXSYS){
		break;
	}
}
table.SetLineCy(EditField::GetStdHeight());


P.S.: I just realized "AddColumn" returns the column so I don't need to always use table.ColumnAt()...


Hard to say from this snippet. How and _where_ is 'editDouble' defined? Note that it must exist through the lifetime of ArrayCtrl.

Mirek
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Button in Array segfault
Next Topic: How to access Fixed Columns?
Goto Forum:
  


Current Time: Sat Jul 05 05:32:56 CEST 2025

Total time taken to generate the page: 0.03657 seconds