Codenameone list scrollbar quetions - codenameone

I have a list and its scroll bar on the right along with two custom buttons representing upscroll and downscroll. These two buttons simulate scrolling by using list.setSelectedIndex(index, true) and are placed above and below my scrollbar via my custom layout.
I have two questions regarding this:
1). Since the upscroll and downscroll buttons are overlayed on top of the list, they disappear when i click elsewhere..and they kind of flash into appearance when i click the area it's supposed to be in. How can I remedy this behavior?
2). I have a scrollbar image that I have used in the "Scroll" theme in the GUI builder. It's alignment is IMAGE_ALIGNED_CENTER. However the scroll thumb doesn't reach the end of the bar when i scroll to the end of the list via my upscroll and downscroll buttons. The upscroll and downscroll buttons essentially scroll the list by one index with each press (using setSelectedIndex(index, true)).
Thanks

How do you overlay the buttons. I'm assuming you just set them into a specific location which disallowed as we can't possibly adapt them to the various resolutions. I suggest reading the developer guide section on layouts very carefully.
To place something on top of the list in a portable way you need to use the LayeredLayout or the LayeredPane and a Container + correct layout to position this within (e.g. BorderLayout EAST).
In this blog post there is a sample for making a scrollbar but it isn't "on top". It can be used as a starting point.

Related

Horizontal scrolling like Instagram in Codename One

In my Codename One app, I don't need an horizontal scrolling identical to Instagram, but similar to some aspects.
Please look at this video, that shows a horizontal scrolling in Instagram:
https://www.informatica-libera.net/videoLavoro/instagramScrolling.mp4
The main functionality that I need (and that is different from the standard horizontal scrolling), is the ability to scroll a Container only if the finger movement is more that a given horizontal space (we can suppose 20mm), otherwise the Container is restored to the position before the scrolling (like Instagram does).
Moreover, if the scrolling is "accepted" (that means more that 20mm), the Container will be automatically horizontally scrolled to make an inner Component full visible at the left of the horizontal space.
Example:
Suppose that I have a Container (with BoxLayout.x()) that contains the Components A, B, C and suppose that A, B and C have a width identical to the 75% of the screen width.
So, at the app start, A is full visible, B is visible only for a small part, C is not visible. I need a scrolling like Instagram that, if accepted (the scrolling is more than 20mm), makes B full visible in the same position of A (otherwise it undoes the scrolling).
So, after this kind of horizontal scrolling, A will be not visible, B full visible, C visible only for a small part.
Any suggest to implement this behaviour (like in this example) with Codename One? Thank you
You need Tab with the swipeActivated set to true. The only downside to Tab is you can't set only one side to be visible. Both left and right will be set to be visible.
From your analogy above, part of both A and C will be visible when B is fully visible, only by the size you set with setTabsContentGap().
Some code to get you started:
Tabs tabs = new Tabs();
tabs.setSwipeActivated(true);
tabs.setAnimateTabSelection(true);
tabs.setEagerSwipeMode(true);
tabs.setTabsContentGap(CN.convertToPixels(20, true));
tabs.setUIID("Container");
tabs.setTabUIID("Container");
tabs.getTabsContainer().setUIID("Container");
tabs.getContentPane().setUIID("Container");
And you can start filling your tab with:
tabs.addTab("", myContent);

wx.ComboBox hides behind other panels

I have been working with wxPython for quite a while now. I have a pretty good handle on most objects, and I've been able to create panel layouts without issue for the most part.
What I'm trying to do here is to display two lists (combo boxes.) One represents the complete list of possible options (on the left) that the user may select and add to the list on the right. The functionality works just fine, but the objects themselves visually become obscured by other panels contained within the same tab of a wxNotebook object (see red rectangle on attached image.)
The top panel is a composite of three panels. The first contains a combo box and some spacers. The second (middle) contains the buttons that allow the user to add/remove items. The third, like the first, is a combo box and some spacers. The middle panel scales fine, but I cannot adjust the height of the combo boxes.
I want the combo boxes to be the wx.CB_SIMPLE layout so that all options are displayed. Ideally, if the number of options exceeds the panel height, I would see a vertical scroll bar.
What would be the easiest way to accomplish this without losing the combo boxes behind other panels?
I don't see a need to have 3 panels nested inside of your notebook page. Instead I would create one panel with nested sizers. You can create one horizontal BoxSizer to hold all the widgets. Then inside of that, you can add the left combobox to the sizer. Next create a vertical sizer that you can put your buttons into (add, remove, clear).
Add that vertical sizer to your horizontal sizer. Now create your right combobox and add it to the horizontal sizer. Now you have the same setup or close to it and you won't have panels crossing over each other.

Hit area of the button changed in silverlight after some functions

Hi I am working on one project on one page there are many controls like hyperlinkbutton, buttons, borders all these bounded by viewbox. when page loads all the buttons shows hand cursor but if i mouse over any other buttons this first buttons do not show any hand cursor or do not take any mouse event. But I abserved one strange thing here when i make full screen in browser buttons will show hand cursor when i disable the full screen view I abserved hit area of the button is above one 2cm from the respective buttons.
I browsed many sites I could not get the answer.
among them I pasted one link here so that you can understand well
http://forums.silverlight.net/t/44026.aspx
So can any one help me help me to resolve this? Please Help me.

How can I make a panels contents resize with a zoom control?

I am using ExtJS 3.3
I have a main panel containing another panel (containing text) and a grid containing data with a paging toolbar and footer.
There is a zoom control (a combo with values like "100%, "50%", "page width","whole page" ) on the paging toolbar.
I wish to select a zoom level from the combo and have everything on the main panel resize to that zoom level.
I need all other panels on the page to appear unchanged in size.
I have Googled around but cannot see any solutions or extensions available.
How can I do this please? Any ideas?
You should be able to do this using CSS to define the size of each element at each required zoom level. Your combo zoom control would need to have an event handler which would switch the class of the (probably) DIV element which contains the content you want to resize.
There is a StackOverflow question here which is a useful discussion about some ways to acheive the scaling; there are many ways to do it and your choice depends on what you need to acheive. If you provide sight of the display or code you're working on then I could probably make some recommendations.

How to make an expandable button toolbar

I have a navigation panel in the left hand side of my WPF application. I want to make a button (like in photoshop or a similar program) when you push it, it expands across the bounds and "on top" of the other controls (the center column) - and allowing the user to push a button. Just like in the ribbon bar.
Does it make sense?
You should try Avalon Dock : http://avalondock.codeplex.com/ It gives you exactly what you want.

Resources