Home » Extra libraries, Code snippets, applications etc. » U++ users applications in progress and useful code snippets, including reference examples! » "Forlano tabs" - how to reduce a headache by the proper use of the designer...
"Forlano tabs" - how to reduce a headache by the proper use of the designer... [message #2135] |
Sun, 02 April 2006 12:11  |
 |
fudadmin
Messages: 1321 Registered: November 2005 Location: Kaunas, Lithuania
|
Ultimate Contributor Administrator |
|
|
I christened this topic "Forlano tabs" - how to reduce a headache by the proper use of the designer... because it's a continuation of forlano's series of "U++ beginners fundamental questions" which you can find in other parts of our forums... (inc. "How to combine two widget-class in the topwindow" )
So, why the code below and "program all your widgets by hand" is a headache?
//personalized tab (1 child) widget
class LuigiTab : public ParentCtrl {
Button btnAdd, btnDel, btnClear, btnModify;
DocEdit doc;
LabelBox lbox;
Label label[10];
EditString editName, editCountry, editBirth, editNatRat,
editNatId, editFIDEId, editFIDERat;
DropList editTitle;
Option tsex;
EditInt kcoeff;
ArrayCtrl arr;
public:
typedef LuigiTab CLASSNAME;
LuigiTab();
~LuigiTab(){;}
};
LuigiTab::LuigiTab() {
// label
lbox.SetLabel(t_("Edit Player")).LeftPosZ(16, 648).TopPosZ(16, 80);
Add(lbox);
label[0].SetLabel(t_("Name")).SetAlign(ALIGN_CENTER).LeftPosZ(28, 132).TopPosZ(32, 19);
Add(label[0]);
label[1].SetLabel(t_("Fed")).SetAlign(ALIGN_CENTER).LeftPosZ(168, 40).TopPosZ(32, 19);
Add(label[1]);
label[2].SetLabel(t_("Birthday")).SetAlign(ALIGN_CENTER).LeftPosZ(208, 56).TopPosZ(32, 19);
Add(label[2]);
label[3].SetLabel(t_("Gender")).SetAlign(ALIGN_CENTER).LeftPosZ(264, 56).TopPosZ(32, 19);
Add(label[3]);
label[4].SetLabel(t_("Title")).SetAlign(ALIGN_CENTER).LeftPosZ(324, 40).TopPosZ(32, 19);
Add(label[4]);
label[5].SetLabel(t_("ID FIDE")).SetAlign(ALIGN_CENTER).LeftPosZ(380, 48).TopPosZ(32, 19);
Add(label[5]);
label[6].SetLabel(t_("Rat FIDE")).SetAlign(ALIGN_CENTER).LeftPosZ(440, 48).TopPosZ(32, 19);
Add(label[6]);
label[7].SetLabel(t_("ID Nat")).SetAlign(ALIGN_CENTER).LeftPosZ(496, 48).TopPosZ(32, 19);
Add(label[7]);
label[8].SetLabel(t_("Rat Nat")).SetAlign(ALIGN_CENTER).LeftPosZ(558, 48).TopPosZ(32, 19);
Add(label[8]);
label[9].SetLabel(t_("K")).SetAlign(ALIGN_CENTER).LeftPosZ(616, 24).TopPosZ(32, 19);
Add(label[9]);
//active widget
editName.MaxLen(25).LeftPosZ(28, 136).TopPosZ(56, 19);
Add(editName);
editCountry.MaxLen(3).LeftPosZ(172, 32).TopPosZ(56, 19);
Add(editCountry);
editNatId.MaxLen(8).LeftPosZ(496, 48).TopPosZ(56, 19);
Add(editNatId);
editBirth.MaxLen(10).LeftPosZ(212, 56).TopPosZ(56, 19);
Add(editBirth);
editFIDERat.MaxLen(8).LeftPosZ(440, 48).TopPosZ(56, 19);
Add(editFIDERat);
tsex.SetLabel(t_("Male")).LeftPosZ(280, 42).TopPosZ(56, 20);
Add(tsex);
editTitle.DisplayAll(true).LeftPosZ(328, 42).TopPosZ(56, 20);
Add(editTitle);
editFIDEId.MaxLen(8).LeftPosZ(380, 48).TopPosZ(56, 19);
Add(editFIDEId);
editNatRat.MaxLen(8).LeftPosZ(554, 56).TopPosZ(56, 19);
Add(editNatRat);
kcoeff.Min(0).Max(100).LeftPosZ(620, 24).TopPosZ(56, 19);
Add(kcoeff);
// button
btnAdd.SetLabel(t_("Add Player")).LeftPosZ(24, 96).TopPosZ(116, 24);
Add(btnAdd);
btnModify.SetLabel(t_("Modify Player")).LeftPosZ(148, 96).TopPosZ(116, 24);
Add(btnModify);
btnDel.SetLabel(t_("Delete Player")).LeftPosZ(56, 96).TopPosZ(328, 24);
Add(btnDel);
btnClear.SetLabel(t_("Clear Data")).LeftPosZ(284, 96).TopPosZ(116, 24);
Add(btnClear);
// array ctrl
arr.Moving(true).Removing(true).AppendLine(true).Inserting(true).LeftPosZ(16, 648).TopPosZ(172, 148);
Add(arr);
arr.AddColumn("Name");
arr.AddColumn("Fed");
arr.AddColumn("Birthday");
arr.AddColumn("Gender");
arr.AddColumn("Title");
arr.AddColumn("ID FIDE");
arr.AddColumn("Rat FIDE");
arr.AddColumn("ID Nat");
arr.AddColumn("Rat Nat");
arr.AddColumn("K");
arr.AddColumn("Available");
1. This way can't go through all your forms quickly and "visually" and add new widgets during the process of improvements.
2. Accessing labels only by index is a headache, too.
[to be continued...]
P.S Comments are welcome!
[Updated on: Sun, 02 April 2006 12:12] Report message to a moderator
|
|
|
 |
|
"Forlano tabs" - how to reduce a headache by the proper use of the designer...
By: fudadmin on Sun, 02 April 2006 12:11
|
 |
|
Re: "Forlano tabs" - how to reduce a headache by the proper use of the designer...
By: fudadmin on Sun, 02 April 2006 12:17
|
 |
|
Re: "Forlano tabs" - how to reduce a headache by the proper use of the designer...
By: forlano on Sun, 02 April 2006 13:17
|
 |
|
Re: "Forlano tabs" - how to reduce a headache by the proper use of the designer...
By: fudadmin on Sun, 02 April 2006 13:28
|
 |
|
Re: "Forlano tabs" - how to reduce a headache by the proper use of the designer...
By: fudadmin on Sun, 02 April 2006 13:30
|
 |
|
Re: "Forlano tabs" - how to reduce a headache by the proper use of the designer...
By: forlano on Sun, 02 April 2006 13:43
|
 |
|
Re: "Forlano tabs" - how to reduce a headache by the proper use of the designer...
By: fudadmin on Sun, 02 April 2006 13:50
|
 |
|
Re: "Forlano tabs" - how to reduce a headache by the proper use of the designer...
By: forlano on Sun, 02 April 2006 14:11
|
 |
|
Re: "Forlano tabs" - how to reduce a headache by the proper use of the designer...
By: fudadmin on Sun, 02 April 2006 14:22
|
 |
|
Re: "Forlano tabs" - how to reduce a headache by the proper use of the designer...
By: fudadmin on Sun, 02 April 2006 15:19
|
 |
|
Re: "Forlano tabs" - how to reduce a headache by the proper use of the designer...
By: fudadmin on Sun, 02 April 2006 15:56
|
 |
|
Re: "Forlano tabs" - how to reduce a headache by the proper use of the designer...
By: forlano on Sun, 02 April 2006 18:51
|
 |
|
Re: "Forlano tabs" - how to reduce a headache by the proper use of the designer...
By: fudadmin on Sun, 02 April 2006 19:58
|
 |
|
Re: "Forlano tabs" - how to reduce a headache by the proper use of the designer...
By: mirek on Sun, 02 April 2006 20:25
|
 |
|
Re: "Forlano tabs" - how to reduce a headache by the proper use of the designer...
By: fudadmin on Sun, 02 April 2006 20:47
|
 |
|
Re: "Forlano tabs" - how to reduce a headache by the proper use of the designer...
By: forlano on Sun, 02 April 2006 20:46
|
 |
|
Re: "Forlano tabs" - how to reduce a headache by the proper use of the designer...
By: mirek on Sun, 02 April 2006 20:54
|
 |
|
Re: "Forlano tabs" - how to reduce a headache by the proper use of the designer...
By: forlano on Mon, 03 April 2006 00:17
|
 |
|
Re: "Forlano tabs" - how to reduce a headache by the proper use of the designer...
By: fudadmin on Mon, 03 April 2006 13:23
|
 |
|
Re: "Forlano tabs" - how to reduce a headache by the proper use of the designer...
By: forlano on Mon, 03 April 2006 13:29
|
 |
|
Re: "Forlano tabs" - how to reduce a headache by the proper use of the designer...
By: mirek on Mon, 03 April 2006 16:33
|
 |
|
Re: "Forlano tabs" - how to reduce a headache by the proper use of the designer...
By: fudadmin on Mon, 03 April 2006 16:37
|
 |
|
Re: "Forlano tabs" - how to reduce a headache by the proper use of the designer...
By: mirek on Mon, 03 April 2006 16:39
|
 |
|
Re: "Forlano tabs" - how to reduce a headache by the proper use of the designer...
By: forlano on Mon, 03 April 2006 13:26
|
 |
|
Re: "Forlano tabs" - how to reduce a headache by the proper use of the designer...
By: fudadmin on Mon, 03 April 2006 13:32
|
 |
|
Re: "Forlano tabs" - how to reduce a headache by the proper use of the designer...
By: fudadmin on Mon, 03 April 2006 13:45
|
 |
|
Re: "Forlano tabs" - how to reduce a headache by the proper use of the designer...
By: mirek on Mon, 03 April 2006 16:37
|
 |
|
Re: "Forlano tabs" - how to reduce a headache by the proper use of the designer...
By: fudadmin on Sun, 02 April 2006 18:54
|
 |
|
Re: "Forlano tabs" - how to reduce a headache by the proper use of the designer...
By: forlano on Sun, 02 April 2006 19:47
|
 |
|
Re: "Forlano tabs" - how to reduce a headache by the proper use of the designer...
By: fudadmin on Sun, 02 April 2006 20:00
|
 |
|
Re: "Forlano tabs" - how to reduce a headache by the proper use of the designer...
By: fudadmin on Sun, 02 April 2006 20:01
|
Goto Forum:
Current Time: Sat Apr 26 08:34:21 CEST 2025
Total time taken to generate the page: 0.00786 seconds
|