send.tag and keyboard

stilltheone

Member
Licensed User
Longtime User
I have quite a bit of experience in VB.
I am currently trying out the trial version of B4A.

Simple routine to put numbers in a textbox.
If I set the textbox to numbers or decimal a keypad pops up but it does not have a decimal point and some chinese stuff. I could not get it to not pop up??

I created my own keypad but I had to trap for numeric entry.
It worked fine until I used the hard keyboard in the virtual device.
This put the character at the begining of the text box entry instead of at the end????

To try to clean it up a bit I noticed the send.tag example.
Could not get it to work?? Is it not supported in the trial version?

Its a simple example. I have done it in VB but I am baffled in B4A.

Would like to learn it and purchase it. My only concern so far is documentation is a bit light and a few oddities (compared to VB) have popped up.
 

stilltheone

Member
Licensed User
Longtime User
Thanks for the quick response.
I read this and my test is from this.
After re-reading it I think I missed a key setting.
I will do the example fully and work backward from there.

The examples are good in that they tell you what settings to use, but they are a bit week sometimes on why a setting is used.

Thanks,
 
Upvote 0

nfordbscndrd

Well-Known Member
Licensed User
Longtime User
I created my own keypad but I had to trap for numeric entry.
It worked fine until I used the hard keyboard in the virtual device.
This put the character at the begining of the text box entry instead of at the end????

I've just uploaded code for a 2nd sample app with routines for use with custom keyboards. One of the features is right-justification, so numbers start on the right instead of the left side of the TextEdit.
 
Upvote 0

stilltheone

Member
Licensed User
Longtime User
On page 35 of the Beginers Guide.
Set parent to pnlKeyboard
"The button now belongs to the panel"
I assume now that the parent is where the tag property comes from.
This is much more straight forward in VB.
Not that one is better than the other, just different.
Keep in mind I am only about 4 hours into learning this.
I am finding it a bit difficult to find an answer to a question because I am used to VB terminology and it does not always produce a good search result.
Took me forever to find SelectionStart.
This solved my problem with the cursor jumping to the start of the field when I used my keys. This was a problem because if the device kbd was used next the charachter went at the start of the text not the end. Works now.

Thanks Klaus,
 
Last edited:
Upvote 0

klaus

Expert
Licensed User
Longtime User
On page 35 of the Beginers Guide.
Set parent to pnlKeyboard
"The button now belongs to the panel"
I assume now that the parent is where the tag property comes from.
In this case the parent object of the 'OK' button is changed from Activity to pnlKeyboard.
This has nothing to do with the Tag property, which can be any variable or object.
In VB the Tag property is also independant from the parent property.

Best regards.
 
Upvote 0

stilltheone

Member
Licensed User
Longtime User
Ok, I guess I do not understand it.

In VB When you copy an object it asks if you want it as an control array or not. If you make the objects an array they all have a shared name and a unique index. object_name.index = number.... I understand this.

In the b4a example:
All the buttons have there own name and subs
send_key=sender is in the panel_click sub not in the button_click sub and so is the reading of send_key.tag

With your help and the tutorial it is working but my objective is to understand it and I am not there yet.

What makes this a control array?
or is it not an array at all and any other objects would need tags that were not already used?

Thanks,
 
Upvote 0

klaus

Expert
Licensed User
Longtime User
In the b4a example:
All the buttons have there own name and subs
In the example in the Beginner's Guide, all buttons have their own name but all have the same event name 'btnEvent'.

send_key=sender is in the panel_click sub not in the button_click sub and so is the reading of send_key.tag
The send = Sender statement is not in the panel_click sub but in the btnEvent_Click sub, the event sub of the buttons !

When several views share the same event name, then in the event routine the names of these views are no more known by B4A. To know what view has raised the event we must use the Tag property. Erel or agraham could perhaps explain why.

Object arrays like in VB are not supported in B4A.

Best regards.
 
Upvote 0

stilltheone

Member
Licensed User
Longtime User
Thanks,

I made the changes, it works, and understand the terminology now.
Altough it did work the way I had it, it should not have!!

Thanks for the help. My programming background is self taught tinkerer.
I am actually a CNC Machine programmer by trade.
I appreciate you taking the time to help.
 
Upvote 0
Top