FORUMS PROFESSIONNELS
WINDEV
,
WEBDEV
et
WINDEV Mobile
Accueil
|
Messages récents
|
Connexion
|
Déconnexion
|
Français
Accueil
→
WINDEV Mobile 2024
→
iOS: How to select all text in a field
iOS: How to select all text in a field
Débuté par Thomas, 07 jan. 2015 12:44 - 3 réponses
Connectez-vous…
Thomas
#1
Membre enregistré
4 messages
Popularité : +1 (1 vote)
Posté le 07 janvier 2015 - 12:44
I have a GUI which is loaded (with OpenChild) when the user taps on a field on the previous screen (enter field event). On the second GUI there is just one text field visible where the user can enter the quantity for an article.
At the moment if the user needs to change the existing value, he needs to clear first the value and enters the new one using the displayed numerical keyboard.
I would to optimize this. I already tried to set the flags on the text field
--automatic erase
-- with selection in read only
But none of them worked.
Is it somehow possible to call native ObjC code to select all text of that field?
Signaler
0
0
Fabrice Harari
#2
Posté le 07 janvier 2015 - 13:34
Hi Thomas
did you try to play with the ..cursor and ..cursorEnd properties ?
Normally, by setting them to 0 and 1000 in the entry code of the field,
you should have the whole thing selected
Best regards
--
Fabrice Harari
International WinDev, WebDev and WinDev mobile Consulting
NEW: WXReplication, your open source replication system is available on
my web site!!!
WXShowroom.com: Show your projects!
More information on
http://www.fabriceharari.com
On 1/7/2015 6:44 AM, Thomas wrote:
I have a GUI which is loaded (with OpenChild) when the user taps on a
field on the previous screen (enter field event). On the second GUI
there is just one text field visible where the user can enter the
quantity for an article.
At the moment if the user needs to change the existing value, he needs
to clear first the value and enters the new one using the displayed
numerical keyboard.
I would to optimize this. I already tried to set the flags on the text
field
--automatic erase
-- with selection in read only
But none of them worked.
Is it somehow possible to call native ObjC code to select all text of
that field?
Signaler
0
0
Thomas
#3
Membre enregistré
4 messages
Popularité : +1 (1 vote)
Posté le 07 janvier 2015 - 14:08
Hi Fabrice
thanks for the hint, but in Version 19 the property Cursor... CursorEnd... is not allowed for iOS.
Maybe this comes with Version 20, when it is available in English too.
In the meanwhile I will use this native iOS solution:
In entry of Field call
selectText(Handle(EDT_EnterText))
which is implemented as ObjC function
#import <UIKit/UIKit.h>
void selectText(void* currentView)
{
UIView *tmpView = (UIView*) currentView;
UITextField *iTextField;
for (id object in [tmpView subviews] ) {
if ( [NSStringFromClass([object class]) isEqualToString: @"CIOSCustomTextField"]) {
iTextField = object;
}
}
[iTextField selectAll:nil];
}
Regards
Thomas
Signaler
1
0
adrianoboller
#4
Membre enregistré
3 655 messages
Popularité : +175 (223 votes)
Posté le 10 janvier 2015 - 16:41
Signaler
0
0
→ Revenir à WINDEV Mobile 2024
WINDEV 2024
WEBDEV 2024
WINDEV Mobile 2024
WINDEV (précédentes versions)
Français
English
Español
Portuguesa
Fermer cette fenêtre
Type de recherche
Uniquement les sujets
Tous les messages
Période de recherche
Date indifférente
Moins d'une heure
Moins de 24 heures
Moins d'une semaine
Moins d'un mois
Moins d'un an
Annuler
Aperçu de votre message
Ajouter une image
Importer une image depuis une URL
Envoyer une image depuis un fichier de votre disque
Déposez ici un fichier ou cliquez sur "Parcourir..."
ou
Annuler
0%
WLangage
SQL
XML, HTML
JAVA, Javascript
Texte