I am using lwuit ComboBox.
I have to set multiline with textwrapping property for ComboBox items. If the size of the item is bigger than the ComboBox width, the text have to wrap to the next line.
I suggest you to derive the ComboBox class and implement the protected method createPopupList() where you add a TextArea field into the List.
Related
In my listbox the strings are longer than the listbox width.
I cannot change the listbox width because of the already made up surface design:
Is there a VBA property for the listbox to:
break the string in half and display it on more than one line
or
scroll horizontally, to see the whole string
If there's not that kind of property, I'd like to know of other ideas.
The ListBox is single line only and does not support line breaks.
If it is an ActiveX then it has a property called ColumnWidths. Set it to something bigger like 500 and you will see a scrollbar at the bottom of the ListBox.
My goals is to create a menu with multiple columns. I went about this by using GridPane, to which I added Labels. Then I inserted the GridPane in a PopOver. I also added action listeners to Labels So when the users click on a cell, I can do a certain action. My current implementation is based on a button. Once clicked, the PopOver will show up.
As an example, font names:
Is there a way to have this in a menu?
I tried making the MyGridPane class that extends MenuItem. It allows me to add the GridPane to the menu, but it only comes in as an ObjectID. If I want it visually, the only way I found was to
menuItem.setGraphic()
But this make the whole GridPane one item. The cells and their action listeners get ignored.
Is there a way to add a grid pane as a menu item?
Is there a way to add a grid pane as a menu item?
Yes, you can try as
CustomMenuItem menuItem = new CustomMenuItem(gridPane);
menuItem.setHideOnClick(false);
To visually disable the highlight color for that menu/menuitem, customize the related CSS selectors of menu/menuitem.
I am new to WPF. I have a problem with ComboBox that is placed within a cell of a grid. I am using xceed grid control. Within the xcd:CellEditor tag, I have this ComboBox control. The combobox is populated with values properly with required value in it selected but when I click on the combobox, the selected value is cleared (showing empty selection) and I had to click on the dropdown arrow to display the list and select that value again.
This problem is occuring to me when I am using the Text property of the ComboBox but when I replace the Text to SelectedValue then I don't see this problem. Can anyone throw some light on this.
Following is what I have changed.
From Text="{xcdg:CellEditorBinding}" to SelectedValue="{xcdg:CellEditorBinding}"
I want to programmatically select an item in JSF selectOneListbox. As there are large number of items and the height is restricted, most of the items are hidden. If I move the slider up and down, I can see the selection, but not other vice. Is there any way to bring the selection to the visible area, like in a Top in VB Listbox?
I used h:selectOneMenu so that selected one is always visible.
When we will use DrawItem for a listbox?
Normally, if the listbox is ownerdraw, we will use DrawItem. What are the other senarios we use drawitem?
To elaborate on Rashmi Pandit; A ListBox with override DrawItem can also be used to 'visualize' objects. In a project I'm working on, a ListBox is used to display rows from a database. Each row / item is visualized using formatted Strings, Icons etc.
Overriding DrawItem (and MeasureItem!) is ideal for this purpose. Of course, the internal structure has to be tweaked a bit (the standard Items property cannot be used for objects), but it is certainly worthwhile.
Message WM_DRAWITEM is sent only to owner-drawn List boxes.
You can use DrawItem when you want to override the default implementation and custom the way a listbox is drawn. For e.g. in the list there might be some item which should is the default item and you would want it to be highlighted so that the user knows it is the default item.
Here's an eg for a combo in C#: Higlighting a particular item in a combo box