mirror of
https://github.com/gnosygnu/xowa.git
synced 2026-03-02 03:49:30 +00:00
'v3.6.3.1'
This commit is contained in:
@@ -1,20 +1,7 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<classpath>
|
||||
<classpathentry kind="src" path="src_100_basic"/>
|
||||
<classpathentry kind="src" path="src_110_draw_core"/>
|
||||
<classpathentry kind="src" path="src_120_draw_objs"/>
|
||||
<classpathentry kind="src" path="src_200_ipt"/>
|
||||
<classpathentry kind="src" path="src_210_lyt"/>
|
||||
<classpathentry kind="src" path="src_300_gxw"/>
|
||||
<classpathentry kind="src" path="src_400_win"/>
|
||||
<classpathentry kind="src" path="src_410_box_core"/>
|
||||
<classpathentry kind="src" path="src_420_box_basic"/>
|
||||
<classpathentry kind="src" path="src_430_box_custom"/>
|
||||
<classpathentry kind="src" path="src_500_tab"/>
|
||||
<classpathentry kind="src" path="src_600_adp"/>
|
||||
<classpathentry kind="src" path="src_700_env"/>
|
||||
<classpathentry kind="src" path="tst"/>
|
||||
<classpathentry kind="src" path="xtn"/>
|
||||
<classpathentry kind="src" path="src"/>
|
||||
<classpathentry kind="src" path="/100_core"/>
|
||||
<classpathentry kind="con" path="org.eclipse.jdt.junit.JUNIT_CONTAINER/4"/>
|
||||
<classpathentry combineaccessrules="false" kind="src" path="/110_gfml"/>
|
||||
|
||||
@@ -29,7 +29,7 @@ public class DirInt {
|
||||
}
|
||||
public boolean BoundFail(int i, int bound) {return this == Bwd ? i < bound : i > bound;}
|
||||
DirInt(int v) {this.val = v;}
|
||||
public static final DirInt
|
||||
public static final DirInt
|
||||
Fwd = new DirInt(1)
|
||||
, Bwd = new DirInt(-1);
|
||||
}
|
||||
@@ -20,18 +20,18 @@ import gplx.core.interfaces.*;
|
||||
public class GfuiAlign_ implements ParseAble {
|
||||
public static GfuiAlign as_(Object obj) {return obj instanceof GfuiAlign ? (GfuiAlign)obj : null;}
|
||||
public static GfuiAlign cast(Object obj) {try {return (GfuiAlign)obj;} catch(Exception exc) {throw Err_.new_type_mismatch_w_exc(exc, GfuiAlign.class, obj);}}
|
||||
public static final GfuiAlign
|
||||
public static final GfuiAlign
|
||||
Null = new_(0, "nil")
|
||||
, Lo = new_(1, "lo")
|
||||
, Mid = new_(2, "mid")
|
||||
, Hi = new_(3, "hi");
|
||||
public static final GfuiAlign
|
||||
public static final GfuiAlign
|
||||
Top = Lo
|
||||
, Bot = Hi
|
||||
, Left = Lo
|
||||
, Right = Hi;
|
||||
static GfuiAlign new_(int v, String s) {return new GfuiAlign(v, s);}
|
||||
public static final GfuiAlign_ Parser = new GfuiAlign_();
|
||||
public static final GfuiAlign_ Parser = new GfuiAlign_();
|
||||
public Object ParseAsObj(String raw) {return parse(raw);}
|
||||
public static GfuiAlign val_(int v) {
|
||||
if (v == Lo.Val()) return Lo;
|
||||
@@ -20,6 +20,6 @@ public class GfuiAxisType {
|
||||
public int Val() {return val;} int val;
|
||||
public GfuiAxisType CrossAxis() {return val == GfuiAxisType.X.val ? GfuiAxisType.Y : GfuiAxisType.X;}
|
||||
GfuiAxisType(int v) {this.val = v;}
|
||||
public static final GfuiAxisType X = new GfuiAxisType(1);
|
||||
public static final GfuiAxisType Y = new GfuiAxisType(2);
|
||||
public static final GfuiAxisType X = new GfuiAxisType(1);
|
||||
public static final GfuiAxisType Y = new GfuiAxisType(2);
|
||||
}
|
||||
@@ -24,11 +24,11 @@ public class GfuiBorderEdge {
|
||||
return new GfuiBorderEdge(comp.val + val);
|
||||
}
|
||||
@gplx.Internal protected GfuiBorderEdge(int v) {this.val = v;}
|
||||
public static final GfuiBorderEdge Left = new GfuiBorderEdge(1);
|
||||
public static final GfuiBorderEdge Right = new GfuiBorderEdge(2);
|
||||
public static final GfuiBorderEdge Top = new GfuiBorderEdge(4);
|
||||
public static final GfuiBorderEdge Bot = new GfuiBorderEdge(8);
|
||||
public static final GfuiBorderEdge All = new GfuiBorderEdge(15);
|
||||
public static final GfuiBorderEdge Left = new GfuiBorderEdge(1);
|
||||
public static final GfuiBorderEdge Right = new GfuiBorderEdge(2);
|
||||
public static final GfuiBorderEdge Top = new GfuiBorderEdge(4);
|
||||
public static final GfuiBorderEdge Bot = new GfuiBorderEdge(8);
|
||||
public static final GfuiBorderEdge All = new GfuiBorderEdge(15);
|
||||
}
|
||||
class GfuiBorderEdge_ {
|
||||
public static String To_str(GfuiBorderEdge edge) {
|
||||
@@ -48,7 +48,7 @@ class GfuiBorderEdge_ {
|
||||
else if (String_.Eq(raw, All_raw)) return GfuiBorderEdge.All;
|
||||
else throw Err_.new_unhandled(raw);
|
||||
}
|
||||
public static final String
|
||||
public static final String
|
||||
All_raw = "all"
|
||||
, Top_raw = "top"
|
||||
, Left_raw = "left"
|
||||
@@ -17,11 +17,11 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.gfui; import gplx.*;
|
||||
public class PointAdp implements To_str_able {
|
||||
public int X() {return x;} final int x;
|
||||
public int Y() {return y;} final int y;
|
||||
public int X() {return x;} final int x;
|
||||
public int Y() {return y;} final int y;
|
||||
public PointAdp Op_add(PointAdp val) {return new PointAdp(x + val.x, y + val.y);}
|
||||
@gplx.Internal protected PointAdp Op_add(int xv, int yv) {return new PointAdp(x + xv, y + yv);}
|
||||
@gplx.Internal protected PointAdp Op_add(int i) {return new PointAdp(x + i, y + i);}
|
||||
public PointAdp Op_add(int xv, int yv) {return new PointAdp(x + xv, y + yv);}
|
||||
public PointAdp Op_add(int i) {return new PointAdp(x + i, y + i);}
|
||||
public PointAdp Op_subtract(PointAdp val) {return new PointAdp(x - val.x, y - val.y);}
|
||||
public boolean Eq(Object compObj) {
|
||||
PointAdp comp = PointAdp_.as_(compObj); if (comp == null) return false;
|
||||
@@ -31,5 +31,5 @@ public class PointAdp implements To_str_able {
|
||||
@Override public String toString() {return To_str();}
|
||||
@Override public boolean equals(Object obj) {return Eq(obj);}
|
||||
@Override public int hashCode() {return super.hashCode();}
|
||||
@gplx.Internal protected PointAdp(int x, int y) {this.x = x; this.y = y;}
|
||||
public PointAdp(int x, int y) {this.x = x; this.y = y;}
|
||||
}
|
||||
@@ -17,8 +17,8 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.gfui; import gplx.*;
|
||||
public class PointAdp_ {
|
||||
public static final PointAdp Null = new PointAdp(Int_.Min_value, Int_.Min_value);
|
||||
public static final PointAdp Zero = new PointAdp(0, 0);
|
||||
public static final PointAdp Null = new PointAdp(Int_.Min_value, Int_.Min_value);
|
||||
public static final PointAdp Zero = new PointAdp(0, 0);
|
||||
public static PointAdp as_(Object obj) {return obj instanceof PointAdp ? (PointAdp)obj : null;}
|
||||
public static PointAdp cast(Object obj) {try {return (PointAdp)obj;} catch(Exception exc) {throw Err_.new_type_mismatch_w_exc(exc, PointAdp.class, obj);}}
|
||||
public static PointAdp new_(int x, int y) {return new PointAdp(x, y);}
|
||||
@@ -40,5 +40,5 @@ public class RectAdp {
|
||||
@Override public int hashCode() {return super.hashCode();}
|
||||
public String Xto_str() {return String_.Concat_any(pos, ",", size);}
|
||||
|
||||
@gplx.Internal protected RectAdp(PointAdp pos, SizeAdp size) {this.pos = pos; this.size = size;}
|
||||
public RectAdp(PointAdp pos, SizeAdp size) {this.pos = pos; this.size = size;}
|
||||
}
|
||||
@@ -24,7 +24,7 @@ public class RectAdpF { //_20101206 // supports Graphics.MeasureString
|
||||
return comp.x == x && comp.y == y && comp.width == width && comp.height == height;
|
||||
}
|
||||
|
||||
public static final RectAdpF Null = new_(Int_.Min_value, Int_.Min_value, Int_.Min_value, Int_.Min_value);
|
||||
public static final RectAdpF Null = new_(Int_.Min_value, Int_.Min_value, Int_.Min_value, Int_.Min_value);
|
||||
public static RectAdpF new_(float x, float y, float width, float height) {
|
||||
RectAdpF rv = new RectAdpF();
|
||||
rv.x = x; rv.y = y; rv.width = width; rv.height = height;
|
||||
@@ -17,7 +17,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.gfui; import gplx.*;
|
||||
public class RectAdp_ {
|
||||
public static final RectAdp Zero = new RectAdp(PointAdp_.Zero, SizeAdp_.Zero);
|
||||
public static final RectAdp Zero = new RectAdp(PointAdp_.Zero, SizeAdp_.Zero);
|
||||
public static RectAdp new_(int x, int y, int width, int height) {return new RectAdp(PointAdp_.new_(x, y), SizeAdp_.new_(width, height));}
|
||||
public static RectAdp corners_(PointAdp upperLeft, PointAdp bottomRight) {return new RectAdp(upperLeft, SizeAdp_.corners_(upperLeft, bottomRight));}
|
||||
public static RectAdp vector_(PointAdp pos, SizeAdp size) {return new RectAdp(pos, size);}
|
||||
@@ -21,9 +21,9 @@ public class SizeAdp {
|
||||
public int Height() {return height;} int height;
|
||||
public int AxisLength(GfuiAxisType axis) {return axis == GfuiAxisType.X ? width : height;}
|
||||
public SizeAdp Op_add(int w, int h) {return SizeAdp_.new_(width + w, height + h);}
|
||||
@gplx.Internal protected SizeAdp Op_add(SizeAdp s) {return SizeAdp_.new_(width + s.width, height + s.height);}
|
||||
@gplx.Internal protected SizeAdp Op_subtract(int val) {return SizeAdp_.new_(width - val, height - val);}
|
||||
@gplx.Internal protected SizeAdp Op_subtract(int w, int h) {return SizeAdp_.new_(width - w, height - h);}
|
||||
public SizeAdp Op_add(SizeAdp s) {return SizeAdp_.new_(width + s.width, height + s.height);}
|
||||
public SizeAdp Op_subtract(int val) {return SizeAdp_.new_(width - val, height - val);}
|
||||
public SizeAdp Op_subtract(int w, int h) {return SizeAdp_.new_(width - w, height - h);}
|
||||
public String To_str() {return String_.Concat_any(width, ",", height);}
|
||||
public boolean Eq(Object o) {
|
||||
SizeAdp comp = (SizeAdp)o; if (comp == null) return false;
|
||||
@@ -32,5 +32,5 @@ public class SizeAdp {
|
||||
@Override public String toString() {return To_str();}
|
||||
@Override public boolean equals(Object obj) {return Eq(obj);}
|
||||
@Override public int hashCode() {return super.hashCode();}
|
||||
@gplx.Internal protected SizeAdp(int width, int height) {this.width = width; this.height = height;}
|
||||
public SizeAdp(int width, int height) {this.width = width; this.height = height;}
|
||||
}
|
||||
@@ -17,9 +17,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.gfui; import gplx.*;
|
||||
public class SizeAdpF_ {
|
||||
public static final SizeAdpF Null = new_(Int_.Min_value, Int_.Min_value);
|
||||
public static final SizeAdpF Zero = new_(0, 0);
|
||||
public static final SizeAdpF Parser = new SizeAdpF(0, 0);
|
||||
public static final SizeAdpF Null = new_(Int_.Min_value, Int_.Min_value);
|
||||
public static final SizeAdpF Zero = new_(0, 0);
|
||||
public static final SizeAdpF Parser = new SizeAdpF(0, 0);
|
||||
public static SizeAdpF as_(Object obj) {return obj instanceof SizeAdpF ? (SizeAdpF)obj : null;}
|
||||
public static SizeAdpF new_(float width, float height) {return new SizeAdpF(width, height);}
|
||||
public static SizeAdpF coerce_(Object obj) {SizeAdpF rv = as_(obj); return rv == null ? parse((String)obj) : rv;}
|
||||
@@ -17,9 +17,9 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
package gplx.gfui; import gplx.*;
|
||||
public class SizeAdp_ {
|
||||
public static final SizeAdp Null = new SizeAdp(Int_.Min_value, Int_.Min_value);
|
||||
public static final SizeAdp Zero = new SizeAdp(0, 0);
|
||||
public static final SizeAdp[] Ary_empty = new SizeAdp[0];
|
||||
public static final SizeAdp Null = new SizeAdp(Int_.Min_value, Int_.Min_value);
|
||||
public static final SizeAdp Zero = new SizeAdp(0, 0);
|
||||
public static final SizeAdp[] Ary_empty = new SizeAdp[0];
|
||||
public static SizeAdp cast(Object obj) {try {return (SizeAdp)obj;} catch(Exception exc) {throw Err_.new_type_mismatch_w_exc(exc, SizeAdp.class, obj);}}
|
||||
public static SizeAdp new_(int width, int height) {return new SizeAdp(width, height);}
|
||||
public static SizeAdp parse(String raw) {return parse_or(raw, SizeAdp_.Null);}
|
||||
@@ -15,7 +15,8 @@ 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.*;
|
||||
package gplx.gfui.controls; import gplx.*; import gplx.gfui.*;
|
||||
import gplx.gfui.draws.*; import gplx.gfui.gfxs.*;
|
||||
import gplx.core.strings.*;
|
||||
public class GfuiBorderMgr {
|
||||
public PenAdp All() {return all;} public GfuiBorderMgr All_(PenAdp v) {SyncPens(true); all = v; return this;} PenAdp all;
|
||||
@@ -15,8 +15,8 @@ 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.*;
|
||||
package gplx.gfui.controls; import gplx.*; import gplx.gfui.*;
|
||||
import org.junit.*; import gplx.gfui.draws.*; import gplx.gfui.imgs.*;
|
||||
public class GfuiBorderMgr_tst {
|
||||
@Before public void setup() {
|
||||
borderMgr = GfuiBorderMgr.new_();
|
||||
@@ -15,23 +15,23 @@ 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.core.interfaces.*;
|
||||
public class DataBndr_whenEvt_execCmd implements InjectAble, GfoInvkAble, GfoEvObj {
|
||||
public GfoEvMgr EvMgr() {if (evMgr == null) evMgr = GfoEvMgr.new_(this); return evMgr;} GfoEvMgr evMgr;
|
||||
package gplx.gfui.controls.customs; import gplx.*; import gplx.gfui.*; import gplx.gfui.controls.*;
|
||||
import gplx.core.interfaces.*; import gplx.gfui.controls.elems.*;
|
||||
public class DataBndr_whenEvt_execCmd implements InjectAble, Gfo_invk, Gfo_evt_itm {
|
||||
public Gfo_evt_mgr Evt_mgr() {if (evt_mgr == null) evt_mgr = new Gfo_evt_mgr(this); return evt_mgr;} Gfo_evt_mgr evt_mgr;
|
||||
public DataBndr_whenEvt_execCmd WhenArg_(String v) {whenArg = v; return this;} private String whenArg = "v";
|
||||
public DataBndr_whenEvt_execCmd WhenEvt_(GfoEvObj whenSrc, String whenEvt) {
|
||||
public DataBndr_whenEvt_execCmd WhenEvt_(Gfo_evt_itm whenSrc, String whenEvt) {
|
||||
this.whenEvt = whenEvt;
|
||||
GfoEvMgr_.SubSame(whenSrc, whenEvt, this);
|
||||
Gfo_evt_mgr_.Sub_same(whenSrc, whenEvt, this);
|
||||
return this;
|
||||
}
|
||||
public DataBndr_whenEvt_execCmd GetCmd_(GfoInvkAble getInvk, String getCmd) {
|
||||
public DataBndr_whenEvt_execCmd GetCmd_(Gfo_invk getInvk, String getCmd) {
|
||||
this.getInvk = getInvk;
|
||||
this.getCmd = getCmd;
|
||||
return this;
|
||||
} GfoInvkAble getInvk; String getCmd;
|
||||
} Gfo_invk getInvk; String getCmd;
|
||||
public void Inject(Object owner) {
|
||||
setInvk = GfoInvkAble_.cast(owner);
|
||||
setInvk = (Gfo_invk)owner;
|
||||
}
|
||||
public Object Invk(GfsCtx ctx, int ikey, String k, GfoMsg m) {
|
||||
if (ctx.Match(k, whenEvt)) {
|
||||
@@ -39,11 +39,11 @@ public class DataBndr_whenEvt_execCmd implements InjectAble, GfoInvkAble, GfoEvO
|
||||
Object getVal = getInvk.Invk(GfsCtx.Instance, 0, getCmd, GfoMsg_.new_cast_(getCmd).Add("v", evtVal));
|
||||
GfoMsg setMsg = GfoMsg_.new_cast_(setCmd).Add("v", Object_.Xto_str_strict_or_empty(getVal));
|
||||
setInvk.Invk(GfsCtx.Instance, 0, setCmd, setMsg);
|
||||
return GfoInvkAble_.Rv_handled;
|
||||
return Gfo_invk_.Rv_handled;
|
||||
}
|
||||
else return GfoInvkAble_.Rv_unhandled;
|
||||
else return Gfo_invk_.Rv_unhandled;
|
||||
}
|
||||
String whenEvt, setCmd; GfoInvkAble setInvk;
|
||||
String whenEvt, setCmd; Gfo_invk setInvk;
|
||||
public static DataBndr_whenEvt_execCmd text_() {
|
||||
DataBndr_whenEvt_execCmd rv = new DataBndr_whenEvt_execCmd();
|
||||
rv.setCmd = GfuiElemKeys.Text_set;
|
||||
@@ -15,11 +15,12 @@ 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 GfuiBnd_box_status implements GfoInvkAble, UsrMsgWkr {
|
||||
package gplx.gfui.controls.customs; import gplx.*; import gplx.gfui.*; import gplx.gfui.controls.*;
|
||||
import gplx.gfui.draws.*; import gplx.gfui.kits.core.*; import gplx.gfui.envs.*; import gplx.gfui.controls.windows.*; import gplx.gfui.controls.elems.*; import gplx.gfui.controls.standards.*;
|
||||
public class GfuiBnd_box_status implements Gfo_invk, UsrMsgWkr {
|
||||
public GfuiElem Box() {return box;} GfuiElem box;
|
||||
public void ExecUsrMsg(int type, UsrMsg umsg) {
|
||||
box.Invoke(GfoInvkAbleCmd.arg_(this, WriteText_cmd, umsg.To_str()));
|
||||
box.Invoke(Gfo_invk_cmd.New_by_val(this, WriteText_cmd, umsg.To_str()));
|
||||
}
|
||||
public void WriteText(String text) {
|
||||
GfuiElem lastFocus = GfuiFocusMgr.Instance.FocusedElem(); // HACK:WINFORMS:.Visible=true will automatically transfer focus to textBox; force Focus back to original
|
||||
@@ -41,7 +42,7 @@ public class GfuiBnd_box_status implements GfoInvkAble, UsrMsgWkr {
|
||||
if (ctx.Match(k, WriteText_cmd)) WriteText(m.ReadStr("v"));
|
||||
else if (ctx.Match(k, TimerTick_evt)) HideWin();
|
||||
return this;
|
||||
} static final String TimerTick_evt = "TimerTick", WriteText_cmd = "WriteText";
|
||||
} static final String TimerTick_evt = "TimerTick", WriteText_cmd = "WriteText";
|
||||
TimerAdp timer;
|
||||
public static GfuiBnd_box_status new_(String key) {
|
||||
GfuiBnd_box_status rv = new GfuiBnd_box_status();
|
||||
@@ -15,8 +15,9 @@ 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.*;
|
||||
package gplx.gfui.controls.customs; import gplx.*; import gplx.gfui.*; import gplx.gfui.controls.*;
|
||||
import gplx.core.lists.*;
|
||||
import gplx.gfui.controls.gxws.*; import gplx.gfui.controls.elems.*;
|
||||
public class GfuiCheckListBox extends GfuiElemBase {
|
||||
public void Items_reverse() {checkListBox.Items_reverse();}
|
||||
public void Items_count() {checkListBox.Items_count();}
|
||||
@@ -15,7 +15,8 @@ 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.*;
|
||||
package gplx.gfui.controls.customs; import gplx.*; import gplx.gfui.*; import gplx.gfui.controls.*;
|
||||
import gplx.gfui.layouts.*; import gplx.gfui.controls.elems.*; import gplx.gfui.controls.standards.*;
|
||||
public class GfuiCheckListPanel extends GfuiElemBase {
|
||||
@Override public void ctor_GfuiBox_base(Keyval_hash ctorArgs) {
|
||||
super.ctor_GfuiBox_base(ctorArgs);
|
||||
@@ -49,7 +50,7 @@ public class GfuiCheckListPanel extends GfuiElemBase {
|
||||
else if (ctx.Match(k, ReverseChks_cmd)) listBox.Items_reverse();
|
||||
else return super.Invk(ctx, ikey, k, m);
|
||||
return this;
|
||||
} public static final String ToggleChecks_cmd = "ToggleChecks", ReverseChks_cmd = "ReverseChks";
|
||||
} public static final String ToggleChecks_cmd = "ToggleChecks", ReverseChks_cmd = "ReverseChks";
|
||||
GfuiChkBox toggle;
|
||||
GfuiCheckListBox listBox = GfuiCheckListBox.new_();
|
||||
public static GfuiCheckListPanel new_() {
|
||||
@@ -15,7 +15,8 @@ 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.*;
|
||||
package gplx.gfui.controls.customs; import gplx.*; import gplx.gfui.*; import gplx.gfui.controls.*;
|
||||
import gplx.gfui.layouts.*; import gplx.gfui.kits.core.*; import gplx.gfui.controls.windows.*; import gplx.gfui.controls.elems.*;
|
||||
public class GfuiFormPanel extends GfuiElemBase {
|
||||
@Override public void ctor_GfuiBox_base(Keyval_hash ctorArgs) {
|
||||
super.ctor_GfuiBox_base(ctorArgs);
|
||||
@@ -15,11 +15,12 @@ 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.*;
|
||||
package gplx.gfui.controls.customs; import gplx.*; import gplx.gfui.*; import gplx.gfui.controls.*;
|
||||
import java.io.File;
|
||||
import java.awt.FileDialog;
|
||||
|
||||
import javax.swing.JFrame;
|
||||
import gplx.gfui.controls.elems.*; import gplx.gfui.controls.windows.*;
|
||||
public class GfuiIoDialogUtl {
|
||||
public static Io_url SelectDir() {return SelectDir(Io_url_.Empty);}
|
||||
public static Io_url SelectDir(Io_url startingDir) {
|
||||
@@ -15,7 +15,8 @@ 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.*;
|
||||
package gplx.gfui.controls.customs; import gplx.*; import gplx.gfui.*; import gplx.gfui.controls.*;
|
||||
import gplx.gfui.layouts.*; import gplx.gfui.controls.elems.*; import gplx.gfui.controls.standards.*;
|
||||
public abstract class GfuiIoUrlSelectBox extends GfuiElemBase {
|
||||
@Override public void ctor_GfuiBox_base(Keyval_hash ctorArgs) {
|
||||
super.ctor_GfuiBox_base(ctorArgs);
|
||||
@@ -26,7 +27,7 @@ public abstract class GfuiIoUrlSelectBox extends GfuiElemBase {
|
||||
this.Lyt_activate();
|
||||
this.Lyt().Bands_add(GftBand.new_().Cell_abs_(60).Cell_pct_(100).Cell_abs_(30));
|
||||
}
|
||||
public static final String PathSelected_evt = "PathSelected_evt";
|
||||
public static final String PathSelected_evt = "PathSelected_evt";
|
||||
public GfuiLbl Label() {return label;} GfuiLbl label;
|
||||
public Io_url Url() {return Io_url_.new_any_(pathBox.TextMgr().Val());}
|
||||
public Io_url StartingFolder() {return startingFolder;}
|
||||
@@ -37,14 +38,14 @@ public abstract class GfuiIoUrlSelectBox extends GfuiElemBase {
|
||||
Io_url selectedPath = SelectAction_hook(this.startingFolder);
|
||||
if (selectedPath.EqNull()) return;
|
||||
pathBox.Text_(selectedPath.Raw());
|
||||
GfoEvMgr_.Pub(this, PathSelected_evt);
|
||||
Gfo_evt_mgr_.Pub(this, PathSelected_evt);
|
||||
}
|
||||
protected abstract Io_url SelectAction_hook(Io_url startingFolder);
|
||||
@Override public Object Invk(GfsCtx ctx, int ikey, String k, GfoMsg m) {
|
||||
if (ctx.Match(k, SelectAction_cmd)) SelectAction();
|
||||
else return super.Invk(ctx, ikey, k, m);
|
||||
return this;
|
||||
} public static final String SelectAction_cmd = "SelectAction";
|
||||
} public static final String SelectAction_cmd = "SelectAction";
|
||||
|
||||
GfuiComboBox pathBox = GfuiComboBox.new_();
|
||||
}
|
||||
@@ -15,7 +15,7 @@ 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.*;
|
||||
package gplx.gfui.controls.customs; import gplx.*; import gplx.gfui.*; import gplx.gfui.controls.*;
|
||||
public class GfuiIoUrlSelectBox_ {
|
||||
public static GfuiIoUrlSelectBox dir_() {return IoFolderSelector.new_();}
|
||||
public static GfuiIoUrlSelectBox fil_() {return IoFileSelector.new_();}
|
||||
@@ -15,11 +15,12 @@ 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.*;
|
||||
package gplx.gfui.controls.customs; import gplx.*; import gplx.gfui.*; import gplx.gfui.controls.*;
|
||||
import gplx.gfui.ipts.*; import gplx.gfui.controls.elems.*;
|
||||
import gplx.core.interfaces.*;
|
||||
public class GfuiMoveElemBnd implements IptBnd, GfoInvkAble, InjectAble {
|
||||
public class GfuiMoveElemBnd implements IptBnd, Gfo_invk, InjectAble {
|
||||
public String Key() {return "gplx.gfui.moveWidget";}
|
||||
public List_adp Ipts() {return args;} List_adp args = List_adp_.new_();
|
||||
public List_adp Ipts() {return args;} List_adp args = List_adp_.New();
|
||||
public IptEventType EventTypes() {return IptEventType_.add_(IptEventType_.KeyDown, IptEventType_.MouseDown, IptEventType_.MouseMove, IptEventType_.MouseUp);}
|
||||
public void Exec(IptEventData iptData) {
|
||||
int val = iptData.EventType().Val();
|
||||
@@ -29,11 +30,11 @@ public class GfuiMoveElemBnd implements IptBnd, GfoInvkAble, InjectAble {
|
||||
else if (val == IptEventType_.MouseMove.Val()) ExecMouseMove(iptData);
|
||||
}
|
||||
public GfuiElem TargetElem() {return targetElem;} public void TargetElem_set(GfuiElem v) {this.targetElem = v;} GfuiElem targetElem;
|
||||
public static final String target_idk = "target";
|
||||
public static final String target_idk = "target";
|
||||
@gplx.Virtual public Object Invk(GfsCtx ctx, int ikey, String k, GfoMsg m) {
|
||||
if (ctx.Match(k, target_idk)) return targetElem;
|
||||
else if (ctx.Match(k, "key")) return key;
|
||||
else return GfoInvkAble_.Rv_unhandled;
|
||||
else return Gfo_invk_.Rv_unhandled;
|
||||
}
|
||||
|
||||
public String Key_of_GfuiElem() {return keyIdf;} public void Key_of_GfuiElem_(String val) {keyIdf = val;} private String keyIdf = "moveElemBtnBnd";
|
||||
@@ -63,7 +64,7 @@ public class GfuiMoveElemBnd implements IptBnd, GfoInvkAble, InjectAble {
|
||||
public Object Srl(GfoMsg owner) {return IptBnd_.Srl(owner, this);}
|
||||
|
||||
boolean moving = false;
|
||||
PointAdp anchor = PointAdp_.Zero; Hash_adp hash = Hash_adp_.new_();
|
||||
PointAdp anchor = PointAdp_.Zero; Hash_adp hash = Hash_adp_.New();
|
||||
public static GfuiMoveElemBnd new_() {return new GfuiMoveElemBnd();}
|
||||
GfuiMoveElemBnd() {
|
||||
args.Add_many(IptMouseBtn_.Left, IptMouseMove.AnyDirection);
|
||||
@@ -15,7 +15,8 @@ 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.*;
|
||||
package gplx.gfui.controls.customs; import gplx.*; import gplx.gfui.*; import gplx.gfui.controls.*;
|
||||
import gplx.gfui.ipts.*; import gplx.gfui.layouts.*; import gplx.gfui.controls.gxws.*; import gplx.gfui.controls.elems.*; import gplx.gfui.controls.standards.*; import gplx.gfui.controls.windows.*;
|
||||
public class GfuiMoveElemBtn extends GfuiBtn { @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);
|
||||
@@ -28,7 +29,7 @@ public class GfuiMoveElemBtn extends GfuiBtn { @Override public GxwElem UnderEl
|
||||
}
|
||||
public void TargetElem_set(GfuiElem v) {moveBinding.TargetElem_set(v);}
|
||||
|
||||
final GfuiMoveElemBnd moveBinding = GfuiMoveElemBnd.new_();
|
||||
final GfuiMoveElemBnd moveBinding = GfuiMoveElemBnd.new_();
|
||||
public static GfuiMoveElemBtn new_() {
|
||||
GfuiMoveElemBtn rv = new GfuiMoveElemBtn();
|
||||
rv.ctor_GfuiBox_base(GfuiElem_.init_focusAble_true_());
|
||||
@@ -37,7 +38,7 @@ public class GfuiMoveElemBtn extends GfuiBtn { @Override public GxwElem UnderEl
|
||||
}
|
||||
class GfuiResizeFormBnd implements IptBnd {
|
||||
public String Key() {return "gplx.gfui.resizeForm";}
|
||||
public List_adp Ipts() {return args;} List_adp args = List_adp_.new_();
|
||||
public List_adp Ipts() {return args;} List_adp args = List_adp_.New();
|
||||
public IptEventType EventTypes() {return IptEventType_.KeyDown.Add(IptEventType_.MouseDown).Add(IptEventType_.MouseUp).Add(IptEventType_.MouseMove);}
|
||||
public void Exec(IptEventData iptData) {
|
||||
int val = iptData.EventType().Val();
|
||||
@@ -75,7 +76,7 @@ class GfuiResizeFormBnd implements IptBnd {
|
||||
static SizeAdp Op_add(SizeAdp lhs, SizeAdp rhs) {return SizeAdp_.new_(lhs.Width() + rhs.Width(), lhs.Height() + rhs.Height());}
|
||||
public Object Srl(GfoMsg owner) {return IptBnd_.Srl(owner, this);}
|
||||
|
||||
boolean active = false; PointAdp lastPos = PointAdp_.Zero; Hash_adp hash = Hash_adp_.new_();
|
||||
boolean active = false; PointAdp lastPos = PointAdp_.Zero; Hash_adp hash = Hash_adp_.New();
|
||||
public static GfuiResizeFormBnd new_() {return new GfuiResizeFormBnd();}
|
||||
GfuiResizeFormBnd() {
|
||||
args.Add_many(IptMouseBtn_.Right, IptMouseMove.AnyDirection);
|
||||
@@ -15,8 +15,8 @@ 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.*;
|
||||
package gplx.gfui.controls.customs; import gplx.*; import gplx.gfui.*; import gplx.gfui.controls.*;
|
||||
import org.junit.*; import gplx.gfui.ipts.*; import gplx.gfui.controls.windows.*; import gplx.gfui.controls.standards.*; import gplx.gfui.controls.customs.*;
|
||||
public class GfuiMoveElemBtn_tst {
|
||||
@Before public void setup() {
|
||||
form = GfuiWin_.app_("form"); form.Size_(100, 100);
|
||||
@@ -15,7 +15,8 @@ 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.*;
|
||||
package gplx.gfui.controls.customs; import gplx.*; import gplx.gfui.*; import gplx.gfui.controls.*;
|
||||
import gplx.gfui.layouts.*; import gplx.gfui.kits.core.*; import gplx.gfui.controls.elems.*;
|
||||
public class GfuiStatusBar extends GfuiElemBase {
|
||||
public GfuiStatusBox Box() {return statusBox;} GfuiStatusBox statusBox;
|
||||
public GfuiMoveElemBtn MoveButton() {return moveBtn;} GfuiMoveElemBtn moveBtn;
|
||||
@@ -28,7 +29,7 @@ public class GfuiStatusBar extends GfuiElemBase {
|
||||
if (ctx.Match(k, StatusBarFocus_cmd)) StatusBar_Focus();
|
||||
else return super.Invk(ctx, ikey, k, m);
|
||||
return this;
|
||||
} public static final String StatusBarFocus_cmd = "StatusBarFocus";
|
||||
} public static final String StatusBarFocus_cmd = "StatusBarFocus";
|
||||
@Override public void ctor_GfuiBox_base(Keyval_hash ctorArgs) {
|
||||
super.ctor_GfuiBox_base(ctorArgs);
|
||||
moveBtn = GfuiMoveElemBtn.new_();
|
||||
@@ -15,8 +15,9 @@ 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.*;
|
||||
package gplx.gfui.controls.customs; import gplx.*; import gplx.gfui.*; import gplx.gfui.controls.*;
|
||||
import gplx.core.interfaces.*;
|
||||
import gplx.gfui.ipts.*; import gplx.gfui.controls.windows.*;
|
||||
public class GfuiStatusBarBnd implements InjectAble {
|
||||
public GfuiStatusBar Bar() {return statusBar;} GfuiStatusBar statusBar = GfuiStatusBar.new_();
|
||||
public void Inject(Object owner) {
|
||||
@@ -15,8 +15,8 @@ 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.core.envs.*;
|
||||
package gplx.gfui.controls.customs; import gplx.*; import gplx.gfui.*; import gplx.gfui.controls.*;
|
||||
import gplx.core.envs.*; import gplx.gfui.kits.core.*; import gplx.gfui.envs.*; import gplx.gfui.controls.gxws.*; import gplx.gfui.controls.standards.*;
|
||||
public class GfuiStatusBox extends GfuiTextBox implements UsrMsgWkr { public GfuiStatusBox Active_(boolean v) {active = v; return this;} private boolean active = true;
|
||||
public GfuiStatusBox VisibilityDuration_(int v) {timer.Interval_(v); visibilityDuration = v; return this;} int visibilityDuration;
|
||||
@Override public void Opened_cbk() {
|
||||
@@ -31,7 +31,7 @@ public class GfuiStatusBox extends GfuiTextBox implements UsrMsgWkr { public Gf
|
||||
this.CreateControlIfNeeded(); // WORKAROUND.WINFORMS: else will sometimes throw: Cannot call Invoke or InvokeAsync on a control until the window handle has been created
|
||||
this.VisibilityDuration_(umsg.VisibilityDuration());
|
||||
String text = String_.Replace(umsg.To_str(), Op_sys.Cur().Nl_str(), " "); // replace NewLine with " " since TextBox cannot show NewLine
|
||||
Invoke(GfoInvkAbleCmd.arg_(this, Invk_WriteText, text));
|
||||
Invoke(Gfo_invk_cmd.New_by_val(this, Invk_WriteText, text));
|
||||
}
|
||||
public void WriteText(String text) {
|
||||
if (!this.Visible()) {
|
||||
@@ -66,7 +66,7 @@ public class GfuiStatusBox extends GfuiTextBox implements UsrMsgWkr { public Gf
|
||||
else if (ctx.Match(k, Invk_WriteText)) WriteText(m.ReadStr("v"));
|
||||
else return super.Invk(ctx, ikey, k, m);
|
||||
return this;
|
||||
} static final String Invk_HideWindow = "HideWindow", Invk_WriteText = "WriteText", Invk_Text_empty = "Text_empty";
|
||||
} static final String Invk_HideWindow = "HideWindow", Invk_WriteText = "WriteText", Invk_Text_empty = "Text_empty";
|
||||
TimerAdp timer;
|
||||
@Override public void ctor_GfuiBox_base(Keyval_hash ctorArgs) {
|
||||
super.ctor_GfuiBox_base(ctorArgs);
|
||||
@@ -92,16 +92,3 @@ public class GfuiStatusBox extends GfuiTextBox implements UsrMsgWkr { public Gf
|
||||
// timer = TimerAdp.new_(timerCmd, GfuiInvkCmd_.Invk_sync, 2000, false);
|
||||
}
|
||||
}
|
||||
class GfuiStatusBox_ {
|
||||
public static GfuiStatusBox new_(String key) {
|
||||
GfuiStatusBox rv = new GfuiStatusBox();
|
||||
rv.ctor_GfuiBox_base(GfuiElem_.init_focusAble_false_());
|
||||
rv.Key_of_GfuiElem_(key);
|
||||
return rv;
|
||||
}
|
||||
public static GfuiStatusBox kit_(Gfui_kit kit, String key, GxwElem underElem) {
|
||||
GfuiStatusBox rv = new GfuiStatusBox();
|
||||
rv.ctor_kit_GfuiElemBase(kit, key, underElem, GfuiElem_.init_focusAble_false_());
|
||||
return rv;
|
||||
}
|
||||
}
|
||||
@@ -15,17 +15,18 @@ 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 GfuiStatusBoxBnd implements GfoInvkAble {
|
||||
package gplx.gfui.controls.customs; import gplx.*; import gplx.gfui.*; import gplx.gfui.controls.*;
|
||||
import gplx.gfui.draws.*; import gplx.gfui.ipts.*; import gplx.gfui.layouts.*; import gplx.gfui.controls.windows.*;
|
||||
public class GfuiStatusBoxBnd implements Gfo_invk {
|
||||
public GfuiStatusBox Box() {return statusBox;} GfuiStatusBox statusBox = GfuiStatusBox_.new_("statusBox");
|
||||
void ShowTime() {
|
||||
statusBox.ExecUsrMsg(UsrMsgWkr_.Type_Note, UsrMsg.new_(DateAdp_.Now().XtoStr_gplx_long()));
|
||||
}
|
||||
public Object Invk(GfsCtx ctx, int ikey, String k, GfoMsg m) {
|
||||
if (ctx.Match(k, Invk_ShowTime)) ShowTime();
|
||||
else return GfoInvkAble_.Rv_unhandled;
|
||||
else return Gfo_invk_.Rv_unhandled;
|
||||
return this;
|
||||
} public static final String Invk_ShowTime = "ShowTime";
|
||||
} public static final String Invk_ShowTime = "ShowTime";
|
||||
public static GfuiStatusBoxBnd gft_(GfuiWin owner) {
|
||||
GfuiStatusBoxBnd rv = new GfuiStatusBoxBnd();
|
||||
rv.ctor_GfuiStatusBoxBnd(owner);
|
||||
32
150_gfui/src/gplx/gfui/controls/customs/GfuiStatusBox_.java
Normal file
32
150_gfui/src/gplx/gfui/controls/customs/GfuiStatusBox_.java
Normal file
@@ -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.controls.customs; import gplx.*; import gplx.gfui.*; import gplx.gfui.controls.*;
|
||||
import gplx.gfui.kits.core.*; import gplx.gfui.controls.gxws.*; import gplx.gfui.controls.elems.*;
|
||||
public class GfuiStatusBox_ {
|
||||
public static GfuiStatusBox new_(String key) {
|
||||
GfuiStatusBox rv = new GfuiStatusBox();
|
||||
rv.ctor_GfuiBox_base(GfuiElem_.init_focusAble_false_());
|
||||
rv.Key_of_GfuiElem_(key);
|
||||
return rv;
|
||||
}
|
||||
public static GfuiStatusBox kit_(Gfui_kit kit, String key, GxwElem underElem) {
|
||||
GfuiStatusBox rv = new GfuiStatusBox();
|
||||
rv.ctor_kit_GfuiElemBase(kit, key, underElem, GfuiElem_.init_focusAble_false_());
|
||||
return rv;
|
||||
}
|
||||
}
|
||||
@@ -15,9 +15,10 @@ 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.*;
|
||||
package gplx.gfui.controls.elems; import gplx.*; import gplx.gfui.*; import gplx.gfui.controls.*;
|
||||
import gplx.gfui.draws.*; import gplx.gfui.gfxs.*; import gplx.gfui.ipts.*; import gplx.gfui.layouts.*; import gplx.gfui.imgs.*; import gplx.gfui.controls.gxws.*; import gplx.gfui.controls.*; import gplx.gfui.controls.windows.*;
|
||||
import gplx.core.interfaces.*;
|
||||
public interface GfuiElem extends GfoInvkAble, GxwCbkHost, IptBndsOwner, GftItem, GfoEvObj {
|
||||
public interface GfuiElem extends Gfo_invk, GxwCbkHost, IptBndsOwner, GftItem, Gfo_evt_itm {
|
||||
//% Layout
|
||||
int X(); GfuiElem X_(int val);
|
||||
int Y(); GfuiElem Y_(int val);
|
||||
@@ -72,5 +73,5 @@ public interface GfuiElem extends GfoInvkAble, GxwCbkHost, IptBndsOwner, GftItem
|
||||
GxwElem UnderElem();
|
||||
GxwElem UnderElem_make(Keyval_hash ctorArgs);
|
||||
void ctor_GfuiBox_base(Keyval_hash ctorArgs);
|
||||
void Invoke(GfoInvkAbleCmd cmd);
|
||||
void Invoke(Gfo_invk_cmd cmd);
|
||||
}
|
||||
@@ -15,12 +15,14 @@ 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.*;
|
||||
package gplx.gfui.controls.elems; import gplx.*; import gplx.gfui.*; import gplx.gfui.controls.*;
|
||||
import gplx.gfui.draws.*; import gplx.gfui.gfxs.*; import gplx.gfui.ipts.*; import gplx.gfui.layouts.*; import gplx.gfui.imgs.*; import gplx.gfui.kits.core.*;
|
||||
import gplx.gfui.controls.*; import gplx.gfui.controls.gxws.*; import gplx.gfui.controls.standards.*; import gplx.gfui.controls.windows.*;
|
||||
import gplx.core.strings.*; import gplx.core.interfaces.*;
|
||||
public class GfuiElemBase implements GfuiElem {
|
||||
//% Layout
|
||||
public GfoEvMgr EvMgr() {if (evMgr == null) evMgr = GfoEvMgr.new_(this); return evMgr;} GfoEvMgr evMgr;
|
||||
public GfoInvkCmdMgr InvkMgr() {return invkMgr;} GfoInvkCmdMgr invkMgr = GfoInvkCmdMgr.new_();
|
||||
public Gfo_evt_mgr Evt_mgr() {if (evt_mgr == null) evt_mgr = new Gfo_evt_mgr(this); return evt_mgr;} Gfo_evt_mgr evt_mgr;
|
||||
public Gfo_invk_cmd_mgr InvkMgr() {return invkMgr;} Gfo_invk_cmd_mgr invkMgr = Gfo_invk_cmd_mgr.new_();
|
||||
public int X() {return underMgr.X();} public GfuiElem X_(int val) {underMgr.X_set(val); return this;}
|
||||
public int Y() {return underMgr.Y();} public GfuiElem Y_(int val) {underMgr.Y_set(val); return this;}
|
||||
public int X_max() {return underMgr.X() + underMgr.Width();} public int Y_max() {return underMgr.Y() + underMgr.Height();}
|
||||
@@ -143,7 +145,7 @@ public class GfuiElemBase implements GfuiElem {
|
||||
}
|
||||
}
|
||||
public void Dispose() {
|
||||
GfoEvMgr_.RlsSub(this);
|
||||
Gfo_evt_mgr_.Rls_sub(this);
|
||||
underMgr.Dispose();
|
||||
}
|
||||
|
||||
@@ -245,19 +247,19 @@ public class GfuiElemBase implements GfuiElem {
|
||||
}
|
||||
else {
|
||||
Object rv = this.InvkMgr().Invk(ctx, ikey, k, m, this);
|
||||
if (rv != GfoInvkAble_.Rv_unhandled) return rv;
|
||||
if (rv != Gfo_invk_.Rv_unhandled) return rv;
|
||||
|
||||
Object findObj = injected.Get_by(k);
|
||||
if (findObj == null) findObj = this.subElems.Get_by(k);
|
||||
if (findObj == null) return GfoInvkAble_.Rv_unhandled;
|
||||
if (findObj == null) return Gfo_invk_.Rv_unhandled;
|
||||
return findObj; // necessary for gplx.images
|
||||
}
|
||||
}
|
||||
return this;
|
||||
} public static final String Invk_OwnerWin_cmd = "ownerWin";
|
||||
} public static final String Invk_OwnerWin_cmd = "ownerWin";
|
||||
|
||||
public void Invoke(GfoInvkAbleCmd cmd) {
|
||||
cmd.Invk();
|
||||
public void Invoke(Gfo_invk_cmd cmd) {
|
||||
cmd.Exec();
|
||||
}
|
||||
public Gfui_kit Kit() {return kit;} private Gfui_kit kit = Gfui_kit_.Mem();
|
||||
|
||||
@@ -286,19 +288,7 @@ public class GfuiElemBase implements GfuiElem {
|
||||
public Object SubItms_getObj(String key) {return injected.Get_by(key);}
|
||||
public GfuiElemBase SubItms_add(String key, Object v) {injected.Add(key, v); return this;}
|
||||
public Ordered_hash XtnAtrs() {return xtnAtrs;} Ordered_hash xtnAtrs = Ordered_hash_.New();
|
||||
Hash_adp injected = Hash_adp_.new_();
|
||||
Hash_adp injected = Hash_adp_.New();
|
||||
GxwCore_base underMgr;
|
||||
@gplx.Internal protected static boolean SizeChanged_ignore = false;
|
||||
}
|
||||
class GfuiFocusMgr implements GfoEvMgrOwner {
|
||||
public static final String FocusChanged_evt = "focusChanged_evt";
|
||||
public GfoEvMgr EvMgr() {if (evMgr == null) evMgr = GfoEvMgr.new_(this); return evMgr;} GfoEvMgr evMgr;
|
||||
public GfuiElem FocusedElem() {return focusedElem;} GfuiElem focusedElem;
|
||||
public GfuiElem FocusedElemPrev() {return focusedElemPrev;} GfuiElem focusedElemPrev;
|
||||
public void FocusedElem_set(GfuiElem focused) {
|
||||
focusedElemPrev = focusedElem;
|
||||
this.focusedElem = focused;
|
||||
GfoEvMgr_.PubVal(this, FocusChanged_evt, focused);
|
||||
}
|
||||
public static final GfuiFocusMgr Instance = new GfuiFocusMgr(); GfuiFocusMgr() {}
|
||||
}
|
||||
@@ -15,7 +15,7 @@ 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.*;
|
||||
package gplx.gfui.controls.elems; import gplx.*; import gplx.gfui.*; import gplx.gfui.controls.*;
|
||||
public class GfuiElemBase_ {
|
||||
public static GfuiElemBase as_(Object obj) {return obj instanceof GfuiElemBase ? (GfuiElemBase)obj : null;}
|
||||
public static GfuiElemBase cast(Object obj) {try {return (GfuiElemBase)obj;} catch(Exception exc) {throw Err_.new_type_mismatch_w_exc(exc, GfuiElemBase.class, obj);}}
|
||||
@@ -15,9 +15,9 @@ 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.*;
|
||||
package gplx.gfui.controls.elems; import gplx.*; import gplx.gfui.*; import gplx.gfui.controls.*;
|
||||
public class GfuiElemKeys {
|
||||
public static final String
|
||||
public static final String
|
||||
ActionExec_cmd = "actionExec"
|
||||
, Focus_cmd = "focus"
|
||||
, Redraw_cmd = "redraw"
|
||||
@@ -26,7 +26,7 @@ public class GfuiElemKeys {
|
||||
, IptRcvd_evt = "IptRcvd_evt"
|
||||
, Evt_menu_detected = "menu_detected"
|
||||
;
|
||||
@gplx.Internal protected static final String
|
||||
@gplx.Internal protected static final String
|
||||
Key_set = "Key_"
|
||||
, TipText = "TipText"
|
||||
, TipText_ = "TipText_"
|
||||
@@ -15,7 +15,7 @@ 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.*;
|
||||
package gplx.gfui.controls.elems; import gplx.*; import gplx.gfui.*; import gplx.gfui.controls.*;
|
||||
public class GfuiElemList {
|
||||
public int Count() {return hash.Count();}
|
||||
public GfuiElem Get_at(int idx) {return (GfuiElem)hash.Get_at(idx);}
|
||||
@@ -35,7 +35,7 @@ public class GfuiElemList {
|
||||
hash.Add(key, box);
|
||||
owner.UnderElem().Core().Controls_add(box.UnderElem());
|
||||
box.OwnerElem_(owner).OwnerWin_(owner.OwnerWin()); // needed b/c box may be added after form is loaded
|
||||
GfoEvMgr_.SubSame(box, GfuiElemKeys.IptRcvd_evt, owner); // bubble iptEvts to owner
|
||||
Gfo_evt_mgr_.Sub_same(box, GfuiElemKeys.IptRcvd_evt, owner); // bubble iptEvts to owner
|
||||
}
|
||||
void Del_exec(GfuiElem box) {
|
||||
String key = box.Key_of_GfuiElem(); if (!hash.Has(key)) throw Err_.new_missing_key(key);
|
||||
@@ -15,9 +15,9 @@ 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.*;
|
||||
package gplx.gfui.controls.elems; import gplx.*; import gplx.gfui.*; import gplx.gfui.controls.*;
|
||||
public class GfuiElem_ {
|
||||
public static final String
|
||||
public static final String
|
||||
InitKey_focusAble = "focusAble"
|
||||
, InitKey_ownerWin = "ownerForm";
|
||||
public static GfuiElem as_(Object obj) {return obj instanceof GfuiElem ? (GfuiElem)obj : null;}
|
||||
@@ -15,7 +15,7 @@ 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.*;
|
||||
package gplx.gfui.controls.gxws; import gplx.*; import gplx.gfui.*; import gplx.gfui.controls.*;
|
||||
import java.awt.event.ComponentEvent;
|
||||
import java.awt.event.ComponentListener;
|
||||
import java.awt.event.FocusEvent;
|
||||
@@ -15,7 +15,8 @@ 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.*;
|
||||
package gplx.gfui.controls.gxws; import gplx.*; import gplx.gfui.*; import gplx.gfui.controls.*;
|
||||
import gplx.gfui.ipts.*; import gplx.gfui.gfxs.*;
|
||||
public interface GxwCbkHost {
|
||||
boolean KeyDownCbk(IptEvtDataKey data);
|
||||
boolean KeyHeldCbk(IptEvtDataKeyHeld data);
|
||||
@@ -15,13 +15,14 @@ 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.*;
|
||||
package gplx.gfui.controls.gxws; import gplx.*; import gplx.gfui.*; import gplx.gfui.controls.*;
|
||||
import java.awt.KeyboardFocusManager;
|
||||
import java.awt.event.KeyEvent;
|
||||
import java.awt.event.MouseEvent;
|
||||
import java.awt.event.MouseWheelEvent;
|
||||
import gplx.gfui.ipts.*; import gplx.gfui.gfxs.*;
|
||||
public class GxwCbkHost_ {
|
||||
public static final GxwCbkHost Null = new GfuiHost_cls_null();
|
||||
public static final GxwCbkHost Null = new GfuiHost_cls_null();
|
||||
public static final boolean ExecKeyEvent(GxwCbkHost host, KeyEvent e) {
|
||||
boolean rv = true; int id = e.getID(), val = e.getKeyCode();
|
||||
boolean isAltF4 = false;
|
||||
@@ -15,7 +15,7 @@ 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.*;
|
||||
package gplx.gfui.controls.gxws; import gplx.*; import gplx.gfui.*; import gplx.gfui.controls.*;
|
||||
public interface GxwCheckListBox extends GxwElem {
|
||||
int Items_count();
|
||||
List_adp Items_getAll();
|
||||
@@ -15,7 +15,7 @@ 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.*;
|
||||
package gplx.gfui.controls.gxws; import gplx.*; import gplx.gfui.*; import gplx.gfui.controls.*;
|
||||
import java.awt.AWTEvent;
|
||||
import java.awt.Color;
|
||||
import java.awt.Component;
|
||||
@@ -33,7 +33,7 @@ import java.util.Vector;
|
||||
import javax.swing.*;
|
||||
import javax.swing.border.Border;
|
||||
import javax.swing.border.EmptyBorder;
|
||||
import gplx.gfui.*;
|
||||
import gplx.gfui.ipts.*; import gplx.gfui.gfxs.*; import gplx.gfui.controls.windows.*;
|
||||
public class GxwCheckListBox_lang extends JScrollPane implements GxwCheckListBox, GxwElem {
|
||||
Vector<CheckListItem> internalItems;
|
||||
GxwListBox_lang listBox;
|
||||
@@ -77,7 +77,7 @@ public class GxwCheckListBox_lang extends JScrollPane implements GxwCheckListBox
|
||||
public List_adp Items_getChecked() {return Items_get(Mode_Selected);}
|
||||
static final int Mode_All = 1, Mode_Selected = 2;
|
||||
List_adp Items_get(int mode) {
|
||||
List_adp list = List_adp_.new_();
|
||||
List_adp list = List_adp_.New();
|
||||
for (CheckListItem data: internalItems) {
|
||||
boolean add = (mode == Mode_All) || (mode == Mode_Selected) && data.Selected();
|
||||
if (add)
|
||||
@@ -15,7 +15,7 @@ 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.*;
|
||||
package gplx.gfui.controls.gxws; import gplx.*; import gplx.gfui.*; import gplx.gfui.controls.*;
|
||||
public interface GxwComboBox extends GxwElem {
|
||||
int SelBgn(); void SelBgn_set(int v);
|
||||
int SelLen(); void SelLen_set(int v);
|
||||
@@ -15,11 +15,12 @@ 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.*;
|
||||
package gplx.gfui.controls.gxws; import gplx.*; import gplx.gfui.*; import gplx.gfui.controls.*;
|
||||
import java.awt.*;
|
||||
import java.awt.event.*;
|
||||
|
||||
import javax.swing.*;
|
||||
import gplx.gfui.ipts.*; import gplx.gfui.gfxs.*;
|
||||
public class GxwComboBox_lang extends JComboBox implements GxwComboBox, GxwElem, ActionListener {
|
||||
public String[] DataSource_as_str_ary() {return String_.Ary_empty;}
|
||||
public void DataSource_set(Object... ary) {
|
||||
@@ -15,7 +15,8 @@ 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.*;
|
||||
package gplx.gfui.controls.gxws; import gplx.*; import gplx.gfui.*; import gplx.gfui.controls.*;
|
||||
import gplx.gfui.draws.*;
|
||||
public abstract class GxwCore_base {
|
||||
public abstract void Controls_add(GxwElem sub);
|
||||
public abstract void Controls_del(GxwElem sub);
|
||||
@@ -15,7 +15,7 @@ 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.*;
|
||||
package gplx.gfui.controls.gxws; import gplx.*; import gplx.gfui.*; import gplx.gfui.controls.*;
|
||||
import javax.swing.JComponent;
|
||||
import javax.swing.JWindow;
|
||||
import javax.swing.RootPaneContainer;
|
||||
@@ -27,6 +27,7 @@ import java.awt.Component;
|
||||
import java.awt.Container;
|
||||
import java.awt.Font;
|
||||
import java.awt.Graphics2D;
|
||||
import gplx.gfui.draws.*; import gplx.gfui.controls.gxws.*;
|
||||
public class GxwCore_lang extends GxwCore_base {
|
||||
@Override public int Width() {return control.getWidth();} @Override public void Width_set(int v) {control.setSize(v, control.getHeight());}
|
||||
@Override public int Height() {return control.getHeight();} @Override public void Height_set(int v) {control.setSize(control.getWidth(), v);}
|
||||
@@ -15,7 +15,8 @@ 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.*;
|
||||
package gplx.gfui.controls.gxws; import gplx.*; import gplx.gfui.*; import gplx.gfui.controls.*;
|
||||
import gplx.gfui.draws.*; import gplx.gfui.ipts.*;
|
||||
public class GxwCore_mock extends GxwCore_base {
|
||||
@Override public int Width() {return size.Width();} @Override public void Width_set(int v) {size = SizeAdp_.new_(v, size.Height());}
|
||||
@Override public int Height() {return size.Height();} @Override public void Height_set(int v) {size = SizeAdp_.new_(size.Width(), v);}
|
||||
@@ -41,5 +42,5 @@ public class GxwCore_mock extends GxwCore_base {
|
||||
@Override public void Invalidate() {} @Override public void Dispose() {}
|
||||
|
||||
public void SendKey(IptKey key) {}
|
||||
List_adp list = List_adp_.new_();
|
||||
List_adp list = List_adp_.New();
|
||||
}
|
||||
@@ -15,8 +15,8 @@ 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 interface GxwElem extends GfoInvkAble {
|
||||
package gplx.gfui.controls.gxws; import gplx.*; import gplx.gfui.*; import gplx.gfui.controls.*;
|
||||
public interface GxwElem extends Gfo_invk {
|
||||
GxwCore_base Core();
|
||||
GxwCbkHost Host(); void Host_set(GxwCbkHost host);
|
||||
String TextVal(); void TextVal_set(String v);
|
||||
23
150_gfui/src/gplx/gfui/controls/gxws/GxwElemFactory_.java
Normal file
23
150_gfui/src/gplx/gfui/controls/gxws/GxwElemFactory_.java
Normal file
@@ -0,0 +1,23 @@
|
||||
/*
|
||||
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.controls.gxws; import gplx.*; import gplx.gfui.*; import gplx.gfui.controls.*;
|
||||
public class GxwElemFactory_ {
|
||||
public static GxwElemFactory_base Instance = new GxwElemFactory_cls_mock();
|
||||
public static void winForms_() {Instance = new GxwElemFactory_cls_lang();}
|
||||
public static void swt_(org.eclipse.swt.widgets.Display display) {Instance = new GxwElemFactory_swt(display);}
|
||||
}
|
||||
@@ -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.controls.gxws; import gplx.*; import gplx.gfui.*; import gplx.gfui.controls.*;
|
||||
public abstract class GxwElemFactory_base {
|
||||
public abstract GxwElem control_();
|
||||
public abstract GxwWin win_app_();
|
||||
public abstract GxwWin win_tool_(Keyval_hash ctorArgs);
|
||||
public abstract GxwWin win_toaster_(Keyval_hash ctorArgs);
|
||||
public abstract GxwElem lbl_();
|
||||
public abstract GxwTextFld text_fld_();
|
||||
public abstract GxwTextFld text_memo_();
|
||||
public abstract GxwTextHtml text_html_();
|
||||
public abstract GxwCheckListBox checkListBox_(Keyval_hash ctorArgs);
|
||||
public abstract GxwComboBox comboBox_();
|
||||
public abstract GxwListBox listBox_();
|
||||
// @gplx.Internal protected GxwElem spacer_() {return MockControl.new_();}
|
||||
}
|
||||
@@ -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.controls.gxws; import gplx.*; import gplx.gfui.*; import gplx.gfui.controls.*;
|
||||
import gplx.gfui.controls.elems.*; import gplx.gfui.controls.windows.*;
|
||||
public class GxwElemFactory_cls_lang extends GxwElemFactory_base {
|
||||
@Override public GxwElem control_() {return new GxwElem_lang();}
|
||||
@Override public GxwWin win_tool_(Keyval_hash ctorArgs) {
|
||||
GfuiWin ownerForm = (GfuiWin)ctorArgs.Get_val_or(GfuiElem_.InitKey_ownerWin, null);
|
||||
GxwWin ownerElem = ownerForm == null ? null : (GxwWin)ownerForm.UnderElem();
|
||||
return GxwWin_jdialog.new_(ownerElem);
|
||||
// return GxwWin_lang.new_();
|
||||
}
|
||||
@Override public GxwWin win_toaster_(Keyval_hash ctorArgs) {
|
||||
GfsCtx ctx = GfsCtx.new_(); ctx.Match("", "");
|
||||
GfuiWin ownerForm = (GfuiWin)ctorArgs.Get_val_or(GfuiElem_.InitKey_ownerWin, null);
|
||||
GxwWin ownerElem = ownerForm == null ? null : (GxwWin)ownerForm.UnderElem();
|
||||
return GxwWin_jwindow.new_(ownerElem);
|
||||
// return GxwWin_lang.new_();
|
||||
}
|
||||
@Override public GxwWin win_app_() {return GxwWin_lang.new_();}
|
||||
@Override public GxwElem lbl_() {return new GxwElem_lang();}
|
||||
@Override public GxwTextFld text_fld_() {return GxwTextBox_lang_.fld_();}
|
||||
@Override public GxwTextFld text_memo_() {return GxwTextBox_lang_.memo_();}
|
||||
@Override public GxwTextHtml text_html_() {return new GxwTextHtml_lang().ctor();}
|
||||
@Override public GxwCheckListBox checkListBox_(Keyval_hash ctorArgs) {return new GxwCheckListBox_lang();}
|
||||
@Override public GxwComboBox comboBox_() {return GxwComboBox_lang.new_();}
|
||||
@Override public GxwListBox listBox_() {return GxwListBox_lang.new_();}
|
||||
}
|
||||
@@ -0,0 +1,31 @@
|
||||
/*
|
||||
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.controls.gxws; import gplx.*; import gplx.gfui.*; import gplx.gfui.controls.*;
|
||||
public class GxwElemFactory_cls_mock extends GxwElemFactory_base {
|
||||
@Override public GxwElem control_() {return GxwElem_mock_base.new_();}
|
||||
@Override public GxwWin win_app_() {return MockForm.Instance;}
|
||||
@Override public GxwWin win_tool_(Keyval_hash ctorArgs) {return MockForm.Instance;}
|
||||
@Override public GxwWin win_toaster_(Keyval_hash ctorArgs) {return MockForm.Instance;}
|
||||
@Override public GxwElem lbl_() {return GxwElem_mock_base.new_();}
|
||||
@Override public GxwTextFld text_fld_() {return new MockTextBox();}
|
||||
@Override public GxwTextFld text_memo_() {return new MockTextBoxMulti();}
|
||||
@Override public GxwTextHtml text_html_() {return new MockTextBoxMulti();}
|
||||
@Override public GxwCheckListBox checkListBox_(Keyval_hash ctorArgs) {throw Err_.new_unimplemented();}
|
||||
@Override public GxwComboBox comboBox_() {return new MockComboBox();}
|
||||
@Override public GxwListBox listBox_() {return new MockListBox();}
|
||||
}
|
||||
@@ -15,7 +15,7 @@ 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.*;
|
||||
package gplx.gfui.controls.gxws; import gplx.*; import gplx.gfui.*; import gplx.gfui.controls.*;
|
||||
import java.awt.AWTEvent;
|
||||
import java.awt.Graphics;
|
||||
import java.awt.Graphics2D;
|
||||
@@ -27,6 +27,7 @@ import java.awt.event.KeyEvent;
|
||||
import java.awt.event.MouseEvent;
|
||||
import java.awt.event.MouseWheelEvent;
|
||||
import javax.swing.JComponent;
|
||||
import gplx.gfui.ipts.*; import gplx.gfui.gfxs.*;
|
||||
public class GxwElem_lang extends JComponent implements GxwElem {
|
||||
public static final String AlignH_cmd = "AlignH";
|
||||
public GxwCbkHost Host() {return host;} public void Host_set(GxwCbkHost host) {this.host = host;} GxwCbkHost host = GxwCbkHost_.Null;
|
||||
@@ -15,7 +15,8 @@ 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.*;
|
||||
package gplx.gfui.controls.gxws; import gplx.*; import gplx.gfui.*; import gplx.gfui.controls.*;
|
||||
import gplx.gfui.ipts.*;
|
||||
public class GxwElem_mock_base implements GxwElem {
|
||||
public GxwCore_base Core() {return ctrlMgr;} final GxwCore_mock ctrlMgr = new GxwCore_mock();
|
||||
public GxwCbkHost Host() {return host;} public void Host_set(GxwCbkHost host) {this.host = host;} GxwCbkHost host = GxwCbkHost_.Null;
|
||||
@@ -26,7 +27,7 @@ public class GxwElem_mock_base implements GxwElem {
|
||||
return this;
|
||||
}
|
||||
|
||||
List_adp list = List_adp_.new_();
|
||||
List_adp list = List_adp_.New();
|
||||
public static GxwElem_mock_base new_() {return new GxwElem_mock_base();} protected GxwElem_mock_base() {}
|
||||
}
|
||||
class MockTextBox extends GxwElem_mock_base implements GxwTextFld {
|
||||
@@ -15,7 +15,7 @@ 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.*;
|
||||
package gplx.gfui.controls.gxws; import gplx.*; import gplx.gfui.*; import gplx.gfui.controls.*;
|
||||
public interface GxwListBox extends GxwElem {
|
||||
void Items_Add(Object item);
|
||||
void Items_Clear();
|
||||
@@ -15,12 +15,13 @@ 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.*;
|
||||
package gplx.gfui.controls.gxws; import gplx.*; import gplx.gfui.*; import gplx.gfui.controls.*;
|
||||
import java.awt.*;
|
||||
import java.awt.event.*;
|
||||
import java.util.Vector;
|
||||
|
||||
import javax.swing.*;
|
||||
import gplx.gfui.ipts.*; import gplx.gfui.gfxs.*;
|
||||
class GxwListBox_lang extends JList implements GxwListBox {
|
||||
void ctor_() {
|
||||
ctrlMgr = GxwCore_lang.new_(this);
|
||||
@@ -15,7 +15,7 @@ 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.*;
|
||||
package gplx.gfui.controls.gxws; import gplx.*; import gplx.gfui.*; import gplx.gfui.controls.*;
|
||||
import java.awt.AWTEvent;
|
||||
import java.awt.Color;
|
||||
import java.awt.Graphics;
|
||||
@@ -33,6 +33,7 @@ import javax.swing.KeyStroke;
|
||||
import javax.swing.border.BevelBorder;
|
||||
import javax.swing.border.Border;
|
||||
import javax.swing.text.JTextComponent;
|
||||
import gplx.gfui.ipts.*; import gplx.gfui.gfxs.*; import gplx.gfui.controls.elems.*;
|
||||
public class GxwTextBox_lang extends JTextArea implements GxwTextFld {
|
||||
public Object UnderElem() {return this;}
|
||||
public GxwCore_base Core() {return ctrlMgr;} GxwCore_base ctrlMgr;
|
||||
26
150_gfui/src/gplx/gfui/controls/gxws/GxwTextFld.java
Normal file
26
150_gfui/src/gplx/gfui/controls/gxws/GxwTextFld.java
Normal file
@@ -0,0 +1,26 @@
|
||||
/*
|
||||
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.controls.gxws; import gplx.*; import gplx.gfui.*; import gplx.gfui.controls.*;
|
||||
public interface GxwTextFld extends GxwElem {
|
||||
boolean Border_on(); void Border_on_(boolean v);
|
||||
int SelBgn(); void SelBgn_set(int v);
|
||||
int SelLen(); void SelLen_set(int v);
|
||||
void CreateControlIfNeeded();
|
||||
boolean OverrideTabKey(); void OverrideTabKey_(boolean v);
|
||||
void Margins_set(int left, int top, int right, int bot);
|
||||
}
|
||||
@@ -15,8 +15,8 @@ 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.*;
|
||||
interface GxwTextHtml extends GxwTextMemo {
|
||||
package gplx.gfui.controls.gxws; import gplx.*; import gplx.gfui.*; import gplx.gfui.controls.*;
|
||||
public interface GxwTextHtml extends GxwTextMemo {
|
||||
Keyval[] Html_sel_atrs();
|
||||
void Html_enabled(boolean v);
|
||||
String Html_doc_html();
|
||||
@@ -15,7 +15,7 @@ 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.*;
|
||||
package gplx.gfui.controls.gxws; import gplx.*; import gplx.gfui.*; import gplx.gfui.controls.*;
|
||||
import gplx.core.strings.*;
|
||||
import java.awt.Color;
|
||||
import java.awt.Component;
|
||||
@@ -62,6 +62,7 @@ import javax.swing.text.html.HTMLEditorKit;
|
||||
import javax.swing.text.html.HTMLEditorKit.HTMLFactory;
|
||||
import javax.swing.text.html.InlineView;
|
||||
import javax.swing.text.html.StyleSheet;
|
||||
import gplx.gfui.ipts.*; import gplx.gfui.gfxs.*;
|
||||
public class GxwTextHtml_lang extends JScrollPane implements GxwTextHtml {
|
||||
@Override public GxwCore_base Core() {return core;} GxwCore_host core;
|
||||
public GxwCbkHost Host() {return host;} public void Host_set(GxwCbkHost host) {this.host = host; editor.Host_set(host);} GxwCbkHost host;
|
||||
@@ -214,7 +215,7 @@ class GxwTextHtml_editor extends JEditorPane implements GxwTextHtml {
|
||||
public Keyval[] Html_sel_atrs() {
|
||||
if (String_.Eq(this.getContentType(), "text/plain")) return Keyval_.Ary_empty;
|
||||
Element elm = Html_sel_elm(); if (elm == null) return Keyval_.Ary_empty;
|
||||
List_adp sel_atrs_list = List_adp_.new_();
|
||||
List_adp sel_atrs_list = List_adp_.New();
|
||||
Html_sel_atrs(elm.getAttributes(), sel_atrs_list, null, ".");
|
||||
return (Keyval[])sel_atrs_list.To_ary(Keyval.class);
|
||||
}
|
||||
@@ -15,16 +15,8 @@ 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 interface GxwTextFld extends GxwElem {
|
||||
boolean Border_on(); void Border_on_(boolean v);
|
||||
int SelBgn(); void SelBgn_set(int v);
|
||||
int SelLen(); void SelLen_set(int v);
|
||||
void CreateControlIfNeeded();
|
||||
boolean OverrideTabKey(); void OverrideTabKey_(boolean v);
|
||||
void Margins_set(int left, int top, int right, int bot);
|
||||
}
|
||||
interface GxwTextMemo extends GxwTextFld {
|
||||
package gplx.gfui.controls.gxws; import gplx.*; import gplx.gfui.*; import gplx.gfui.controls.*;
|
||||
public interface GxwTextMemo extends GxwTextFld {
|
||||
int LinesPerScreen();
|
||||
int LinesTotal();
|
||||
int ScreenCount();
|
||||
@@ -15,7 +15,7 @@ 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.*;
|
||||
package gplx.gfui.controls.gxws; import gplx.*; import gplx.gfui.*; import gplx.gfui.controls.*;
|
||||
import java.awt.AWTKeyStroke;
|
||||
import java.awt.Color;
|
||||
import java.awt.Font;
|
||||
@@ -37,6 +37,16 @@ import javax.swing.text.Document;
|
||||
import javax.swing.undo.CannotRedoException;
|
||||
import javax.swing.undo.CannotUndoException;
|
||||
import javax.swing.undo.UndoManager;
|
||||
|
||||
import gplx.gfui.GfuiAlign;
|
||||
import gplx.gfui.GfuiAlign_;
|
||||
import gplx.gfui.PointAdp;
|
||||
import gplx.gfui.PointAdp_;
|
||||
import gplx.gfui.RectAdp;
|
||||
import gplx.gfui.SizeAdp;
|
||||
import gplx.gfui.controls.elems.GfuiElem;
|
||||
import gplx.gfui.draws.*;
|
||||
import gplx.gfui.ipts.*; import gplx.gfui.controls.windows.*;
|
||||
public class GxwTextMemo_lang extends JScrollPane implements GxwTextMemo {
|
||||
public JTextArea Inner() {return txt_box;} GxwTextBox_lang txt_box;
|
||||
public GxwCore_base Core() {return core;} GxwCore_base core;
|
||||
@@ -56,7 +66,7 @@ public class GxwTextMemo_lang extends JScrollPane implements GxwTextMemo {
|
||||
else {
|
||||
// txt_box.setBorder(BasicBorders.getTextFieldBorder());
|
||||
// txt_box.setMargin(new Insets(0, l, 0, r));
|
||||
txt_box.setFont(new Font("Courier New", FontStyleAdp_.Plain.val, 12));
|
||||
txt_box.setFont(new Font("Courier New", FontStyleAdp_.Plain.Val(), 12));
|
||||
txt_box.setBorder(BorderFactory.createCompoundBorder(BorderFactory.createLineBorder(Color.BLACK), BorderFactory.createEmptyBorder(top, left, bot, right)));
|
||||
}
|
||||
}
|
||||
@@ -15,7 +15,8 @@ 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.*;
|
||||
package gplx.gfui.controls.gxws; import gplx.*; import gplx.gfui.*; import gplx.gfui.controls.*;
|
||||
import gplx.gfui.imgs.*;
|
||||
public interface GxwWin extends GxwElem {
|
||||
IconAdp IconWin(); void IconWin_set(IconAdp v);
|
||||
|
||||
@@ -26,7 +27,7 @@ public interface GxwWin extends GxwElem {
|
||||
void CloseWin();
|
||||
boolean Pin(); void Pin_set(boolean val);
|
||||
|
||||
void OpenedCmd_set(GfoInvkAbleCmd v);
|
||||
void OpenedCmd_set(Gfo_invk_cmd v);
|
||||
void TaskbarVisible_set(boolean val);
|
||||
void TaskbarParkingWindowFix(GxwElem form);
|
||||
}
|
||||
@@ -15,7 +15,7 @@ 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.*;
|
||||
package gplx.gfui.controls.gxws; import gplx.*; import gplx.gfui.*; import gplx.gfui.controls.*;
|
||||
import javax.swing.JDesktopPane;
|
||||
import javax.swing.JDialog;
|
||||
import javax.swing.JFrame;
|
||||
@@ -43,6 +43,7 @@ import java.awt.event.MouseEvent;
|
||||
import java.awt.event.MouseWheelEvent;
|
||||
import java.awt.event.WindowEvent;
|
||||
import java.awt.event.WindowListener;
|
||||
import gplx.gfui.draws.*; import gplx.gfui.ipts.*; import gplx.gfui.gfxs.*; import gplx.gfui.imgs.*; import gplx.gfui.kits.swts.*;
|
||||
public class GxwWin_lang extends JFrame implements GxwWin, WindowListener {
|
||||
public void ShowWin() {this.setVisible(true);}
|
||||
public void HideWin() {this.setVisible(false);}
|
||||
@@ -58,7 +59,7 @@ public class GxwWin_lang extends JFrame implements GxwWin, WindowListener {
|
||||
icon = i;
|
||||
this.setIconImage(i.XtoImage());
|
||||
}
|
||||
public void OpenedCmd_set(GfoInvkAbleCmd v) {whenLoadedCmd = v;} GfoInvkAbleCmd whenLoadedCmd = GfoInvkAbleCmd.Null;
|
||||
public void OpenedCmd_set(Gfo_invk_cmd v) {whenLoadedCmd = v;} Gfo_invk_cmd whenLoadedCmd = Gfo_invk_cmd.Noop;
|
||||
public GxwCore_base Core() {return ctrlMgr;} GxwCore_base ctrlMgr;
|
||||
public GxwCbkHost Host() {return host;} public void Host_set(GxwCbkHost host) {this.host = host;} GxwCbkHost host = GxwCbkHost_.Null;
|
||||
public String TextVal() {return this.getTitle();} public void TextVal_set(String v) {this.setTitle(v);}
|
||||
@@ -72,7 +73,7 @@ public class GxwWin_lang extends JFrame implements GxwWin, WindowListener {
|
||||
public void windowDeactivated(WindowEvent e) {}
|
||||
public void windowDeiconified(WindowEvent e) {host.SizeChangedCbk();}
|
||||
public void windowIconified(WindowEvent e) {host.SizeChangedCbk();}
|
||||
public void windowOpened(WindowEvent e) {whenLoadedCmd.Invk();}
|
||||
public void windowOpened(WindowEvent e) {whenLoadedCmd.Exec();}
|
||||
@Override public void processKeyEvent(KeyEvent e) {if (GxwCbkHost_.ExecKeyEvent(host, e)) super.processKeyEvent(e);}
|
||||
@Override public void processMouseEvent(MouseEvent e) {if (GxwCbkHost_.ExecMouseEvent(host, e)) super.processMouseEvent(e);}
|
||||
@Override public void processMouseWheelEvent(MouseWheelEvent e) {if (GxwCbkHost_.ExecMouseWheel(host, e)) super.processMouseWheelEvent(e);}
|
||||
@@ -115,7 +116,7 @@ class GxwWin_jdialog extends JDialog implements GxwWin, WindowListener {
|
||||
icon = i;
|
||||
this.setIconImage(i.XtoImage());
|
||||
}
|
||||
public void OpenedCmd_set(GfoInvkAbleCmd v) {whenLoadedCmd = v;} GfoInvkAbleCmd whenLoadedCmd = GfoInvkAbleCmd.Null;
|
||||
public void OpenedCmd_set(Gfo_invk_cmd v) {whenLoadedCmd = v;} Gfo_invk_cmd whenLoadedCmd = Gfo_invk_cmd.Noop;
|
||||
public GxwCore_base Core() {return ctrlMgr;} GxwCore_base ctrlMgr;
|
||||
public GxwCbkHost Host() {return host;} public void Host_set(GxwCbkHost host) {this.host = host;} GxwCbkHost host = GxwCbkHost_.Null;
|
||||
public String TextVal() {return "";} public void TextVal_set(String v) {}
|
||||
@@ -129,7 +130,7 @@ class GxwWin_jdialog extends JDialog implements GxwWin, WindowListener {
|
||||
public void windowDeactivated(WindowEvent e) {}
|
||||
public void windowDeiconified(WindowEvent e) {host.SizeChangedCbk();}
|
||||
public void windowIconified(WindowEvent e) {host.SizeChangedCbk();}
|
||||
public void windowOpened(WindowEvent e) {whenLoadedCmd.Invk();}
|
||||
public void windowOpened(WindowEvent e) {whenLoadedCmd.Exec();}
|
||||
@Override public void processKeyEvent(KeyEvent e) {if (GxwCbkHost_.ExecKeyEvent(host, e)) super.processKeyEvent(e);}
|
||||
@Override public void processMouseEvent(MouseEvent e) {if (GxwCbkHost_.ExecMouseEvent(host, e)) super.processMouseEvent(e);}
|
||||
@Override public void processMouseWheelEvent(MouseWheelEvent e) {if (GxwCbkHost_.ExecMouseWheel(host, e)) super.processMouseWheelEvent(e);}
|
||||
@@ -172,7 +173,7 @@ class GxwWin_jwindow extends JWindow implements GxwWin, WindowListener {
|
||||
icon = i;
|
||||
this.setIconImage(i.XtoImage());
|
||||
}
|
||||
public void OpenedCmd_set(GfoInvkAbleCmd v) {whenLoadedCmd = v;} GfoInvkAbleCmd whenLoadedCmd = GfoInvkAbleCmd.Null;
|
||||
public void OpenedCmd_set(Gfo_invk_cmd v) {whenLoadedCmd = v;} Gfo_invk_cmd whenLoadedCmd = Gfo_invk_cmd.Noop;
|
||||
public GxwCore_base Core() {return ctrlMgr;} GxwCore_base ctrlMgr;
|
||||
public GxwCbkHost Host() {return host;} public void Host_set(GxwCbkHost host) {this.host = host;} GxwCbkHost host = GxwCbkHost_.Null;
|
||||
public String TextVal() {return "";} public void TextVal_set(String v) {}// this.setTitle(v);
|
||||
@@ -186,7 +187,7 @@ class GxwWin_jwindow extends JWindow implements GxwWin, WindowListener {
|
||||
public void windowDeactivated(WindowEvent e) {}
|
||||
public void windowDeiconified(WindowEvent e) {host.SizeChangedCbk();}
|
||||
public void windowIconified(WindowEvent e) {host.SizeChangedCbk();}
|
||||
public void windowOpened(WindowEvent e) {whenLoadedCmd.Invk();}
|
||||
public void windowOpened(WindowEvent e) {whenLoadedCmd.Exec();}
|
||||
@Override public void processKeyEvent(KeyEvent e) {if (GxwCbkHost_.ExecKeyEvent(host, e)) super.processKeyEvent(e);}
|
||||
@Override public void processMouseEvent(MouseEvent e) {if (GxwCbkHost_.ExecMouseEvent(host, e)) super.processMouseEvent(e);}
|
||||
@Override public void processMouseWheelEvent(MouseWheelEvent e) {if (GxwCbkHost_.ExecMouseWheel(host, e)) super.processMouseWheelEvent(e);}
|
||||
@@ -242,30 +243,26 @@ class GxwCore_form extends GxwCore_lang {
|
||||
} GxwCore_form() {}
|
||||
}
|
||||
|
||||
|
||||
|
||||
class GxwElemFactory_swt extends GxwElemFactory_base {
|
||||
public GxwElemFactory_swt(org.eclipse.swt.widgets.Display display) {
|
||||
this.display = display;
|
||||
} Display display;
|
||||
@gplx.Internal @Override protected GxwElem control_() {return null;}
|
||||
@gplx.Internal @Override protected GxwWin win_app_() {
|
||||
return new Swt_win(display);
|
||||
public GxwElem control_() {return null;}
|
||||
public GxwWin win_app_() {
|
||||
return new Swt_win(display);
|
||||
}
|
||||
public GxwWin win_tool_(Keyval_hash ctorArgs) {
|
||||
return null;
|
||||
}
|
||||
public GxwWin win_toaster_(Keyval_hash ctorArgs) {
|
||||
return null;
|
||||
}
|
||||
public GxwElem lbl_() {return null;}
|
||||
public GxwTextFld text_fld_() {return null;}
|
||||
public GxwTextFld text_memo_() {return null;}
|
||||
public GxwTextHtml text_html_() {return null;}
|
||||
public GxwCheckListBox checkListBox_(Keyval_hash ctorArgs) {throw Err_.new_unimplemented();}
|
||||
public GxwComboBox comboBox_() {return null;}
|
||||
public GxwListBox listBox_() {return null;}
|
||||
}
|
||||
@gplx.Internal @Override protected GxwWin win_tool_(Keyval_hash ctorArgs) {
|
||||
return null;
|
||||
}
|
||||
@gplx.Internal @Override protected GxwWin win_toaster_(Keyval_hash ctorArgs) {
|
||||
return null;
|
||||
}
|
||||
@gplx.Internal @Override protected GxwElem lbl_() {return null;}
|
||||
@gplx.Internal @Override protected GxwTextFld text_fld_() {return null;}
|
||||
@gplx.Internal @Override protected GxwTextFld text_memo_() {return null;}
|
||||
@gplx.Internal @Override protected GxwTextHtml text_html_() {return null;}
|
||||
@gplx.Internal @Override protected GxwCheckListBox checkListBox_(Keyval_hash ctorArgs) {throw Err_.new_unimplemented();}
|
||||
@gplx.Internal @Override protected GxwComboBox comboBox_() {return null;}
|
||||
@gplx.Internal @Override protected GxwListBox listBox_() {return null;}
|
||||
}
|
||||
|
||||
|
||||
//#}
|
||||
@@ -15,7 +15,7 @@ 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.*;
|
||||
package gplx.gfui.controls.gxws; import gplx.*; import gplx.gfui.*; import gplx.gfui.controls.*;
|
||||
public interface Gxw_html extends GxwElem {
|
||||
void Html_doc_html_load_by_mem(String html);
|
||||
void Html_doc_html_load_by_url(Io_url path, String html);
|
||||
@@ -24,8 +24,9 @@ public interface Gxw_html extends GxwElem {
|
||||
String Html_js_eval_proc_as_str (String name, Object... args);
|
||||
boolean Html_js_eval_proc_as_bool (String name, Object... args);
|
||||
String Html_js_eval_script (String script);
|
||||
void Html_js_cbks_add (String js_func_name, GfoInvkAble invk);
|
||||
Object Html_js_eval_script_as_obj (String script);
|
||||
void Html_js_cbks_add (String js_func_name, Gfo_invk invk);
|
||||
String Html_js_send_json (String name, String data);
|
||||
void Html_invk_src_(GfoEvObj v);
|
||||
void Html_invk_src_(Gfo_evt_itm v);
|
||||
void Html_dispose();
|
||||
}
|
||||
@@ -15,7 +15,7 @@ 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.*;
|
||||
package gplx.gfui.controls.gxws; import gplx.*; import gplx.gfui.*; import gplx.gfui.controls.*;
|
||||
public class Gxw_html_load_tid_ {
|
||||
public static final byte Tid_mem = 0, Tid_url = 1;
|
||||
public static final String Key_mem = "mem", Key_url = "url";
|
||||
@@ -15,7 +15,8 @@ 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.*;
|
||||
package gplx.gfui.controls.gxws; import gplx.*; import gplx.gfui.*; import gplx.gfui.controls.*;
|
||||
import gplx.gfui.controls.elems.*; import gplx.gfui.controls.standards.*;
|
||||
public interface Gxw_tab_itm extends GxwElem {
|
||||
void Subs_add(GfuiElem sub);
|
||||
Gfui_tab_itm_data Tab_data();
|
||||
@@ -15,7 +15,8 @@ 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.*;
|
||||
package gplx.gfui.controls.gxws; import gplx.*; import gplx.gfui.*; import gplx.gfui.controls.*;
|
||||
import gplx.gfui.draws.*; import gplx.gfui.controls.standards.*;
|
||||
public interface Gxw_tab_mgr extends GxwElem {
|
||||
ColorAdp Btns_selected_color(); void Btns_selected_color_(ColorAdp v);
|
||||
ColorAdp Btns_unselected_color(); void Btns_unselected_color_(ColorAdp v);
|
||||
@@ -15,7 +15,8 @@ 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.*;
|
||||
package gplx.gfui.controls.gxws; import gplx.*; import gplx.gfui.*; import gplx.gfui.controls.*;
|
||||
import gplx.gfui.imgs.*;
|
||||
public class MockForm extends GxwElem_mock_base implements GxwWin {
|
||||
public IconAdp IconWin() {return null;} public void IconWin_set(IconAdp v) {}
|
||||
public void ShowWin() {}
|
||||
@@ -24,8 +25,8 @@ public class MockForm extends GxwElem_mock_base implements GxwWin {
|
||||
public boolean Maximized() {return false;} public void Maximized_(boolean v) {}
|
||||
public boolean Minimized() {return false;} public void Minimized_(boolean v) {}
|
||||
public boolean Pin() {return pin;} public void Pin_set(boolean val) {pin = val;} private boolean pin;
|
||||
public void OpenedCmd_set(GfoInvkAbleCmd v) {}
|
||||
public void OpenedCmd_set(Gfo_invk_cmd v) {}
|
||||
public void TaskbarVisible_set(boolean val) {}
|
||||
public void TaskbarParkingWindowFix(GxwElem form) {}
|
||||
public static final MockForm Instance = new MockForm(); MockForm() {}
|
||||
public static final MockForm Instance = new MockForm(); MockForm() {}
|
||||
}
|
||||
@@ -15,13 +15,14 @@ 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.*;
|
||||
package gplx.gfui.controls.standards; import gplx.*; import gplx.gfui.*; import gplx.gfui.controls.*;
|
||||
import gplx.langs.gfs.*;
|
||||
import gplx.gfui.draws.*; import gplx.gfui.gfxs.*; import gplx.gfui.imgs.*; import gplx.gfui.kits.core.*; import gplx.gfui.controls.gxws.*; import gplx.gfui.controls.elems.*; import gplx.gfui.controls.windows.*;
|
||||
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;
|
||||
public GfuiBtn Click_msg_(GfoMsg v) {clickMsg = v; return this;} GfoMsg clickMsg;
|
||||
public GfuiBtn Click_invk(Gfo_invk_cmd v) {clickInvkCmd = v; return this;} Gfo_invk_cmd clickInvkCmd;
|
||||
@Override public boolean PaintCbk(PaintArgs args) {
|
||||
super.PaintCbk(args);
|
||||
if (this.Focus_has()) focusBorder.DrawData(args.Graphics());
|
||||
@@ -32,9 +33,9 @@ public class GfuiBtn extends GfuiElemBase {
|
||||
@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);
|
||||
Object o = Gfo_invk_.Invk_by_key(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;}
|
||||
} public GfuiBtn Btn_img_(ImageAdp v) {Gfo_invk_.Invk_by_val(UnderElem(), Invk_btn_img_, v); return this;}
|
||||
@Override public GxwElem UnderElem_make(Keyval_hash ctorArgs) {return GxwElemFactory_.Instance.control_();}
|
||||
@Override public void ctor_GfuiBox_base(Keyval_hash ctorArgs) {
|
||||
focusBorder = GfuiBorderMgr.new_().All_(PenAdp_.new_(ColorAdp_.Gray, 1));
|
||||
@@ -53,11 +54,11 @@ public class GfuiBtn extends GfuiElemBase {
|
||||
Inject_(GfuiBtnClickBnd.Instance);
|
||||
Inject_(GfuiFocusXferBnd.Instance);
|
||||
} Gfui_kit kit;
|
||||
@gplx.Internal protected static void DoThis(GfuiElem click, GfoMsg clickMsg, GfoInvkAbleCmd clickInvkCmd) {
|
||||
@gplx.Internal protected static void DoThis(GfuiElem click, GfoMsg clickMsg, Gfo_invk_cmd clickInvkCmd) {
|
||||
try {
|
||||
if (clickInvkCmd != null) {
|
||||
GfsCtx ctx = GfsCtx.new_().MsgSrc_(click);
|
||||
clickInvkCmd.InvkAble().Invk(ctx, 0, clickInvkCmd.Cmd(), GfoMsg_.Null);
|
||||
clickInvkCmd.Exec_by_ctx(ctx, GfoMsg_.Null);
|
||||
}
|
||||
else if (clickMsg != null && clickMsg != GfoMsg_.Null) {
|
||||
GfsCtx ctx = GfsCtx.new_().MsgSrc_(click);
|
||||
@@ -15,9 +15,10 @@ 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.*;
|
||||
package gplx.gfui.controls.standards; import gplx.*; import gplx.gfui.*; import gplx.gfui.controls.*;
|
||||
import gplx.gfui.ipts.*; import gplx.gfui.controls.elems.*;
|
||||
import gplx.core.interfaces.*;
|
||||
class GfuiBtnClickBnd implements InjectAble, GfoInvkAble {
|
||||
class GfuiBtnClickBnd implements InjectAble, Gfo_invk {
|
||||
public void Inject(Object owner) {
|
||||
GfuiElem elem = GfuiElem_.cast(owner);
|
||||
IptBnd_.cmd_(IptCfg_.Null, elem, GfuiElemKeys.ActionExec_cmd, IptKey_.Enter, IptKey_.Space);
|
||||
@@ -34,8 +35,8 @@ class GfuiBtnClickBnd implements InjectAble, GfoInvkAble {
|
||||
}
|
||||
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;
|
||||
else return Gfo_invk_.Rv_unhandled;
|
||||
return this;
|
||||
} static final String ExecMouseUp_cmd = "ExecMouseUp";
|
||||
public static final GfuiBtnClickBnd Instance = new GfuiBtnClickBnd(); GfuiBtnClickBnd() {}
|
||||
} static final String ExecMouseUp_cmd = "ExecMouseUp";
|
||||
public static final GfuiBtnClickBnd Instance = new GfuiBtnClickBnd(); GfuiBtnClickBnd() {}
|
||||
}
|
||||
@@ -15,7 +15,8 @@ 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.*;
|
||||
package gplx.gfui.controls.standards; import gplx.*; import gplx.gfui.*; import gplx.gfui.controls.*;
|
||||
import gplx.gfui.imgs.*; import gplx.gfui.kits.core.*; import gplx.gfui.controls.gxws.*; import gplx.gfui.controls.elems.*;
|
||||
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_.new_type_mismatch_w_exc(exc, GfuiBtn.class, obj);}}
|
||||
@@ -25,9 +26,9 @@ public class GfuiBtn_ {
|
||||
rv.Click_msg_(msg);
|
||||
return rv;
|
||||
}
|
||||
public static GfuiBtn invk_(String key, GfuiElem owner, GfoInvkAble invk, String m) {
|
||||
public static GfuiBtn invk_(String key, GfuiElem owner, Gfo_invk invk, String m) {
|
||||
GfuiBtn rv = new_(key); rv.Owner_(owner);
|
||||
rv.Click_invk(GfoInvkAbleCmd.new_(invk, m));
|
||||
rv.Click_invk(Gfo_invk_cmd.New_by_key(invk, m));
|
||||
return rv;
|
||||
}
|
||||
public static GfuiBtn kit_(Gfui_kit kit, String key, GxwElem elm, Keyval_hash ctorArgs) {
|
||||
@@ -35,7 +36,7 @@ public class GfuiBtn_ {
|
||||
rv.ctor_kit_GfuiElemBase(kit, key, elm, ctorArgs);
|
||||
return rv;
|
||||
}
|
||||
@gplx.Internal protected static GfuiBtn new_(String key) {
|
||||
public static GfuiBtn new_(String key) {
|
||||
GfuiBtn rv = new GfuiBtn();
|
||||
rv.ctor_GfuiBox_base(GfuiElem_.init_focusAble_true_());
|
||||
rv.Key_of_GfuiElem_(key);
|
||||
@@ -15,12 +15,13 @@ 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.*;
|
||||
package gplx.gfui.controls.standards; import gplx.*; import gplx.gfui.*; import gplx.gfui.controls.*;
|
||||
import gplx.gfui.draws.*; import gplx.gfui.gfxs.*; import gplx.gfui.imgs.*; import gplx.gfui.controls.gxws.*; import gplx.gfui.controls.elems.*; import gplx.gfui.controls.windows.*;
|
||||
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);
|
||||
Gfo_evt_mgr_.Pub_val(this, "Check_end", val);
|
||||
GfuiBtn.DoThis(this, clickMsg, clickInvkCmd);
|
||||
}
|
||||
public void Val_sync(boolean val) {
|
||||
@@ -28,7 +29,7 @@ public class GfuiChkBox extends GfuiElemBase {
|
||||
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;
|
||||
@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() {
|
||||
@@ -15,7 +15,8 @@ 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.*;
|
||||
package gplx.gfui.controls.standards; import gplx.*; import gplx.gfui.*; import gplx.gfui.controls.*;
|
||||
import gplx.gfui.gfxs.*; import gplx.gfui.controls.elems.*;
|
||||
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_.new_type_mismatch_w_exc(exc, GfuiChkBox.class, obj);}}
|
||||
@@ -30,9 +31,9 @@ public class GfuiChkBox_ {
|
||||
rv.Click_msg_(msg);
|
||||
return rv;
|
||||
}
|
||||
public static GfuiChkBox invk_(String key, GfuiElem owner, String text, GfoInvkAble invk, String m) {
|
||||
public static GfuiChkBox invk_(String key, GfuiElem owner, String text, Gfo_invk invk, String m) {
|
||||
GfuiChkBox rv = new_(); rv.Owner_(owner, key).Text_any_(text);
|
||||
rv.Click_invk(GfoInvkAbleCmd.new_(invk, m));
|
||||
rv.Click_invk(Gfo_invk_cmd.New_by_key(invk, m));
|
||||
return rv;
|
||||
}
|
||||
public static GfuiChkBox noop_(String key, GfuiElem owner, String text) {
|
||||
@@ -15,14 +15,15 @@ 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.*;
|
||||
package gplx.gfui.controls.standards; import gplx.*; import gplx.gfui.*; import gplx.gfui.controls.*;
|
||||
import gplx.gfui.kits.core.*; import gplx.gfui.controls.gxws.*; import gplx.gfui.controls.elems.*;
|
||||
public class GfuiComboBox extends GfuiElemBase {
|
||||
@Override public void ctor_GfuiBox_base(Keyval_hash ctorArgs) {
|
||||
super.ctor_GfuiBox_base(ctorArgs);
|
||||
this.combo = (GxwComboBox)this.UnderElem();
|
||||
}
|
||||
@Override public GxwElem UnderElem_make(Keyval_hash ctorArgs) {return GxwElemFactory_.Instance.comboBox_();} private GxwComboBox combo;
|
||||
public int SelBgn() {return combo.SelBgn();} public void SelBgn_set(int v) {combo.SelBgn_set(v); GfoEvMgr_.Pub(this, Evt__selection_start_changed);}
|
||||
public int SelBgn() {return combo.SelBgn();} public void SelBgn_set(int v) {combo.SelBgn_set(v); Gfo_evt_mgr_.Pub(this, Evt__selection_start_changed);}
|
||||
public int SelLen() {return combo.SelLen();} public void SelLen_set(int v) {combo.SelLen_set(v);}
|
||||
public void Sel_(int bgn, int len) {combo.Sel_(bgn, len);}
|
||||
public Object SelectedItm() {return combo.SelectedItm();} public void SelectedItm_set(Object v) {combo.SelectedItm_set(v);}
|
||||
@@ -15,7 +15,8 @@ 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.*;
|
||||
package gplx.gfui.controls.standards; import gplx.*; import gplx.gfui.*; import gplx.gfui.controls.*;
|
||||
import gplx.gfui.gfxs.*; import gplx.gfui.imgs.*; import gplx.gfui.kits.core.*; import gplx.gfui.controls.gxws.*; import gplx.gfui.controls.elems.*;
|
||||
public class GfuiLbl extends GfuiElemBase { // standard label does not support tooltips
|
||||
@Override public void Click() {
|
||||
int focusOrder = this.OwnerElem().SubElems().IndexOfA(this);
|
||||
@@ -15,7 +15,8 @@ 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.*;
|
||||
package gplx.gfui.controls.standards; import gplx.*; import gplx.gfui.*; import gplx.gfui.controls.*;
|
||||
import gplx.gfui.draws.*; import gplx.gfui.kits.core.*; import gplx.gfui.controls.gxws.*; import gplx.gfui.controls.elems.*;
|
||||
public class GfuiLbl_ {
|
||||
public static GfuiLbl sub_(String key, GfuiElem owner) {
|
||||
GfuiLbl rv = new_();
|
||||
@@ -42,7 +43,7 @@ public class GfuiLbl_ {
|
||||
rv.Border().All_(PenAdp_.black_());
|
||||
return rv;
|
||||
}
|
||||
public static final String Text_Null = null;
|
||||
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_());
|
||||
@@ -15,8 +15,9 @@ 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.*;
|
||||
package gplx.gfui.controls.standards; import gplx.*; import gplx.gfui.*; import gplx.gfui.controls.*;
|
||||
import gplx.core.lists.*; /*EnumerAble*/
|
||||
import gplx.gfui.controls.gxws.*; import gplx.gfui.controls.elems.*;
|
||||
public class GfuiListBox extends GfuiElemBase {
|
||||
@Override public GxwElem UnderElem_make(Keyval_hash ctorArgs) {return GxwElemFactory_.Instance.listBox_();}
|
||||
@Override public void ctor_GfuiBox_base(Keyval_hash ctorArgs) {
|
||||
@@ -15,12 +15,13 @@ 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.*;
|
||||
package gplx.gfui.controls.standards; import gplx.*; import gplx.gfui.*; import gplx.gfui.controls.*;
|
||||
import gplx.gfui.kits.core.*; import gplx.gfui.controls.gxws.*; import gplx.gfui.controls.elems.*;
|
||||
public class GfuiTextBox extends GfuiElemBase {
|
||||
public static final String SelectionStartChanged_evt = "SelectionStartChanged";
|
||||
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 SelBgn() {return textBox.SelBgn();} public void SelBgn_set(int v) {textBox.SelBgn_set(v); Gfo_evt_mgr_.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());
|
||||
@@ -53,7 +54,7 @@ public class GfuiTextBox extends GfuiElemBase {
|
||||
@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();}
|
||||
public void CreateControlIfNeeded() {textBox.CreateControlIfNeeded();}
|
||||
@Override public GxwElem UnderElem_make(Keyval_hash ctorArgs) {return GxwElemFactory_.Instance.text_fld_();}
|
||||
@Override public void ctor_GfuiBox_base(Keyval_hash ctorArgs) {
|
||||
super.ctor_GfuiBox_base(ctorArgs);
|
||||
@@ -15,12 +15,13 @@ 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.*;
|
||||
package gplx.gfui.controls.standards; import gplx.*; import gplx.gfui.*; import gplx.gfui.controls.*;
|
||||
import gplx.gfui.kits.core.*; import gplx.gfui.controls.gxws.*; import gplx.gfui.controls.elems.*;
|
||||
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_.new_type_mismatch_w_exc(exc, GfuiTextBox.class, obj);}}
|
||||
public static final String NewLine = "\n";
|
||||
public static final String Ctor_Memo = "TextBox_Memo";
|
||||
public static final String NewLine = "\n";
|
||||
public static final String Ctor_Memo = "TextBox_Memo";
|
||||
|
||||
public static GfuiTextBox new_() {
|
||||
GfuiTextBox rv = new GfuiTextBox();
|
||||
@@ -15,7 +15,8 @@ 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.*;
|
||||
package gplx.gfui.controls.standards; import gplx.*; import gplx.gfui.*; import gplx.gfui.controls.*;
|
||||
import gplx.gfui.controls.gxws.*;
|
||||
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());}
|
||||
@@ -29,7 +30,7 @@ public class GfuiTextMemo extends GfuiTextBox { public int LinesPerScreen() {re
|
||||
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 SelectionStart_toFirstChar() {textBox.SelectionStart_toFirstChar(); Gfo_evt_mgr_.Pub(this, SelectionStartChanged_evt);}
|
||||
public void ScrollTillSelectionStartIsFirstLine() {textBox.ScrollTillSelectionStartIsFirstLine();}
|
||||
|
||||
@Override public GxwElem UnderElem_make(Keyval_hash ctorArgs) {return GxwElemFactory_.Instance.text_memo_();}
|
||||
@@ -15,7 +15,8 @@ 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.*;
|
||||
package gplx.gfui.controls.standards; import gplx.*; import gplx.gfui.*; import gplx.gfui.controls.*;
|
||||
import gplx.gfui.kits.core.*; import gplx.gfui.controls.gxws.*; import gplx.gfui.controls.elems.*;
|
||||
public class Gfui_html extends GfuiElemBase {
|
||||
public void Under_html_(Gxw_html v) {under = v;} private Gxw_html under;
|
||||
public void Html_doc_html_load_by_mem(String html) {under.Html_doc_html_load_by_mem(html);}
|
||||
@@ -26,9 +27,10 @@ public class Gfui_html extends GfuiElemBase {
|
||||
@gplx.Virtual public String Html_js_eval_proc_as_str(String name, Object... args) {return under.Html_js_eval_proc_as_str(name, args);}
|
||||
@gplx.Virtual public boolean Html_js_eval_proc_as_bool(String name, Object... args) {return under.Html_js_eval_proc_as_bool(name, args);}
|
||||
public String Html_js_eval_script(String script) {return under.Html_js_eval_script(script);}
|
||||
public Object Html_js_eval_script_as_obj(String script) {return under.Html_js_eval_script_as_obj(script);}
|
||||
public String Html_js_send_json(String name, String data) {return under.Html_js_send_json(name, data);}
|
||||
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);}
|
||||
public void Html_js_cbks_add(String js_func_name, Gfo_invk invk) {under.Html_js_cbks_add(js_func_name, invk);}
|
||||
public void Html_invk_src_(Gfo_evt_itm v) {under.Html_invk_src_(v);}
|
||||
public void Html_dispose() {under.Html_dispose();}
|
||||
@Override public GfuiElem Text_(String v) {
|
||||
this.Html_doc_html_load_by_mem(v);
|
||||
@@ -46,9 +48,9 @@ public class Gfui_html extends GfuiElemBase {
|
||||
rv.under = under;
|
||||
return rv;
|
||||
}
|
||||
public static Object Js_args_exec(GfoInvkAble invk, Object[] args) {
|
||||
public static Object Js_args_exec(Gfo_invk invk, Object[] args) {
|
||||
GfoMsg m = Js_args_to_msg(args);
|
||||
return GfoInvkAble_.InvkCmd_msg(invk, m.Key(), m);
|
||||
return Gfo_invk_.Invk_by_msg(invk, m.Key(), m);
|
||||
}
|
||||
public static GfoMsg Js_args_to_msg(Object[] args) {
|
||||
String proc = (String)args[0];
|
||||
@@ -15,7 +15,8 @@ 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.*;
|
||||
package gplx.gfui.controls.standards; import gplx.*; import gplx.gfui.*; import gplx.gfui.controls.*;
|
||||
import gplx.gfui.kits.core.*; import gplx.gfui.controls.gxws.*; import gplx.gfui.controls.elems.*;
|
||||
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);}
|
||||
@@ -15,7 +15,7 @@ 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.*;
|
||||
package gplx.gfui.controls.standards; import gplx.*; import gplx.gfui.*; import gplx.gfui.controls.*;
|
||||
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;
|
||||
@@ -15,7 +15,7 @@ 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.*;
|
||||
package gplx.gfui.controls.standards; import gplx.*; import gplx.gfui.*; import gplx.gfui.controls.*;
|
||||
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();
|
||||
@@ -15,7 +15,8 @@ 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.*;
|
||||
package gplx.gfui.controls.standards; import gplx.*; import gplx.gfui.*; import gplx.gfui.controls.*;
|
||||
import gplx.gfui.draws.*; import gplx.gfui.kits.core.*; import gplx.gfui.controls.gxws.*; import gplx.gfui.controls.elems.*;
|
||||
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);}
|
||||
@@ -15,12 +15,13 @@ 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.*;
|
||||
package gplx.gfui.controls.tabs; import gplx.*; import gplx.gfui.*; import gplx.gfui.controls.*;
|
||||
import gplx.core.interfaces.*;
|
||||
import gplx.gfui.ipts.*; import gplx.gfui.controls.standards.*;
|
||||
class TabBoxEvt_nameChange {
|
||||
public static String Key = "TabBoxEvt_nameChange";
|
||||
public static void Send(TabBoxMgr mgr, TabPnlItm itm) {
|
||||
GfoEvMgr_.PubVal(mgr, Key, itm);
|
||||
Gfo_evt_mgr_.Pub_val(mgr, Key, itm);
|
||||
}
|
||||
public static void Rcvd(TabBox tabBox, GfsCtx ctx, GfoMsg m) {
|
||||
TabPnlItm itm = (TabPnlItm)m.CastObj("v");
|
||||
@@ -38,7 +39,7 @@ class TabBoxEvt_tabSelectByBtn {
|
||||
mgr.Select(mgr.Get_by(key));
|
||||
}
|
||||
}
|
||||
class TabBnd_selectTab implements InjectAble, GfoInvkAble {
|
||||
class TabBnd_selectTab implements InjectAble, Gfo_invk {
|
||||
public void Inject(Object obj) {
|
||||
tabBox = TabBox_.cast(obj);
|
||||
IptBnd_.cmd_to_(IptCfg_.Null, tabBox, this, SelectNext_cmd, IptKey_.add_(IptKey_.Ctrl, IptKey_.Tab), IptKey_.add_(IptKey_.Ctrl, IptKey_.PageDown));
|
||||
@@ -52,13 +53,13 @@ class TabBnd_selectTab implements InjectAble, GfoInvkAble {
|
||||
public Object Invk(GfsCtx ctx, int ikey, String k, GfoMsg m) {
|
||||
if (ctx.Match(k, SelectNext_cmd)) Select(m, 1);
|
||||
else if (ctx.Match(k, SelectPrev_cmd)) Select(m, -1);
|
||||
else return GfoInvkAble_.Rv_unhandled;
|
||||
else return Gfo_invk_.Rv_unhandled;
|
||||
return this;
|
||||
} static final String SelectNext_cmd = "SelectNext", SelectPrev_cmd = "SelectPrev";
|
||||
} static final String SelectNext_cmd = "SelectNext", SelectPrev_cmd = "SelectPrev";
|
||||
TabBox tabBox;
|
||||
public static TabBnd_selectTab new_() {return new TabBnd_selectTab();} TabBnd_selectTab() {}
|
||||
}
|
||||
class TabBnd_reorderTab implements InjectAble, GfoInvkAble {
|
||||
class TabBnd_reorderTab implements InjectAble, Gfo_invk {
|
||||
public void Inject(Object owner) {
|
||||
GfuiBtn btn = GfuiBtn_.cast(owner);
|
||||
IptBnd_.cmd_to_(IptCfg_.Null, btn, this, MovePrev_cmd, IptKey_.add_(IptKey_.Ctrl, IptKey_.Left));
|
||||
@@ -78,9 +79,9 @@ class TabBnd_reorderTab implements InjectAble, GfoInvkAble {
|
||||
public Object Invk(GfsCtx ctx, int ikey, String k, GfoMsg m) {
|
||||
if (ctx.Match(k, MoveNext_cmd)) MoveTab(GfuiBtn_.cast(ctx.MsgSrc()), 1);
|
||||
else if (ctx.Match(k, MovePrev_cmd)) MoveTab(GfuiBtn_.cast(ctx.MsgSrc()), -1);
|
||||
else return GfoInvkAble_.Rv_unhandled;
|
||||
else return Gfo_invk_.Rv_unhandled;
|
||||
return this;
|
||||
} public static final String MoveNext_cmd = "MoveNext", MovePrev_cmd = "MovePrev";
|
||||
} public static final String MoveNext_cmd = "MoveNext", MovePrev_cmd = "MovePrev";
|
||||
public static TabBnd_reorderTab new_(TabBox tabBox) {
|
||||
TabBnd_reorderTab rv = new TabBnd_reorderTab();
|
||||
rv.tabBox = tabBox;
|
||||
@@ -15,7 +15,8 @@ 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.*;
|
||||
package gplx.gfui.controls.tabs; import gplx.*; import gplx.gfui.*; import gplx.gfui.controls.*;
|
||||
import gplx.gfui.draws.*; import gplx.gfui.layouts.*; import gplx.gfui.controls.elems.*; import gplx.gfui.controls.standards.*;
|
||||
public class TabBox extends GfuiElemBase {
|
||||
public int Tabs_Count() {return mgr.Count();}
|
||||
public TabPnlItm Tabs_SelectedItm() {return mgr.CurTab();}
|
||||
@@ -35,7 +36,7 @@ public class TabBox extends GfuiElemBase {
|
||||
mgr.Del_at(idx);
|
||||
}
|
||||
@gplx.Internal protected TabBoxMgr Mgr() {return mgr;} TabBoxMgr mgr = TabBoxMgr.new_();
|
||||
@gplx.Internal protected GfuiElem BtnBox() {return btnBox;} GfuiElem btnBox;
|
||||
public GfuiElem BtnBox() {return btnBox;} GfuiElem btnBox;
|
||||
@gplx.Internal protected GfuiElem PnlBox() {return pnlBox;} GfuiElem pnlBox;
|
||||
@Override public Object Invk(GfsCtx ctx, int ikey, String k, GfoMsg m) {
|
||||
if (ctx.Match(k, TabBoxEvt_tabSelectByBtn.Key)) TabBoxEvt_tabSelectByBtn.Rcvd(ctx.MsgSrc(), this);
|
||||
@@ -49,8 +50,8 @@ public class TabBox extends GfuiElemBase {
|
||||
btnBox = TabBtnAreaMgr.new_("btnBox", this);
|
||||
pnlBox = TabPnlAreaMgr.new_("pnlBox", this);
|
||||
this.Inject_(TabBnd_selectTab.new_());
|
||||
GfoEvMgr_.SubSame(mgr, TabBoxEvt_tabSelect.Key, this);
|
||||
GfoEvMgr_.SubSame(mgr, TabBoxEvt_nameChange.Key, this);
|
||||
Gfo_evt_mgr_.Sub_same(mgr, TabBoxEvt_tabSelect.Key, this);
|
||||
Gfo_evt_mgr_.Sub_same(mgr, TabBoxEvt_nameChange.Key, this);
|
||||
|
||||
this.Lyt_activate();
|
||||
this.Lyt().Bands_add(GftBand.fillWidth_());
|
||||
@@ -69,7 +70,7 @@ class TabBtnAreaMgr {
|
||||
GfuiBtn btn = GfuiBtn_.new_(itm.Key());
|
||||
btn.TipText_(itm.Name()).Text_(itm.Name()).Width_(80);
|
||||
btn.TextMgr().Font_(btn.TextMgr().Font().Size_(8));
|
||||
btn.Click_invk(GfoInvkAbleCmd.new_(tabBox, TabBoxEvt_tabSelectByBtn.Key));
|
||||
btn.Click_invk(Gfo_invk_cmd.New_by_key(tabBox, TabBoxEvt_tabSelectByBtn.Key));
|
||||
btn.Inject_(TabBnd_reorderTab.new_(tabBox));
|
||||
if (btnBox.SubElems().Count() > 0) { // place button after last
|
||||
GfuiElem lastBtn = btnBox.SubElems().Get_at(btnBox.SubElems().Count() - 1);
|
||||
@@ -15,14 +15,14 @@ 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.*;
|
||||
package gplx.gfui.controls.tabs; import gplx.*; import gplx.gfui.*; import gplx.gfui.controls.*;
|
||||
public class TabBoxEvt_orderChanged {
|
||||
public int CurIdx() {return curIdx;} public TabBoxEvt_orderChanged CurIdx_(int v) {curIdx = v; return this;} int curIdx;
|
||||
public int NewIdx() {return newIdx;} public TabBoxEvt_orderChanged NewIdx_(int v) {newIdx = v; return this;} int newIdx;
|
||||
|
||||
public static final String OrderChanged_evt = "OrderChanged_evt";
|
||||
public static final String OrderChanged_evt = "OrderChanged_evt";
|
||||
public static void Publish(TabBox tabBox, int curIdx, int newIdx) {
|
||||
GfoEvMgr_.PubVals(tabBox, OrderChanged_evt, Keyval_.new_("curIdx", curIdx), Keyval_.new_("newIdx", newIdx));
|
||||
Gfo_evt_mgr_.Pub_vals(tabBox, OrderChanged_evt, Keyval_.new_("curIdx", curIdx), Keyval_.new_("newIdx", newIdx));
|
||||
}
|
||||
public static TabBoxEvt_orderChanged Handle(GfsCtx ctx, GfoMsg m) {
|
||||
TabBoxEvt_orderChanged rv = new TabBoxEvt_orderChanged();
|
||||
@@ -15,12 +15,12 @@ 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.*;
|
||||
package gplx.gfui.controls.tabs; import gplx.*; import gplx.gfui.*; import gplx.gfui.controls.*;
|
||||
public class TabBoxEvt_tabSelect {
|
||||
public static String Key = "TabBoxEvt_tabSelect";
|
||||
public static final String SelectedChanged_evt = "SelectedChanged_evt";
|
||||
public static final String SelectedChanged_evt = "SelectedChanged_evt";
|
||||
public static void Send(TabBoxMgr tabBoxMgr, TabPnlItm oldTab, TabPnlItm newTab) {
|
||||
GfoEvMgr_.PubVal(tabBoxMgr, Key, new TabPnlItm[] {oldTab, newTab});
|
||||
Gfo_evt_mgr_.Pub_val(tabBoxMgr, Key, new TabPnlItm[] {oldTab, newTab});
|
||||
}
|
||||
@gplx.Internal protected static void Select(TabBox tabBox, GfsCtx ctx, GfoMsg m) {
|
||||
TabPnlItm[] ary = (TabPnlItm[])m.CastObj("v");
|
||||
@@ -29,7 +29,7 @@ public class TabBoxEvt_tabSelect {
|
||||
@gplx.Internal protected static void Select(TabBox tabBox, TabPnlItm curTabItm, TabPnlItm newTabItm) {
|
||||
TabPnlAreaMgr.Select(tabBox, curTabItm, newTabItm);
|
||||
TabBtnAreaMgr.Select(tabBox, curTabItm, newTabItm);
|
||||
GfoEvMgr_.PubVal(tabBox, SelectedChanged_evt, newTabItm.Idx());
|
||||
Gfo_evt_mgr_.Pub_val(tabBox, SelectedChanged_evt, newTabItm.Idx());
|
||||
}
|
||||
public static int Handle(GfsCtx ctx, GfoMsg m) {
|
||||
return m.ReadInt("v");
|
||||
@@ -15,9 +15,9 @@ 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 TabBoxMgr implements GfoEvMgrOwner {
|
||||
public GfoEvMgr EvMgr() {if (evMgr == null) evMgr = GfoEvMgr.new_(this); return evMgr;} GfoEvMgr evMgr;
|
||||
package gplx.gfui.controls.tabs; import gplx.*; import gplx.gfui.*; import gplx.gfui.controls.*;
|
||||
public class TabBoxMgr implements Gfo_evt_mgr_owner {
|
||||
public Gfo_evt_mgr Evt_mgr() {if (evt_mgr == null) evt_mgr = new Gfo_evt_mgr(this); return evt_mgr;} Gfo_evt_mgr evt_mgr;
|
||||
public int Count() {return itms.Count();}
|
||||
public TabPnlItm Get_by(String k) {return (TabPnlItm)itms.Get_by(k);}
|
||||
public TabPnlItm Get_at(int i) {return (TabPnlItm)itms.Get_at(i);}
|
||||
@@ -33,7 +33,7 @@ public class TabBoxMgr implements GfoEvMgrOwner {
|
||||
itms.Del(itm.Key());
|
||||
this.Reorder(i);
|
||||
if (isCur) {
|
||||
curTab = null; // must null out curTab since it has been deleted from itms; TODO: should raise Deleted event to delete btn,pnl,view; wait for rewrite of view
|
||||
curTab = null; // must null out curTab since it has been deleted from itms; TODO_OLD: should raise Deleted event to delete btn,pnl,view; wait for rewrite of view
|
||||
if (isLast) i--; // last was dropped; select prev; otherwise re-select idx (effectively, whatever tab drops into slot)
|
||||
if (i >=0)
|
||||
this.Select(i);
|
||||
@@ -15,7 +15,8 @@ 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.*;
|
||||
package gplx.gfui.controls.tabs; import gplx.*; import gplx.gfui.*; import gplx.gfui.controls.*;
|
||||
import gplx.gfui.controls.elems.*;
|
||||
public class TabBox_ {
|
||||
public static TabBox as_(Object obj) {return obj instanceof TabBox ? (TabBox)obj : null;}
|
||||
public static TabBox cast(Object obj) {try {return (TabBox)obj;} catch(Exception exc) {throw Err_.new_type_mismatch_w_exc(exc, TabBox.class, obj);}}
|
||||
@@ -15,8 +15,8 @@ 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.*;
|
||||
package gplx.gfui.controls.tabs; import gplx.*; import gplx.gfui.*; import gplx.gfui.controls.*;
|
||||
import org.junit.*; import gplx.gfui.controls.tabs.*; import gplx.gfui.controls.elems.*; import gplx.gfui.controls.standards.*;
|
||||
public class TabBox_tst {
|
||||
// @Before public void setup() {
|
||||
// fx = TabBoxFxt.new_();
|
||||
@@ -64,7 +64,7 @@ class GfuiElemFxt {
|
||||
return rv;
|
||||
} GfuiElemFxt() {}
|
||||
}
|
||||
class TabBoxFxt implements GfoInvkAble {
|
||||
class TabBoxFxt implements Gfo_invk {
|
||||
@gplx.Internal protected TabBox TabBox() {return tabBox;}
|
||||
@gplx.Internal protected TabBoxFxt Make(int count) {
|
||||
for (int i = 0; i < tabBox.Tabs_Count(); i++)
|
||||
@@ -117,9 +117,9 @@ class TabBoxFxt implements GfoInvkAble {
|
||||
// }
|
||||
public Object Invk(GfsCtx ctx, int ikey, String k, GfoMsg m) {
|
||||
if (ctx.Match(k, OrderChangedReceived_cmd)) OrderChangedReceived(m);
|
||||
else return GfoInvkAble_.Rv_unhandled;
|
||||
else return Gfo_invk_.Rv_unhandled;
|
||||
return this;
|
||||
} public static final String OrderChangedReceived_cmd = "OrderChangedReceived";
|
||||
} public static final String OrderChangedReceived_cmd = "OrderChangedReceived";
|
||||
TabBox tabBox;
|
||||
public static TabBoxFxt new_() {
|
||||
TabBoxFxt rv = new TabBoxFxt();
|
||||
@@ -15,7 +15,7 @@ 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.*;
|
||||
package gplx.gfui.controls.tabs; import gplx.*; import gplx.gfui.*; import gplx.gfui.controls.*;
|
||||
public class TabPnlItm {
|
||||
public String Key() {return key;} private String key;
|
||||
public String Name() {return name;}
|
||||
@@ -15,10 +15,11 @@ 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.*;
|
||||
package gplx.gfui.controls.windows; import gplx.*; import gplx.gfui.*; import gplx.gfui.controls.*;
|
||||
import gplx.gfui.draws.*; import gplx.gfui.ipts.*; import gplx.gfui.layouts.*; import gplx.gfui.envs.*; import gplx.gfui.controls.elems.*; import gplx.gfui.controls.standards.*; import gplx.gfui.controls.customs.*;
|
||||
import gplx.core.envs.*;
|
||||
import gplx.gfml.*; import gplx.langs.gfs.*;
|
||||
public class GfoConsoleWin implements GfoInvkAble, UsrMsgWkr {
|
||||
public class GfoConsoleWin implements Gfo_invk, UsrMsgWkr {
|
||||
GfuiWin win; GfoConsoleWinCmds cmds; GfuiTextBox statusBox, resultBox; GfuiTextBoxLogger logger;
|
||||
public boolean Enabled() {return enabled;} public GfoConsoleWin Enabled_(boolean v) {enabled = v; return this;} private boolean enabled = true;
|
||||
public GfuiWin Win() {return win;}
|
||||
@@ -79,13 +80,13 @@ public class GfoConsoleWin implements GfoInvkAble, UsrMsgWkr {
|
||||
}
|
||||
public Object Invk(GfsCtx ctx, int ikey, String k, GfoMsg m) {
|
||||
if (ctx.Match(k, Invk_Show)) Show();
|
||||
else return GfoInvkAble_.Rv_unhandled;
|
||||
else return Gfo_invk_.Rv_unhandled;
|
||||
return this;
|
||||
} public static final String Invk_Show = "Show"
|
||||
} public static final String Invk_Show = "Show"
|
||||
;
|
||||
public static final GfoConsoleWin Instance = new GfoConsoleWin(); GfoConsoleWin() {}
|
||||
public static final GfoConsoleWin Instance = new GfoConsoleWin(); GfoConsoleWin() {}
|
||||
}
|
||||
class GfoConsoleWinCmds implements GfoInvkAble {
|
||||
class GfoConsoleWinCmds implements Gfo_invk {
|
||||
GfuiWin win; GfuiTextBox consoleFilBox, consoleBox, statusBox, resultBox;
|
||||
public void Owner_set(GfuiElem elem) {win = (GfuiWin)elem;}
|
||||
public void Init() {
|
||||
@@ -122,7 +123,7 @@ class GfoConsoleWinCmds implements GfoInvkAble {
|
||||
GfsCtx ctx = GfsCtx.new_();
|
||||
try {
|
||||
Object rv = GfsCore.Instance.ExecOne(ctx, runMsg);
|
||||
if (rv != GfoInvkAble_.Rv_handled && rv != GfoInvkAble_.Rv_unhandled) {
|
||||
if (rv != Gfo_invk_.Rv_handled && rv != Gfo_invk_.Rv_unhandled) {
|
||||
UsrDlg_.Instance.Note(Object_.Xto_str_strict_or_empty(rv));
|
||||
}
|
||||
// Results_add(FixNewLines(ctx.Results_XtoStr()));
|
||||
@@ -198,13 +199,13 @@ class GfoConsoleWinCmds implements GfoInvkAble {
|
||||
}
|
||||
else return win.Invk(ctx, ikey, k, m);
|
||||
return this;
|
||||
} public static final String Invk_Exec = "Exec", Invk_Hide = "Hide", Invk_Save = "Save", Invk_Load = "Load", Invk_Help = "Help", Invk_Clear = "Clear"
|
||||
} public static final String Invk_Exec = "Exec", Invk_Hide = "Hide", Invk_Save = "Save", Invk_Load = "Load", Invk_Help = "Help", Invk_Clear = "Clear"
|
||||
, Invk_X_ = "X_", Invk_Y_ = "Y_", Invk_Width_ = "Width_", Invk_Height_ = "Height_", Invk_Enabled_ = "Enabled_", Invk_SaveUrl_ = "SaveUrl_"
|
||||
;
|
||||
GfoConsoleWin owner;
|
||||
public GfoConsoleWinCmds(GfoConsoleWin owner) {this.owner = owner;}
|
||||
}
|
||||
class GfuiTextBoxLogger implements GfoInvkAble {
|
||||
class GfuiTextBoxLogger implements Gfo_invk {
|
||||
public GfuiTextBoxLogger Init(GfuiTextBox tbox) {
|
||||
this.tbox = tbox;
|
||||
win = tbox.OwnerWin();
|
||||
@@ -228,7 +229,7 @@ class GfuiTextBoxLogger implements GfoInvkAble {
|
||||
void WriteText(String text) {
|
||||
if (!win.Visible()) return; // StatusForm not visible; return; otherwise .CreateControl will be called
|
||||
tbox.CreateControlIfNeeded(); // otherwise will occasionally throw: Cannot call Invoke or InvokeAsync on a control until the window handle has been created
|
||||
tbox.Invoke(GfoInvkAbleCmd.arg_(this, Invk_WriteText_cmd, text));
|
||||
tbox.Invoke(Gfo_invk_cmd.New_by_val(this, Invk_WriteText_cmd, text));
|
||||
}
|
||||
void Invk_WriteText(String text) {
|
||||
tbox.Text_(text);
|
||||
@@ -243,7 +244,7 @@ class GfuiTextBoxLogger implements GfoInvkAble {
|
||||
public Object Invk(GfsCtx ctx, int ikey, String k, GfoMsg m) {
|
||||
if (ctx.Match(k, Tmr_cmd)) WhenTick();
|
||||
else if (ctx.Match(k, Invk_WriteText_cmd)) Invk_WriteText(m.ReadStr("v"));
|
||||
else return GfoInvkAble_.Rv_unhandled;
|
||||
else return Gfo_invk_.Rv_unhandled;
|
||||
return this;
|
||||
}
|
||||
String Invk_WriteText_cmd = "Invk_WriteText", Tmr_cmd = "Tmr";
|
||||
@@ -15,7 +15,8 @@ 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.*;
|
||||
package gplx.gfui.controls.windows; import gplx.*; import gplx.gfui.*; import gplx.gfui.controls.*;
|
||||
import gplx.gfui.ipts.*; import gplx.gfui.controls.elems.*;
|
||||
public class GfuiBnd_win_host {
|
||||
public GfuiWin HosterWin() {return hosterWin;} GfuiWin hosterWin;
|
||||
public GfuiElem HosteeBox() {return hosteeBox;} GfuiElem hosteeBox;
|
||||
@@ -15,9 +15,10 @@ 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.*;
|
||||
package gplx.gfui.controls.windows; import gplx.*; import gplx.gfui.*; import gplx.gfui.controls.*;
|
||||
import gplx.core.interfaces.*;
|
||||
public class GfuiCmdForm implements GfoInvkAble, InjectAble {
|
||||
import gplx.gfui.ipts.*; import gplx.gfui.controls.elems.*;
|
||||
public class GfuiCmdForm implements Gfo_invk, InjectAble {
|
||||
public void Inject(Object ownerObj) {
|
||||
GfuiElem owner = (GfuiElem)ownerObj;
|
||||
GfuiCmdForm.host_(key, cmdElem, owner);
|
||||
@@ -39,11 +40,11 @@ public class GfuiCmdForm implements GfoInvkAble, InjectAble {
|
||||
}
|
||||
|
||||
GfuiWin cmdForm;
|
||||
static final String DoStuff = "doStuff", HideMe_cmd = "HideMe";
|
||||
static final String DoStuff = "doStuff", HideMe_cmd = "HideMe";
|
||||
public Object Invk(GfsCtx ctx, int ikey, String k, GfoMsg m) {
|
||||
if (ctx.Match(k, DoStuff)) ActivateMe((GfuiElem)ctx.MsgSrc());
|
||||
else if (ctx.Match(k, HideMe_cmd)) ((GfuiWin)ctx.MsgSrc()).Hide();
|
||||
else return GfoInvkAble_.Rv_unhandled;
|
||||
else return Gfo_invk_.Rv_unhandled;
|
||||
return this;
|
||||
}
|
||||
void ActivateMe(GfuiElem elem) {
|
||||
31
150_gfui/src/gplx/gfui/controls/windows/GfuiFocusMgr.java
Normal file
31
150_gfui/src/gplx/gfui/controls/windows/GfuiFocusMgr.java
Normal file
@@ -0,0 +1,31 @@
|
||||
/*
|
||||
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.controls.windows; import gplx.*; import gplx.gfui.*; import gplx.gfui.controls.*;
|
||||
import gplx.gfui.controls.elems.*;
|
||||
public class GfuiFocusMgr implements Gfo_evt_mgr_owner {
|
||||
public static final String FocusChanged_evt = "focusChanged_evt";
|
||||
public Gfo_evt_mgr Evt_mgr() {if (evt_mgr == null) evt_mgr = new Gfo_evt_mgr(this); return evt_mgr;} Gfo_evt_mgr evt_mgr;
|
||||
public GfuiElem FocusedElem() {return focusedElem;} GfuiElem focusedElem;
|
||||
public GfuiElem FocusedElemPrev() {return focusedElemPrev;} GfuiElem focusedElemPrev;
|
||||
public void FocusedElem_set(GfuiElem focused) {
|
||||
focusedElemPrev = focusedElem;
|
||||
this.focusedElem = focused;
|
||||
Gfo_evt_mgr_.Pub_val(this, FocusChanged_evt, focused);
|
||||
}
|
||||
public static final GfuiFocusMgr Instance = new GfuiFocusMgr(); GfuiFocusMgr() {}
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user