What's the best way to show "focus" in a grid? - grid

I'm drawing a standard grid view with rows and columns, but I want to do something unique and interesting to mark the focused or selected cell. Any ideas? The dotted-line rectangle is out. :)

Allow me to through an idea - hook the onfocus/onclick client events of the gridview cells and apply your css classes or some kind of jQuery animation when those events are raised.

Related

Highlight item with mouse hover in QTreeView?

I have a QStandardItemModel that I am displaying as a QTreeView with multiple columns. How can I make it highlight rows when the mouse hovers over them?
Related pages
How to catch mouse over event of QTableWidget item in pyqt?:
similar question using QTableWidget instead of Q*View.
Customizing QListView: suggests it is possible to do it very
easily with stylesheets, but I don't quite follow the c++.
How to highlight the entire row on mouse hover in QTableWidget
QListView selection with highlight/hover
You can achieve this by a stylesheet
treeView->setStyleSheet("QTreeView::item:hover{background-color:#FFFF00;}");
Lahiru's answer is easy to translate to PyQt/PySide, as the input to setStyleSheet doesn't need any modification: it is the same in Qt/PyQt/PySide:
treeView.setStyleSheet("QTreeView::item:hover{background-color:#999966;}")
I found it helpful to read the Overview of style sheet syntax for Qt. Also, this answer has some nice examples on using style sheets in PySide/PyQt.

Adding two buttons next to an ExtJS ComboBox

I need to place an Add button and a Remove button next to an ExtJS ComboBox. It's critical for these three elements to be in a single line because I have to apply this to all other ComboBoxes in the fieldset too.
Please notice that the given ComboBoxes are items of a fieldset. Replacing the buttons with context menu items is not the desired solution.
Can you give me some ideas? Thanks in advance.
For this, you can place all the three elements - combobox and the two buttons - in a container with layout hbox. This will place all of them in the same line.
Hope this helps.
Ext.form.FieldContainer is the class you need.
It has a label and will layout nicely with your form, but can contain multiple fields and controls.

adobe flex datagrid selectable columns

I'm trying to make a Flex (Advanced)DataGrid component with some mechanism where the user can toggle the visibility of the columns. I've crudely implemented this by reading in the columns into the right-click menu, and when a column name is selected here, the visibility is toggled. It works, but it's not the most elegant solution.
Specifically, I'm trying to emulate the "datagrid" that Mozilla Thunderbird uses to display emails. Here is an image:
In the upper right, there is an icon over the scroll bar. If there is no scrollbar, the icon remains in the same place. When clicking the icon, it opens up a menu that shows all the possible columns, with the visible ones having a check mark next to them, like this:
Also, the scroll bar always appears under this button, never "pushing" it over into it's own column.
I'd like to re-create this in Flex. I believe the menu part and creating a column with a button headerRenderer is easy enough. But I can't figure out how (if at all possible) to do this with the scrollbar, because the scrollbar always seems to be "its own column". Any ideas or help would be appreciated. Thank you.
Ian
One dirty solution comes to mind. Create a component based on Canvas, then add an AdvancedDataGrid by overriding createChildren. Override updateDisplayList as well and add a button like the one in Thunderbird to the upper right of the Canvas. This will cause the button to appear over the DataGrid. Problemo solved?

Flex 4 ItemRenderer Question

I have a DataGroup with a Custom ItemRenderer. Within the itemrenderer, there are 2 states. normal and hovered. I have a <s:Group> within the itemrenderer that shows a bunch of data but i only want to be shown when hovered so I can do includeIn="hovered" which is good.
the problem is the x,y position of this group needs to be outside the bounds of the container itself. much like a tooltip only that this is not a tooltip.
whatever i do, it stays within the bounds of the datagroup. any ideas? or am I missing something simple here?
The behavior you are describing sounds an awful lot like a tooltip/datatip. Why not create your own tooltip skin and assign it to your renderer instead of re-inventing tooltips?
EDIT: Based on the comment below, the approach I would consider is to show a custom skinned Panel or ToolTip when entering the hovered state using the PopUpManager.addPopUp method. After adding it, then position it where ever you like. You'll probably need to change the local coordinates to the global coordinates when moving your popup. Then call PopUpManager.removePopUp when exiting the hovered state. Hope that helps.

Flex: Adding selectable image on canvas

I am new to flex, and do not know how to add an image (or other ui component) to canvas, so user can select it (and see that it's selected), also I want to add a possibility for example to click backspace and remove selected image from scene. How to do that?
Maybe you can point me to a doc to read?
I am not sure what you exactly need.
Do you need to add one image to the canvas, or possibly multiple?
And how do you need to lay out these images? Horizontal? Vertical? Tiled?
One way of doing it could be to add a TileList to your canvas, and as dataprovider an ArrayCollection that holds the sources of the images you need.
Create an itemrenderer for the List or TileList and you will be able to display the images.
The images will then be selectable. When you add an eventListener to the keyDown event you can catch the backscpace button being clicked and remove the selected item from the tilelist.
<mx:TileList id="myTileList" dataProvider="{myImages}" itemRenderer="your.domain.MyItemRenderer" keyDown="{keyDownHandler(event)}" />
Adobe LiveDocs and a few of the words I used in this answer might help you further.
Hope this helps.

Resources