O omoba Active Member Licensed User Longtime User Dec 2, 2012 #1 HI, Pls help. I want to copy text from an Edittext. Once I do the long_click, the keyboard comes up -normal thing. Well I dont want that. This is what I want when I do a long_click/press I dont want the keyboard to show. I want to copy text. I dont want user to be able to edit text (I have tried INPUT_TYPE = NONE --but then no copy option).
HI, Pls help. I want to copy text from an Edittext. Once I do the long_click, the keyboard comes up -normal thing. Well I dont want that. This is what I want when I do a long_click/press I dont want the keyboard to show. I want to copy text. I dont want user to be able to edit text (I have tried INPUT_TYPE = NONE --but then no copy option).
mc73 Well-Known Member Licensed User Longtime User Dec 2, 2012 #2 You can have a pseudo-editTextBox by using a label. Upvote 0
O omoba Active Member Licensed User Longtime User Dec 2, 2012 #3 Ok. I am putting the text in a label and cant copy paste. With edittext copy/paste popup is auto. But nothing when I long press label. I know I am not doing something. Pls, show some code or point me somewhere Thanks Upvote 0
Ok. I am putting the text in a label and cant copy paste. With edittext copy/paste popup is auto. But nothing when I long press label. I know I am not doing something. Pls, show some code or point me somewhere Thanks
mc73 Well-Known Member Licensed User Longtime User Dec 2, 2012 #4 You can use the label_longClick event subroutine, and there popup a inputList containing the actions you want the user to be able to perform. Code: Copy sub label_longclick dim ls as list, rst as int ls.initialize ls.addall(array as string("COPY","CUT","PASTE")) rst=inputList(ls,"Choose:",-1) select rst case 0 'copy case 1 'cut case 2 'paste case -1 return end select end sub Upvote 0
You can use the label_longClick event subroutine, and there popup a inputList containing the actions you want the user to be able to perform. Code: Copy sub label_longclick dim ls as list, rst as int ls.initialize ls.addall(array as string("COPY","CUT","PASTE")) rst=inputList(ls,"Choose:",-1) select rst case 0 'copy case 1 'cut case 2 'paste case -1 return end select end sub
O omoba Active Member Licensed User Longtime User Dec 2, 2012 #5 No luck. Pls look at attached file. Attachments sample.bal sample.bal 2.8 KB · Views: 253 Last edited: Dec 2, 2012 Upvote 0
mc73 Well-Known Member Licensed User Longtime User Dec 2, 2012 #6 I've looked at it. It's a designer's file, not the actual code. Anyway, the code I posted works. If you need help with your coding, you can always upload it here, 'file->export as zip', I am sure there are many member of this forum, willing to help. Upvote 0
I've looked at it. It's a designer's file, not the actual code. Anyway, the code I posted works. If you need help with your coding, you can always upload it here, 'file->export as zip', I am sure there are many member of this forum, willing to help.
O omoba Active Member Licensed User Longtime User Dec 3, 2012 #7 Well the popup (COPY CUT PASTE) does come up. I choose copy then I dont what to do. Nothing is copying, nothing paste. Pls how do you copy from a label using long click? I guess I am nothing thinking straight Thanks :sign0163: Upvote 0
Well the popup (COPY CUT PASTE) does come up. I choose copy then I dont what to do. Nothing is copying, nothing paste. Pls how do you copy from a label using long click? I guess I am nothing thinking straight Thanks :sign0163:
klaus Expert Licensed User Longtime User Dec 3, 2012 #8 Sorry but I don't understand what exactly you want to do. Where does the text come from ? What is the user supposed to do ? Where will the text be copied. Best regards. Upvote 0
Sorry but I don't understand what exactly you want to do. Where does the text come from ? What is the user supposed to do ? Where will the text be copied. Best regards.
O omoba Active Member Licensed User Longtime User Dec 3, 2012 #9 When the app is opened, a text file is loaded to a edittext box. The user can then copy any word from the text in the edittext box. The user can then paste the copied word/s to another edittext box within the app. I have this working fine BUT I don’t want the droid keyboard to come up and I don’t want the user to have access to edit the loaded text. It was suggested that I use a label box; which I tried but I don’t know how to make it work. Thanks Upvote 0
When the app is opened, a text file is loaded to a edittext box. The user can then copy any word from the text in the edittext box. The user can then paste the copied word/s to another edittext box within the app. I have this working fine BUT I don’t want the droid keyboard to come up and I don’t want the user to have access to edit the loaded text. It was suggested that I use a label box; which I tried but I don’t know how to make it work. Thanks
klaus Expert Licensed User Longtime User Dec 3, 2012 #10 Sorry, but I haven't found a way to avoid the keyboard being displayed after having clicked on Select Text in the popup menu. I don't think you could do it with a Label. Best regards. Upvote 0
Sorry, but I haven't found a way to avoid the keyboard being displayed after having clicked on Select Text in the popup menu. I don't think you could do it with a Label. Best regards.
mc73 Well-Known Member Licensed User Longtime User Dec 3, 2012 #11 so user has to have the ability to partially select words? cool. split words and place them in different labels. user clicks the label -> grab the word -> place it at the element you want. Upvote 0
so user has to have the ability to partially select words? cool. split words and place them in different labels. user clicks the label -> grab the word -> place it at the element you want.
O omoba Active Member Licensed User Longtime User Dec 6, 2012 #12 Thanks , What about preventing the user editing the text in the edittext box Upvote 0
klaus Expert Licensed User Longtime User Dec 7, 2012 #13 Does this code do what you expect ? Code: Copy Sub Globals Dim EditText1, EditText2 As EditText Dim Obj1 As Reflector Dim IME1 As IME End Sub Sub Activity_Create(FirstTime As Boolean) Activity.LoadLayout("main") Obj1.Target = EditText1 EditText1.Tag = "EditText1" Obj1.SetOnLongClickListener("EditText1_LongClick") IME1.Initialize("") End Sub Sub EditText1_LongClick(viewtag As Object) As Boolean IME1.HideKeyboard Return False End Sub Sub EditText1_TextChanged (Old As String, New As String) EditText1.Text = Old End Sub Needs the Reflection and IME libraies. Best regards. Attachments TextCopyPaste.zip TextCopyPaste.zip 6.9 KB · Views: 295 Last edited: Dec 7, 2012 Upvote 0
Does this code do what you expect ? Code: Copy Sub Globals Dim EditText1, EditText2 As EditText Dim Obj1 As Reflector Dim IME1 As IME End Sub Sub Activity_Create(FirstTime As Boolean) Activity.LoadLayout("main") Obj1.Target = EditText1 EditText1.Tag = "EditText1" Obj1.SetOnLongClickListener("EditText1_LongClick") IME1.Initialize("") End Sub Sub EditText1_LongClick(viewtag As Object) As Boolean IME1.HideKeyboard Return False End Sub Sub EditText1_TextChanged (Old As String, New As String) EditText1.Text = Old End Sub Needs the Reflection and IME libraies. Best regards.