|
|
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...
Re: "Forlano tabs" - how to reduce a headache by the proper use of the designer... [message #2176 is a reply to message #2173] |
Mon, 03 April 2006 00:17 |
|
forlano
Messages: 1185 Registered: March 2006 Location: Italy
|
Senior Contributor |
|
|
luzr wrote on Sun, 02 April 2006 20:54 |
forlano wrote on Sun, 02 April 2006 14:46 |
I've no idea about how to fill the drop list, and how to add a checkbox inside the arrayctrl. [snip]
|
DropList dl;
ArrayCtrl ar;
....
dl.Add(1, "First item");
dl.Add("Second", "Second item");
ar.AddColumn("Check").Ctrls<Option>();
Mirek
|
Thank you Mirek,
I've not resisted to the temptetion to write the code before to go to sleep... even because I was afraid that Fudadmin (by the way... which is your human name?) could anticipate me once more . With my surprise I was able to perform everything in not more than 10 minutes! (two day ago I wont bet a cent). Here is the new class Tab1 code with Add and Clear button activated:
class Tab1 : public WithTab1Layout<TopWindow> {
public:
typedef Tab1 CLASSNAME;
Tab1();
void AddPlayer(); //callback from Add_Player button
void MaskDefaultValue(); //callback from Clera button
};
Tab1::Tab1()
{
CtrlLayout(*this, "");
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").Ctrls<Option>();
// how to set ON the checkbox?
//drop list widget
editTitle.Add(1, "First");
editTitle.Add(2, "Second");
editTitle.Add(3, "Third");
//set the callback for the Add_Player button
btnAdd <<= THISBACK(AddPlayer);
btnClear <<= THISBACK(MaskDefaultValue);
//fill with default value
MaskDefaultValue();
}
void Tab1::AddPlayer() // body of the callback
{
if ( (~editName) == Null) {
PromptOK("The Name field cannot be empty!");
return;
}
arr.Add(~editName, ~editCountry, ~editBirth, ~tsex, ~editTitle,
~editFIDEId, ~editFIDERat, ~editNatId, ~editNatRat, ~kcoeff);
arr.GoEnd();
// editName <<= editCountry <<= editBirth <<= tsex <<= editTitle <<= editFIDEId <<=
// editFIDERat <<= editNatId <<= editNatRat <<=kcoeff <<= Null;
ActiveFocus(editName);
MaskDefaultValue();
}
void Tab1::MaskDefaultValue() // body of the callback
{
editName <<= Null;
editCountry <<= "--";
editBirth <<= "00.00.00";
tsex <<= 1;
editTitle <<= "GM";
editFIDEId <<= editFIDERat <<= editNatId <<= editNatRat <<= 0;
kcoeff <<= 30;
ActiveFocus(editName);
}
Now arise some questions that regards the details (the details make the difference as everybody knows):
1. I desire my user do not enter more than 25 character in the editName widget. It is not enough that a pink colour appear. I desire that the widget refuse to write any character further the 25th. Is there such limitation?
2. I desire that the lenght of the arrayCtrl in corrispondence, for example, of field Name be 25 character long. The user can tune it manually but I prefer to set it initially to some lenght. How to do it?
3. The check box appear in the array but it is not set to ON (checked) but it is unchecked. How to set it to ON?
4. I desire that the even numbered line of the array be colored, say light blue (I love this feature. By the way, in the past this feature attracted my attention toward Ultimate++)
Now I can go to sleep very . Today was a great day!
The next step is to click on the array, retrieve the data of the row, and sent them in the above mask for some modification.
Good night,
Luigi
|
|
|
|
|
"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: Wed May 15 17:55:09 CEST 2024
Total time taken to generate the page: 0.01384 seconds
|
|
|