I have an Oracle form, which when starts has the following activated field.
1. 2 text Item + 2 push button working as LOV button
2. One Button (cancel)
Now for simplicity lets call the text time as text_1 , text_2
Now user has an option to enter any value in text_1 and either press TAB to move to next text item or use mouse pointer to move the cursor to text_2 item OR can press cancel button.
I want to know if the user has pressed TAB or used mouse to press cancel button. Please let me know in case the question is not clear to you.
if user presses tab key, forms generate KEY-NEXT-ITEM trigger. You can type your code there and manage this event. If users presses a button, forms generates WHEN-BUTTON-PRESSED.
Is this right answer to your question? If not, provide a use case, how will programm work from user point of view.
if user presses tab key, forms generate KEY-NEXT-ITEM trigger and post-text-item trigger. Again if user move the cursor using mouse then it only generate post-text-item trigger. If any text item has to fire two trigger then key-next-item fires first.
You can also get triggered item using :SYSTEM.TRIGGER_ITEM.
Thanks
Shamim Ahmed.
Related
I want to implement my own sequence for changing the focus of the active child widget using the Tab key. How to capture the Tab Key press event? I am using Qt5.2
If you want to change focus with Tab , you don't need to do those works, Qt has it as a feature.
First: set the desired widgets to be Qt::TabFocus or Qt::StrongFocus by QWidget::setFocusPolicy( Qt::FocusPolicy policy )
For example, if you want to rotate between 3 QLineEdit and 1 QCombobox, you have to assure that their focus policy have been set right. (Normally either Qt::TabFocus or Qt::StrongFocus will be set as default, but sometimes you might want to escape some widgets from being tabbed)
Second: go to designer mode and click "Edit Tab Order" to enter the tab-order editing mode
Third: After seeing the numbers, click on them until you got the desired sequence order.
(Picture from Qt official site)
Have a mouse press event or a event filter, get to the point where you have a QKeyEvent
Then only do something if tab was pressed
key_event->button() == Qt::Key_Tab
I'm using Oracle Forms Builder. I have a button which has a pop-up menu attached to it. I need to retrieve the name of that button into a text_item after the user right clicks on it and selects one of the pop-up option.
Use :SYSTEM.TRIGGER_ITEM.
........
If you need the name of the button clicked inside a trigger like when-button-pressed, then you can use the system parameter :system.trigger_item this will give you the item that fired the trigger. So if you use that in the when-button-pressed trigger you will get the item that pressed the button.
If you start another application instead of just a popup or so and you need the item in that application then you can set a global or create a parameterlist with the itemname and then you can refer to that in the application you just started.
I have added three text box with three Buttons, I want that when enter first text box, event fire of first button as well as when enter on second text box, event fire of second button as on..
But facing the problem that this all in user control, and when enter in first text box, event fire of first button, and when enter second or third text box also event fired of first button.
I have added java script and Jquery function on key-press event of textbox(key == 13) But these functions not making check in user control.
You can user jquery change method or focusin
$('#firsttxtbox').change(function() {
alert('First textbox's text changed');
});
I am on screen 1. There is a button called "Register Now" is there on the screen. If I press any key, the button is not gaining focus. So i can not able to press the button using the keys to go to the subsequent pages. is there any way to select the button by any other way?
Also please let me know that is there any way to swipe through the images on the screen..
Regards,
Chandra
In GUI dialogs, most applications provide for keyboard control as follows:
Enter key - presses the default button. (Default is usually indicated with a bold button border.)
Esc key - presses the Cancel or close button.
Space key - presses widget that currently has keyboard focus.
Tab key - advances focus to next widget.
Question is, when keyboard focus is on a widget that is a button, should the default button be changed to be the one with focus?
I see some issues with this behavior:
The display noise of redrawing buttons to unbold the outline of original default button and rebold the button under focus as being new default.
The Space key is now somewhat redundant with Enter key.
There is no keyboard accelerator to get the normal default button now (Usually the OK button).
However, it seems the trend has been in this direction to change the default button with focus change to another button. What is the rationale for this departure from the early GUIs? It would seem to provide less functionality given there is no way to press the original default button. Did people find that the original model was too complicated for users to understand? I would think keyboard control of dialogs would be a task for advanced users who would have no trouble understanding the model and prefer to have accelerator for current button (Space) and original default button (Enter) at all times.
Note that Qt for one is supporting the change: QPushButton's autoDefault property is responsible for the behavior of changing the default button. By default its value is true. Therefore, you must take extra action to set it to false for all buttons, to prevent them from becoming the default button when focused.
This is not a "departure from the early GUIs", at least not if by "early GUIs", you mean Windows 1.0. The behavior that you describe has been this way since the beginning.
The focused button is always "pushed" when the Enter key is pressed. The default button is only triggered in the following two situations:
The default button has the focus (which it does by default), or
The focus is on a control that does not process Enter key presses (such as a static control, or a single-line textbox that does not have the ES_WANTRETURN style flag set).
The famous Win32 blogger Raymond Chen has a post explaining this behavior (focus specifically on the last two quoted paragraphs):
A dialog box maintains the concept of a "default button" (which is always a pushbutton). The default button is typically drawn with a distinctive look (a heavy outline or a different color) and indicates what action the dialog box will take when you hit Enter. Note that this is not the same as the control that has the focus.
For example, open the Run dialog from the Start menu. Observe that the OK button is the default button; it has a different look from the other buttons. But focus is on the edit control. Your typing goes to the edit control, until you hit Enter; the Enter activates the default button, which is OK.
As you tab through the dialog, observe what happens to the default button. When the dialog box moves focus to a pushbutton, that pushbutton becomes the new default button. But when the dialog box moves focus to something that isn't a pushbutton at all, the OK button resumes its position as the default button.
The dialog manager remebers which control was the default button when the dialog was initially created, and when it moves focus to something that isn't a button, it restores that original button as the default button.
The behavior that I would expect is:
If I press enter when the window just pop up, it should press the default button
If I press tab, I start navigating through the widgets. In this case there are two options:
2.1 I press enter - this event should be delivered to the focused widget. There's no need to change the default button - simply hand the event to the focused widget.
2.2 I press escape. In this case, everything should go back to the state after the window is created.
Notes:
I come from a mixed background - I don't know if I learned this in windows, linux or Mobile OSes! This is just how I expect things to work out.
I don't use the space key (didn't know it's functionality)