Drag item from treeviewer without the viewer getting focus - drag-and-drop

Question
Is there a way to prevent a treeviewer from gaining the focus when starting a drag-and-drop operation? Or do you know another way to prevent it from changing its selection on drag?
Situation
Category 1
Note 1.1
Category 2
Note 2.1
I have TreeViewer "categories" that show the categories and 1 TableViewer "notes" that shows the notes within the selected category. The "notes" view content is provided by the selection of the "categories" view through databinding.
Problem
When I have Category 1 selected in the "categories" view then I see Note 1.1 in the "notes" view.
The problem is that when I want to drag Category 2 onto Note 1.1 the "categories" view selects Category 2 and I cannot drop the category on Note 1.1 anymore because now the "notes" view shows only Note 2.1

I don't think you can stop the categories view from getting the focus and firing selection change when you want to start a drag. This just the natural behavior of the controls. There might be some unconventional ways to delay selection firing but they may not work perfectly.
However, to solve your problem I suggest configuring your drag-drop support such that when you start dragging "Category 2" (and consequently changing selection) you first have to hover over "Category 1" (which should re-select "Category 1") and it will allow you to drop "Category 2" on "Note 1.1".
This means that you also add drop support to your categories viewer and in the DropTargetListener#dragOver(DropTargetEvent) you set selection to the category the mouse is hovering over. This should start showing your correct note so that you can drop the dragged category over it.

Related

Custom Work Item Types don't show in any Board or Backlog?

We've created a new work item type called "Improvement", but found that it does not show in any board or backlog - only search. After some digging in settings, I found this:
Can you really not add new work item types and get them into your workflow along side the default types?
In this page, hover with the mouse on the work item level you want to include your custom item and click "Edit":
In the screen that opens you can add the custom work item.

How can I view the table/query linked to a form/table/list in Access?

How can I view the table/query linked to a form/table/list in Access? It's not displaying in the "Property" pane during the Design View.
This seems simple but it took me a while, and there seems to be only one way of doing it.
It's most likely being set in the code (i.e. the RowSource of the List gets set in a VBA module).
Go to Design View and go to View Code:
Open the form, right click on an "empty" part of it, select "Design View". Now click the "Design" tab at the very top, then click "View Code" which should be on the very right.
If it doesn't take you to the correct place, it might be a subform. So while inside the Design View, right click the object containing the data and select "Subform in New Window", and then from there go to the "View Code" view the "Design" tab.

Cocos2d and UIScrollView

I am developing an IPhone cocos2d app with a scene like the the one depicted in the following image (I hope you can see that):
On the right there is a vertically scrollable menu contained in a separated layer (menulayer) which is itself contained in the main scene's layer. On the left there is a back button contained in the main scene's layer.
I am trying to exploit the UIScrollView as described in this link. However, despite I can see the UIScrollView working I am experimenting some problems:
1) while the menulayer actually scrolls it seems the menu does not. In fact when a press the menu item 8 the menu item 4 is selected, when I press the menu item 7 the menu item 3 is selected and so on.
2) the back button only works when the menulayer is at its first position
Do you have any idea of how shall I do to fix it?
You need to check you selectors. calls selectors from proper controls. check it carefully.Your problem shows your menu item 8 th selector bind with 4th same for others. some mis binding of selectors is present in your code so check them properly.

How in Interface Builder can you select a rectangular group of items when they're on top of a background item?

I've had this problem several times now, and never found a satisfactory solution: If I want to move a group of items with a view all together in Interface Builder, and these items are all on top of a larger background item, I can't put a selection rectangle around the items in the view because any click and drag in the view initiates a move of the background item. In other words, every pixel in the area I'm interested in (and nearby) has a "hand" mouse pointer, no "arrow" pointer is available so I can't drag out a rectangle selection box.
cmd-clicking individual items to build up the group only works when they are separate, and only when there are a few of them. Sometimes I want to select a "pile" of items all on top of each other.
Is there some way to "select for moving" by clicking in the .xib item list? Double clicking a single item selects it for moving in the view, but I have't found a way to add to the "select for moving" selection this way.
So far the best way I've found is temporarily moving the background out of the way and then putting it back but this is unsatisfactory, and wouldn't work with a more complex background arrangement.
How have others done this?
I know what you mean, and I have found a slightly better solution: go to the list view and...
drag either the background view or your custom view up to the root hierarchy level (adjacent to File's Owner)
double click on your custom view and edit away using drag-box-selection
when finished, drag the view back into its original hierarchy position
The key here is that the GUI editor only edits one root object at a time, so moving the background vs. 'foreground' views into separate root objects allows you to edit them separately. Woo!
This is my solution to this problem: Select the background images/object that you don't want to move and set its width to 1 and then, after a comfortable layout editing, restore its original width. This works for me.
Use the left hand side list view and multi-select a range by clicking on the first item in the range then shift-click on the last item. Use ctrl-click to unselect some items if necessary. As items are selected they will also show as being selected in the interface view on the right.
Once have set up all the selected items, cmd-click on the selected items in the right hand side interface view and drag.
In the list of objects, cmd+click each one you want to select them all. In the interface hold command and click and drag the stack of items. Drag them to where you want them and release cmd. If you don't release the button they will rubber band back to their original position.

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.