|
|
Home » U++ Library support » ArrayCtrl, HeaderCtrl & GridCtrl » edit data in arrayctrl [GOOD EXAMPLES...]
edit data in arrayctrl [GOOD EXAMPLES...] [message #1879] |
Fri, 24 March 2006 19:30 |
barpas
Messages: 13 Registered: March 2006 Location: Poland
|
Promising Member |
|
|
maybe i'm an idiot but i thing i know the reason of UPP low popularity:
maybe i'm an idiot but for two hours im looking how make array control editable - (eg goEditing in builder)
looking reading and .... nothing
i use:
teren.lista.SetEditable();
and
teren.lista.AddColumn("x1",1).Edit(es1);
and testing very very other ideas
and NOTHING
maybe i'm an idiot but there is more idiots on the world
why we can't use UPP???
help my with this problem please ...
ps in my first step by builder i spend 10 seconds to find go editin options - it is very important for begginers to not loosing time ...
[Updated on: Sun, 09 April 2006 04:31] by Moderator Report message to a moderator
|
|
|
Re: edit data in arrayctrl [message #1882 is a reply to message #1879] |
Fri, 24 March 2006 20:25 |
|
fudadmin
Messages: 1321 Registered: November 2005 Location: Kaunas, Lithuania
|
Ultimate Contributor Administrator |
|
|
Yes, life is difficult here... You have to look at the sources. It took me 10 min this time... Not perfect, but maybe as a starting point for you.
#include <CtrlLib/CtrlLib.h>
class App : public TopWindow {
ArrayCtrl array;
EditField arr_edit;
public:
typedef App CLASSNAME;
void ArrayEdit();
App();
};
void App::ArrayEdit() {
array.ColumnAt(0).Edit(arr_edit);
}
App::App() {
Add(array.SizePos());
array.AddColumnAt(0,"Column0",50);
array.AddColumnAt(1,"Column1",50);
array.Add("1textfor0","1textfor1");
array.Add("2textfor0","2textfor1");
array.WhenLeftDouble = THISBACK(ArrayEdit); //double click to edit
Sizeable().Zoomable();
Title("ArrayEdit");
}
GUI_APP_MAIN
{
App().Run();
}
|
|
|
|
|
|
|
Re: edit data in arrayctrl [message #1895 is a reply to message #1890] |
Sat, 25 March 2006 00:12 |
|
mirek
Messages: 13975 Registered: November 2005
|
Ultimate Member |
|
|
OK, something I should have done a long time ago, a good reference examples demonstrating different ways of editing cells in ArrayCtrl:
#include <CtrlLib/CtrlLib.h>
#define LAYOUTFILE <ArrayCtrlEdits/ArrayCtrlEdits.lay>
#include <CtrlCore/lay.h>
struct App : public WithAppLayout<TopWindow> {
EditDouble editdbl;
typedef App CLASSNAME;
App();
};
struct SqrNumberConvert : Convert {
virtual Value Format(const Value& q) const {
return IsNull(q) ? (double)Null : (double)q * (double)q;
}
};
void EditDblMinMaxFactory(One<Ctrl>& ctrl)
{
ctrl.Create<EditDouble>().MinMax(0, 1);
}
App::App()
{
CtrlLayout(*this);
list.AddColumn("Number").Edit(editdbl);
list.AddColumnAt(0, "Number^2").SetConvert(Single<SqrNumberConvert>());
list.AddColumn("Text").Ctrls<EditString>();
list.AddColumn("Limited number").Ctrls(EditDblMinMaxFactory);
list.AddCtrl(editor);
list.AddCtrl(option);
list.Appending().Removing();
list.SetLineCy(EditField::GetStdHeight());
list.ColumnWidths("49 63 74 96");
}
GUI_APP_MAIN
{
App().Run();
}
ArrayCtrlEdits.lay:
LAYOUT(AppLayout, 416, 132)
ITEM(ArrayCtrl, list, LeftPosZ(4, 300).TopPosZ(4, 124))
ITEM(EditInt, editor, LeftPosZ(308, 104).TopPosZ(4, 19))
ITEM(Option, option, SetLabel(t_("Option")).LeftPosZ(308, 104).TopPosZ(28, 15))
END_LAYOUT
Mire
|
|
|
Re: edit data in arrayctrl [message #1896 is a reply to message #1890] |
Sat, 25 March 2006 00:14 |
barpas
Messages: 13 Registered: March 2006 Location: Poland
|
Promising Member |
|
|
thanks awfully!
teren.lista.AddColumn("x1",0).Ctrls<EditDouble>();
it is that what i need
i tray this metod before im writting:
teren.lista.AddColumn("x1",0).Edit(x1);
but i use:
EditString x1; (i find something like that on forum)
and it was my mistake... but now evrything works ok THANK YOU again
I wont to say something abaut UPP popularity:
In my opinion UPP worth to by farmous all over the world and should be used by many many people - there is a lot wonderful thigs in it (eg. containers, serialize mechanism etc..)
but there is colossal work to do - it must be more intuitional (simple to use) by people who are using delphi builder etc.
especially in "using widget" aspect builder is more more confortable to use ...
if that work won't be made that people will be discourage
fast ... it's a pity!
more people, more links, more aplications, more ideas ...
remember that all beginers are potential expert in future - so dont forget abaut as
upp worth it !!!
sory my english
Yours faithfuly
Bartek
ps if is there any person who wonts to make polish version of upp site (i'm to stiupid to do it alone), i can give good, unlimited hosting and help (in my possibility)
[Updated on: Sat, 25 March 2006 00:45] Report message to a moderator
|
|
|
Re: edit data in arrayctrl [message #1897 is a reply to message #1896] |
Sat, 25 March 2006 00:27 |
|
mirek
Messages: 13975 Registered: November 2005
|
Ultimate Member |
|
|
barpas wrote on Fri, 24 March 2006 18:14 |
In my opinion UPP worth to by farmous all over the world and should be used by many many people - there is a lot wonderful thigs in it (eg. compactors, serialize mechanism etc..)
but there is colossal work to do - it must be more intuitional (simple to use) by people who are using delphi builder etc.
if it won't that people will be discourage
fast ... it's a pity!
more people, more links, more aplications, more ideas ...
|
Yes. OTOH, we need to gather resources for that colossal work now - it mostly involves creating experienced U++ programmers via forum tutoring that will spread the U++ fame, bring more people to use it , find bugs, write tutorials and start the chain reaction...
U++ was and IS developed as tool to solve the problem. We (I mean original U++ developers) always cared more about experienced programmers and daily use for developing of very complex apps than about C++ beginners. We are trying to make it more accessible, but there is limited amount of time we can dedicate on that...
Mirek
|
|
|
Goto Forum:
Current Time: Sat May 04 21:52:21 CEST 2024
Total time taken to generate the page: 0.03478 seconds
|
|
|