Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Eclipse Scout » Layout on Form Scout 8(How can i force the form to use half of the space)
Layout on Form Scout 8 [message #1799141] Fri, 30 November 2018 11:59 Go to next message
The Maddes is currently offline The MaddesFriend
Messages: 44
Registered: October 2018
Member
Hello,

i have a question about the layouting of a form.
This form is attached on a tablepage as a detailform.
What i need to have is, that all fields are in the left side of the form.

So like you see in the picture, that box 3 and box 4 should be positioned under box 2, so that all boxes are positioned on the left side and the right side is just plain empty. Is this possible?

At the moment my code (simplified for layout) looks like that:
  @Order(1000)
  @ClassId("e87975bc-28d4-4912-834a-aeca15209dae")
  public class MainBox extends AbstractGroupBox {
    
    @Override
    protected int getConfiguredGridColumnCount() {
      return 2;
    }   
    
    public class GeneralBox extends AbstractGroupBox {
      
      @Override
      protected int getConfiguredGridW() {
        return 1;
      }
      
      @Override
      protected double getConfiguredGridWeightY() {
        // do not allow the general box to grow or shrink vertically.
        return 0;
      }

      public class Box1Box extends AbstractGroupBox {       
        @Override
        protected int getConfiguredGridW() {
          return 1;
        }       
   
        public class Field1Field extends AbstractDateField { }
		
        public class Field2Field extends AbstractSmartField<Long> {  }
        
      }
	  
      public class Box2Box extends AbstractGroupBox {
        
        @Override
        protected int getConfiguredGridW() {
          return 1;
        }
		public class Field3Field extends AbstractBigDecimalField {   }
		public class Field4Field extends AbstractBigDecimalField {   }
		
		}
      public class Box3Box extends AbstractGroupBox {
        @Override
        protected int getConfiguredGridW() {
          return 1;
        }           
        
        public class Button1 extends AbstractButton { }


        public class Button2 extends AbstractButton { }
      }

      public class Box4Box extends AbstractGroupBox {
       
        @Override
        protected int getConfiguredGridW() {
          return 1;
        }
                     
        public class Field5Field extends AbstractStringField {}     
)
        public class Field6Field extends AbstractStringField {         
          @Override
          protected int getConfiguredGridH() {
            return 2;
          }
        }  
      }
    }

    public class OkButton extends AbstractOkButton {  
      @Override
      protected int getConfiguredSystemType() {
        return SYSTEM_TYPE_SAVE;
      }
      @Override
      protected String getConfiguredLabel() {
        return TEXTS.get("SaveEntry");
      }
    } 
  }


So i think it will be an easy fix, but i just dont get where to make the definitions needed. Tried with different column counts, weights, added empty boxes as buffers...nothing worked out.

Thank you.

[Updated on: Fri, 30 November 2018 11:59]

Report message to a moderator

Re: Layout on Form Scout 8 [message #1799153 is a reply to message #1799141] Fri, 30 November 2018 14:53 Go to previous messageGo to next message
Patrick Baenziger is currently offline Patrick BaenzigerFriend
Messages: 96
Registered: September 2011
Member
Sure, that should be possible.

You can make a "left group box" and a "right group box" directly inside the main box. Make each of them 1 Unit wide. If you want, hide the border and label of the group boxes (left and right).
Make sure the main group box has a column count of 2 (should be the default).

Then add your boxes to the left group box only and you're almost done.

Now the trick: Since the right box would be empty (for now), Scout would remove it. To prevent this, add a PlaceholderField (AbstractPlaceholderField, or empty LabelField) to the right group box.

                                             MainBox
+---------------------------------------------------------------------+
|                                            getConf...ColumnCount=2  |
|                                                                     |
|                     LeftBox                      RightBox           |
|      +-----------------------+    +------------------------+        |
|      |          g.C.GridW=1  |    |            g.C.GridW=1 |        |
|      |                       |    |                        |        |
|      |                       |    |                        |        |
|      | +-------------------+ |    |   +----------------+   |        |
|      | |      Box1         | |    |   |  Placeholder   |   |        |
|      | +-------------------+ |    |   +----------------+   |        |
|      |                       |    |                        |        |
|      | +-------------------+ |    |                        |        |
|      | |      Box2         | |    |                        |        |
|      | +-------------------+ |    |                        |        |
|      |                       |    |                        |        |
|      | +-------------------+ |    |                        |        |
|      | |      Box3         | |    |                        |        |
|      | +-------------------+ |    |                        |        |
|      |                       |    |                        |        |
|      | +-------------------+ |    |                        |        |
|      | |      Box4         | |    |                        |        |
|      | +-------------------+ |    |                        |        |
|      |                       |    |                        |        |
|      +-----------------------+    +------------------------+        |
|                                                                     |
+---------------------------------------------------------------------+

[Updated on: Fri, 30 November 2018 14:55]

Report message to a moderator

Re: Layout on Form Scout 8 [message #1799252 is a reply to message #1799153] Mon, 03 December 2018 13:58 Go to previous message
The Maddes is currently offline The MaddesFriend
Messages: 44
Registered: October 2018
Member
Thanks a lot!
The trick was the part i was missing before, already been there but i was wondering why the box was just ignored/removed.

Thx again for sharing your magic with us here :)
Previous Topic:Eclipse Scout 8.0 (Photon) now available
Next Topic:Upgrade to 8.0 issues : TEXTS, version
Goto Forum:
  


Current Time: Sun Jan 19 04:28:39 GMT 2025

Powered by FUDForum. Page generated in 0.02708 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top