Announcement

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

    Disabled MenuButton doesnt reflect its state in its icon

    Hello,

    We have this case where a disabled menu item still has an enabled looking icon, we would expect this to be visually reflected too in a disabled looking icon (eg add_Disabled.png is our example.

    Code:
    	public Canvas getViewPanel() {
    		
    		String ICON_SKIN_ACTION_ADD = "[SKINIMG]/actions/add.png";
    		
    		RibbonBar bar = new RibbonBar();
    		RibbonGroup group = new RibbonGroup();
    		group.setNumRows(1);
    		group.setTitle("Group");
    		group.setRowHeight(76);
    		
    		IconMenuButton button = new IconMenuButton("Add");
    		button.setIcon(ICON_SKIN_ACTION_ADD);
    		button.setLargeIcon(ICON_SKIN_ACTION_ADD);
    		button.setOrientation("vertical");
    		group.addControl(button);
    		
    		Menu menu = new Menu();
    		button.setMenu(menu);
    		
    		MenuItem item1 = new MenuItem("Add Before");
    		item1.setIcon(ICON_SKIN_ACTION_ADD);
    		item1.setEnabled(false);
    		menu.addItem(item1);
    		
    		bar.addMember(group);
    		
    		final VLayout v = new VLayout();
    		v.setOverflow(Overflow.VISIBLE);
    		v.addMember(bar);
    		
    		return v;
    	}
    Can we achieve this functionality somehow, is this a bug or isn't this supposed to be working as we expect?

    We are on v9.0p_2013-10-27.

    thanks

    #2
    The property showDisabledIcon (inherited from Button) controls whether a distinct image is shown for the disabled state.

    Comment


      #3
      Hello,

      Yes indeed, but its default value is also true - but the item where we expect the disabled icon is an instance of MenuItem where I can not set such a setting.
      Please advise. I uploaded a screenshot to make it a bit clearer what we actually mean.

      thanks
      Attached Files
      Last edited by jan.swaelens; 24 Mar 2014, 04:31.

      Comment


        #4
        Same property on MenuItem - showDisabledIcon, inherited from ListGridField.

        Comment


          #5
          Hello,

          Since there is no setter for that property we added it as follows, but still it is not showing the 'add_Disabled.png' icon as we would expect.

          Code:
          		MenuItem item1 = new MenuItem("Add Before");
          		item1.setIcon("[SKINIMG]/actions/add.png");
          		item1.setEnabled(false);
          		item1.setAttribute("showDisabledIcon", "true");
          		menu.addItem(item1);
          thanks

          Comment


            #6
            Sorry, to clarify, a Menu is a ListGrid with default fields.

            The iconField needs showDisabledIcon set on it in order for MenuItems to show disabled icons.

            Comment

            Working...
            X