示例#1
0
  public ButtonDialog(
      CB_RectF rec,
      String Name,
      String msg,
      String title,
      MessageBoxButtons buttons,
      MessageBoxIcon icon,
      OnMsgBoxClickListener Listener) {
    super(rec, Name);
    setTitle(title);
    setButtonCaptions(buttons);
    SizeF contentSize = getContentSize();

    CB_RectF imageRec =
        new CB_RectF(
            0,
            contentSize.height - margin - UI_Size_Base.that.getButtonHeight(),
            UI_Size_Base.that.getButtonHeight(),
            UI_Size_Base.that.getButtonHeight());

    if (icon != MessageBoxIcon.None && icon != null) {
      Image iconImage = new Image(imageRec, "MsgBoxIcon", false);
      iconImage.setDrawable(new SpriteDrawable(getIcon(icon)));
      addChild(iconImage);
    }

    label = new Label(this.name + " label", contentSize.getBounds());
    label.setWidth(contentSize.getBounds().getWidth() - 5 - UI_Size_Base.that.getButtonHeight());
    label.setX(imageRec.getMaxX() + 5);
    label.setY(-margin);
    label.setWrappedText(msg);
    addChild(label);

    mMsgBoxClickListener = Listener;

    // setFooterHeight(80);
  }
示例#2
0
 public void setText(String text) {
   label.setWrappedText(text);
 }