|
|
Home » Community » Newbie corner » "Enter" code
"Enter" code [message #37320] |
Sat, 22 September 2012 05:19 |
nlneilson
Messages: 644 Registered: January 2010 Location: U.S. California. Mojave &...
|
Contributor |
|
|
What code is equivalent to pressing the enter key?
With a tablet computer with the control by a mouse and there is no keypad how can the "Enter" action be included?
An example is using copy and paste into a text field.
Or editing data in a text field.
With a keyboard pressing "Enter" something can be done.
It may have been in a java app where a small box when clicked it was the same as pressing the "Enter" key.
In U++ how can this be done?
|
|
|
Re: "Enter" code (Solved) [message #37321 is a reply to message #37320] |
Sat, 22 September 2012 07:37 |
nlneilson
Messages: 644 Registered: January 2010 Location: U.S. California. Mojave &...
|
Contributor |
|
|
I recall partially how it was done before.
A small box at the end of the edit field when clicked would act as pressing the "Enter" key, like a button or whatever.
It would check the data in the edit field and if valid would process and display the data in decimal degrees, deg min or deg min sec and set the number of decimal places.
When I ported the java code to C++ with a U++ GUI the mouse click was not included. Now that it is being tested on tablets without a keyboard the code will be modified to work with a mouse click.
[Updated on: Sat, 22 September 2012 07:55] Report message to a moderator
|
|
|
|
Re: "Enter" code [message #37328 is a reply to message #37325] |
Sat, 22 September 2012 19:48 |
nlneilson
Messages: 644 Registered: January 2010 Location: U.S. California. Mojave &...
|
Contributor |
|
|
Hi Koldo
SysInfo is a good link.
But that is what info can be obtained.
What I was trying to find is something that was equivalent to pressing "Enter" but with a mouse click.
First I realized there must be something to click on.
A left click gives the EditField scope and places the cursor in the characters.
A right click brings up options.
Without getting into a center click something else needed to be clicked.
Then pressing "Enter" in U++ is:
if (key == K_RETURN && Point1.HasFocus()) {
Point1Action();
return true;
}
then the action:
void Point1Action() { // Point1 is an edit field
if (~Point1 != ""){
Ln = ~Point1;
Ln = parseLatLon(Ln);
So an EditField P1 for one character like < then
if (Mouse_LeftClick() && P1.HasFocus()) {
Point1Action();
return true;
}
I will try this and see if it will work.
It has been a few years since doing this and then it was in java
Thanks Koldo
[Updated on: Sat, 22 September 2012 20:07] Report message to a moderator
|
|
|
|
|
Re: "Enter" code (Solved and working OK) [message #37332 is a reply to message #37331] |
Sun, 23 September 2012 07:45 |
nlneilson
Messages: 644 Registered: January 2010 Location: U.S. California. Mojave &...
|
Contributor |
|
|
It depended on where the THISBACK was placed, just after menu.Set(THISBACK(MainMenu)); worked OK.
Also was able to call Point1Action directly.
menu.Set(THISBACK(MainMenu)); // Set the menu callback
P1 <<= THISBACK(Point1Action);
P2 <<= THISBACK(Point2Action);
edit: The only thing that was necessary was to:
create a button in dlg.lay
Button P1;
P1 <<= THISBACK(Point1Action)
[Updated on: Sun, 23 September 2012 08:25] Report message to a moderator
|
|
|
Goto Forum:
Current Time: Sat May 04 08:35:56 CEST 2024
Total time taken to generate the page: 0.03152 seconds
|
|
|