Codename One combobox styling - combobox

Please, see picture bolow:
I cannot get rid of white paddings/margins in combobox popup. I have two custom containers in designer called DropdownItem and DropdownItemSelected, Fisheye renderer type for ComboBox renderer. As you may see in combobox selected item is displayed just fine. However, in I cannot get combobox popup displayed without white paddings. I have actually used PopupContentPane to add blue border around popup, I also have border set to empty, all margins/paddings set to 0 for following UIIDs: PopupItem, PopupFocus, DropdownItem and DropdownItemSelected. PopupContentPane has also all paddings/margins set to 0. Also see my contants:
I went through source code and cannot find any other useful UIID I can style in order to remove these white paddings. Can someone help me with this?
Update:
Might be helpful - see below how popup looks like when PopupContentPane border sickness is set to 2px:
Update 2:
Almost there. After setting listItemGapInt constant to 0 I managed to remove gaps between list items. See screenshot below.
I still cannot find out how to remove 2 pixel gap on the right and don't know where it's coming from. Would appreciate any thoughts/ideas.
Update 3:
I eventually found where two pixels are coming from.
com.codename1.ui.ComboBox class, lines 289-290
289 int listW = Math.max(getWidth() , l.getPreferredW());
290 listW = Math.min(listW + getUIManager().getLookAndFeel().getVerticalScrollWidth(),
parentForm.getContentPane().getWidth());
In my particular case, listW=630px and in line 290 listW is recalculated as Math.min(630 + 2, 768), where 2px is width of vertical scroll.
As far as can say, scroll bar should be a part ComboBox popup.

I managed to remove unwanted gaps. As I mentioned in 'update 2', listItemGapInt should be set to 0 in order to remove horizontal gaps.
Vertical gap was related to scroll bar however it was not clear that it's a vertical scroll bar that creates that gap. After I set paddings to 0 for Scroll UIID, vertical gap has gone.

In regard to update 3, this is a bug but not because it should be in the container. The list is scrollable so this should be a part of the list however the call should be to l.getSideGap() and not to getVerticalScrollWidth().
This will allow you to hide that by setting the scroll bars to visible false etc. We'll fix that for the next update.

Related

How to edit colors of the legend toggle of react google chart if they are activated and desactivated

I have 3 lines graphed, and when I hide one, the color of the bottom line changes to the color of the top one, how do I keep the color the same regardless of the hidden line?
It took me some time to find a way to achieve what you wanted and I'm giving you live demo (React Google Charts - Toggle Line Visibility) so you can inspect it and see if that's what you wanted.
It's a little bit hacky, but hey it's working fine, I guess.
What I did is:
Listen for select event and detect when legend is pressed
Apply series with some configuration and make it state variable for our custom Graph component
By setting lineWidth: 0 and tooltip: false we fake line invisibility. Line width trick is obvious... Tooltip is disabled so you can't get tooltip when you try to hover over "invisibile" line on the graph (try to comment out line of code which sets tooltip: false and go hover over the area where dot of an "invisible" line is suppose to be to see what I mean by that)
I hope this helps, because there is nothing out there for this scenario in React.

Follow up on: Rebuild list of containers without scrolling the list

Referring to this question and answer by Shai Almog:
Rebuild list of containers without scrolling the list
I have a form with one container (TableLayout), which contains several rows with labels and buttons. Clicking a button changes the order of the rows and rebuilds the whole form (after myForm.removeAll() ). After myForm.revalidate() the form jumps to the top.
I am trying to implement this exact behaviour, to return to the same point (scroll position Y) after revalidating/changing the container contents.
I subclassed the Container-class to make setScrollY(int) visible. Using this with an arbitrary value does not scroll to the position, so it seems that the setScrollY method is not changing the scroll position of the content pane overall.
And myContainer.getScrollY() always returns "0". I only get the scroll position by calling getContentPane().getScrollY().
But it is obviously not possible to call the setScrollY()-method on the content pane - as it is not possible to subclass the content pane - to scroll back to the same position after revalidating the form.
Thanks for any advice!
Use border layout which disables the scrolling of the form/content pane.
Place your container (where you exposed setScroll) in the center and make sure to invoke setScrollableY(true) on that Container.

How can I reduce the padding on a Dialog?

When I press a button, my app displays a calendar (within a Dialog) that slides from the bottom of the screen:
I want the Calendar to occupy the whole width of the screen, but it shows some white padding on both sides and also on the top and bottom (It is white because the "Dialog" UIID has a white created image as background)
I have tried changing all the UIID related to Dialog: "Dialog", "DialogBody", "DialogTitle", etc. I set all margins and paddings to cero.
How can I get rid of that padding?
Try change both the DialogUIID and the UIID of the dialog. Also make sure your calendars margin values are set to zero. It could be that your calendar is too small. Try placing it in a table layout with 1 row and 1 column then in layout constraints set the width and height to 100%
Open up the Component Inspector tool and traverse the hierarchy. You will be able to see all the components and their UIID's within the hierarchy and you should be able to understand which one of those components contributes to the padding/margin.

How to insert scroll bar in WPF in code behind for RadMenu

This Radmenu is dynamically created in code behind.Please let me know how to add scroll bar in this menu to limit the items in the submenu.
Check out this post from telerik forums.
Though it's in silverlight, I'm pretty sure you can use it as is.
Try explicitly setting the Height property of the Menu for that has a lot of menu items and that should add (Up/Down) button I believe
While not a scrollbar, you can set the DropDownHeight property of the RadMenuItem. It limits the height taken by the child menu items, and has up/down arrows to enable the scrolling.

IE display with absolute positioned div

I'm having a display problem with an absolute positioned div in IE6 + IE7
I'm trying to display a drop down menu. this drop down menu is positioned absolute.
now as soon as there's another element below this menu that has position: relative, the absolute positioned drop down menu is displayed behind it.
this only happens in IE7 and 6 as mentioned above.
any ideas on how to fix this?
The css property z-index is there to let you define what object should be displayed "on top". Define z-indexes for all elements in quest (only drop-down should also work I think).
EDIT (based on provided code):
The element to give the z-index property to is "the topmost element with a position attribute that the overlapped div is not part of. In terms of your sample, give the z-index to menu_container or add it to header and give header position: relative (I like the latter option better because it is less likely to break with future changes of your html).
As for an explanation why this is so, in IE6 and IE7 things work as follows: currently absolute_div is above everything inside menu_container, but menu_container is below relative_div, so absolute_div is too. The reason that header doesn't participate in this story is that if no position attribute is given, what is displayed in front and what is in the back is calculated differently.

Resources