How to change the style of CComboBox scrollbar in MFC - visual-c++

I want to change the style of scrollbar of CComboBox. I can only change the selected item and background of dropbox, but haven't found any way to change the default style of scrollbar.
And is there any way to get the index of the current item shown on dropbox, so that I can draw my own scrollbar?

Related

Motif: How to move Scroll Bar automatically without user intervention

I have a scrolled window in my application, in which I have created a drawing area widget. In the drawing area, I have placed multiple images. When the user enters information about an image in a search box, the appropriate image gets highlighted.
My problem is how do I get the application to scroll automatically to the highlighted Image box without the user using the scroll bar. The scrolledwindow should automatically move the view region, to display the region where the highlighted Image is present.
The scrolling policy used on the scrolled window is XmAUTOMATIC.
Any pointers would be greatly appreciated.Thanks in advance.
Try XmScrollVisible() if this does not work then you will need to:
1. Find out the size of the work area.
2. Find out the size and position of the clip window.
3. Find out the max/ min values for the horizontal scrollbar.
4. Use XmScrollBarGetValues() for the horizontal scrollbar to get its position within the max/min values.
5. Do some math magic to determine how much to move the horizontal scrollbar to get the work area to show through the clip window.
6. Call XmScrollBarSetValues() with Notify = True.
7. Repeat for the Vertical scrollbar.
HTH

Menus with multiple item-columns javaFX 8

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.

Add fixed positioned Combobox inside FlowPane

I have a FlowPane which will hold many panels which are based on BorderPane.
I want to create ComboBox which will be used to filter the Panels by type. And the panels will be scrolled by ScrollPanewhen they exceed the visible area.
I want the combo box to scroll along with the FlowPane inside the ScrollPane. I want to get the result which is displayed into the picture. Can you tell me how I can get the desired result. I can very easy create BorderPanes and insert them into the FlowPane and the challenge is how to position the Combo Box and keep it always at this position.
Why don't you simply use another border pane?
Add your combobox to the top ( or additional flow pane with combobox on
it)
Add your Flowpane to the Center
Then scroll the whole border pane using the scrollpane?
What could be simpler?
Here's how you'd do it:
StackPane with 2 layers:
layer1: your ComboBox panel.
layer2: your ScrollPane with your FlowPane inside*.
*The trick is: just make your combobox panel background opaque, and some initial top inset on the flowpane so that it starts at the right place.

How to show rich text in the QCombobox.lineEdit()? or how to replace the lineedit in qcombobox with textedit?

i have this working example
now i want to be able to edit the QLineEdit and highlight items that are not in the dropdown listview,(eg. red background color) , and add auto complete feature. from my understanding, the only viable way is making a custom widget, with a QTextEdit and a listView ( since qlineedit can't display html ?)
edit: eg I have India,China in the lineEdit, but i only want China's bg color to be red since it's not in the dropdown items list
is there an easier way other than this? thanks !
the code is here: http://pastebin.com/WGrj3ud5
and here : http://www.barishcb.com/?p=426
For the auto-completion, you need to add a QCompleter to your QlineEdit
For the red background, you can dynamically change the style sheet of the QLineEdit:
# in case of item not in the dropdown listview:
self.lineEdit.setStyleSheet("background-color: rgb(255, 0, 0);")
# otherwise:
self.lineEdit.setStyleSheet("")

Button border issue in LWUIT

I have created button without any border using LWUIT resource editor. I am able to see that button with all my properties set. However, when i am trying to add an image into this button using its image constructor, i am able to see a thick border around my image. I tried changing the button into Label, still image is coming. Please help.
Have you set the button border type as Empty on ResourceEdit? If not, set the button border type as Empty for selected and unselected style on ResourceEdit. It should work.

Resources