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 » Insert Ctrl editors in a single row of ArrayCtrl
Insert Ctrl editors in a single row of ArrayCtrl [message #56300] Thu, 18 February 2021 16:52 Go to next message
mubeta is currently offline  mubeta
Messages: 77
Registered: October 2006
Member
Hi all,
any way for integrate in a single cell of ArrayCtrl an existing Ctrl object? For example an already defined EditString or DropDate?

With ArrayCtrl there are a lot of examples and references, but most of them oriented to assign an editor for a defined column. There are even some examples for assing an editor to a single cell, but I don't found a way to assign to a single cell an object with it's own name.

Example
dpDate DropDate;
acRows ArrayCtrl;

...
ac.Add(...);
ac.Add(..., dpDate);



Thanks
Re: Insert Ctrl editors in a single row of ArrayCtrl [message #56302 is a reply to message #56300] Thu, 18 February 2021 18:50 Go to previous messageGo to next message
mubeta is currently offline  mubeta
Messages: 77
Registered: October 2006
Member
Nothing. My brain it's getting old. Forget all.
Thanks.
Re: Insert Ctrl editors in a single row of ArrayCtrl [message #56303 is a reply to message #56300] Thu, 18 February 2021 19:08 Go to previous messageGo to next message
Oblivion is currently offline  Oblivion
Messages: 1091
Registered: August 2007
Senior Contributor
Hello mubeta,
Try this:

#include <CtrlLib/CtrlLib.h>

using namespace Upp;

struct MyApp : TopWindow {
	ArrayCtrl array;
	MyApp()
	{
		Sizeable().Zoomable().CenterScreen().SetRect(0, 0, 800, 600);
		Add(array.SizePos());
		
			array.AddColumn("Index").WithLined([=](int i, One<Ctrl>& c){
				if(i % 2 == 0)
					c.Create<DropDate>();
				else {
					DropList& l = c.Create<DropList>();
					l.Add("a").Add("b").Add("c");
				}
			});

		for(int i = 0; i < 10; i++) {
			array.Add(i);
		}
	}
};

GUI_APP_MAIN
{
	MyApp().Run();
}


Best regards,
Oblivion


[Updated on: Thu, 18 February 2021 19:09]

Report message to a moderator

Re: Insert Ctrl editors in a single row of ArrayCtrl [message #56308 is a reply to message #56303] Fri, 19 February 2021 16:35 Go to previous message
mubeta is currently offline  mubeta
Messages: 77
Registered: October 2006
Member
Thankyou for your reply, but, as I wrote, the problem was only an me. when the editor is integrated in the ArrayCtrl, the data value is owned by the Array, not by the editor, so I was confuse for some time for develop my needs.
Previous Topic: Select Grid Row BY ID
Next Topic: GridCtrl - grid problem when i set focus
Goto Forum:
  


Current Time: Thu Mar 28 10:45:17 CET 2024

Total time taken to generate the page: 0.01145 seconds