mirror of
https://github.com/gnosygnu/xowa.git
synced 2026-03-02 03:49:30 +00:00
v1.6.5.1
This commit is contained in:
71
150_gfui/src_420_box_basic/gplx/gfui/GfuiBtn.java
Normal file
71
150_gfui/src_420_box_basic/gplx/gfui/GfuiBtn.java
Normal file
@@ -0,0 +1,71 @@
|
||||
/*
|
||||
XOWA: the XOWA Offline Wiki Application
|
||||
Copyright (C) 2012 gnosygnu@gmail.com
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as
|
||||
published by the Free Software Foundation, either version 3 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.gfui; import gplx.*;
|
||||
public class GfuiBtn extends GfuiElemBase {
|
||||
@Override public boolean Click_able() {return true;}
|
||||
@Override public void Click() {GfuiBtn.DoThis(this, clickMsg, clickInvkCmd);}
|
||||
@gplx.Internal protected GfuiBtn Click_msg_(GfoMsg v) {clickMsg = v; return this;} GfoMsg clickMsg;
|
||||
@gplx.Internal protected GfuiBtn Click_invk(GfoInvkAbleCmd v) {clickInvkCmd = v; return this;} GfoInvkAbleCmd clickInvkCmd;
|
||||
@Override public boolean PaintCbk(PaintArgs args) {
|
||||
super.PaintCbk(args);
|
||||
if (this.Focus_has()) focusBorder.DrawData(args.Graphics());
|
||||
this.TextMgr().DrawData(args.Graphics());
|
||||
return true;
|
||||
} GfuiBorderMgr focusBorder;
|
||||
@Override public boolean SizeChangedCbk() {super.SizeChangedCbk(); GfuiBtn_.FocusBorderRect_set(focusBorder, this); this.Redraw(); return true;}
|
||||
@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
|
||||
public ImageAdp Btn_img() {
|
||||
Object o = GfoInvkAble_.InvkCmd(UnderElem(), Invk_btn_img);
|
||||
return o == UnderElem() ? null : (ImageAdp)o; // NOTE: lgc guard
|
||||
} public GfuiBtn Btn_img_(ImageAdp v) {GfoInvkAble_.InvkCmd_val(UnderElem(), Invk_btn_img_, v); return this;}
|
||||
@Override public GxwElem UnderElem_make(KeyValHash ctorArgs) {return GxwElemFactory_._.control_();}
|
||||
@Override public void ctor_GfuiBox_base(KeyValHash ctorArgs) {
|
||||
focusBorder = GfuiBorderMgr.new_().All_(PenAdp_.new_(ColorAdp_.Gray, 1));
|
||||
super.ctor_GfuiBox_base(ctorArgs);
|
||||
this.TextMgr().AlignH_(GfuiAlign_.Mid);
|
||||
this.Border().All_(PenAdp_.black_()); this.Border().Bounds_sync(RectAdp_.size_(this.Size().Op_subtract(1)));
|
||||
GfuiBtn_.FocusBorderRect_set(focusBorder, this);
|
||||
Inject_(GfuiBtnClickBnd._);
|
||||
Inject_(GfuiFocusXferBnd._);
|
||||
this.CustomDraw_set(true);
|
||||
}
|
||||
@Override public void ctor_kit_GfuiElemBase(Gfui_kit kit, String key, GxwElem underElem, KeyValHash ctorArgs) {
|
||||
this.kit = kit;
|
||||
super.ctor_kit_GfuiElemBase(kit, key, underElem, ctorArgs);
|
||||
focusBorder = GfuiBorderMgr.new_().All_(PenAdp_.new_(ColorAdp_.Gray, 1));
|
||||
Inject_(GfuiBtnClickBnd._);
|
||||
Inject_(GfuiFocusXferBnd._);
|
||||
} Gfui_kit kit;
|
||||
@gplx.Internal protected static void DoThis(GfuiElem click, GfoMsg clickMsg, GfoInvkAbleCmd clickInvkCmd) {
|
||||
try {
|
||||
if (clickInvkCmd != null) {
|
||||
GfsCtx ctx = GfsCtx.new_().MsgSrc_(click);
|
||||
clickInvkCmd.InvkAble().Invk(ctx, 0, clickInvkCmd.Cmd(), GfoMsg_.Null);
|
||||
}
|
||||
else if (clickMsg != null && clickMsg != GfoMsg_.Null) {
|
||||
GfsCtx ctx = GfsCtx.new_().MsgSrc_(click);
|
||||
if (String_.Eq(clickMsg.Key(), "."))
|
||||
GfsCore._.ExecOne_to(ctx, click, clickMsg.Subs_getAt(0));
|
||||
else
|
||||
GfsCore._.ExecOne(ctx, clickMsg);
|
||||
}
|
||||
} catch (Exception e) {GfuiEnv_.ShowMsg(Err_.Message_gplx(e));}
|
||||
}
|
||||
public static final String Invk_btn_img = "btn_img", Invk_btn_img_ = "btn_img_";
|
||||
}
|
||||
40
150_gfui/src_420_box_basic/gplx/gfui/GfuiBtnClickBnd.java
Normal file
40
150_gfui/src_420_box_basic/gplx/gfui/GfuiBtnClickBnd.java
Normal file
@@ -0,0 +1,40 @@
|
||||
/*
|
||||
XOWA: the XOWA Offline Wiki Application
|
||||
Copyright (C) 2012 gnosygnu@gmail.com
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as
|
||||
published by the Free Software Foundation, either version 3 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.gfui; import gplx.*;
|
||||
class GfuiBtnClickBnd implements InjectAble, GfoInvkAble {
|
||||
public void Inject(Object owner) {
|
||||
GfuiElem elem = GfuiElem_.cast_(owner);
|
||||
IptBnd_.cmd_(IptCfg_.Null, elem, GfuiElemKeys.ActionExec_cmd, IptKey_.Enter, IptKey_.Space);
|
||||
IptBnd_.cmd_(IptCfg_.Null, elem, GfuiElemKeys.Focus_cmd, IptMouseBtn_.Left);
|
||||
IptBnd_.ipt_to_(IptCfg_.Null, elem, this, ExecMouseUp_cmd, IptEventType_.MouseUp, IptMouseBtn_.Left);
|
||||
}
|
||||
void ExecMouseUp(IptEventData iptData) {
|
||||
GfuiElem elem = GfuiElem_.cast_(iptData.Sender());
|
||||
int x = iptData.MousePos().X(), y = iptData.MousePos().Y();
|
||||
SizeAdp buttonSize = elem.Size();
|
||||
if ( x >= 0 && x <= buttonSize.Width()
|
||||
&& y >= 0 && y <= buttonSize.Height())
|
||||
elem.Click();
|
||||
}
|
||||
public Object Invk(GfsCtx ctx, int ikey, String k, GfoMsg m) {
|
||||
if (ctx.Match(k, ExecMouseUp_cmd)) ExecMouseUp(IptEventData.ctx_(ctx, m));
|
||||
else return GfoInvkAble_.Rv_unhandled;
|
||||
return this;
|
||||
} static final String ExecMouseUp_cmd = "ExecMouseUp";
|
||||
public static final GfuiBtnClickBnd _ = new GfuiBtnClickBnd(); GfuiBtnClickBnd() {}
|
||||
}
|
||||
47
150_gfui/src_420_box_basic/gplx/gfui/GfuiBtn_.java
Normal file
47
150_gfui/src_420_box_basic/gplx/gfui/GfuiBtn_.java
Normal file
@@ -0,0 +1,47 @@
|
||||
/*
|
||||
XOWA: the XOWA Offline Wiki Application
|
||||
Copyright (C) 2012 gnosygnu@gmail.com
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as
|
||||
published by the Free Software Foundation, either version 3 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.gfui; import gplx.*;
|
||||
public class GfuiBtn_ {
|
||||
public static GfuiBtn as_(Object obj) {return obj instanceof GfuiBtn ? (GfuiBtn)obj : null;}
|
||||
public static GfuiBtn cast_(Object obj) {try {return (GfuiBtn)obj;} catch(Exception exc) {throw Err_.type_mismatch_exc_(exc, GfuiBtn.class, obj);}}
|
||||
|
||||
public static GfuiBtn msg_(String key, GfuiElem owner, GfoMsg msg) {
|
||||
GfuiBtn rv = new_(key); rv.Owner_(owner);
|
||||
rv.Click_msg_(msg);
|
||||
return rv;
|
||||
}
|
||||
public static GfuiBtn invk_(String key, GfuiElem owner, GfoInvkAble invk, String m) {
|
||||
GfuiBtn rv = new_(key); rv.Owner_(owner);
|
||||
rv.Click_invk(GfoInvkAbleCmd.new_(invk, m));
|
||||
return rv;
|
||||
}
|
||||
public static GfuiBtn kit_(Gfui_kit kit, String key, GxwElem elm, KeyValHash ctorArgs) {
|
||||
GfuiBtn rv = new GfuiBtn();
|
||||
rv.ctor_kit_GfuiElemBase(kit, key, elm, ctorArgs);
|
||||
return rv;
|
||||
}
|
||||
@gplx.Internal protected static GfuiBtn new_(String key) {
|
||||
GfuiBtn rv = new GfuiBtn();
|
||||
rv.ctor_GfuiBox_base(GfuiElem_.init_focusAble_true_());
|
||||
rv.Key_of_GfuiElem_(key);
|
||||
return rv;
|
||||
}
|
||||
@gplx.Internal protected static void FocusBorderRect_set(GfuiBorderMgr borderMgr, GfuiElem elem) {
|
||||
borderMgr.Bounds_sync(RectAdp_.new_(3, 3, elem.Width() - 6, elem.Height() - 6));
|
||||
}
|
||||
}
|
||||
61
150_gfui/src_420_box_basic/gplx/gfui/GfuiChkBox.java
Normal file
61
150_gfui/src_420_box_basic/gplx/gfui/GfuiChkBox.java
Normal file
@@ -0,0 +1,61 @@
|
||||
/*
|
||||
XOWA: the XOWA Offline Wiki Application
|
||||
Copyright (C) 2012 gnosygnu@gmail.com
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as
|
||||
published by the Free Software Foundation, either version 3 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.gfui; import gplx.*;
|
||||
public class GfuiChkBox extends GfuiElemBase {
|
||||
public boolean Val() {return val;} private boolean val;
|
||||
public void Val_set(boolean val) {
|
||||
this.val = val;
|
||||
GfoEvMgr_.PubVal(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(GfoInvkAbleCmd v) {clickInvkCmd = v; return this;} GfoInvkAbleCmd 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(KeyValHash ctorArgs) {return GxwElemFactory_._.lbl_();}
|
||||
@Override public void ctor_GfuiBox_base(KeyValHash ctorArgs) {
|
||||
super.ctor_GfuiBox_base(ctorArgs);
|
||||
focusBorder.All_(PenAdp_.new_(ColorAdp_.Gray, 1));
|
||||
Inject_(GfuiFocusXferBnd._).Inject_(GfuiBtnClickBnd._);
|
||||
this.CustomDraw_set(true);
|
||||
}
|
||||
}
|
||||
73
150_gfui/src_420_box_basic/gplx/gfui/GfuiChkBox_.java
Normal file
73
150_gfui/src_420_box_basic/gplx/gfui/GfuiChkBox_.java
Normal file
@@ -0,0 +1,73 @@
|
||||
/*
|
||||
XOWA: the XOWA Offline Wiki Application
|
||||
Copyright (C) 2012 gnosygnu@gmail.com
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as
|
||||
published by the Free Software Foundation, either version 3 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.gfui; import gplx.*;
|
||||
public class GfuiChkBox_ {
|
||||
public static GfuiChkBox as_(Object obj) {return obj instanceof GfuiChkBox ? (GfuiChkBox)obj : null;}
|
||||
public static GfuiChkBox cast_(Object obj) {try {return (GfuiChkBox)obj;} catch(Exception exc) {throw Err_.type_mismatch_exc_(exc, GfuiChkBox.class, obj);}}
|
||||
@gplx.Internal protected static GfuiChkBox new_() {
|
||||
GfuiChkBox rv = new GfuiChkBox();
|
||||
rv.ctor_GfuiBox_base(GfuiElem_.init_focusAble_true_());
|
||||
return rv;
|
||||
}
|
||||
|
||||
public static GfuiChkBox msg_(String key, GfuiElem owner, String text, GfoMsg msg) {
|
||||
GfuiChkBox rv = new_(); rv.Owner_(owner, key).Text_any_(text);
|
||||
rv.Click_msg_(msg);
|
||||
return rv;
|
||||
}
|
||||
public static GfuiChkBox invk_(String key, GfuiElem owner, String text, GfoInvkAble invk, String m) {
|
||||
GfuiChkBox rv = new_(); rv.Owner_(owner, key).Text_any_(text);
|
||||
rv.Click_invk(GfoInvkAbleCmd.new_(invk, m));
|
||||
return rv;
|
||||
}
|
||||
public static GfuiChkBox noop_(String key, GfuiElem owner, String text) {
|
||||
GfuiChkBox rv = new_(); rv.Owner_(owner, key); rv.Text_any_(text);
|
||||
return rv;
|
||||
}
|
||||
public static RectAdp CboxRect(GfuiChkBox box) {
|
||||
SizeAdp size = SizeAdp_.new_(12, 12);
|
||||
PointAdp pos = GfuiAlign_.CalcInsideOf(box.AlignH(), box.AlignV(), size, box.Size(), box.ChkAlignCustom());
|
||||
return RectAdp_.vector_(pos.Op_add(0, 0), size);
|
||||
}
|
||||
public static void DrawCheckBox(GfuiChkBox box, GfxAdp gfx) {
|
||||
RectAdp cboxRect = CboxRect(box);
|
||||
box.TextMgr().AlignH_(box.AlignH()).AlignV_(box.AlignV());
|
||||
RectAdpF textRect = box.TextMgr().TextRect_calc(gfx);
|
||||
|
||||
int w = cboxRect.Width() + 4 + (int)textRect.Width();
|
||||
int h = (int)textRect.Height(); // assume textRect.Height is >= cboxRect.Height
|
||||
SizeAdp size = SizeAdp_.new_(w, h);
|
||||
PointAdp pos = GfuiAlign_.CalcInsideOf(box.AlignH(), box.AlignV(), size, box.Size(), PointAdp_.Zero);
|
||||
cboxRect = RectAdp_.vector_(pos.Op_add(0, 1), cboxRect.Size());
|
||||
textRect = RectAdpF.new_(pos.X() + cboxRect.Width() + 4, textRect.Y(), textRect.Width(), textRect.Height());
|
||||
box.TextMgr().TextRect_set(textRect);
|
||||
box.TextMgr().DrawData(gfx);
|
||||
|
||||
gfx.DrawRect(box.ChkPen(), cboxRect.X(), cboxRect.Y(), cboxRect.Width(), cboxRect.Height());
|
||||
if (box.Val()) {
|
||||
gfx.DrawLine(box.ChkPen(), cboxRect.CornerTL().Op_add(3), cboxRect.CornerBR().Op_add(-3));
|
||||
gfx.DrawLine(box.ChkPen(), cboxRect.CornerBL().Op_add(3, -3), cboxRect.CornerTR().Op_add(-3, 3));
|
||||
}
|
||||
if (box.Focus_has()) {
|
||||
// -1 so border does not start right on top of text; RoundUp to give a little more space to edges
|
||||
// +2 so that focusRect does not overlap mnemonic (in C#)
|
||||
box.FocusBorder().Bounds_sync(RectAdp_.new_((int)textRect.X() - 1, (int)cboxRect.Y(), Float_.RoundUp(textRect.Width()), Float_.RoundUp(cboxRect.Height())));
|
||||
box.FocusBorder().DrawData(gfx);
|
||||
}
|
||||
}
|
||||
}
|
||||
34
150_gfui/src_420_box_basic/gplx/gfui/GfuiComboBox.java
Normal file
34
150_gfui/src_420_box_basic/gplx/gfui/GfuiComboBox.java
Normal file
@@ -0,0 +1,34 @@
|
||||
/*
|
||||
XOWA: the XOWA Offline Wiki Application
|
||||
Copyright (C) 2012 gnosygnu@gmail.com
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as
|
||||
published by the Free Software Foundation, either version 3 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.gfui; import gplx.*;
|
||||
public class GfuiComboBox extends GfuiElemBase {
|
||||
@Override public GxwElem UnderElem_make(KeyValHash ctorArgs) {return GxwElemFactory_._.comboBox_();} GxwComboBox comboBox;
|
||||
public Object SelectedItm() {return comboBox.SelectedItm();} public void SelectedItm_set(Object v) {comboBox.SelectedItm_set(v);}
|
||||
@Override public void ctor_GfuiBox_base(KeyValHash ctorArgs) {
|
||||
super.ctor_GfuiBox_base(ctorArgs);
|
||||
this.comboBox = (GxwComboBox)this.UnderElem();
|
||||
}
|
||||
public void DataSource_set(Object... ary) {
|
||||
comboBox.DataSource_set(ary);
|
||||
}
|
||||
public static GfuiComboBox new_() {
|
||||
GfuiComboBox rv = new GfuiComboBox();
|
||||
rv.ctor_GfuiBox_base(GfuiElem_.init_focusAble_true_());
|
||||
return rv;
|
||||
}
|
||||
}
|
||||
36
150_gfui/src_420_box_basic/gplx/gfui/GfuiLbl.java
Normal file
36
150_gfui/src_420_box_basic/gplx/gfui/GfuiLbl.java
Normal file
@@ -0,0 +1,36 @@
|
||||
/*
|
||||
XOWA: the XOWA Offline Wiki Application
|
||||
Copyright (C) 2012 gnosygnu@gmail.com
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as
|
||||
published by the Free Software Foundation, either version 3 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.gfui; import gplx.*;
|
||||
public class GfuiLbl extends GfuiElemBase { // standard label does not support tooltips
|
||||
@Override public void Click() {
|
||||
int focusOrder = this.OwnerElem().SubElems().IndexOfA(this);
|
||||
GfuiElem focusNext = this.OwnerElem().SubElems().FetchAt(focusOrder + 1); // FIXME: incorporate into new FocusOrder
|
||||
focusNext.Focus();
|
||||
}
|
||||
@Override public boolean PaintCbk(PaintArgs args) {
|
||||
super.PaintCbk(args);
|
||||
this.TextMgr().DrawData(args.Graphics());
|
||||
return true;
|
||||
}
|
||||
@Override public void ctor_GfuiBox_base(KeyValHash ctorArgs) {
|
||||
super.ctor_GfuiBox_base(ctorArgs);
|
||||
this.CustomDraw_set(true);
|
||||
}
|
||||
GfuiBorderMgr focusBorder = GfuiBorderMgr.new_();
|
||||
@Override public GxwElem UnderElem_make(KeyValHash ctorArgs) {return GxwElemFactory_._.lbl_();}
|
||||
}
|
||||
46
150_gfui/src_420_box_basic/gplx/gfui/GfuiLbl_.java
Normal file
46
150_gfui/src_420_box_basic/gplx/gfui/GfuiLbl_.java
Normal file
@@ -0,0 +1,46 @@
|
||||
/*
|
||||
XOWA: the XOWA Offline Wiki Application
|
||||
Copyright (C) 2012 gnosygnu@gmail.com
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as
|
||||
published by the Free Software Foundation, either version 3 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.gfui; import gplx.*;
|
||||
public class GfuiLbl_ {
|
||||
public static GfuiLbl sub_(String key, GfuiElem owner) {
|
||||
GfuiLbl rv = new_();
|
||||
rv.Owner_(owner, key); // must be after ctor, else "Error creating window handle"
|
||||
rv.TextMgr().AlignH_(GfuiAlign_.Mid);
|
||||
return rv;
|
||||
}
|
||||
public static GfuiLbl prefix_(String key, GfuiElem owner, String text) {
|
||||
GfuiLbl rv = sub_(key, owner);
|
||||
rv.Text_(text);
|
||||
rv.TextMgr().AlignH_(GfuiAlign_.Left);
|
||||
return rv;
|
||||
}
|
||||
public static GfuiLbl menu_(String key, GfuiElem owner, String text, String tipText) {
|
||||
GfuiLbl rv = sub_(key, owner);
|
||||
rv.Text_(text);
|
||||
rv.TextMgr().AlignH_(GfuiAlign_.Mid);
|
||||
rv.TipText_(tipText);
|
||||
rv.Border().All_(PenAdp_.black_());
|
||||
return rv;
|
||||
}
|
||||
public static final String Text_Null = null;
|
||||
@gplx.Internal protected static GfuiLbl new_() {
|
||||
GfuiLbl rv = new GfuiLbl();
|
||||
rv.ctor_GfuiBox_base(GfuiElem_.init_focusAble_false_());
|
||||
return rv;
|
||||
}
|
||||
}
|
||||
43
150_gfui/src_420_box_basic/gplx/gfui/GfuiListBox.java
Normal file
43
150_gfui/src_420_box_basic/gplx/gfui/GfuiListBox.java
Normal file
@@ -0,0 +1,43 @@
|
||||
/*
|
||||
XOWA: the XOWA Offline Wiki Application
|
||||
Copyright (C) 2012 gnosygnu@gmail.com
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as
|
||||
published by the Free Software Foundation, either version 3 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.gfui; import gplx.*;
|
||||
import gplx.lists.*; /*EnumerAble*/
|
||||
public class GfuiListBox extends GfuiElemBase {
|
||||
@Override public GxwElem UnderElem_make(KeyValHash ctorArgs) {return GxwElemFactory_._.listBox_();}
|
||||
@Override public void ctor_GfuiBox_base(KeyValHash ctorArgs) {
|
||||
super.ctor_GfuiBox_base(ctorArgs);
|
||||
this.listBox = (GxwListBox)UnderElem();
|
||||
}
|
||||
public void Items_Add(Object o) {listBox.Items_Add(o);}
|
||||
public void Items_Clear() {listBox.Items_Clear();}
|
||||
public Object Items_SelObj() {return listBox.Items_SelObj();}
|
||||
public void BindData(EnumerAble enumerable) {
|
||||
for (Object item : enumerable)
|
||||
this.listBox.Items_Add(item.toString());
|
||||
}
|
||||
public int Items_Count() {return listBox.Items_Count();}
|
||||
public int Items_SelIdx() {return listBox.Items_SelIdx();} public void Items_SelIdx_set(int v) {listBox.Items_SelIdx_set(v);}
|
||||
|
||||
GxwListBox listBox;
|
||||
public static GfuiListBox new_() {
|
||||
GfuiListBox rv = new GfuiListBox();
|
||||
rv.ctor_GfuiBox_base(GfuiElem_.init_focusAble_true_());
|
||||
return rv;
|
||||
}
|
||||
}
|
||||
|
||||
67
150_gfui/src_420_box_basic/gplx/gfui/GfuiTextBox.java
Normal file
67
150_gfui/src_420_box_basic/gplx/gfui/GfuiTextBox.java
Normal file
@@ -0,0 +1,67 @@
|
||||
/*
|
||||
XOWA: the XOWA Offline Wiki Application
|
||||
Copyright (C) 2012 gnosygnu@gmail.com
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as
|
||||
published by the Free Software Foundation, either version 3 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.gfui; import gplx.*;
|
||||
public class GfuiTextBox extends GfuiElemBase {
|
||||
public static final String SelectionStartChanged_evt = "SelectionStartChanged";
|
||||
|
||||
public boolean Border_on() {return textBox.Border_on();} public void Border_on_(boolean v) {BorderOn_set(v);}
|
||||
public int SelBgn() {return textBox.SelBgn();} public void SelBgn_set(int v) {textBox.SelBgn_set(v); GfoEvMgr_.Pub(this, SelectionStartChanged_evt);}
|
||||
public int SelLen() {return textBox.SelLen();} public void SelLen_set(int v) {textBox.SelLen_set(v);}
|
||||
public String SelText() {
|
||||
return String_.MidByLen(this.TextMgr().Val(), this.SelBgn(), this.SelLen());
|
||||
}
|
||||
public void Focus_select_all() {
|
||||
this.Focus();
|
||||
this.SelBgn_set(0);
|
||||
int len = String_.Len(this.Text());
|
||||
this.SelLen_set(len);
|
||||
}
|
||||
public boolean OverrideTabKey() {return textBox.OverrideTabKey();} public void OverrideTabKey_(boolean val) {textBox.OverrideTabKey_(val);}
|
||||
public void Margins_set(int left, int top, int right, int bot) {textBox.Margins_set(left, top, right, bot);}
|
||||
@Override public Object Invk(GfsCtx ctx, int ikey, String k, GfoMsg m) {
|
||||
if (ctx.Match(k, Invk_Margins_)) {
|
||||
int u = m.ReadInt("u");
|
||||
int l = m.ReadInt("l");
|
||||
int d = m.ReadInt("d");
|
||||
int r = m.ReadInt("r");
|
||||
if (ctx.Deny()) return this;
|
||||
Margins_set(l, u, r, d);
|
||||
return this;
|
||||
}
|
||||
else return super.Invk (ctx, ikey, k, m);
|
||||
} static final String Invk_Margins_ = "Margins_";
|
||||
void BorderOn_set(boolean val) {
|
||||
textBox.Border_on_(val);
|
||||
if (val == false)
|
||||
this.Height_(13); // WORKAROUND (WinForms): if border is off, height automatically becomes 13 and immutable for singleLine fields; affects statusBox in opal.imgs which will show with small gap over bottom of screen
|
||||
}
|
||||
@gplx.Internal @Override protected void Click_key_set_(String v) {}// TextBox's shouldn't have clickKeys; among other things, .Text is used to set ClickKey, which for textBox may be very large
|
||||
|
||||
@gplx.Internal protected void SetTextBox(GxwTextFld textBox) {this.textBox = textBox;}
|
||||
@gplx.Internal protected void CreateControlIfNeeded() {textBox.CreateControlIfNeeded();}
|
||||
@Override public GxwElem UnderElem_make(KeyValHash ctorArgs) {return GxwElemFactory_._.text_fld_();}
|
||||
@Override public void ctor_GfuiBox_base(KeyValHash ctorArgs) {
|
||||
super.ctor_GfuiBox_base(ctorArgs);
|
||||
textBox = (GxwTextFld)this.UnderElem();
|
||||
} GxwTextFld textBox;
|
||||
@Override public void ctor_kit_GfuiElemBase(Gfui_kit kit, String key, GxwElem underElem, KeyValHash ctorArgs) {
|
||||
super.ctor_kit_GfuiElemBase(kit, key, underElem, ctorArgs);
|
||||
textBox = (GxwTextFld)underElem;
|
||||
}
|
||||
public static final String CFG_border_on_ = "border_on_";
|
||||
}
|
||||
46
150_gfui/src_420_box_basic/gplx/gfui/GfuiTextBox_.java
Normal file
46
150_gfui/src_420_box_basic/gplx/gfui/GfuiTextBox_.java
Normal file
@@ -0,0 +1,46 @@
|
||||
/*
|
||||
XOWA: the XOWA Offline Wiki Application
|
||||
Copyright (C) 2012 gnosygnu@gmail.com
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as
|
||||
published by the Free Software Foundation, either version 3 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.gfui; import gplx.*;
|
||||
public class GfuiTextBox_ {
|
||||
public static GfuiTextBox as_(Object obj) {return obj instanceof GfuiTextBox ? (GfuiTextBox)obj : null;}
|
||||
public static GfuiTextBox cast_(Object obj) {try {return (GfuiTextBox)obj;} catch(Exception exc) {throw Err_.type_mismatch_exc_(exc, GfuiTextBox.class, obj);}}
|
||||
public static final String NewLine = "\n";
|
||||
public static final String Ctor_Memo = "TextBox_Memo";
|
||||
|
||||
public static GfuiTextBox new_() {
|
||||
GfuiTextBox rv = new GfuiTextBox();
|
||||
rv.ctor_GfuiBox_base(GfuiElem_.init_focusAble_true_());
|
||||
return rv;
|
||||
}
|
||||
public static GfuiTextBox fld_(String key, GfuiElem owner) {
|
||||
GfuiTextBox rv = new_();
|
||||
rv.Owner_(owner, key);
|
||||
return rv;
|
||||
}
|
||||
public static GfuiTextMemo multi_(String key, GfuiElem owner) {
|
||||
GfuiTextMemo rv = new GfuiTextMemo();
|
||||
rv.ctor_GfuiBox_base(GfuiElem_.init_focusAble_true_());
|
||||
rv.Key_of_GfuiElem_(key).Owner_(owner);
|
||||
return rv;
|
||||
}
|
||||
public static GfuiTextBox kit_(Gfui_kit kit, String key, GxwTextFld wk_textBox, KeyValHash ctorArgs) {
|
||||
GfuiTextBox rv = new GfuiTextBox();
|
||||
rv.ctor_kit_GfuiElemBase(kit, key, wk_textBox, ctorArgs);
|
||||
return rv;
|
||||
}
|
||||
}
|
||||
41
150_gfui/src_420_box_basic/gplx/gfui/GfuiTextMemo.java
Normal file
41
150_gfui/src_420_box_basic/gplx/gfui/GfuiTextMemo.java
Normal file
@@ -0,0 +1,41 @@
|
||||
/*
|
||||
XOWA: the XOWA Offline Wiki Application
|
||||
Copyright (C) 2012 gnosygnu@gmail.com
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as
|
||||
published by the Free Software Foundation, either version 3 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.gfui; import gplx.*;
|
||||
public class GfuiTextMemo extends GfuiTextBox { public int LinesPerScreen() {return textBox.LinesPerScreen();}
|
||||
public int LinesTotal() {return textBox.LinesTotal();}
|
||||
public int ScreenCount() {return Int_.DivAndRoundUp(this.LinesTotal(), this.LinesPerScreen());}
|
||||
public int CharIndexOfFirst() {return textBox.CharIndexOfFirst();}
|
||||
public int CharIndexOf(int lineIndex) {return textBox.CharIndexOf(lineIndex);}
|
||||
public int CharIndexAtLine(int lineIndex) {return textBox.CharIndexOf(lineIndex);}
|
||||
public int LineIndexOfFirst() {return textBox.LineIndexOfFirst();}
|
||||
public int LineIndexOf(int charIndex) {return textBox.LineIndexOf(charIndex);}
|
||||
public PointAdp PosOf(int charIndex) {return textBox.PosOf(charIndex);}
|
||||
public void ScrollLineUp() {textBox.ScrollLineUp();}
|
||||
public void ScrollLineDown() {textBox.ScrollLineDown();}
|
||||
public void ScrollScreenUp() {textBox.ScrollScreenUp();}
|
||||
public void ScrollScreenDown() {textBox.ScrollScreenDown();}
|
||||
public void SelectionStart_toFirstChar() {textBox.SelectionStart_toFirstChar(); GfoEvMgr_.Pub(this, SelectionStartChanged_evt);}
|
||||
public void ScrollTillSelectionStartIsFirstLine() {textBox.ScrollTillSelectionStartIsFirstLine();}
|
||||
|
||||
@Override public GxwElem UnderElem_make(KeyValHash ctorArgs) {return GxwElemFactory_._.text_memo_();}
|
||||
@Override public void ctor_GfuiBox_base(KeyValHash ctorArgs) {
|
||||
super.ctor_GfuiBox_base(ctorArgs);
|
||||
textBox = (GxwTextMemo)UnderElem();
|
||||
this.SetTextBox(textBox);
|
||||
} GxwTextMemo textBox;
|
||||
}
|
||||
77
150_gfui/src_420_box_basic/gplx/gfui/Gfui_html.java
Normal file
77
150_gfui/src_420_box_basic/gplx/gfui/Gfui_html.java
Normal file
@@ -0,0 +1,77 @@
|
||||
/*
|
||||
XOWA: the XOWA Offline Wiki Application
|
||||
Copyright (C) 2012 gnosygnu@gmail.com
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as
|
||||
published by the Free Software Foundation, either version 3 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.gfui; import gplx.*;
|
||||
public class Gfui_html extends GfuiElemBase {
|
||||
public void Under_html_(Gxw_html v) {under = v;} private Gxw_html under;
|
||||
public String Html_doc_html() {return under.Html_doc_html();}
|
||||
public void Html_doc_html_(String s) {under.Html_doc_html_(s);}
|
||||
public String Html_doc_selected_get_text_or_href() {return under.Html_doc_selected_get_text_or_href();}
|
||||
public String Html_doc_selected_get_href_or_text() {return under.Html_doc_selected_get_href_or_text();}
|
||||
public String Html_doc_selected_get_src_or_empty() {return under.Html_doc_selected_get_src_or_empty();}
|
||||
public boolean Html_doc_find(String elem_id, String find, boolean dir_fwd, boolean case_match, boolean wrap_find) {return under.Html_doc_find(elem_id, find, dir_fwd, case_match, wrap_find);}
|
||||
public void Html_doc_body_focus() {under.Html_doc_body_focus();}
|
||||
@gplx.Virtual public String Html_elem_atr_get_str(String elem_id, String atr_key) {return under.Html_elem_atr_get_str(elem_id, atr_key);}
|
||||
@gplx.Virtual public boolean Html_elem_atr_get_bool(String elem_id, String atr_key) {return under.Html_elem_atr_get_bool(elem_id, atr_key);}
|
||||
public boolean Html_elem_atr_set(String elem_id, String atr_key, String v) {return under.Html_elem_atr_set(elem_id, atr_key, v);}
|
||||
public boolean Html_elem_atr_set_append(String elem_id, String atr_key, String append) {return under.Html_elem_atr_set_append(elem_id, atr_key, append);}
|
||||
public boolean Html_elem_delete(String elem_id) {return under.Html_elem_delete(elem_id);}
|
||||
public boolean Html_elem_replace_html(String id, String html) {return under.Html_elem_replace_html(id, html);}
|
||||
public boolean Html_gallery_packed_exec() {return under.Html_gallery_packed_exec();}
|
||||
public void Html_elem_focus(String elem_id) {under.Html_elem_focus(elem_id);}
|
||||
public boolean Html_elem_scroll_into_view(String elem_id) {return under.Html_elem_scroll_into_view(elem_id);}
|
||||
public boolean Html_elem_img_update(String elem_id, String elem_src, int elem_width, int elem_height) {return under.Html_elem_img_update(elem_id, elem_src, elem_width, elem_height);}
|
||||
public String Html_window_vpos() {return under.Html_window_vpos();}
|
||||
public void Html_window_vpos_(String v) {under.Html_window_vpos_(v);}
|
||||
public boolean Html_window_print_preview() {return under.Html_window_print_preview();}
|
||||
public String Html_active_atr_get_str(String atrKey, String or) {return under.Html_active_atr_get_str(atrKey, or);}
|
||||
public void Html_js_enabled_(boolean v) {under.Html_js_enabled_(v);}
|
||||
public void Html_js_eval_proc(String name, String... args) {under.Html_js_eval_proc(name, args);}
|
||||
public String Html_js_eval_script(String script) {return under.Html_js_eval_script(script);}
|
||||
public void Html_js_cbks_add(String js_func_name, GfoInvkAble invk) {under.Html_js_cbks_add(js_func_name, invk);}
|
||||
public void Html_invk_src_(GfoEvObj v) {under.Html_invk_src_(v);}
|
||||
@Override public GfuiElem Text_(String v) {
|
||||
this.Html_doc_html_(v);
|
||||
return this;
|
||||
}
|
||||
public static Gfui_html kit_(Gfui_kit kit, String key, Gxw_html under, KeyValHash ctorArgs) {
|
||||
Gfui_html rv = new Gfui_html();
|
||||
rv.ctor_kit_GfuiElemBase(kit, key, (GxwElem)under, ctorArgs);
|
||||
rv.under = under;
|
||||
return rv;
|
||||
}
|
||||
public static Gfui_html mem_(String key, Gxw_html under) {
|
||||
Gfui_html rv = new Gfui_html();
|
||||
rv.Key_of_GfuiElem_(key);
|
||||
rv.under = under;
|
||||
return rv;
|
||||
}
|
||||
public static Object Js_args_exec(GfoInvkAble invk, Object[] args) {
|
||||
GfoMsg m = Js_args_to_msg(args);
|
||||
return GfoInvkAble_.InvkCmd_msg(invk, m.Key(), m);
|
||||
}
|
||||
public static GfoMsg Js_args_to_msg(Object[] args) {
|
||||
String proc = (String)args[0];
|
||||
GfoMsg rv = GfoMsg_.new_parse_(proc);
|
||||
for (int i = 1; i < args.length; i++)
|
||||
rv.Add(Int_.XtoStr(i), args[i]); // NOTE: args[i] can be either String or String[]
|
||||
return rv;
|
||||
}
|
||||
public static final String Atr_href = "href", Atr_title = "title", Atr_value = "value", Atr_innerHTML = "innerHTML", Atr_src = "src";
|
||||
public static final String Elem_id_body = "body";
|
||||
public static final String Evt_location_changed = "location_changed", Evt_location_changing = "location_changing", Evt_link_hover = "link_hover", Evt_win_resized = "win_resized";
|
||||
}
|
||||
108
150_gfui/src_420_box_basic/gplx/gfui/Gfui_html_cfg.java
Normal file
108
150_gfui/src_420_box_basic/gplx/gfui/Gfui_html_cfg.java
Normal file
@@ -0,0 +1,108 @@
|
||||
/*
|
||||
XOWA: the XOWA Offline Wiki Application
|
||||
Copyright (C) 2012 gnosygnu@gmail.com
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as
|
||||
published by the Free Software Foundation, either version 3 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.gfui; import gplx.*;
|
||||
public class Gfui_html_cfg implements GfoInvkAble {
|
||||
public String Doc_html() {return Exec_fmt(fmtr_doc_html);} private Bry_fmtr fmtr_doc_html = Bry_fmtr.new_();
|
||||
public String Doc_body_focus() {return Exec_fmt(fmtr_doc_body_focus);} private Bry_fmtr fmtr_doc_body_focus = Bry_fmtr.new_();
|
||||
public String Doc_selected_get_text_or_href() {return Exec_fmt(fmtr_doc_selected_get_text_or_href);} private Bry_fmtr fmtr_doc_selected_get_text_or_href = Bry_fmtr.keys_();
|
||||
public String Doc_selected_get_href_or_text() {return Exec_fmt(fmtr_doc_selected_get_href_or_text);} private Bry_fmtr fmtr_doc_selected_get_href_or_text = Bry_fmtr.keys_();
|
||||
public String Doc_selected_get_src_or_empty() {return Exec_fmt(fmtr_doc_selected_get_src_or_empty);} private Bry_fmtr fmtr_doc_selected_get_src_or_empty = Bry_fmtr.keys_();
|
||||
public String Doc_find_html(String find, boolean dir_fwd, boolean case_match, boolean wrap_find, boolean search_text_is_diff, int prv_find_bgn) {
|
||||
return Exec_fmt(fmtr_doc_find_html, find, Bool_.XtoStr_lower(dir_fwd), Bool_.XtoStr_lower(case_match), Bool_.XtoStr_lower(wrap_find), Bool_.XtoStr_lower(search_text_is_diff), Int_.XtoStr(prv_find_bgn));
|
||||
} private Bry_fmtr fmtr_doc_find_html = Bry_fmtr.keys_("find_text", "dir_fwd", "case_match", "wrap_find", "find_text_is_diff", "prv_find_bgn");
|
||||
public String Doc_find_edit(String find, boolean dir_fwd, boolean case_match, boolean wrap_find, boolean search_text_is_diff, int prv_find_bgn) {
|
||||
return Exec_fmt(fmtr_doc_find_edit, find, Bool_.XtoStr_lower(dir_fwd), Bool_.XtoStr_lower(case_match), Bool_.XtoStr_lower(wrap_find), Bool_.XtoStr_lower(search_text_is_diff), Int_.XtoStr(prv_find_bgn));
|
||||
} private Bry_fmtr fmtr_doc_find_edit = Bry_fmtr.keys_("find_text", "dir_fwd", "case_match", "wrap_find", "find_text_is_diff", "prv_find_bgn");
|
||||
public String Elem_atr_get(String elem_id, String atr_key) {return Exec_fmt(fmtr_elem_atr_get, elem_id, atr_key);} private Bry_fmtr fmtr_elem_atr_get = Bry_fmtr.keys_("elem_id", "atr_key");
|
||||
public String Elem_atr_get_toString(String elem_id, String atr_key) {return Exec_fmt(fmtr_elem_atr_get_toString, elem_id, atr_key);} private Bry_fmtr fmtr_elem_atr_get_toString = Bry_fmtr.keys_("elem_id", "atr_key");
|
||||
public String Elem_atr_set(String elem_id, String atr_key, String atr_val) {return Exec_fmt(fmtr_elem_atr_set, elem_id, atr_key, atr_val);} private Bry_fmtr fmtr_elem_atr_set = Bry_fmtr.keys_("elem_id", "atr_key", "atr_val");
|
||||
public String Elem_atr_set_append(String elem_id, String atr_key, String atr_val) {
|
||||
return Exec_fmt(fmtr_elem_atr_set_append, elem_id, atr_key, atr_val);
|
||||
} private Bry_fmtr fmtr_elem_atr_set_append = Bry_fmtr.keys_("elem_id", "atr_key", "atr_val");
|
||||
public String Elem_delete(String elem_id) {return Exec_fmt(fmtr_elem_delete, elem_id);} private Bry_fmtr fmtr_elem_delete = Bry_fmtr.keys_("elem_id");
|
||||
public String Elem_replace_html(String id, String html) {return Exec_fmt(fmtr_elem_replace_html, id, Escape_quote(html));} private Bry_fmtr fmtr_elem_replace_html = Bry_fmtr.keys_("id", "html");
|
||||
public String Gallery_packed_exec() {return Exec_fmt(fmtr_gallery_packed_exec);} private Bry_fmtr fmtr_gallery_packed_exec = Bry_fmtr.keys_();
|
||||
public String Elem_focus(String elem_id) {return Exec_fmt(fmtr_elem_focus, elem_id);} private Bry_fmtr fmtr_elem_focus = Bry_fmtr.keys_("elem_id");
|
||||
public String Elem_scroll_into_view(String elem_id) {return Exec_fmt(fmtr_elem_scroll_into_view, elem_id);} private Bry_fmtr fmtr_elem_scroll_into_view = Bry_fmtr.keys_("elem_id");
|
||||
public String Elem_img_update(String id, String src, int w, int h) {return Exec_fmt(fmtr_elem_img_update, id, src, Int_.XtoStr(w), Int_.XtoStr(h));} Bry_fmtr fmtr_elem_img_update = Bry_fmtr.keys_("elem_id", "elem_src", "elem_width", "elem_height");
|
||||
public String Window_vpos() {return Exec_fmt(fmtr_window_vpos);} private Bry_fmtr fmtr_window_vpos = Bry_fmtr.new_();
|
||||
public String Window_vpos_(String node_path, String scroll_top) {return Exec_fmt(fmtr_window_vpos_, node_path, scroll_top);} private Bry_fmtr fmtr_window_vpos_ = Bry_fmtr.keys_("node_path", "scroll_top");
|
||||
public String Window_print_preview() {return Exec_fmt(fmtr_window_print_preview);} private Bry_fmtr fmtr_window_print_preview = Bry_fmtr.keys_();
|
||||
public String Active_atr_get_str(String atr_key) {return Exec_fmt(fmtr_active_atr_get, atr_key);} private Bry_fmtr fmtr_active_atr_get = Bry_fmtr.keys_("atr_key");
|
||||
public Bry_fmtr Js_scripts_get(String name) {return (Bry_fmtr)js_scripts.Fetch(name);}
|
||||
private void Js_scripts_add(String name, String text) {
|
||||
Bry_fmtr fmtr = Bry_fmtr.new_(text);
|
||||
js_scripts.AddReplace(name, fmtr);
|
||||
} private OrderedHash js_scripts = OrderedHash_.new_();
|
||||
private String Exec_fmt(Bry_fmtr fmtr, String... vals) {
|
||||
if (debug_file != null) GfsCore._.ExecFile(debug_file);
|
||||
return fmtr.Bld_str_many(vals);
|
||||
} private Io_url debug_file = null;
|
||||
private static String Escape_quote(String v) {
|
||||
String rv = v;
|
||||
rv = String_.Replace(rv, "'", "\\'");
|
||||
rv = String_.Replace(rv, "\"", "\\\"");
|
||||
rv = String_.Replace(rv, "\n", "\\n");
|
||||
return rv;
|
||||
}
|
||||
public Object Invk(GfsCtx ctx, int ikey, String k, GfoMsg m) {
|
||||
if (ctx.Match(k, Invk_doc_html_)) fmtr_doc_html.Fmt_(m.ReadBry("v"));
|
||||
else if (ctx.Match(k, Invk_doc_body_focus_)) fmtr_doc_body_focus.Fmt_(m.ReadBry("v"));
|
||||
else if (ctx.Match(k, Invk_doc_selected_get_text_or_href_)) fmtr_doc_selected_get_text_or_href.Fmt_(m.ReadBry("v"));
|
||||
else if (ctx.Match(k, Invk_doc_selected_get_href_or_text_)) fmtr_doc_selected_get_href_or_text.Fmt_(m.ReadBry("v"));
|
||||
else if (ctx.Match(k, Invk_doc_selected_get_src_or_empty_)) fmtr_doc_selected_get_src_or_empty.Fmt_(m.ReadBry("v"));
|
||||
else if (ctx.Match(k, Invk_doc_find_html_)) fmtr_doc_find_html.Fmt_(m.ReadBry("v"));
|
||||
else if (ctx.Match(k, Invk_doc_find_edit_)) fmtr_doc_find_edit.Fmt_(m.ReadBry("v"));
|
||||
else if (ctx.Match(k, Invk_elem_atr_get_)) fmtr_elem_atr_get.Fmt_(m.ReadBry("v"));
|
||||
else if (ctx.Match(k, Invk_elem_atr_get_toString_)) fmtr_elem_atr_get_toString.Fmt_(m.ReadBry("v"));
|
||||
else if (ctx.Match(k, Invk_elem_atr_set_)) fmtr_elem_atr_set.Fmt_(m.ReadBry("v"));
|
||||
else if (ctx.Match(k, Invk_elem_atr_set_append_)) fmtr_elem_atr_set_append.Fmt_(m.ReadBry("v"));
|
||||
else if (ctx.Match(k, Invk_elem_delete_)) fmtr_elem_delete.Fmt_(m.ReadBry("v"));
|
||||
else if (ctx.Match(k, Invk_elem_replace_html_)) fmtr_elem_replace_html.Fmt_(m.ReadBry("v"));
|
||||
else if (ctx.Match(k, Invk_gallery_packed_exec_)) fmtr_gallery_packed_exec.Fmt_(m.ReadBry("v"));
|
||||
else if (ctx.Match(k, Invk_elem_focus_)) fmtr_elem_focus.Fmt_(m.ReadBry("v"));
|
||||
else if (ctx.Match(k, Invk_elem_scroll_into_view_)) fmtr_elem_scroll_into_view.Fmt_(m.ReadBry("v"));
|
||||
else if (ctx.Match(k, Invk_elem_img_update_)) fmtr_elem_img_update.Fmt_(m.ReadBry("v"));
|
||||
else if (ctx.Match(k, Invk_elem_path_get_)) fmtr_window_vpos.Fmt_(m.ReadBry("v"));
|
||||
else if (ctx.Match(k, Invk_win_print_preview_)) fmtr_window_print_preview.Fmt_(m.ReadBry("v"));
|
||||
else if (ctx.Match(k, Invk_elem_path_set_)) fmtr_window_vpos_.Fmt_(m.ReadBry("v"));
|
||||
else if (ctx.Match(k, Invk_doc_active_atr_get_)) fmtr_active_atr_get.Fmt_(m.ReadBry("v"));
|
||||
else if (ctx.Match(k, Invk_js_scripts_add)) Js_scripts_add(m.ReadStr("name"), m.ReadStr("text"));
|
||||
else if (ctx.Match(k, Invk_debug_file_)) debug_file = m.ReadIoUrl("v");
|
||||
else return GfoInvkAble_.Rv_unhandled;
|
||||
return this;
|
||||
}
|
||||
public static void Html_window_vpos_parse(String v, String_obj_ref scroll_top, String_obj_ref node_path) {
|
||||
int pipe_pos = String_.FindFwd(v, "|"); if (pipe_pos == String_.Find_none) return; // if elem_get_path returns invalid value, don't fail; DATE:2014-04-05
|
||||
scroll_top.Val_(String_.Mid(v, 0, pipe_pos));
|
||||
String node_path_val = String_.Mid(v, pipe_pos + 1, String_.Len(v));
|
||||
node_path_val = "'" + String_.Replace(node_path_val, ",", "','") + "'";
|
||||
node_path.Val_(node_path_val);
|
||||
}
|
||||
public static final String Invk_debug_file_ = "debug_file_"
|
||||
, Invk_doc_html_ = "doc_html_", Invk_doc_body_focus_ = "doc_body_focus_", Invk_doc_active_atr_get_ = "doc_active_atr_get_", Invk_doc_find_html_ = "doc_find_html_", Invk_doc_find_edit_ = "doc_find_edit_"
|
||||
, Invk_doc_selected_get_text_or_href_ = "doc_selected_get_text_or_href_", Invk_doc_selected_get_href_or_text_ = "doc_selected_get_href_or_text_", Invk_doc_selected_get_src_or_empty_ = "doc_selected_get_src_or_empty_"
|
||||
, Invk_win_print_preview_ = "win_print_preview_"
|
||||
, Invk_elem_atr_get_ = "elem_atr_get_", Invk_elem_atr_get_toString_ = "elem_atr_get_toString_", Invk_elem_atr_set_ = "elem_atr_set_", Invk_elem_atr_set_append_ = "elem_atr_set_append_"
|
||||
, Invk_elem_path_get_ = "elem_path_get_", Invk_elem_path_set_ = "elem_path_set_"
|
||||
, Invk_elem_focus_ = "elem_focus_", Invk_elem_scroll_into_view_ = "elem_scroll_into_view_"
|
||||
, Invk_elem_img_update_ = "elem_img_update_", Invk_elem_delete_ = "elem_delete_", Invk_elem_replace_html_ = "elem_replace_html_", Invk_gallery_packed_exec_ = "gallery_packed_exec_"
|
||||
, Invk_js_scripts_add = "js_scripts_add"
|
||||
, Invk_javascript_enabled_ = "javascript_enabled_"
|
||||
;
|
||||
}
|
||||
37
150_gfui/src_420_box_basic/gplx/gfui/Gfui_html_cfg_tst.java
Normal file
37
150_gfui/src_420_box_basic/gplx/gfui/Gfui_html_cfg_tst.java
Normal file
@@ -0,0 +1,37 @@
|
||||
/*
|
||||
XOWA: the XOWA Offline Wiki Application
|
||||
Copyright (C) 2012 gnosygnu@gmail.com
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as
|
||||
published by the Free Software Foundation, either version 3 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.gfui; import gplx.*;
|
||||
import org.junit.*;
|
||||
public class Gfui_html_cfg_tst {
|
||||
private Gfui_html_cfg_fxt fxt = new Gfui_html_cfg_fxt();
|
||||
@Before public void init() {fxt.Reset();}
|
||||
@Test public void Html_window_vpos_parse() {
|
||||
fxt.Test_Html_window_vpos_parse("0|0,1,2", "0", "'0','1','2'");
|
||||
fxt.Test_Html_window_vpos_parse("org.eclipse.swt.SWTException: Permission denied for <file://> to get property Selection.rangeCount", null, null); // check that invalid path doesn't fail; DATE:2014-04-05
|
||||
}
|
||||
}
|
||||
class Gfui_html_cfg_fxt {
|
||||
private String_obj_ref scroll_top = String_obj_ref.null_(), node_path = String_obj_ref.null_();
|
||||
public void Reset() {}
|
||||
public void Test_Html_window_vpos_parse(String raw, String expd_scroll_top, String expd_node_path) {
|
||||
scroll_top.Val_null_(); node_path.Val_null_();
|
||||
Gfui_html_cfg.Html_window_vpos_parse(raw, scroll_top, node_path);
|
||||
Tfds.Eq(expd_scroll_top, scroll_top.Val(), expd_scroll_top);
|
||||
Tfds.Eq(expd_node_path, node_path.Val(), expd_node_path);
|
||||
}
|
||||
}
|
||||
30
150_gfui/src_420_box_basic/gplx/gfui/Gfui_tab_itm.java
Normal file
30
150_gfui/src_420_box_basic/gplx/gfui/Gfui_tab_itm.java
Normal file
@@ -0,0 +1,30 @@
|
||||
/*
|
||||
XOWA: the XOWA Offline Wiki Application
|
||||
Copyright (C) 2012 gnosygnu@gmail.com
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as
|
||||
published by the Free Software Foundation, either version 3 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.gfui; import gplx.*;
|
||||
public class Gfui_tab_itm extends GfuiElemBase {
|
||||
private Gxw_tab_itm under;
|
||||
public String Tab_name() {return under.Tab_name();} public void Tab_name_(String v) {under.Tab_name_(v);}
|
||||
public String Tab_tip_text() {return under.Tab_tip_text();} public void Tab_tip_text_(String v) {under.Tab_tip_text_(v);}
|
||||
public void Subs_add(GfuiElem elem) {under.Subs_add(elem);}
|
||||
public static Gfui_tab_itm kit_(Gfui_kit kit, String key, Gxw_tab_itm under, KeyValHash ctor_args) {
|
||||
Gfui_tab_itm rv = new Gfui_tab_itm();
|
||||
// rv.ctor_kit_GfuiElemBase(kit, key, (GxwElem)under, ctor_args); // causes swt_tab_itm to break, since it's not a real Swt Control
|
||||
rv.under = under;
|
||||
return rv;
|
||||
}
|
||||
}
|
||||
38
150_gfui/src_420_box_basic/gplx/gfui/Gfui_tab_itm_data.java
Normal file
38
150_gfui/src_420_box_basic/gplx/gfui/Gfui_tab_itm_data.java
Normal file
@@ -0,0 +1,38 @@
|
||||
/*
|
||||
XOWA: the XOWA Offline Wiki Application
|
||||
Copyright (C) 2012 gnosygnu@gmail.com
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as
|
||||
published by the Free Software Foundation, either version 3 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.gfui; import gplx.*;
|
||||
public class Gfui_tab_itm_data {
|
||||
public Gfui_tab_itm_data(String key, int idx) {this.key = key; this.idx = idx;}
|
||||
public String Key() {return key;} private String key;
|
||||
public int Idx() {return idx;} public Gfui_tab_itm_data Idx_(int v) {idx = v; return this;} private int idx;
|
||||
public String Name() {return name;} public void Name_(String v) {name = v;} private String name;
|
||||
public String Tip_text() {return tip_text;} public Gfui_tab_itm_data Tip_text_(String v) {tip_text = v; return this;} private String tip_text;
|
||||
public boolean Pinned() {return pinned;} public Gfui_tab_itm_data Pinned_(boolean v) {pinned = v; return this;} private boolean pinned;
|
||||
public void Switch(Gfui_tab_itm_data comp) { // NOTE: key is invariant; idx should not be switched, as tab_idx remains the same; only contents have been switched
|
||||
String tmp_str = name;
|
||||
this.name = comp.name; comp.name = tmp_str;
|
||||
tmp_str = tip_text;
|
||||
this.tip_text = comp.tip_text; comp.tip_text = tmp_str;
|
||||
}
|
||||
public static int Get_idx_after_closing(int cur, int len) {
|
||||
if (len < 1) return Idx_null; // 1 or 0 tabs; return -1
|
||||
else if (cur == len - 1) return len - 2; // last tab; select_bwd
|
||||
else return cur + 1; // else, select_fwd
|
||||
}
|
||||
public static final int Idx_null = -1;
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
/*
|
||||
XOWA: the XOWA Offline Wiki Application
|
||||
Copyright (C) 2012 gnosygnu@gmail.com
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as
|
||||
published by the Free Software Foundation, either version 3 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.gfui; import gplx.*;
|
||||
import org.junit.*;
|
||||
public class Gfui_tab_itm_data_tst {
|
||||
@Before public void init() {} private Gfui_tab_itm_data_fxt fxt = new Gfui_tab_itm_data_fxt();
|
||||
@Test public void Get_idx_after_closing() {
|
||||
fxt.Test_Get_idx_after_closing(0, 1, -1);
|
||||
fxt.Test_Get_idx_after_closing(4, 5, 3);
|
||||
fxt.Test_Get_idx_after_closing(3, 5, 4);
|
||||
}
|
||||
}
|
||||
class Gfui_tab_itm_data_fxt {
|
||||
public void Test_Get_idx_after_closing(int cur, int len, int expd) {
|
||||
Tfds.Eq(expd, Gfui_tab_itm_data.Get_idx_after_closing(cur, len));
|
||||
}
|
||||
}
|
||||
46
150_gfui/src_420_box_basic/gplx/gfui/Gfui_tab_mgr.java
Normal file
46
150_gfui/src_420_box_basic/gplx/gfui/Gfui_tab_mgr.java
Normal file
@@ -0,0 +1,46 @@
|
||||
/*
|
||||
XOWA: the XOWA Offline Wiki Application
|
||||
Copyright (C) 2012 gnosygnu@gmail.com
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU Affero General Public License as
|
||||
published by the Free Software Foundation, either version 3 of the
|
||||
License, or (at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU Affero General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU Affero General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.gfui; import gplx.*;
|
||||
public class Gfui_tab_mgr extends GfuiElemBase {
|
||||
public void Under_tab_mgr_(Gxw_tab_mgr v) {under = v;} private Gxw_tab_mgr under;
|
||||
public ColorAdp Btns_selected_color() {return under.Btns_selected_color();} public void Btns_selected_color_(ColorAdp v) {under.Btns_selected_color_(v);}
|
||||
public ColorAdp Btns_unselected_color() {return under.Btns_unselected_color();} public void Btns_unselected_color_(ColorAdp v) {under.Btns_unselected_color_(v);}
|
||||
public Gfui_tab_itm Tabs_add(Gfui_tab_itm_data tab_data) {
|
||||
Gxw_tab_itm tab_itm = under.Tabs_add(tab_data);
|
||||
return Gfui_tab_itm.kit_(this.Kit(), tab_data.Key(), tab_itm, KeyValHash.Empty);
|
||||
}
|
||||
public int Btns_height() {return under.Btns_height();} public void Btns_height_(int v) {under.Btns_height_(v);}
|
||||
public boolean Btns_place_on_top() {return under.Btns_place_on_top();} public void Btns_place_on_top_(boolean v) {under.Btns_place_on_top_(v);}
|
||||
public boolean Btns_curved() {return under.Btns_curved();} public void Btns_curved_(boolean v) {under.Btns_curved_(v);}
|
||||
public boolean Btns_close_visible_() {return under.Btns_close_visible();} public void Btns_close_visible_(boolean v) {under.Btns_close_visible_(v);}
|
||||
public boolean Btns_unselected_close_visible() {return under.Btns_unselected_close_visible();} public void Btns_unselected_close_visible_(boolean v) {under.Btns_unselected_close_visible_(v);}
|
||||
public void Tabs_select_by_idx(int idx) {under.Tabs_select_by_idx(idx);}
|
||||
public void Tabs_close_by_idx(int idx) {under.Tabs_close_by_idx(idx);}
|
||||
public void Tabs_switch(int src, int trg) {under.Tabs_switch(src, trg);}
|
||||
public static Gfui_tab_mgr kit_(Gfui_kit kit, String key, Gxw_tab_mgr under, KeyValHash ctor_args) {
|
||||
Gfui_tab_mgr rv = new Gfui_tab_mgr();
|
||||
rv.ctor_kit_GfuiElemBase(kit, key, (GxwElem)under, ctor_args);
|
||||
rv.under = under;
|
||||
return rv;
|
||||
}
|
||||
public static final String
|
||||
Evt_tab_selected = "tab_selected"
|
||||
, Evt_tab_closed = "tab_closed"
|
||||
, Evt_tab_switched = "tab_switched"
|
||||
;
|
||||
}
|
||||
Reference in New Issue
Block a user