GWT:how to display a popup at the poistion of the key pressed - gwt

I am trying to display a word suggestion list when ctl+space entered as in eclipse.
For that I need to know the location where user has entered ctrl+space so that i can display the suggestion list exact below to the word user just entered.
I see ways to get the mouse cursor position , But isnt there a way to get the keyboard button pressed position ,
I am writing inside textArea, I tried getCursor, but it gives me the no of word on which user entered ctrl+space. Not the location as per the Window.
Any idea
thanks

There is no reliable, accurate and cross-browser way to do it with TextArea.
You can experiment with a RichTextArea (you don't have to provide a toolbar for rich text features) and its getFormatter().insertHTML() method. It will insert a new HTML element at a cursor position. You can insert a list of suggested words, that you can style to look anyway you like, or you can insert an empty div and try to show a panel relative to it.
Or you can use a different UI approach. Create a panel with a fixed position relative to your TextArea and show your suggested words there - similar to the way good smartphone keyboards show suggested words just above the keyboard itself. Once your users realize that suggested words always show up in the same place, they may even like this design better.

Related

how to show the entry completion popup as soon as the text field has focus in gtk+ 3.2?

I have a Gtk Entry that uses a Entry Completion object. I have set it up to an extent. If I enter the minimum key length number of characters the completion popup shows me available choices. So far so good.
Now what I want is that the text field should show the completion popup even it is empty, as soon as it has focus. Even if set the completion object's minimum key length to 0, the completion popup will not immediately appear as soon as the text field has focus. It will, however, appear if I enter something then delete it, leaving the text field empty.
My real goal is to select an item from a predefined list of choices, quickly, using the keyboard. What I did was to use a Gtk Entry attached to an Entry Completion Object which uses a List Store. Any alternatives are most welcome...
I am using gtkmm/Glade for doing my work. Please tell me if I need to add anything.
Thanks
If you just want to select from a list of predefined choices you'd probably be better using a combo box instead of a entry.

way to give tooltip in remedy

We can able to create lot of fields and forms using remedy developer. i just wanted to know whether any options for giving tooltip to those fields so that users can better understand over the respective field.
For eg: If there is a field say price, say tooltip like decimal values accepted or something reasonable.
Try to edit fields' "Alternate Text" attribute for a small tool tip.
If you want a bigger one like in overview console table etc., run AL log and see which AL opens it.
Hover option is available for ARS 7.6 or later, and here are some info for you from BMC docs:
Using the message action to create tooltips
Tooltips are brief informational messages that are displayed in response to a user action with an object on the screen. Tooltips are commonly used to provide descriptions of menu items, toolbar buttons, or other objects.
In AR System, tooltips can be applied to tables, attachments, field labels, or field data.
A tooltip can be displayed either by hovering the mouse over an area in a form or by clicking an object such as a button. For table fields, a tooltip can be displayed by hovering over a row. The tooltip displays the values for the row being hovered over, even if that row is not the currently selected row.
When a tooltip appears by hovering, it is closed when the mouse is moved outside the tooltip's border. When a tooltip appears by clicking (for example, when a tooltip appears when you click a button), it is closed when you click anywhere outside the tooltip's border.
A tooltip also can be dismissed by pressing the Escape key.
Tooltips can include URL links, which can be added through a Set Fields action.
Implementing tooltips
Tooltips are implemented through two types of AR System features:
HOVER event
Active link Message action

How to return the focus to a textInput in a browser

I need to focus a text input into the Facebook login popup. I am using a virtual keyboard to simulate a physical one, but when I click a key, the text input lose focus and the letter is not written into the field.
How could I maintain the focus in the text input?
I'm not sure if creating your own virtual keyboard is a smart idea since all mobiles already have one in there, you just need to set useSoftKeyboard in Flex.
Also, you can always remove focusability to your components by setting focusEnabled and hasFocusableChildren to false.
I finally came to another solution... Using getElementsByTagName('theElementID'), I could get a reference to the textInputs in the browser, and I could modify its attributes...
For example,
emailStringObject =this.html.htmlLoader.window.document.getElementById('email');
emailStringObject.value="example#correo.com"

Dynamic GWT Menu

How can I modify a GWT menu - grey out some entries, put a checkmark next to others, according to my application state?
My app has a menu bar across the top - File, Edit, View, Insert, Format, etc. I have a number of paragraphs, each of which could have a different format. When the user clicks on Format, I want the format menu to show a checkmark next to the menuItem that corresponds to the format of the currently selected paragraph. If some formats are inappropriate for the currently selected paragraph, I want to grey those menuItems out.
The main issue is when to do the update: (a) when the Format menu button is clicked, or (b) each time my user selects a new paragraph?
I find option (a) more appealing. But how can I detect this? A MenuItem doesn't have any facility for adding event listeners. It could be a mouseClick that I need, but it might be a mouseOver: if the user clicks on the Insert menuItem the Insert menu will appear, but then if the mouse is moved over Format, then the Format menu will appear.
Option (b) sounds simpler, but wastes more processor time.
For my contextMenu (right click on the paragraph), it's much easier, because the menu is only constructed when the right click happens.
I've resorted to using the square-root symbol (&#8730) for a tick. Does anyone know a nicer way? Do I need to use HTML and use " Plain-Format" for my menu item?
Finally, is there a way to disable (grey-out) a menu item so that it can't be selected?
Option (a) sounds better from a conserving resources point of view.
Instead of using the square-root symbol, why don't you use an image (using the com.google.gwt.user.client.ui.Image class)?
I think a more elegant/simple solution might be to use the checkbox class for your menu items. That way you could have automatic ticks/checks instead of having to use an image or the square-root symbol. Also, you will be able to "grey-out" items with setEnabled(false). Otherwise, you will have to write your own widget or add your own functionality to your menu labels in order to "grey-out" items.

MS Access 2003 - Simple value input into a text box from clicking label boxes

Ok so could anyone please help me out with the VB for auto entering information into a text box, by clicking certian label boxes on a form in access 2003.
I built this thing using label boxes as "sort of links" instead of button for navigation/commands etc, and I have this power point presentation viewer on one of the forms.
The client has numerous briefings and this will be great for me to provide a little something for them to be able to get their briefings from one spot.
So if I list the choices for the month out on the form as label boxes (with little mouse move events to resemble a web link) and they click on it to select, then the only way I know how this may become functional is if I add a text box to the form, and make it not visible, that way I can name it, and add it to the file path string and it works.
But how do I create the action of clicking the "link" result in "NVOWEFDJHF" into text box?
Anyone know a better way?
Yeah I am an amateur, so I am ALWAYS willing to learn a better way.
Thanks very much!
I would recommend using a transparent button instead of a label.
The main reason is that you can set the mouse cursor to become a small hand when you hover over the button, so it gives back information to the user that this can be clicked.
With a label, the user cannot make the difference between a normal label and one that can be clicked since there is no visual cue.
To create a button that resemble a label:
Add the button to the form
In the properties for the button, set the following:
Format > Back-Style: Transparent
Other > Cursor on Hover: Hyperlink Hand
Other > Name: btAutoFill (or whatever name you want)
If you want the button to resemble a link a bit more, you can change it's caption's format, making it blue and underlined if you wish.
Now if you view the form, you will see that the mouse cursor will change when you move over the 'button label'.
To automatically fill-in other controls when you click your button, add the code to handle its OnClick event (in the button's properties, under Events > On Click, choose [Event Procedure]):
Public Sub btAutoFill_Click()
myTextBox = "NVOWEFDJHF"
End Sub
Quick air code here...
Private Sub MyLabel_OnClick()
Me.MyTextBox = "NVOWEGDJHF"
End Sub
Don't forget your error handling.
You're making this as difficult as possible by using an approach that is not Access-native. The simplest way to make the labels "clickable" is to put a transparent command button over them. But that means the MouseMove events will go to the command button, so you'll have to have its events do the MouseOver actions.