I have an editor which is comprised of a table and a set of selection-specific form fields below it, so that when I make a selection in the table, the fields below it will change. When the editor is sized too small, the fields container gets a scrollbar:
The problem is that when I make a selection in the table, I can't scroll the fields container down (with the mouse wheel) because the focus is still within the table. Currently I have to select one of the fields to be able to scroll its container or manually drag the scrollbar itself, but it's much easier to just click or hover anywhere in the target container to focus it for mouse wheel scrolling.
How can I make the composite body (in my case, a Form) selectable? Or even better, is there a way to control scrolling depending on where the mouse cursor is?
If you want to control scrolling based on where the mouse cursor is located, you're going to have to write a combination org.eclipse.swt.events.MouseMoveListener and org.eclipse.swt.events.MouseWheelListener.
Component method setFocus() brings the component into keyboard focus.
I've not tried to do this. Be sure to handle the case where the user does not have a scroll wheel on their mouse.
Related
I have two panels in unity 2d directly overlapping each other and they use scroll panels so I can scroll down. I have it set so when one is accessed, the other is pulled up, but when they swap the other panel is grey and I cannot interact with it, but when I attempt to scroll the other panel scrolls instead, even though it is hidden and turned off.
I suspect that this is a bug in the code. It's possible, that when the user presses the scroll button in the first panel, and then releases the button, the second panel's scroll button thinks, it's already been pressed by the user, when in fact it isn't.
Set it up in such a way, that when you release the button on a scrollbar (the first scroll bar), it resets the click on the scrollbars connected to it (a second scroll bar).
I want to have this component's size to only encapsulate the info button not the whole area. Is there a way to have a component have different sizes depending on components state.
Right now when i hover over that entire green area it changes to hover state, i want it to only activate when the "i" is hovered
If you choose the component state and go to the left menu you can hide layer you dont want
I know this is an old post but hopefully this helps someone. This same problem was driving me insane! But there is a simple solution:
Rather than using the default "Hover State" in the component create a "New State" which will function as your hover state and name it whatever you like and design the default and new states. Then, go to the Prototype tab, select the icon you want to trigger the hover animation, then add a new Interaction on the right panel. Set the Trigger to Hover, and the Destination to your new state. Works perfectly, and now you will only trigger the hover animation when hover over your icon rather than the entire component area.
I have some nodes in the content of a scrollPane.
With nodes mouse pressing , a popup is shown and is positioned in the required X and Y.
Well , when scrolling , the popup is always fixed , as it is positioned according to the scene.
Is it possible to show the popup inside the scrollPane , so when scrolling , the popup scrolls too .
Yes, it is possible for the pop-up location to track the scroll position of the scroll pane. I am not going to write the code for that here.
One consideration you will have is what to do with the pop-up if the user scrolls such that the pop-up ends up outside the visible region of the scroll pane (I'm guessing the pop-up would then be hidden and cease tracking the scroll pane location).
Do consider your design and decide if you really need a pop-up or not, or if you can just place a node in the group that maintains the content for the scroll pane. Because, if you did that rather than using a pop-up, then the scroll pane would automatically scroll the node in the group as it scrolled around the group.
I wish to make a drag and select application in GWT where I wish to have cell table or grid of say 20*100 columns*rows. I want to add a event such that I can drag something like a rectangle with my mouse and all the cells in that region get selected or I can fire an event for each cell and assign each of them a same ID. The main idea behind the thing is to perform a selection by dragging and then grouping all selected cells as one, something like Excel sheet selection. Can any one help me out in this?
I have once implemented GWT widget allowing to "select" some rectangular region of a table. Basically the idea was to subclass a Grid or FlexTable and do all the logic in various mouse event handlers (mouse down, mouse up, mouse out, mouse over).
The only minor hack I had to introduce was a method for getting the cell for any mouse event. There is a method HTMLTable#getCellForEvent that works for a click event, but when I looked into implementation of this method, I saw that it could actually work for any event, so I just implemented my own method for getting cell for any mouse event based on mentioned implementation.
Maybe it would be also possible to achieve this using HTMLTable#getEventTargetCell
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 (√) 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.