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...
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 Go to previous messageGo to previous message
forlano is currently offline  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 Smile . 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 Very Happy . 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
 
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: Wed May 15 17:55:09 CEST 2024

Total time taken to generate the page: 0.01384 seconds