unable to add a text field in cocos2d - cocos2d-iphone

i am developing a game using cocos2d framework. I want to add a text field to enter player's name. I used UITextField and the textfield is visible and the keyboard gets pop up. But my problem is the Return key is not working. I tried out many times but all in vain. please help me out, or is there any other way to add a text field in cocos2d. Thanx in advance.

Make sure that you implement all needed delegate methods for your text field. For example,
- (BOOL)textFieldShouldReturn:(UITextField *)textField
method.

did you use resignfirstresponder ? for returning keyboard just add the code as
[textfield resignFirstResponder];
also add this line of code on place where you want to return the keyboard such as on cctouchbegin or on click of any button. Hope this will work.

Related

How to Change django-autocomplete-light input box styling?

I have gotten the autocomplete to work with my Database and my front end, but the input widget looks slightly off.
Is there a way to change the styling for the input?
Also, is there a way to remove the initial dropdown, so after you click once, you can start typing and suggestions will appear? I am using the ListSelect2 Widget. The Select2Multiple looks like more of what I need but I want input to be only one.
Current Widget Pre-Input
Current Widget During Input
Current Widget After Selection
Desired Look (Select2Multiple Widget)
I would appreciate any suggestions!

Add some text to a QToolBar

I am having trouble adding some text in a QToolBar. I can only add Actions. Also I have two actions with their rerspectives icons in my QToolBar but I want to separate them and I canĀ“t either.
My newbie approach was to add empty actions to simulate blank spaces between the icons. But the user can click on the blank spaces.
I am using the Design function of QT Creator. Some help would be really apreciated.
It looks like you can't do it from within Designer:
https://bugreports.qt.io/browse/QTBUG-1267
That's an oooold suggestion, too, with a low priority to boot, so it probably won't get fixed any time soon.
You can get your hands dirty and do it in code, however.

Adding items to tableView QT

i need i little help here. I'm creating a application through QtCreator (C++). It's basically a single view application that the user input two line edits, click return than the data from both fields goes to a table view. Here is my problem, i have no idea how to make it work (show the data typed and update the tableView every time the user presses return, i never used tableView before (QT)). I'm not even using database, it's not necessary. And i'm saving the data in a struct.
Any help?
Sorry about my english, thanks in advance!!!!!

C++ Windows Forms - Password Strength

I've been following YouTube tutorials most of the day now and I think I've got the basic hang of forms. I'm aiming to create something like this below, which checks a users password and shows how strong it is:
This is what I have at the moment:
I'd like to know the basic theory behind how the top form works, specifically how I can take the user input of password in my form and just get it to print and update in realtime underneath below. I'm not quite sure what tool is used to do that, or for that matter what tool is used to create the colour changing box.
Any help or direction is appreciated, thanks!
Add a keyboardListener to your jtextfield. When a key is pressed get the text and do your stuff(figure out the strength, number of Uppercase etc)
Is this win32 or mfc forms, or some other tech like Qt or wxWidgets?
In both cases you will want to handle messages from the edit field as text is changed in it. This message is the EN_CHANGE message. Handle that message and you can get the text from the edit field and send messages to the strength form to tell it to change its color and text.
Add a System::Windows::Forms::KeyPressEventHandler (or similar) to the TextBox. When raised, do whatever analysis you need to do on the string and update the table below. The color changing box can be one of many implementations. It can be something as simple as a panel that changes its background with a System::Windows::Forms::Label positioned on top of it. It actually looks like that, as the text is not centered.

Save the current position/order in a QTabWidget when a button is clicked - User Settings

Is it possible to save the current tab position/order in a QTabWidget in Qt?
What I want is basically to be able to let the users arrange the tabs as they like and then let them save the position so when they open the application again the tabs are where they were when last saved.
In the past I have done this put this only saves the window geometry.
QSettings mySettings("someName", "MyApp");
mySettings.beginGroup("MainWindow");
mySettings.setValue("geometry", saveGeometry());
mySettings.endGroup()
;
Any idea how or where can I find the information to get this done?
Thanks
Apparently there is no built-in way to do it, so you need to implement it. I don't see any possible troubles with it.
For example, you may obtain the index of each widget using QTabWidget::indexOf, or you may iterate over all tabs and obtain widgets using QTabWidget::widget, depending on which way is more convenient in your app.
When starting the app, sort your widgets by saved index and add them to the tab widget in that order.