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 » 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 Go to previous message
fudadmin is currently offline  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

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: How to combine two widget-class in the topwindow
Next Topic: Getting data in a row of ArrCtrl
Goto Forum:
  


Current Time: Mon Apr 29 06:12:19 CEST 2024

Total time taken to generate the page: 0.03779 seconds