[codenameone-discussions] Re: Scrolling with Borderlayout (NORTH & SOUTH) overlappng

2019-02-20 Thread shop . service . assistant
Thank You!

On Tuesday, February 19, 2019 at 8:49:29 AM UTC-5, shop.servic...@gmail.com 
wrote:
>
> If you are experiencing an issue please mention the full platform your 
> issue applies to:
> IDE: NetBeans/Eclipse/IDEA NetBeans 8.2
> Desktop OS Windows 10 Pro
> Simulator  Latest
> Device PC, Android, IOS
>
> I have a BorderLayout Dialog, 2 com.codename1.ui.table.TableLayout(rows, 
> 1) Containers
> First Container has 20 rows of Label("some text) and is set as 
> dlg.add(BorderLayout.NORTH,ContainerDataBaseContainer);
>
> And An Options Container set as
> dlg.add(BorderLayout.SOUTH,OptionsContainer);
> Scrolling is set true for ContainerDataBaseContainer
>
> When Running demo, ContainerDataBaseContainer consumes 100% of the frame 
> and overlaps OptionsContainer Container
> VS Always showing 
> OptionsContainer  at Bottom and the ContainerDataBaseContainer scrolls 
> between top and OptionsContainer 
> Please see attached pics BorderLayoutScrollPic1.JPG , 
> BorderLayoutScrollPic2.JPG& BorderLayoutScrollPic3.JPG
> Pic one shows when app first opened,
> Pic two shoes app when Top container is scrolled.
> Pic Three shows correct scrolling between Top header and bottom options 
> container
>
> Here is the demo code:
>
> --
> Dialog dlg = new Dialog("A3-Tech Customer Search");
> try {
> int rows = 20;
> dlg.setLayout(new BorderLayout());
> Container ContainerDataBaseContainer = new Container(new 
> com.codename1.ui.table.TableLayout(rows, 1));
> ContainerDataBaseContainer.setScrollableY(true);
> for (int a = 0; a < rows; a++) {
> buildConstrantsGeneric(ContainerDataBaseContainer, new 
> Label("Label Row [" + (a + 1) + "]"), a, 0, 100);
> }
> Container OptionsContainer = new Container(new 
> com.codename1.ui.table.TableLayout(1, 3));
> Button CmdCancel = new Button("Cancel", "Button");
> CmdCancel.addActionListener(e -> {
> dlg.dispose();
> });
> Button ExecSearch = new Button("Execute Search", "Button");
> ExecSearch.addActionListener(e -> {
> dlg.dispose();
> });
> Button OpenRos = new Button("Load Open Invoices", 
> "Button");
> OpenRos.addActionListener(e -> {
> dlg.dispose();
> });
> buildConstrantsGeneric(OptionsContainer, OpenRos, 0, 0, 
> 33);
> buildConstrantsGeneric(OptionsContainer, ExecSearch, 0, 1, 
> 33);
> buildConstrantsGeneric(OptionsContainer, CmdCancel, 0, 2, 
> 34);
> dlg.add(BorderLayout.NORTH, ContainerDataBaseContainer);
> dlg.add(BorderLayout.SOUTH, OptionsContainer);
> } catch (Exception e) {
> e.printStackTrace();
> }
> dlg.show(0, 0, 0, 0);
>
> public static TableLayout.Constraint buildConstrantsGeneric(Container 
> CTR, Component comp, int row, int col, int widthPercent) {
> TableLayout.Constraint ConSt = ((TableLayout) 
> CTR.getLayout()).createConstraint(row, col);
> ConSt.setWidthPercentage(widthPercent);
> CTR.addComponent(ConSt, comp);
> return ConSt;
> }
>
> Regards
>

-- 
You received this message because you are subscribed to the Google Groups 
"CodenameOne Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to codenameone-discussions+unsubscr...@googlegroups.com.
Visit this group at https://groups.google.com/group/codenameone-discussions.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/codenameone-discussions/b30ec227-ae0e-44e3-928f-508278339898%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


[codenameone-discussions] Re: Scrolling with Borderlayout (NORTH & SOUTH) overlappng

2019-02-19 Thread Shai Almog
North and south take up their preferred height. East and west take up their 
preferred width. 
As such all of these need to take components that have reasonable 
height/width expectations e.g. buttons etc.

So you need to place the larger component in the center not in the north.

-- 
You received this message because you are subscribed to the Google Groups 
"CodenameOne Discussions" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to codenameone-discussions+unsubscr...@googlegroups.com.
Visit this group at https://groups.google.com/group/codenameone-discussions.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/codenameone-discussions/bf0bab7f-2eee-438a-aacf-fd802f2e1964%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.