Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

    bug with Enterprise Blue, and setDefaultProperties, test case included

    Hi all, I'm on SmartGWT LGPL 3 2012-07-16 and FF13.

    I've essentially confirmed two problems:

    1) Enterprise Blue and long menus
    Through upgrading a project that is on SGWT 2.5 LGPL I found this problem. A Menu which has long text causes the grey column where the icons would go to extend further than it should. Please refer to the screenshots below. This only happens to Enterprise Blue. The border on the menu in the blue skin also appears to be thicker.

    2) setDefaultProperties
    The second issue relates to setDefaultProperties. My app is a full window app and makes use of many 100% width and height VLayouts. So I have code like this at the app's initialisation:
    Code:
    VLayout defaultVLayout = new VLayout();
    defaultVLayout.setHeight100();
    defaultVLayout.setWidth100();
    VLayout.setDefaultProperties(defaultVLayout);
    This worked fine under SGWT 2.5. However since moving to SGWT 3 this has also affected context menus. Context menus now also go 100% width and height, ie, they take up the whole screen!

    Simple standalone test case:
    Code:
    public void onModuleLoad() {
    
    	setDefaultVLayout();
    		
    	VLayout layout = new VLayout();
    	layout.setShowEdges(true);
    	layout.setHeight100();
    	layout.setWidth100();
    	layout.draw();
    		
    	layout.addClickHandler(new ClickHandler() {
    		@Override
    		public void onClick(ClickEvent event) {
    			MenuItem itmTest = new MenuItem("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA");
    			Menu menuTest = new Menu();
    			menuTest.addItem(itmTest);
    			menuTest.showContextMenu();
    		}
    	});
    }
    	
    	
    /**
     * Make all VLayouts automatically be 100% width and 100% height 
     */
    private static void setDefaultVLayout() {
    	VLayout defaultVLayout = new VLayout();
    	defaultVLayout.setHeight100();
    	defaultVLayout.setWidth100();
    	VLayout.setDefaultProperties(defaultVLayout);
    }
    Calling or not calling setDefaultVLayout varies the results. My current fix is to setAutoWidth and setAutoHeight on the context menus, but it does not resolve the first problem (icon/grey column being too wide)

    The gwt.xml file used either:
    Code:
    <inherits name='com.smartgwt.SmartGwtNoTheme' />
    <inherits name='com.smartclient.theme.enterpriseblue.EnterpriseBlue' />
    <inherits name='com.smartclient.theme.enterpriseblue.EnterpriseBlueResources' />
    or
    Code:
    <inherits name='com.smartgwt.SmartGwt' />
    to switch between enterprise blue and grey.

    ps, this caused many, many, many hours of frustration.
    Attached Files
    Last edited by sunnyl; 17 Jul 2012, 21:53.

    #2
    Setting all layouts to default to 100% width/height is definitely not supported. setDefaultProperties() is intended as more of a skinning API, if you change the default *behaviors* of classes in the framework, you will of course cause issues for framework code that uses such components, as well as for any other developers in the project.

    Comment


      #3
      Originally posted by Isomorphic View Post
      Setting all layouts to default to 100% width/height is definitely not supported. setDefaultProperties() is intended as more of a skinning API, if you change the default *behaviors* of classes in the framework, you will of course cause issues for framework code that uses such components, as well as for any other developers in the project.
      Thanks for the info, i'll recode accordingly.

      Is there a real isse with enterprise blue and long menu texts?

      Comment


        #4
        From a quick test that seems like an artifact of your 100%/100% setting or some other configuration specific to your project.

        Comment


          #5
          Originally posted by Isomorphic View Post
          From a quick test that seems like an artifact of your 100%/100% setting or some other configuration specific to your project.
          hmm...I've removed the setDataProperties from the code and only called setWidth100 and setHeight100 explicitly as required, but I'm still seeing the same behaviour on the icon column of menus with enterprise blue only.

          To confirm here is the test code now:
          Code:
          public void onModuleLoad() {
          
          //	setDefaultVLayout();
          		
          	VLayout layout = new VLayout();
          	layout.setShowEdges(true);
          //	layout.setHeight100();
          //	layout.setWidth100();
          	layout.setHeight(400);
          	layout.setWidth(400);
          	layout.draw();
          		
          	layout.addClickHandler(new ClickHandler() {
          		@Override
          		public void onClick(ClickEvent event) {
          			MenuItem itmTest = new MenuItem("AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA");
          			Menu menuTest = new Menu();
          			menuTest.addItem(itmTest);
          			menuTest.showContextMenu();
          		}
          	});
          }
          I should also mention this is created from clean project, not my existing project.

          gwt.xml:
          Code:
          <!-- 
          <inherits name='com.smartgwt.SmartGwt' />
           -->
          <inherits name='com.smartgwt.SmartGwtNoTheme' />
          <inherits name='com.smartclient.theme.enterpriseblue.EnterpriseBlue' />
          <inherits name='com.smartclient.theme.enterpriseblue.EnterpriseBlueResources' />
          Switching between enterprise blue and grey, I'm seeing the two attached results (compiled mode, latest Chrome)


          Edit: project attached. Rename txt to zip
          Attached Files
          Last edited by sunnyl; 18 Jul 2012, 17:19.

          Comment

          Working...
          X