コード例 #1
0
ファイル: GfuiChkBox.java プロジェクト: gnosygnu/xowa_android
 @Override
 public void ctor_GfuiBox_base(Keyval_hash ctorArgs) {
   super.ctor_GfuiBox_base(ctorArgs);
   focusBorder.All_(PenAdp_.new_(ColorAdp_.Gray, 1));
   Inject_(GfuiFocusXferBnd.Instance).Inject_(GfuiBtnClickBnd.Instance);
   this.CustomDraw_set(true);
 }
コード例 #2
0
ファイル: GfuiChkBox.java プロジェクト: gnosygnu/xowa_android
public class GfuiChkBox extends GfuiElemBase {
  public boolean Val() {
    return val;
  }

  private boolean val;

  public void Val_set(boolean val) {
    this.val = val;
    Gfo_evt_mgr_.Pub_val(this, "Check_end", val);
    GfuiBtn.DoThis(this, clickMsg, clickInvkCmd);
  }

  public void Val_sync(boolean val) {
    this.val = val; // (boolean)v; // NOTE: do not resend message
    this.Redraw();
  }

  @gplx.Internal
  protected void Click_msg_(GfoMsg v) {
    clickMsg = v;
  }

  GfoMsg clickMsg;

  @gplx.Internal
  protected GfuiChkBox Click_invk(Gfo_invk_cmd v) {
    clickInvkCmd = v;
    return this;
  }

  Gfo_invk_cmd clickInvkCmd;

  public GfuiBorderMgr FocusBorder() {
    return focusBorder;
  }

  GfuiBorderMgr focusBorder = GfuiBorderMgr.new_();

  @Override
  public boolean Click_able() {
    return true;
  }

  @Override
  public void Click() {
    Val_set(!val);
    this.Redraw();
  }

  public GfuiAlign AlignH() {
    return alignH;
  }

  public void AlignH_set(GfuiAlign v) {
    alignH = v;
  }

  GfuiAlign alignH = GfuiAlign_.Mid;

  public GfuiAlign AlignV() {
    return alignV;
  }

  public void AlignV_set(GfuiAlign v) {
    alignV = v;
  }

  GfuiAlign alignV = GfuiAlign_.Mid;

  public PointAdp ChkAlignCustom() {
    return chkAlignCustom;
  }

  public void ChkAlignCustom_set(PointAdp val) {
    chkAlignCustom = val;
  }

  PointAdp chkAlignCustom = PointAdp_.Zero;

  @gplx.Internal
  protected PenAdp ChkPen() {
    return chkPen;
  }

  PenAdp chkPen = PenAdp_.new_(ColorAdp_.Black);

  @Override
  public boolean PaintCbk(PaintArgs args) {
    super.PaintCbk(args);
    GfuiChkBox_.DrawCheckBox(this, args.Graphics());
    return true;
  }

  @Override
  public boolean SizeChangedCbk() {
    boolean rv = super.SizeChangedCbk();
    this.Redraw();
    return rv;
  }

  @Override
  public boolean FocusGotCbk() {
    super.FocusGotCbk();
    this.Redraw();
    return true;
  } // Redraw for focusBorder

  @Override
  public boolean FocusLostCbk() {
    super.FocusLostCbk();
    this.Redraw();
    return true;
  } // Redraw for focusBorder

  @Override
  public GxwElem UnderElem_make(Keyval_hash ctorArgs) {
    return GxwElemFactory_.Instance.lbl_();
  }

  @Override
  public void ctor_GfuiBox_base(Keyval_hash ctorArgs) {
    super.ctor_GfuiBox_base(ctorArgs);
    focusBorder.All_(PenAdp_.new_(ColorAdp_.Gray, 1));
    Inject_(GfuiFocusXferBnd.Instance).Inject_(GfuiBtnClickBnd.Instance);
    this.CustomDraw_set(true);
  }
}