mirror of
https://github.com/gnosygnu/xowa.git
synced 2026-03-02 03:49:30 +00:00
Refactor: @Test whitespace clean-up and other corelib changes
This commit is contained in:
@@ -1,38 +1,38 @@
|
||||
/*
|
||||
XOWA: the XOWA Offline Wiki Application
|
||||
Copyright (C) 2012-2017 gnosygnu@gmail.com
|
||||
|
||||
XOWA is licensed under the terms of the General Public License (GPL) Version 3,
|
||||
or alternatively under the terms of the Apache License Version 2.0.
|
||||
|
||||
You may use XOWA according to either of these licenses as is most appropriate
|
||||
for your project on a case-by-case basis.
|
||||
|
||||
The terms of each license can be found in the source code repository:
|
||||
|
||||
GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt
|
||||
Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt
|
||||
*/
|
||||
/*
|
||||
XOWA: the XOWA Offline Wiki Application
|
||||
Copyright (C) 2012-2017 gnosygnu@gmail.com
|
||||
|
||||
XOWA is licensed under the terms of the General Public License (GPL) Version 3,
|
||||
or alternatively under the terms of the Apache License Version 2.0.
|
||||
|
||||
You may use XOWA according to either of these licenses as is most appropriate
|
||||
for your project on a case-by-case basis.
|
||||
|
||||
The terms of each license can be found in the source code repository:
|
||||
|
||||
GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt
|
||||
Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt
|
||||
*/
|
||||
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_();
|
||||
}
|
||||
@Test public void NullToEdge() { // all null -> one edge
|
||||
@Test public void NullToEdge() { // all null -> one edge
|
||||
tst_Eq(borderMgr, null, null, null, null, null);
|
||||
|
||||
borderMgr.Top_(red);
|
||||
tst_Eq(borderMgr, null, red, null, null, null);
|
||||
}
|
||||
@Test public void EdgeToAll() { // one edge -> all edge
|
||||
@Test public void EdgeToAll() { // one edge -> all edge
|
||||
borderMgr.Top_(red);
|
||||
tst_Eq(borderMgr, null, red, null, null, null);
|
||||
|
||||
borderMgr.All_(black);
|
||||
tst_Eq(borderMgr, black, null, null, null, null);
|
||||
}
|
||||
@Test public void AllToEdge() { // all edge -> one new; three old
|
||||
@Test public void AllToEdge() { // all edge -> one new; three old
|
||||
borderMgr.All_(red);
|
||||
tst_Eq(borderMgr, red, null, null, null, null);
|
||||
|
||||
|
||||
@@ -1,21 +1,39 @@
|
||||
/*
|
||||
XOWA: the XOWA Offline Wiki Application
|
||||
Copyright (C) 2012-2017 gnosygnu@gmail.com
|
||||
|
||||
XOWA is licensed under the terms of the General Public License (GPL) Version 3,
|
||||
or alternatively under the terms of the Apache License Version 2.0.
|
||||
|
||||
You may use XOWA according to either of these licenses as is most appropriate
|
||||
for your project on a case-by-case basis.
|
||||
|
||||
The terms of each license can be found in the source code repository:
|
||||
|
||||
GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt
|
||||
Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt
|
||||
*/
|
||||
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.*;
|
||||
/*
|
||||
XOWA: the XOWA Offline Wiki Application
|
||||
Copyright (C) 2012-2017 gnosygnu@gmail.com
|
||||
|
||||
XOWA is licensed under the terms of the General Public License (GPL) Version 3,
|
||||
or alternatively under the terms of the Apache License Version 2.0.
|
||||
|
||||
You may use XOWA according to either of these licenses as is most appropriate
|
||||
for your project on a case-by-case basis.
|
||||
|
||||
The terms of each license can be found in the source code repository:
|
||||
|
||||
GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt
|
||||
Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt
|
||||
*/
|
||||
package gplx.gfui.controls.customs; import gplx.GfoMsg;
|
||||
import gplx.Gfo_invk;
|
||||
import gplx.Gfo_invk_;
|
||||
import gplx.GfsCtx;
|
||||
import gplx.Hash_adp;
|
||||
import gplx.Hash_adp_;
|
||||
import gplx.List_adp;
|
||||
import gplx.List_adp_;
|
||||
import gplx.core.interfaces.InjectAble;
|
||||
import gplx.gfui.PointAdp;
|
||||
import gplx.gfui.PointAdp_;
|
||||
import gplx.gfui.controls.elems.GfuiElem;
|
||||
import gplx.gfui.ipts.IptArg;
|
||||
import gplx.gfui.ipts.IptBnd;
|
||||
import gplx.gfui.ipts.IptBnd_;
|
||||
import gplx.gfui.ipts.IptEventData;
|
||||
import gplx.gfui.ipts.IptEventType;
|
||||
import gplx.gfui.ipts.IptEventType_;
|
||||
import gplx.gfui.ipts.IptKey_;
|
||||
import gplx.gfui.ipts.IptMouseBtn_;
|
||||
import gplx.gfui.ipts.IptMouseMove;
|
||||
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();
|
||||
@@ -29,7 +47,7 @@ public class GfuiMoveElemBnd implements IptBnd, Gfo_invk, InjectAble {
|
||||
}
|
||||
public GfuiElem TargetElem() {return targetElem;} public void TargetElem_set(GfuiElem v) {this.targetElem = v;} GfuiElem targetElem;
|
||||
public static final String target_idk = "target";
|
||||
@gplx.Virtual public Object Invk(GfsCtx ctx, int ikey, String k, GfoMsg m) {
|
||||
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 Gfo_invk_.Rv_unhandled;
|
||||
@@ -66,10 +84,10 @@ public class GfuiMoveElemBnd implements IptBnd, Gfo_invk, InjectAble {
|
||||
public static GfuiMoveElemBnd new_() {return new GfuiMoveElemBnd();}
|
||||
GfuiMoveElemBnd() {
|
||||
args.Add_many(IptMouseBtn_.Left, IptMouseMove.AnyDirection);
|
||||
IptBndArgsBldr.AddWithData(args, hash, IptKey_.Ctrl.Add(IptKey_.Up), PointAdp_.new_(0, -10));
|
||||
IptBndArgsBldr.AddWithData(args, hash, IptKey_.Ctrl.Add(IptKey_.Down), PointAdp_.new_(0, 10));
|
||||
IptBndArgsBldr.AddWithData(args, hash, IptKey_.Ctrl.Add(IptKey_.Left), PointAdp_.new_(-10, 0));
|
||||
IptBndArgsBldr.AddWithData(args, hash, IptKey_.Ctrl.Add(IptKey_.Right), PointAdp_.new_(10, 0));
|
||||
IptBndArgsBldr.AddWithData(args, hash, IptKey_.MOD_1ST.Add(IptKey_.Up), PointAdp_.new_(0, -10));
|
||||
IptBndArgsBldr.AddWithData(args, hash, IptKey_.MOD_1ST.Add(IptKey_.Down), PointAdp_.new_(0, 10));
|
||||
IptBndArgsBldr.AddWithData(args, hash, IptKey_.MOD_1ST.Add(IptKey_.Left), PointAdp_.new_(-10, 0));
|
||||
IptBndArgsBldr.AddWithData(args, hash, IptKey_.MOD_1ST.Add(IptKey_.Right), PointAdp_.new_(10, 0));
|
||||
}
|
||||
}
|
||||
class IptBndArgsBldr {
|
||||
|
||||
@@ -1,20 +1,43 @@
|
||||
/*
|
||||
XOWA: the XOWA Offline Wiki Application
|
||||
Copyright (C) 2012-2017 gnosygnu@gmail.com
|
||||
|
||||
XOWA is licensed under the terms of the General Public License (GPL) Version 3,
|
||||
or alternatively under the terms of the Apache License Version 2.0.
|
||||
|
||||
You may use XOWA according to either of these licenses as is most appropriate
|
||||
for your project on a case-by-case basis.
|
||||
|
||||
The terms of each license can be found in the source code repository:
|
||||
|
||||
GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt
|
||||
Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt
|
||||
*/
|
||||
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.*;
|
||||
/*
|
||||
XOWA: the XOWA Offline Wiki Application
|
||||
Copyright (C) 2012-2017 gnosygnu@gmail.com
|
||||
|
||||
XOWA is licensed under the terms of the General Public License (GPL) Version 3,
|
||||
or alternatively under the terms of the Apache License Version 2.0.
|
||||
|
||||
You may use XOWA according to either of these licenses as is most appropriate
|
||||
for your project on a case-by-case basis.
|
||||
|
||||
The terms of each license can be found in the source code repository:
|
||||
|
||||
GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt
|
||||
Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt
|
||||
*/
|
||||
package gplx.gfui.controls.customs; import gplx.GfoMsg;
|
||||
import gplx.Hash_adp;
|
||||
import gplx.Hash_adp_;
|
||||
import gplx.Keyval_hash;
|
||||
import gplx.List_adp;
|
||||
import gplx.List_adp_;
|
||||
import gplx.gfui.PointAdp;
|
||||
import gplx.gfui.PointAdp_;
|
||||
import gplx.gfui.SizeAdp;
|
||||
import gplx.gfui.SizeAdp_;
|
||||
import gplx.gfui.controls.elems.GfuiElem;
|
||||
import gplx.gfui.controls.elems.GfuiElem_;
|
||||
import gplx.gfui.controls.gxws.GxwElem;
|
||||
import gplx.gfui.controls.gxws.GxwElemFactory_;
|
||||
import gplx.gfui.controls.standards.GfuiBtn;
|
||||
import gplx.gfui.controls.windows.GfuiWin;
|
||||
import gplx.gfui.ipts.IptBnd;
|
||||
import gplx.gfui.ipts.IptBnd_;
|
||||
import gplx.gfui.ipts.IptEventData;
|
||||
import gplx.gfui.ipts.IptEventType;
|
||||
import gplx.gfui.ipts.IptEventType_;
|
||||
import gplx.gfui.ipts.IptKey_;
|
||||
import gplx.gfui.ipts.IptMouseBtn_;
|
||||
import gplx.gfui.ipts.IptMouseMove;
|
||||
import gplx.gfui.layouts.GftGrid;
|
||||
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);
|
||||
@@ -78,9 +101,9 @@ class GfuiResizeFormBnd implements IptBnd {
|
||||
public static GfuiResizeFormBnd new_() {return new GfuiResizeFormBnd();}
|
||||
GfuiResizeFormBnd() {
|
||||
args.Add_many(IptMouseBtn_.Right, IptMouseMove.AnyDirection);
|
||||
IptBndArgsBldr.AddWithData(args, hash, IptKey_.Ctrl.Add(IptKey_.Shift).Add(IptKey_.Up), SizeAdp_.new_(0, -10));
|
||||
IptBndArgsBldr.AddWithData(args, hash, IptKey_.Ctrl.Add(IptKey_.Shift).Add(IptKey_.Down), SizeAdp_.new_(0, 10));
|
||||
IptBndArgsBldr.AddWithData(args, hash, IptKey_.Ctrl.Add(IptKey_.Shift).Add(IptKey_.Left), SizeAdp_.new_(-10, 0));
|
||||
IptBndArgsBldr.AddWithData(args, hash, IptKey_.Ctrl.Add(IptKey_.Shift).Add(IptKey_.Right), SizeAdp_.new_(10, 0));
|
||||
IptBndArgsBldr.AddWithData(args, hash, IptKey_.MOD_1ST.Add(IptKey_.Shift).Add(IptKey_.Up), SizeAdp_.new_(0, -10));
|
||||
IptBndArgsBldr.AddWithData(args, hash, IptKey_.MOD_1ST.Add(IptKey_.Shift).Add(IptKey_.Down), SizeAdp_.new_(0, 10));
|
||||
IptBndArgsBldr.AddWithData(args, hash, IptKey_.MOD_1ST.Add(IptKey_.Shift).Add(IptKey_.Left), SizeAdp_.new_(-10, 0));
|
||||
IptBndArgsBldr.AddWithData(args, hash, IptKey_.MOD_1ST.Add(IptKey_.Shift).Add(IptKey_.Right), SizeAdp_.new_(10, 0));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,20 +1,29 @@
|
||||
/*
|
||||
XOWA: the XOWA Offline Wiki Application
|
||||
Copyright (C) 2012-2017 gnosygnu@gmail.com
|
||||
|
||||
XOWA is licensed under the terms of the General Public License (GPL) Version 3,
|
||||
or alternatively under the terms of the Apache License Version 2.0.
|
||||
|
||||
You may use XOWA according to either of these licenses as is most appropriate
|
||||
for your project on a case-by-case basis.
|
||||
|
||||
The terms of each license can be found in the source code repository:
|
||||
|
||||
GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt
|
||||
Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt
|
||||
*/
|
||||
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.*;
|
||||
/*
|
||||
XOWA: the XOWA Offline Wiki Application
|
||||
Copyright (C) 2012-2017 gnosygnu@gmail.com
|
||||
|
||||
XOWA is licensed under the terms of the General Public License (GPL) Version 3,
|
||||
or alternatively under the terms of the Apache License Version 2.0.
|
||||
|
||||
You may use XOWA according to either of these licenses as is most appropriate
|
||||
for your project on a case-by-case basis.
|
||||
|
||||
The terms of each license can be found in the source code repository:
|
||||
|
||||
GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt
|
||||
Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt
|
||||
*/
|
||||
package gplx.gfui.controls.customs; import gplx.Tfds;
|
||||
import gplx.gfui.controls.standards.GfuiBtn;
|
||||
import gplx.gfui.controls.standards.GfuiBtn_;
|
||||
import gplx.gfui.controls.windows.GfuiWin;
|
||||
import gplx.gfui.controls.windows.GfuiWin_;
|
||||
import gplx.gfui.ipts.IptEventMgr;
|
||||
import gplx.gfui.ipts.IptEvtDataKey;
|
||||
import gplx.gfui.ipts.IptKey;
|
||||
import gplx.gfui.ipts.IptKey_;
|
||||
import org.junit.Before;
|
||||
import org.junit.Test;
|
||||
public class GfuiMoveElemBtn_tst {
|
||||
@Before public void setup() {
|
||||
form = GfuiWin_.app_("form"); form.Size_(100, 100);
|
||||
@@ -22,12 +31,12 @@ public class GfuiMoveElemBtn_tst {
|
||||
GfuiMoveElemBnd bnd = GfuiMoveElemBnd.new_(); bnd.TargetElem_set(form);
|
||||
moveBtn.IptBnds().Add(bnd);
|
||||
}
|
||||
@Test public void Basic() {
|
||||
@Test public void Basic() {
|
||||
Tfds.Eq(form.X(), 0);
|
||||
IptEventMgr.ExecKeyDown(moveBtn, IptEvtDataKey.test_(MoveRightArg()));
|
||||
Tfds.Eq(form.X(), 10);
|
||||
}
|
||||
|
||||
IptKey MoveRightArg() {return IptKey_.Ctrl.Add(IptKey_.Right);}
|
||||
IptKey MoveRightArg() {return IptKey_.MOD_1ST.Add(IptKey_.Right);}
|
||||
GfuiWin form; GfuiBtn moveBtn;
|
||||
}
|
||||
|
||||
@@ -13,16 +13,20 @@ The terms of each license can be found in the source code repository:
|
||||
GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt
|
||||
Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt
|
||||
*/
|
||||
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) {
|
||||
GfuiWin form = GfuiWin_.as_(owner); if (form == null) throw Err_.new_type_mismatch(GfuiWin.class, owner);
|
||||
statusBar.Owner_(form, "statusBar");
|
||||
IptBnd_.cmd_to_(IptCfg_.Null, form, statusBar, GfuiStatusBar.StatusBarFocus_cmd, IptKey_.add_(IptKey_.Ctrl, IptKey_.Alt, IptKey_.T));
|
||||
statusBar.MoveButton().TargetElem_set(form);
|
||||
}
|
||||
public static GfuiStatusBarBnd new_() {return new GfuiStatusBarBnd();} GfuiStatusBarBnd() {}
|
||||
}
|
||||
package gplx.gfui.controls.customs; import gplx.Err_;
|
||||
import gplx.core.interfaces.InjectAble;
|
||||
import gplx.gfui.controls.windows.GfuiWin;
|
||||
import gplx.gfui.controls.windows.GfuiWin_;
|
||||
import gplx.gfui.ipts.IptBnd_;
|
||||
import gplx.gfui.ipts.IptCfg_;
|
||||
import gplx.gfui.ipts.IptKey_;
|
||||
public class GfuiStatusBarBnd implements InjectAble {
|
||||
public GfuiStatusBar Bar() {return statusBar;} GfuiStatusBar statusBar = GfuiStatusBar.new_();
|
||||
public void Inject(Object owner) {
|
||||
GfuiWin form = GfuiWin_.as_(owner); if (form == null) throw Err_.new_type_mismatch(GfuiWin.class, owner);
|
||||
statusBar.Owner_(form, "statusBar");
|
||||
IptBnd_.cmd_to_(IptCfg_.Null, form, statusBar, GfuiStatusBar.StatusBarFocus_cmd, IptKey_.add_(IptKey_.MOD_1ST, IptKey_.MOD_2ND, IptKey_.T));
|
||||
statusBar.MoveButton().TargetElem_set(form);
|
||||
}
|
||||
public static GfuiStatusBarBnd new_() {return new GfuiStatusBarBnd();} GfuiStatusBarBnd() {}
|
||||
}
|
||||
|
||||
@@ -1,20 +1,33 @@
|
||||
/*
|
||||
XOWA: the XOWA Offline Wiki Application
|
||||
Copyright (C) 2012-2017 gnosygnu@gmail.com
|
||||
|
||||
XOWA is licensed under the terms of the General Public License (GPL) Version 3,
|
||||
or alternatively under the terms of the Apache License Version 2.0.
|
||||
|
||||
You may use XOWA according to either of these licenses as is most appropriate
|
||||
for your project on a case-by-case basis.
|
||||
|
||||
The terms of each license can be found in the source code repository:
|
||||
|
||||
GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt
|
||||
Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt
|
||||
*/
|
||||
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.*;
|
||||
/*
|
||||
XOWA: the XOWA Offline Wiki Application
|
||||
Copyright (C) 2012-2017 gnosygnu@gmail.com
|
||||
|
||||
XOWA is licensed under the terms of the General Public License (GPL) Version 3,
|
||||
or alternatively under the terms of the Apache License Version 2.0.
|
||||
|
||||
You may use XOWA according to either of these licenses as is most appropriate
|
||||
for your project on a case-by-case basis.
|
||||
|
||||
The terms of each license can be found in the source code repository:
|
||||
|
||||
GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt
|
||||
Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt
|
||||
*/
|
||||
package gplx.gfui.controls.customs; import gplx.Datetime_now;
|
||||
import gplx.GfoMsg;
|
||||
import gplx.Gfo_invk;
|
||||
import gplx.Gfo_invk_;
|
||||
import gplx.GfsCtx;
|
||||
import gplx.UsrMsg;
|
||||
import gplx.UsrMsgWkr_;
|
||||
import gplx.gfui.DirInt;
|
||||
import gplx.gfui.controls.windows.GfuiWin;
|
||||
import gplx.gfui.draws.ColorAdp_;
|
||||
import gplx.gfui.ipts.IptBnd_;
|
||||
import gplx.gfui.ipts.IptCfg_;
|
||||
import gplx.gfui.ipts.IptKey_;
|
||||
import gplx.gfui.layouts.GftBand;
|
||||
import gplx.gfui.layouts.GftGrid;
|
||||
public class GfuiStatusBoxBnd implements Gfo_invk {
|
||||
public GfuiStatusBox Box() {return statusBox;} GfuiStatusBox statusBox = GfuiStatusBox_.new_("statusBox");
|
||||
void ShowTime() {
|
||||
@@ -31,7 +44,7 @@ public class GfuiStatusBoxBnd implements Gfo_invk {
|
||||
return rv;
|
||||
}
|
||||
void ctor_GfuiStatusBoxBnd(GfuiWin win) {
|
||||
IptBnd_.cmd_to_(IptCfg_.Null, win, this, GfuiStatusBoxBnd.Invk_ShowTime, IptKey_.add_(IptKey_.Ctrl, IptKey_.Shift, IptKey_.T));
|
||||
IptBnd_.cmd_to_(IptCfg_.Null, win, this, GfuiStatusBoxBnd.Invk_ShowTime, IptKey_.add_(IptKey_.MOD_1ST, IptKey_.Shift, IptKey_.T));
|
||||
statusBox.Owner_(win).Visible_off_().BackColor_(ColorAdp_.Black).TextAlignH_right_().ForeColor_(ColorAdp_.Green);
|
||||
win.Lyt().SubLyts().Add(GftGrid.new_().Bands_dir_(DirInt.Bwd).Bands_add(GftBand.new_().Cells_num_(1).Len1_abs_(13)));
|
||||
}
|
||||
|
||||
@@ -1,23 +1,73 @@
|
||||
/*
|
||||
XOWA: the XOWA Offline Wiki Application
|
||||
Copyright (C) 2012-2017 gnosygnu@gmail.com
|
||||
|
||||
XOWA is licensed under the terms of the General Public License (GPL) Version 3,
|
||||
or alternatively under the terms of the Apache License Version 2.0.
|
||||
|
||||
You may use XOWA according to either of these licenses as is most appropriate
|
||||
for your project on a case-by-case basis.
|
||||
|
||||
The terms of each license can be found in the source code repository:
|
||||
|
||||
GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt
|
||||
Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt
|
||||
*/
|
||||
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.layouts.swts.*;
|
||||
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.*;
|
||||
/*
|
||||
XOWA: the XOWA Offline Wiki Application
|
||||
Copyright (C) 2012-2017 gnosygnu@gmail.com
|
||||
|
||||
XOWA is licensed under the terms of the General Public License (GPL) Version 3,
|
||||
or alternatively under the terms of the Apache License Version 2.0.
|
||||
|
||||
You may use XOWA according to either of these licenses as is most appropriate
|
||||
for your project on a case-by-case basis.
|
||||
|
||||
The terms of each license can be found in the source code repository:
|
||||
|
||||
GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt
|
||||
Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt
|
||||
*/
|
||||
package gplx.gfui.controls.elems; import gplx.Bool_;
|
||||
import gplx.Err_;
|
||||
import gplx.GfoMsg;
|
||||
import gplx.Gfo_evt_mgr;
|
||||
import gplx.Gfo_evt_mgr_;
|
||||
import gplx.Gfo_invk_;
|
||||
import gplx.Gfo_invk_cmd;
|
||||
import gplx.Gfo_invk_cmd_mgr;
|
||||
import gplx.GfsCtx;
|
||||
import gplx.Hash_adp;
|
||||
import gplx.Hash_adp_;
|
||||
import gplx.Keyval_hash;
|
||||
import gplx.Object_;
|
||||
import gplx.Ordered_hash;
|
||||
import gplx.Ordered_hash_;
|
||||
import gplx.String_;
|
||||
import gplx.core.interfaces.InjectAble;
|
||||
import gplx.gfui.GfuiAlign;
|
||||
import gplx.gfui.GfuiAlign_;
|
||||
import gplx.gfui.PointAdp;
|
||||
import gplx.gfui.PointAdp_;
|
||||
import gplx.gfui.RectAdp;
|
||||
import gplx.gfui.RectAdp_;
|
||||
import gplx.gfui.SizeAdp;
|
||||
import gplx.gfui.SizeAdp_;
|
||||
import gplx.gfui.controls.GfuiBorderMgr;
|
||||
import gplx.gfui.controls.gxws.GxwCore_base;
|
||||
import gplx.gfui.controls.gxws.GxwElem;
|
||||
import gplx.gfui.controls.gxws.GxwElemFactory_;
|
||||
import gplx.gfui.controls.windows.GfuiFocusMgr;
|
||||
import gplx.gfui.controls.windows.GfuiFocusOrderer;
|
||||
import gplx.gfui.controls.windows.GfuiWin;
|
||||
import gplx.gfui.controls.windows.GfuiWinKeyCmdMgr;
|
||||
import gplx.gfui.draws.ColorAdp;
|
||||
import gplx.gfui.draws.ColorAdp_;
|
||||
import gplx.gfui.draws.FontStyleAdp;
|
||||
import gplx.gfui.draws.FontStyleAdp_;
|
||||
import gplx.gfui.draws.PenAdp_;
|
||||
import gplx.gfui.gfxs.GfxStringData;
|
||||
import gplx.gfui.gfxs.PaintArgs;
|
||||
import gplx.gfui.ipts.IptBndMgr;
|
||||
import gplx.gfui.ipts.IptEventMgr;
|
||||
import gplx.gfui.ipts.IptEventType;
|
||||
import gplx.gfui.ipts.IptEvtDataKey;
|
||||
import gplx.gfui.ipts.IptEvtDataKeyHeld;
|
||||
import gplx.gfui.ipts.IptEvtDataMouse;
|
||||
import gplx.gfui.ipts.IptKey;
|
||||
import gplx.gfui.ipts.IptKey_;
|
||||
import gplx.gfui.kits.core.Gfui_kit;
|
||||
import gplx.gfui.kits.core.Gfui_kit_;
|
||||
import gplx.gfui.kits.core.Swing_kit;
|
||||
import gplx.gfui.layouts.GftGrid;
|
||||
import gplx.gfui.layouts.GftItem;
|
||||
import gplx.gfui.layouts.swts.Swt_layout_data;
|
||||
import gplx.gfui.layouts.swts.Swt_layout_mgr;
|
||||
public class GfuiElemBase implements GfuiElem {
|
||||
//% Layout
|
||||
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;
|
||||
@@ -55,7 +105,7 @@ public class GfuiElemBase implements GfuiElem {
|
||||
SizeChanged_ignore = false;
|
||||
}
|
||||
public void Zorder_front() {underMgr.Zorder_front();} public void Zorder_back() {underMgr.Zorder_back();}
|
||||
@gplx.Virtual public void Zorder_front_and_focus() {
|
||||
public void Zorder_front_and_focus() {
|
||||
this.Zorder_front();
|
||||
this.Visible_set(true);
|
||||
this.Focus();
|
||||
@@ -66,28 +116,28 @@ public class GfuiElemBase implements GfuiElem {
|
||||
public void Layout_data_(Swt_layout_data v) {underElem.Core().Layout_data_(v);}
|
||||
|
||||
//% Visual
|
||||
@gplx.Virtual public boolean Visible() {return underMgr.Visible();} @gplx.Virtual public void Visible_set(boolean v) {underMgr.Visible_set(v);}
|
||||
public boolean Visible() {return underMgr.Visible();} public void Visible_set(boolean v) {underMgr.Visible_set(v);}
|
||||
public GfuiElem Visible_on_() {this.Visible_set(true); return this;} public GfuiElem Visible_off_() {this.Visible_set(false); return this;}
|
||||
@gplx.Virtual public ColorAdp BackColor() {return backColor;} ColorAdp backColor = ColorAdp_.White;
|
||||
@gplx.Virtual public GfuiElem BackColor_(ColorAdp v) {backColor = v; underMgr.BackColor_set(backColor); return this;}
|
||||
public ColorAdp BackColor() {return backColor;} ColorAdp backColor = ColorAdp_.White;
|
||||
public GfuiElem BackColor_(ColorAdp v) {backColor = v; underMgr.BackColor_set(backColor); return this;}
|
||||
public GfuiBorderMgr Border() {return border;} GfuiBorderMgr border = GfuiBorderMgr.new_();
|
||||
public GfuiElem Border_on_() {border.All_(PenAdp_.new_(ColorAdp_.Black, 1)); return this;}
|
||||
public GfuiElem Border_off_() {border.All_(null); return this;}
|
||||
public GfxStringData TextMgr() {return textMgr;} GfxStringData textMgr;
|
||||
public String Text() {return textMgr.Val();}
|
||||
public GfuiElem Text_any_(Object obj) {return Text_(Object_.Xto_str_strict_or_null_mark(obj));}
|
||||
@gplx.Virtual public GfuiElem Text_(String v) {
|
||||
public GfuiElem Text_(String v) {
|
||||
this.TextMgr().Text_set(v);
|
||||
Click_key_set_(v);
|
||||
return this;
|
||||
}
|
||||
@gplx.Virtual public GfuiElem ForeColor_(ColorAdp v) {textMgr.Color_(v); return this;}
|
||||
public GfuiElem ForeColor_(ColorAdp v) {textMgr.Color_(v); return this;}
|
||||
public void TextAlignH_(GfuiAlign v) {textMgr.AlignH_(v);}
|
||||
public GfuiElem TextAlignH_left_() {textMgr.AlignH_(GfuiAlign_.Left); return this;}
|
||||
public GfuiElem TextAlignH_right_() {textMgr.AlignH_(GfuiAlign_.Right); return this;}
|
||||
public GfuiElem TextAlignH_center_() {textMgr.AlignH_(GfuiAlign_.Mid); return this;}
|
||||
public String TipText() {return underElem.Core().TipText();} public GfuiElem TipText_(String v) {underElem.Core().TipText_set(v); return this;}
|
||||
@gplx.Virtual public void Redraw() {underMgr.Invalidate();}
|
||||
public void Redraw() {underMgr.Invalidate();}
|
||||
public boolean CustomDraw() {return customDraw;} public void CustomDraw_set(boolean v) {customDraw = v;} private boolean customDraw;
|
||||
|
||||
|
||||
@@ -101,7 +151,7 @@ public class GfuiElemBase implements GfuiElem {
|
||||
focusKey_order_manual = val;
|
||||
return this;
|
||||
}
|
||||
@gplx.Virtual public void Focus() {
|
||||
public void Focus() {
|
||||
if (subElems.Count() == 0) // if no subs, focus self
|
||||
underElem.Core().Focus();
|
||||
else if (defaultFocusKey != null) { // if default is specified, focus it
|
||||
@@ -124,10 +174,10 @@ public class GfuiElemBase implements GfuiElem {
|
||||
public IptBndMgr IptBnds() {return iptBnds;} IptBndMgr iptBnds = IptBndMgr.new_();
|
||||
|
||||
//% ActionKey
|
||||
@gplx.Virtual public void Click() {}
|
||||
@gplx.Virtual public boolean Click_able() {return false;}
|
||||
public void Click() {}
|
||||
public boolean Click_able() {return false;}
|
||||
public IptKey Click_key() {return clickKey;}
|
||||
@gplx.Internal @gplx.Virtual protected void Click_key_set_(String v) {clickKey = GfuiWinKeyCmdMgr.ExtractKeyFromText(v);} IptKey clickKey = IptKey_.None;
|
||||
@gplx.Internal protected void Click_key_set_(String v) {clickKey = GfuiWinKeyCmdMgr.ExtractKeyFromText(v);} IptKey clickKey = IptKey_.None;
|
||||
|
||||
//% Owner
|
||||
public String Key_of_GfuiElem() {return keyIdf;} public GfuiElem Key_of_GfuiElem_(String val) {keyIdf = val; return this;} private String keyIdf;
|
||||
@@ -140,9 +190,9 @@ public class GfuiElemBase implements GfuiElem {
|
||||
}
|
||||
|
||||
//% Form
|
||||
@gplx.Virtual public GfuiWin OwnerWin() {return ownerForm;} public GfuiElem OwnerWin_(GfuiWin val) {ownerForm = val; return this;} GfuiWin ownerForm = null;
|
||||
@gplx.Virtual public boolean Opened_done() {return ownerForm == null ? false : ownerForm.Opened_done();}
|
||||
@gplx.Virtual public void Opened_cbk() {
|
||||
public GfuiWin OwnerWin() {return ownerForm;} public GfuiElem OwnerWin_(GfuiWin val) {ownerForm = val; return this;} GfuiWin ownerForm = null;
|
||||
public boolean Opened_done() {return ownerForm == null ? false : ownerForm.Opened_done();}
|
||||
public void Opened_cbk() {
|
||||
for (int i = 0; i < subElems.Count(); i++) {
|
||||
GfuiElem elem = subElems.Get_at(i);
|
||||
elem.Opened_cbk();
|
||||
@@ -154,23 +204,23 @@ public class GfuiElemBase implements GfuiElem {
|
||||
}
|
||||
|
||||
//% Cbks
|
||||
@gplx.Virtual public boolean KeyDownCbk(IptEvtDataKey data) {IptEventMgr.ExecKeyDown(this, data); return true;}
|
||||
@gplx.Virtual public boolean KeyUpCbk(IptEvtDataKey data) {IptEventMgr.ExecKeyUp(this, data); return true;}
|
||||
@gplx.Virtual public boolean KeyHeldCbk(IptEvtDataKeyHeld data) {IptEventMgr.ExecKeyPress(this, data); return true;}
|
||||
@gplx.Virtual public boolean MouseDownCbk(IptEvtDataMouse data) {IptEventMgr.ExecMouseDown(this, data); return true;}
|
||||
@gplx.Virtual public boolean MouseUpCbk(IptEvtDataMouse data) {IptEventMgr.ExecMouseUp(this, data); return true;}
|
||||
@gplx.Virtual public boolean MouseMoveCbk(IptEvtDataMouse data) {IptEventMgr.ExecMouseMove(this, data); return true;}
|
||||
@gplx.Virtual public boolean MouseWheelCbk(IptEvtDataMouse data) {IptEventMgr.ExecMouseWheel(this, data); return true;}
|
||||
@gplx.Virtual public boolean PaintCbk(PaintArgs args) {border.DrawData(args.Graphics()); return true;}
|
||||
@gplx.Virtual public boolean PaintBackgroundCbk(PaintArgs args) {return true;}
|
||||
@gplx.Virtual public boolean DisposeCbk() {return true;}
|
||||
@gplx.Virtual public boolean VisibleChangedCbk() {return true;}
|
||||
@gplx.Virtual public boolean FocusGotCbk() {
|
||||
public boolean KeyDownCbk(IptEvtDataKey data) {IptEventMgr.ExecKeyDown(this, data); return true;}
|
||||
public boolean KeyUpCbk(IptEvtDataKey data) {IptEventMgr.ExecKeyUp(this, data); return true;}
|
||||
public boolean KeyHeldCbk(IptEvtDataKeyHeld data) {IptEventMgr.ExecKeyPress(this, data); return true;}
|
||||
public boolean MouseDownCbk(IptEvtDataMouse data) {IptEventMgr.ExecMouseDown(this, data); return true;}
|
||||
public boolean MouseUpCbk(IptEvtDataMouse data) {IptEventMgr.ExecMouseUp(this, data); return true;}
|
||||
public boolean MouseMoveCbk(IptEvtDataMouse data) {IptEventMgr.ExecMouseMove(this, data); return true;}
|
||||
public boolean MouseWheelCbk(IptEvtDataMouse data) {IptEventMgr.ExecMouseWheel(this, data); return true;}
|
||||
public boolean PaintCbk(PaintArgs args) {border.DrawData(args.Graphics()); return true;}
|
||||
public boolean PaintBackgroundCbk(PaintArgs args) {return true;}
|
||||
public boolean DisposeCbk() {return true;}
|
||||
public boolean VisibleChangedCbk() {return true;}
|
||||
public boolean FocusGotCbk() {
|
||||
GfuiFocusMgr.Instance.FocusedElem_set(this);
|
||||
return true;
|
||||
}
|
||||
@gplx.Virtual public boolean FocusLostCbk() {return true;}
|
||||
@gplx.Virtual public boolean SizeChangedCbk() {
|
||||
public boolean FocusLostCbk() {return true;}
|
||||
public boolean SizeChangedCbk() {
|
||||
this.TextMgr().OwnerSize_sync(this.Size());
|
||||
this.Border().Bounds_sync(RectAdp_.size_(this.Size().Op_subtract(1)));
|
||||
if (SizeChanged_ignore
|
||||
@@ -186,8 +236,8 @@ public class GfuiElemBase implements GfuiElem {
|
||||
//% InjectAble
|
||||
public GfuiElem Inject_(InjectAble sub) {sub.Inject(this); return this;}
|
||||
|
||||
@gplx.Virtual public GxwElem UnderElem() {return underElem;} GxwElem underElem;
|
||||
@gplx.Virtual public Object Invk(GfsCtx ctx, int ikey, String k, GfoMsg m) {
|
||||
public GxwElem UnderElem() {return underElem;} GxwElem underElem;
|
||||
public Object Invk(GfsCtx ctx, int ikey, String k, GfoMsg m) {
|
||||
if (ctx.Match(k, GfuiElemKeys.Redraw_cmd)) Redraw();
|
||||
else if (ctx.Match(k, GfuiElemKeys.Key_set)) {
|
||||
String v = m.ReadStr("v");
|
||||
@@ -241,15 +291,15 @@ public class GfuiElemBase implements GfuiElem {
|
||||
else if (ctx.Match(k, GfuiElemKeys.Zorder_front_cmd)) Zorder_front();
|
||||
else if (ctx.Match(k, Invk_OwnerWin_cmd)) return OwnerWin();
|
||||
else {
|
||||
if (ctx.Help_browseMode()) {
|
||||
String_bldr sb = String_bldr_.new_();
|
||||
for (int i = 0; i < this.SubElems().Count(); i++) {
|
||||
GfuiElem subE = (GfuiElem)this.SubElems().Get_at(i);
|
||||
sb.Add_str_w_crlf(subE.Key_of_GfuiElem());
|
||||
}
|
||||
return sb.To_str();
|
||||
}
|
||||
else {
|
||||
// if (ctx.Help_browseMode()) {
|
||||
// String_bldr sb = String_bldr_.new_();
|
||||
// for (int i = 0; i < this.SubElems().Count(); i++) {
|
||||
// GfuiElem subE = (GfuiElem)this.SubElems().Get_at(i);
|
||||
// sb.Add_str_w_crlf(subE.Key_of_GfuiElem());
|
||||
// }
|
||||
// return sb.To_str();
|
||||
// }
|
||||
// else {
|
||||
Object rv = this.InvkMgr().Invk(ctx, ikey, k, m, this);
|
||||
if (rv != Gfo_invk_.Rv_unhandled) return rv;
|
||||
|
||||
@@ -257,7 +307,7 @@ public class GfuiElemBase implements GfuiElem {
|
||||
if (findObj == null) findObj = this.subElems.Get_by(k);
|
||||
if (findObj == null) return Gfo_invk_.Rv_unhandled;
|
||||
return findObj; // necessary for gplx.images
|
||||
}
|
||||
// }
|
||||
}
|
||||
return this;
|
||||
} public static final String Invk_OwnerWin_cmd = "ownerWin";
|
||||
@@ -267,7 +317,7 @@ public class GfuiElemBase implements GfuiElem {
|
||||
}
|
||||
public Gfui_kit Kit() {return kit;} private Gfui_kit kit = Gfui_kit_.Mem();
|
||||
|
||||
@gplx.Virtual public void ctor_GfuiBox_base(Keyval_hash ctorArgs) {
|
||||
public void ctor_GfuiBox_base(Keyval_hash ctorArgs) {
|
||||
this.kit = Swing_kit.Instance; // NOTE: assume that callers want Swing; SWT / Mem should be calling ctor_kit_GfuiElemBase
|
||||
underElem = UnderElem_make(ctorArgs);
|
||||
underElem.Host_set(this);
|
||||
@@ -277,7 +327,7 @@ public class GfuiElemBase implements GfuiElem {
|
||||
this.Focus_able_(Bool_.Cast(ctorArgs.Get_val_or(GfuiElem_.InitKey_focusAble, true)));
|
||||
underMgr.Size_set(SizeAdp_.new_(20, 20)); // NOTE: CS inits to 20,20; JAVA inits to 0,0
|
||||
}
|
||||
@gplx.Virtual public void ctor_kit_GfuiElemBase(Gfui_kit kit, String key, GxwElem underElem, Keyval_hash ctorArgs) {
|
||||
public void ctor_kit_GfuiElemBase(Gfui_kit kit, String key, GxwElem underElem, Keyval_hash ctorArgs) {
|
||||
this.kit = kit;
|
||||
this.keyIdf = key;
|
||||
this.underElem = underElem;
|
||||
@@ -288,7 +338,7 @@ public class GfuiElemBase implements GfuiElem {
|
||||
this.Focus_able_(Bool_.Cast(ctorArgs.Get_val_or(GfuiElem_.InitKey_focusAble, true)));
|
||||
// underMgr.Size_set(SizeAdp_.new_(20, 20)); // NOTE: CS inits to 20,20; JAVA inits to 0,0
|
||||
}
|
||||
@gplx.Virtual public GxwElem UnderElem_make(Keyval_hash ctorArgs) {return GxwElemFactory_.Instance.control_();}
|
||||
public GxwElem UnderElem_make(Keyval_hash ctorArgs) {return GxwElemFactory_.Instance.control_();}
|
||||
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();
|
||||
|
||||
@@ -1,25 +1,32 @@
|
||||
/*
|
||||
XOWA: the XOWA Offline Wiki Application
|
||||
Copyright (C) 2012-2017 gnosygnu@gmail.com
|
||||
|
||||
XOWA is licensed under the terms of the General Public License (GPL) Version 3,
|
||||
or alternatively under the terms of the Apache License Version 2.0.
|
||||
|
||||
You may use XOWA according to either of these licenses as is most appropriate
|
||||
for your project on a case-by-case basis.
|
||||
|
||||
The terms of each license can be found in the source code repository:
|
||||
|
||||
GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt
|
||||
Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt
|
||||
*/
|
||||
package gplx.gfui.controls.gxws; import gplx.*; import gplx.gfui.*; import gplx.gfui.controls.*;
|
||||
import java.awt.KeyboardFocusManager;
|
||||
/*
|
||||
XOWA: the XOWA Offline Wiki Application
|
||||
Copyright (C) 2012-2017 gnosygnu@gmail.com
|
||||
|
||||
XOWA is licensed under the terms of the General Public License (GPL) Version 3,
|
||||
or alternatively under the terms of the Apache License Version 2.0.
|
||||
|
||||
You may use XOWA according to either of these licenses as is most appropriate
|
||||
for your project on a case-by-case basis.
|
||||
|
||||
The terms of each license can be found in the source code repository:
|
||||
|
||||
GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt
|
||||
Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt
|
||||
*/
|
||||
package gplx.gfui.controls.gxws;
|
||||
import gplx.gfui.gfxs.PaintArgs;
|
||||
import gplx.gfui.ipts.IptEvtDataKey;
|
||||
import gplx.gfui.ipts.IptEvtDataKeyHeld;
|
||||
import gplx.gfui.ipts.IptEvtDataMouse;
|
||||
import gplx.gfui.ipts.IptKey_;
|
||||
import gplx.gfui.ipts.IptMouseBtn_;
|
||||
import gplx.gfui.ipts.IptMouseWheel;
|
||||
import gplx.gfui.ipts.IptMouseWheel_;
|
||||
|
||||
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 class GxwCbkHost_ {
|
||||
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();
|
||||
@@ -34,10 +41,10 @@ public class GxwCbkHost_ {
|
||||
}
|
||||
else {
|
||||
if (e.isShiftDown()) val |= IptKey_.Shift.Val();
|
||||
if (e.isControlDown()) val |= IptKey_.Ctrl.Val();
|
||||
if (e.isControlDown()) val |= IptKey_.Ctrl.Val();
|
||||
if (e.isAltDown()) val |= IptKey_.Alt.Val();
|
||||
if (e.isMetaDown()) val |= IptKey_.Meta.Val();
|
||||
IptEvtDataKey keyData = IptEvtDataKey.int_(val);
|
||||
// Tfds.Write(e.getKeyChar(), e.getKeyCode(), val, id);
|
||||
if (id == KeyEvent.KEY_PRESSED) rv = host.KeyDownCbk(keyData);
|
||||
else if (id == KeyEvent.KEY_RELEASED) rv = host.KeyUpCbk(keyData);
|
||||
if (keyData.Handled()) rv = false; // was false
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
/*
|
||||
XOWA: the XOWA Offline Wiki Application
|
||||
Copyright (C) 2012-2017 gnosygnu@gmail.com
|
||||
|
||||
XOWA is licensed under the terms of the General Public License (GPL) Version 3,
|
||||
or alternatively under the terms of the Apache License Version 2.0.
|
||||
|
||||
You may use XOWA according to either of these licenses as is most appropriate
|
||||
for your project on a case-by-case basis.
|
||||
|
||||
The terms of each license can be found in the source code repository:
|
||||
|
||||
GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt
|
||||
Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt
|
||||
*/
|
||||
/*
|
||||
XOWA: the XOWA Offline Wiki Application
|
||||
Copyright (C) 2012-2017 gnosygnu@gmail.com
|
||||
|
||||
XOWA is licensed under the terms of the General Public License (GPL) Version 3,
|
||||
or alternatively under the terms of the Apache License Version 2.0.
|
||||
|
||||
You may use XOWA according to either of these licenses as is most appropriate
|
||||
for your project on a case-by-case basis.
|
||||
|
||||
The terms of each license can be found in the source code repository:
|
||||
|
||||
GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt
|
||||
Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt
|
||||
*/
|
||||
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 {
|
||||
|
||||
@@ -1,31 +1,35 @@
|
||||
/*
|
||||
XOWA: the XOWA Offline Wiki Application
|
||||
Copyright (C) 2012-2017 gnosygnu@gmail.com
|
||||
|
||||
XOWA is licensed under the terms of the General Public License (GPL) Version 3,
|
||||
or alternatively under the terms of the Apache License Version 2.0.
|
||||
|
||||
You may use XOWA according to either of these licenses as is most appropriate
|
||||
for your project on a case-by-case basis.
|
||||
|
||||
The terms of each license can be found in the source code repository:
|
||||
|
||||
GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt
|
||||
Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt
|
||||
*/
|
||||
package gplx.gfui.controls.gxws; import gplx.*; import gplx.gfui.*; import gplx.gfui.controls.*;
|
||||
/*
|
||||
XOWA: the XOWA Offline Wiki Application
|
||||
Copyright (C) 2012-2017 gnosygnu@gmail.com
|
||||
|
||||
XOWA is licensed under the terms of the General Public License (GPL) Version 3,
|
||||
or alternatively under the terms of the Apache License Version 2.0.
|
||||
|
||||
You may use XOWA according to either of these licenses as is most appropriate
|
||||
for your project on a case-by-case basis.
|
||||
|
||||
The terms of each license can be found in the source code repository:
|
||||
|
||||
GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt
|
||||
Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt
|
||||
*/
|
||||
package gplx.gfui.controls.gxws; import gplx.GfoMsg;
|
||||
import gplx.GfsCtx;
|
||||
import gplx.gfui.RectAdp;
|
||||
import gplx.gfui.gfxs.GfxAdpBase;
|
||||
import gplx.gfui.gfxs.PaintArgs;
|
||||
import gplx.gfui.ipts.IptEvtDataMouse;
|
||||
import gplx.gfui.ipts.IptKey;
|
||||
import gplx.gfui.ipts.IptMouseBtn;
|
||||
import gplx.gfui.ipts.IptMouseBtn_;
|
||||
import gplx.gfui.ipts.IptMouseWheel_;
|
||||
import javax.swing.JComponent;
|
||||
import java.awt.AWTEvent;
|
||||
import java.awt.Graphics;
|
||||
import java.awt.Graphics2D;
|
||||
import java.awt.event.ComponentEvent;
|
||||
import java.awt.event.ComponentListener;
|
||||
import java.awt.event.FocusEvent;
|
||||
import java.awt.event.FocusListener;
|
||||
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;
|
||||
@@ -58,8 +62,7 @@ public class GxwElem_lang extends JComponent implements GxwElem {
|
||||
public GxwCore_base Core() {return ctrlMgr;} GxwCore_base ctrlMgr;
|
||||
public void SendKeyDown(IptKey key) {}
|
||||
public void SendMouseMove(int x, int y) {}
|
||||
public void SendMouseDown(IptMouseBtn btn) {
|
||||
}
|
||||
public void SendMouseDown(IptMouseBtn btn) {}
|
||||
public void EnableDoubleBuffering() {} // eliminates flickering during OnPaint
|
||||
JComponent comp = null;
|
||||
public GxwElem_lang() {this.ctor_GxwElem();}
|
||||
|
||||
@@ -1,38 +1,43 @@
|
||||
/*
|
||||
XOWA: the XOWA Offline Wiki Application
|
||||
Copyright (C) 2012-2017 gnosygnu@gmail.com
|
||||
|
||||
XOWA is licensed under the terms of the General Public License (GPL) Version 3,
|
||||
or alternatively under the terms of the Apache License Version 2.0.
|
||||
|
||||
You may use XOWA according to either of these licenses as is most appropriate
|
||||
for your project on a case-by-case basis.
|
||||
|
||||
The terms of each license can be found in the source code repository:
|
||||
|
||||
GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt
|
||||
Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt
|
||||
*/
|
||||
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;
|
||||
import java.awt.Graphics2D;
|
||||
/*
|
||||
XOWA: the XOWA Offline Wiki Application
|
||||
Copyright (C) 2012-2017 gnosygnu@gmail.com
|
||||
|
||||
XOWA is licensed under the terms of the General Public License (GPL) Version 3,
|
||||
or alternatively under the terms of the Apache License Version 2.0.
|
||||
|
||||
You may use XOWA according to either of these licenses as is most appropriate
|
||||
for your project on a case-by-case basis.
|
||||
|
||||
The terms of each license can be found in the source code repository:
|
||||
|
||||
GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt
|
||||
Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt
|
||||
*/
|
||||
package gplx.gfui.controls.gxws; import gplx.Err_;
|
||||
import gplx.GfoMsg;
|
||||
import gplx.GfsCtx;
|
||||
import gplx.gfui.GfuiAlign;
|
||||
import gplx.gfui.GfuiAlign_;
|
||||
import gplx.gfui.RectAdp_;
|
||||
import gplx.gfui.controls.elems.GfuiElem;
|
||||
import gplx.gfui.draws.ColorAdp;
|
||||
import gplx.gfui.gfxs.GfxAdpBase;
|
||||
import gplx.gfui.gfxs.PaintArgs;
|
||||
import gplx.gfui.ipts.IptEvtDataMouse;
|
||||
import gplx.gfui.ipts.IptKey;
|
||||
import gplx.gfui.ipts.IptMouseBtn;
|
||||
import gplx.gfui.ipts.IptMouseBtn_;
|
||||
import gplx.gfui.ipts.IptMouseWheel;
|
||||
import gplx.gfui.ipts.IptMouseWheel_;
|
||||
|
||||
import javax.swing.*;
|
||||
import javax.swing.border.Border;
|
||||
import javax.swing.text.JTextComponent;
|
||||
import java.awt.*;
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.awt.event.FocusEvent;
|
||||
import java.awt.event.KeyEvent;
|
||||
import java.awt.event.MouseEvent;
|
||||
import java.awt.event.MouseWheelEvent;
|
||||
import javax.swing.AbstractAction;
|
||||
import javax.swing.BorderFactory;
|
||||
import javax.swing.JTextArea;
|
||||
import javax.swing.JTextField;
|
||||
import javax.swing.KeyStroke;
|
||||
import javax.swing.border.BevelBorder;
|
||||
import javax.swing.border.Border;
|
||||
import javax.swing.text.JTextComponent;
|
||||
import gplx.gfui.draws.*;
|
||||
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;
|
||||
@@ -86,7 +91,7 @@ public class GxwTextBox_lang extends JTextArea implements GxwTextFld {
|
||||
}
|
||||
public void EnableDoubleBuffering() {} // eliminates flickering during OnPaint
|
||||
public void CreateControlIfNeeded() {}
|
||||
@gplx.Virtual public void ctor_MsTextBox_() {
|
||||
public void ctor_MsTextBox_() {
|
||||
ctor_();
|
||||
}
|
||||
}
|
||||
@@ -108,7 +113,7 @@ class GxwTextFld_cls_lang extends JTextField implements GxwTextFld {
|
||||
} // NOTE: sometimes fails when skipping ahead in dvd player; v = 0, and start/end = 0
|
||||
}
|
||||
public int SelLen() {return this.getSelectionEnd() - this.getSelectionStart();} public void SelLen_set(int v) {this.setSelectionEnd(this.SelBgn() + v);}
|
||||
@gplx.Virtual public void ctor_MsTextBox_() {
|
||||
public void ctor_MsTextBox_() {
|
||||
ctor_();
|
||||
}
|
||||
//@#if !plat_wce
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
/*
|
||||
XOWA: the XOWA Offline Wiki Application
|
||||
Copyright (C) 2012-2017 gnosygnu@gmail.com
|
||||
|
||||
XOWA is licensed under the terms of the General Public License (GPL) Version 3,
|
||||
or alternatively under the terms of the Apache License Version 2.0.
|
||||
|
||||
You may use XOWA according to either of these licenses as is most appropriate
|
||||
for your project on a case-by-case basis.
|
||||
|
||||
The terms of each license can be found in the source code repository:
|
||||
|
||||
GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt
|
||||
Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt
|
||||
*/
|
||||
/*
|
||||
XOWA: the XOWA Offline Wiki Application
|
||||
Copyright (C) 2012-2017 gnosygnu@gmail.com
|
||||
|
||||
XOWA is licensed under the terms of the General Public License (GPL) Version 3,
|
||||
or alternatively under the terms of the Apache License Version 2.0.
|
||||
|
||||
You may use XOWA according to either of these licenses as is most appropriate
|
||||
for your project on a case-by-case basis.
|
||||
|
||||
The terms of each license can be found in the source code repository:
|
||||
|
||||
GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt
|
||||
Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt
|
||||
*/
|
||||
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.*;
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
/*
|
||||
XOWA: the XOWA Offline Wiki Application
|
||||
Copyright (C) 2012-2017 gnosygnu@gmail.com
|
||||
|
||||
XOWA is licensed under the terms of the General Public License (GPL) Version 3,
|
||||
or alternatively under the terms of the Apache License Version 2.0.
|
||||
|
||||
You may use XOWA according to either of these licenses as is most appropriate
|
||||
for your project on a case-by-case basis.
|
||||
|
||||
The terms of each license can be found in the source code repository:
|
||||
|
||||
GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt
|
||||
Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt
|
||||
*/
|
||||
/*
|
||||
XOWA: the XOWA Offline Wiki Application
|
||||
Copyright (C) 2012-2017 gnosygnu@gmail.com
|
||||
|
||||
XOWA is licensed under the terms of the General Public License (GPL) Version 3,
|
||||
or alternatively under the terms of the Apache License Version 2.0.
|
||||
|
||||
You may use XOWA according to either of these licenses as is most appropriate
|
||||
for your project on a case-by-case basis.
|
||||
|
||||
The terms of each license can be found in the source code repository:
|
||||
|
||||
GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt
|
||||
Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt
|
||||
*/
|
||||
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 {
|
||||
@@ -22,8 +22,8 @@ public class Gfui_html extends GfuiElemBase {
|
||||
public byte Html_doc_html_load_tid() {return under.Html_doc_html_load_tid();}
|
||||
public void Html_doc_html_load_tid_(byte v) {under.Html_doc_html_load_tid_(v);}
|
||||
public void Html_js_enabled_(boolean v) {under.Html_js_enabled_(v);}
|
||||
@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_proc_as_str(String name, Object... args) {return under.Html_js_eval_proc_as_str(name, args);}
|
||||
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);}
|
||||
|
||||
@@ -13,18 +13,18 @@ The terms of each license can be found in the source code repository:
|
||||
GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt
|
||||
Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt
|
||||
*/
|
||||
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();
|
||||
@Test public void Get_idx_after_closing() {
|
||||
fxt.Test_Get_idx_after_closing(0, 1, -1);
|
||||
fxt.Test_Get_idx_after_closing(4, 5, 3);
|
||||
fxt.Test_Get_idx_after_closing(3, 5, 4);
|
||||
}
|
||||
}
|
||||
class Gfui_tab_itm_data_fxt {
|
||||
public void Test_Get_idx_after_closing(int cur, int len, int expd) {
|
||||
Tfds.Eq(expd, Gfui_tab_itm_data.Get_idx_after_closing(cur, len));
|
||||
}
|
||||
}
|
||||
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();
|
||||
@Test public void Get_idx_after_closing() {
|
||||
fxt.Test_Get_idx_after_closing(0, 1, -1);
|
||||
fxt.Test_Get_idx_after_closing(4, 5, 3);
|
||||
fxt.Test_Get_idx_after_closing(3, 5, 4);
|
||||
}
|
||||
}
|
||||
class Gfui_tab_itm_data_fxt {
|
||||
public void Test_Get_idx_after_closing(int cur, int len, int expd) {
|
||||
Tfds.Eq(expd, Gfui_tab_itm_data.Get_idx_after_closing(cur, len));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,21 +1,29 @@
|
||||
/*
|
||||
XOWA: the XOWA Offline Wiki Application
|
||||
Copyright (C) 2012-2017 gnosygnu@gmail.com
|
||||
|
||||
XOWA is licensed under the terms of the General Public License (GPL) Version 3,
|
||||
or alternatively under the terms of the Apache License Version 2.0.
|
||||
|
||||
You may use XOWA according to either of these licenses as is most appropriate
|
||||
for your project on a case-by-case basis.
|
||||
|
||||
The terms of each license can be found in the source code repository:
|
||||
|
||||
GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt
|
||||
Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt
|
||||
*/
|
||||
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.*;
|
||||
/*
|
||||
XOWA: the XOWA Offline Wiki Application
|
||||
Copyright (C) 2012-2017 gnosygnu@gmail.com
|
||||
|
||||
XOWA is licensed under the terms of the General Public License (GPL) Version 3,
|
||||
or alternatively under the terms of the Apache License Version 2.0.
|
||||
|
||||
You may use XOWA according to either of these licenses as is most appropriate
|
||||
for your project on a case-by-case basis.
|
||||
|
||||
The terms of each license can be found in the source code repository:
|
||||
|
||||
GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt
|
||||
Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt
|
||||
*/
|
||||
package gplx.gfui.controls.tabs; import gplx.GfoMsg;
|
||||
import gplx.Gfo_evt_mgr_;
|
||||
import gplx.Gfo_invk;
|
||||
import gplx.Gfo_invk_;
|
||||
import gplx.GfsCtx;
|
||||
import gplx.core.interfaces.InjectAble;
|
||||
import gplx.gfui.controls.standards.GfuiBtn;
|
||||
import gplx.gfui.controls.standards.GfuiBtn_;
|
||||
import gplx.gfui.ipts.IptBnd_;
|
||||
import gplx.gfui.ipts.IptCfg_;
|
||||
import gplx.gfui.ipts.IptKey_;
|
||||
class TabBoxEvt_nameChange {
|
||||
public static String Key = "TabBoxEvt_nameChange";
|
||||
public static void Send(TabBoxMgr mgr, TabPnlItm itm) {
|
||||
@@ -40,8 +48,8 @@ class TabBoxEvt_tabSelectByBtn {
|
||||
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));
|
||||
IptBnd_.cmd_to_(IptCfg_.Null, tabBox, this, SelectPrev_cmd, IptKey_.add_(IptKey_.Ctrl, IptKey_.Tab, IptKey_.Shift), IptKey_.add_(IptKey_.Ctrl, IptKey_.PageUp));
|
||||
IptBnd_.cmd_to_(IptCfg_.Null, tabBox, this, SelectNext_cmd, IptKey_.add_(IptKey_.MOD_1ST, IptKey_.Tab), IptKey_.add_(IptKey_.MOD_1ST, IptKey_.PageDown));
|
||||
IptBnd_.cmd_to_(IptCfg_.Null, tabBox, this, SelectPrev_cmd, IptKey_.add_(IptKey_.MOD_1ST, IptKey_.Tab, IptKey_.Shift), IptKey_.add_(IptKey_.MOD_1ST, IptKey_.PageUp));
|
||||
}
|
||||
void Select(GfoMsg msg, int delta) {
|
||||
TabPnlItm curTab = tabBox.Mgr().CurTab();
|
||||
@@ -60,8 +68,8 @@ class TabBnd_selectTab implements InjectAble, Gfo_invk {
|
||||
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));
|
||||
IptBnd_.cmd_to_(IptCfg_.Null, btn, this, MoveNext_cmd, IptKey_.add_(IptKey_.Ctrl, IptKey_.Right));
|
||||
IptBnd_.cmd_to_(IptCfg_.Null, btn, this, MovePrev_cmd, IptKey_.add_(IptKey_.MOD_1ST, IptKey_.Left));
|
||||
IptBnd_.cmd_to_(IptCfg_.Null, btn, this, MoveNext_cmd, IptKey_.add_(IptKey_.MOD_1ST, IptKey_.Right));
|
||||
}
|
||||
@gplx.Internal protected void MoveTab(GfuiBtn curBtn, int delta) {
|
||||
TabPnlItm curItm = tabBox.Mgr().Get_by(curBtn.Key_of_GfuiElem());
|
||||
|
||||
@@ -1,29 +1,29 @@
|
||||
/*
|
||||
XOWA: the XOWA Offline Wiki Application
|
||||
Copyright (C) 2012-2017 gnosygnu@gmail.com
|
||||
|
||||
XOWA is licensed under the terms of the General Public License (GPL) Version 3,
|
||||
or alternatively under the terms of the Apache License Version 2.0.
|
||||
|
||||
You may use XOWA according to either of these licenses as is most appropriate
|
||||
for your project on a case-by-case basis.
|
||||
|
||||
The terms of each license can be found in the source code repository:
|
||||
|
||||
GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt
|
||||
Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt
|
||||
*/
|
||||
/*
|
||||
XOWA: the XOWA Offline Wiki Application
|
||||
Copyright (C) 2012-2017 gnosygnu@gmail.com
|
||||
|
||||
XOWA is licensed under the terms of the General Public License (GPL) Version 3,
|
||||
or alternatively under the terms of the Apache License Version 2.0.
|
||||
|
||||
You may use XOWA according to either of these licenses as is most appropriate
|
||||
for your project on a case-by-case basis.
|
||||
|
||||
The terms of each license can be found in the source code repository:
|
||||
|
||||
GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt
|
||||
Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt
|
||||
*/
|
||||
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_();
|
||||
// } TabBoxFxt fx;
|
||||
@Test public void Add() {
|
||||
@Test public void Add() {
|
||||
// fx.Make(1).tst_Selected("0").FetchBtnAt(0).tst_X(0);
|
||||
// fx.Make(3).tst_Selected("2").FetchBtnAt(2).tst_X(160);
|
||||
}
|
||||
// @Test public void Del_at() {
|
||||
// @Test public void Del_at() {
|
||||
// fx.Make(2).Del_at(1).tst_Btns("0");
|
||||
// fx.Make(2).Del_at(0).tst_Btns("1");
|
||||
// fx.Make(3).Del_at(0).tst_Btns("1", "2");
|
||||
@@ -34,17 +34,17 @@ public class TabBox_tst {
|
||||
// fx.Make(3).Select(1).Del_at(0).tst_Selected("1"); // 0 deleted; 1 still remains active (but will have idx of 0
|
||||
// fx.Make(3).Select(2).Del_at(2).tst_Selected("1"); // 2 deleted; 1 selected
|
||||
// }
|
||||
// @Test public void Selected_byAdd() {
|
||||
// @Test public void Selected_byAdd() {
|
||||
// fx.Make(2).Select(0).tst_Selected("0").Select(1).tst_Selected("1");
|
||||
// }
|
||||
// @Test public void Selected_byBtn() {
|
||||
// @Test public void Selected_byBtn() {
|
||||
// fx.Make(2).tst_Selected("1");
|
||||
//
|
||||
// GfuiBtn btn = fx.TabBox().SubBtnArea().Get_at(0);
|
||||
// btn.Click();
|
||||
// fx.tst_Selected("0");
|
||||
// }
|
||||
// @Test public void ReorderTab() {
|
||||
// @Test public void ReorderTab() {
|
||||
// fx.Make(3).Reorder(0, -1).tst_Raised(false);
|
||||
// fx.Make(3).Reorder(2, 1).tst_Raised(false);
|
||||
// fx.Make(3).Reorder(0, 1).tst_Btns("1", "0", "2").tst_Raised(true).tst_FocusOrder();
|
||||
|
||||
@@ -1,22 +1,52 @@
|
||||
/*
|
||||
XOWA: the XOWA Offline Wiki Application
|
||||
Copyright (C) 2012-2017 gnosygnu@gmail.com
|
||||
|
||||
XOWA is licensed under the terms of the General Public License (GPL) Version 3,
|
||||
or alternatively under the terms of the Apache License Version 2.0.
|
||||
|
||||
You may use XOWA according to either of these licenses as is most appropriate
|
||||
for your project on a case-by-case basis.
|
||||
|
||||
The terms of each license can be found in the source code repository:
|
||||
|
||||
GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt
|
||||
Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt
|
||||
*/
|
||||
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.*;
|
||||
/*
|
||||
XOWA: the XOWA Offline Wiki Application
|
||||
Copyright (C) 2012-2017 gnosygnu@gmail.com
|
||||
|
||||
XOWA is licensed under the terms of the General Public License (GPL) Version 3,
|
||||
or alternatively under the terms of the Apache License Version 2.0.
|
||||
|
||||
You may use XOWA according to either of these licenses as is most appropriate
|
||||
for your project on a case-by-case basis.
|
||||
|
||||
The terms of each license can be found in the source code repository:
|
||||
|
||||
GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt
|
||||
Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt
|
||||
*/
|
||||
package gplx.gfui.controls.windows; import gplx.Err_;
|
||||
import gplx.GfoMsg;
|
||||
import gplx.GfoMsg_;
|
||||
import gplx.Gfo_invk;
|
||||
import gplx.Gfo_invk_;
|
||||
import gplx.Gfo_invk_cmd;
|
||||
import gplx.GfsCtx;
|
||||
import gplx.Io_mgr;
|
||||
import gplx.Io_url;
|
||||
import gplx.Io_url_;
|
||||
import gplx.Object_;
|
||||
import gplx.String_;
|
||||
import gplx.UsrDlg_;
|
||||
import gplx.UsrMsg;
|
||||
import gplx.UsrMsgWkr;
|
||||
import gplx.UsrMsgWkr_;
|
||||
import gplx.core.envs.System_;
|
||||
import gplx.gfml.GfmlDataNde;
|
||||
import gplx.gfui.PointAdp;
|
||||
import gplx.gfui.PointAdp_;
|
||||
import gplx.gfui.controls.customs.GfuiIoDialogUtl;
|
||||
import gplx.gfui.controls.customs.GfuiStatusBarBnd;
|
||||
import gplx.gfui.controls.elems.GfuiElem;
|
||||
import gplx.gfui.controls.standards.GfuiTextBox;
|
||||
import gplx.gfui.controls.standards.GfuiTextBox_;
|
||||
import gplx.gfui.draws.FontAdp;
|
||||
import gplx.gfui.draws.FontStyleAdp_;
|
||||
import gplx.gfui.envs.ScreenAdp_;
|
||||
import gplx.gfui.envs.TimerAdp;
|
||||
import gplx.gfui.ipts.IptBnd_;
|
||||
import gplx.gfui.ipts.IptCfg_;
|
||||
import gplx.gfui.ipts.IptKey_;
|
||||
import gplx.gfui.layouts.GftBand;
|
||||
import gplx.langs.gfs.GfsCore;
|
||||
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;
|
||||
@@ -40,11 +70,11 @@ public class GfoConsoleWin implements Gfo_invk, UsrMsgWkr {
|
||||
cmds = new GfoConsoleWinCmds(this);
|
||||
cmds.Owner_set(win); cmds.Init();
|
||||
IptBnd_.cmd_to_(IptCfg_.Null, win, cmds, GfoConsoleWinCmds.Invk_Hide, IptKey_.Escape);
|
||||
IptBnd_.cmd_to_(IptCfg_.Null, consoleBox, cmds, GfoConsoleWinCmds.Invk_Exec, IptKey_.add_(IptKey_.Ctrl, IptKey_.E));
|
||||
IptBnd_.cmd_to_(IptCfg_.Null, consoleBox, cmds, GfoConsoleWinCmds.Invk_Save, IptKey_.add_(IptKey_.Ctrl, IptKey_.S));
|
||||
IptBnd_.cmd_to_(IptCfg_.Null, consoleBox, cmds, GfoConsoleWinCmds.Invk_Load, IptKey_.add_(IptKey_.Ctrl, IptKey_.L));
|
||||
IptBnd_.cmd_to_(IptCfg_.Null, consoleBox, cmds, GfoConsoleWinCmds.Invk_Help, IptKey_.add_(IptKey_.Ctrl, IptKey_.D));
|
||||
IptBnd_.cmd_to_(IptCfg_.Null, consoleBox, cmds, GfoConsoleWinCmds.Invk_Clear, IptKey_.add_(IptKey_.Ctrl, IptKey_.Alt, IptKey_.C));
|
||||
IptBnd_.cmd_to_(IptCfg_.Null, consoleBox, cmds, GfoConsoleWinCmds.Invk_Exec, IptKey_.add_(IptKey_.MOD_1ST, IptKey_.E));
|
||||
IptBnd_.cmd_to_(IptCfg_.Null, consoleBox, cmds, GfoConsoleWinCmds.Invk_Save, IptKey_.add_(IptKey_.MOD_1ST, IptKey_.S));
|
||||
IptBnd_.cmd_to_(IptCfg_.Null, consoleBox, cmds, GfoConsoleWinCmds.Invk_Load, IptKey_.add_(IptKey_.MOD_1ST, IptKey_.L));
|
||||
IptBnd_.cmd_to_(IptCfg_.Null, consoleBox, cmds, GfoConsoleWinCmds.Invk_Help, IptKey_.add_(IptKey_.MOD_1ST, IptKey_.D));
|
||||
IptBnd_.cmd_to_(IptCfg_.Null, consoleBox, cmds, GfoConsoleWinCmds.Invk_Clear, IptKey_.add_(IptKey_.MOD_1ST, IptKey_.MOD_2ND, IptKey_.C));
|
||||
logger = new GfuiTextBoxLogger(this).Init(statusBox);
|
||||
// gplx.core.ios.GfioApp.InitGfs();
|
||||
UsrDlg_.Instance.Reg(UsrMsgWkr_.Type_Note, this);
|
||||
|
||||
@@ -1,21 +1,28 @@
|
||||
/*
|
||||
XOWA: the XOWA Offline Wiki Application
|
||||
Copyright (C) 2012-2017 gnosygnu@gmail.com
|
||||
|
||||
XOWA is licensed under the terms of the General Public License (GPL) Version 3,
|
||||
or alternatively under the terms of the Apache License Version 2.0.
|
||||
|
||||
You may use XOWA according to either of these licenses as is most appropriate
|
||||
for your project on a case-by-case basis.
|
||||
|
||||
The terms of each license can be found in the source code repository:
|
||||
|
||||
GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt
|
||||
Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt
|
||||
*/
|
||||
package gplx.gfui.controls.windows; import gplx.*; import gplx.gfui.*; import gplx.gfui.controls.*;
|
||||
import gplx.core.interfaces.*;
|
||||
import gplx.gfui.ipts.*; import gplx.gfui.controls.elems.*;
|
||||
/*
|
||||
XOWA: the XOWA Offline Wiki Application
|
||||
Copyright (C) 2012-2017 gnosygnu@gmail.com
|
||||
|
||||
XOWA is licensed under the terms of the General Public License (GPL) Version 3,
|
||||
or alternatively under the terms of the Apache License Version 2.0.
|
||||
|
||||
You may use XOWA according to either of these licenses as is most appropriate
|
||||
for your project on a case-by-case basis.
|
||||
|
||||
The terms of each license can be found in the source code repository:
|
||||
|
||||
GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt
|
||||
Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt
|
||||
*/
|
||||
package gplx.gfui.controls.windows; import gplx.GfoMsg;
|
||||
import gplx.Gfo_invk;
|
||||
import gplx.Gfo_invk_;
|
||||
import gplx.GfsCtx;
|
||||
import gplx.core.interfaces.InjectAble;
|
||||
import gplx.gfui.controls.elems.GfuiElem;
|
||||
import gplx.gfui.ipts.IptBnd_;
|
||||
import gplx.gfui.ipts.IptCfg_;
|
||||
import gplx.gfui.ipts.IptKey_;
|
||||
import gplx.gfui.ipts.IptMouseBtn_;
|
||||
public class GfuiCmdForm implements Gfo_invk, InjectAble {
|
||||
public void Inject(Object ownerObj) {
|
||||
GfuiElem owner = (GfuiElem)ownerObj;
|
||||
@@ -33,7 +40,7 @@ public class GfuiCmdForm implements Gfo_invk, InjectAble {
|
||||
GfuiCmdForm cmd = new GfuiCmdForm(); cmd.cmdForm = rv;
|
||||
|
||||
IptBnd_.cmd_to_(IptCfg_.Null, rv, cmd, HideMe_cmd, IptKey_.Escape);
|
||||
IptBnd_.cmd_to_(IptCfg_.Null, hostElem, cmd, DoStuff, IptKey_.add_(IptKey_.Ctrl, IptKey_.Space), IptMouseBtn_.Right);
|
||||
IptBnd_.cmd_to_(IptCfg_.Null, hostElem, cmd, DoStuff, IptKey_.add_(IptKey_.MOD_1ST, IptKey_.Space), IptMouseBtn_.Right);
|
||||
return rv;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
/*
|
||||
XOWA: the XOWA Offline Wiki Application
|
||||
Copyright (C) 2012-2017 gnosygnu@gmail.com
|
||||
|
||||
XOWA is licensed under the terms of the General Public License (GPL) Version 3,
|
||||
or alternatively under the terms of the Apache License Version 2.0.
|
||||
|
||||
You may use XOWA according to either of these licenses as is most appropriate
|
||||
for your project on a case-by-case basis.
|
||||
|
||||
The terms of each license can be found in the source code repository:
|
||||
|
||||
GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt
|
||||
Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt
|
||||
*/
|
||||
/*
|
||||
XOWA: the XOWA Offline Wiki Application
|
||||
Copyright (C) 2012-2017 gnosygnu@gmail.com
|
||||
|
||||
XOWA is licensed under the terms of the General Public License (GPL) Version 3,
|
||||
or alternatively under the terms of the Apache License Version 2.0.
|
||||
|
||||
You may use XOWA according to either of these licenses as is most appropriate
|
||||
for your project on a case-by-case basis.
|
||||
|
||||
The terms of each license can be found in the source code repository:
|
||||
|
||||
GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt
|
||||
Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt
|
||||
*/
|
||||
package gplx.gfui.controls.windows; import gplx.*; import gplx.gfui.*; import gplx.gfui.controls.*;
|
||||
import org.junit.*; import gplx.gfui.controls.elems.*;
|
||||
public class GfuiFocusOrderer_tst {
|
||||
@@ -20,28 +20,28 @@ public class GfuiFocusOrderer_tst {
|
||||
owner = GfuiElem_.new_();
|
||||
list = List_adp_.New(); // list of all controls
|
||||
}
|
||||
@Test public void Horizontal() {
|
||||
@Test public void Horizontal() {
|
||||
ini_Subs(owner, list, xy_(40, 0), xy_(20, 0), xy_(0, 0));
|
||||
tst_FocusIndxs(owner, list, 0, 1, 2);
|
||||
|
||||
GfuiFocusOrderer.OrderByX(owner);
|
||||
tst_FocusIndxs(owner, list, 2, 1, 0);
|
||||
}
|
||||
@Test public void Vertical() {
|
||||
@Test public void Vertical() {
|
||||
ini_Subs(owner, list, xy_(0, 40), xy_(0, 20), xy_(0, 0));
|
||||
tst_FocusIndxs(owner, list, 0, 1, 2);
|
||||
|
||||
GfuiFocusOrderer.OrderByY(owner);
|
||||
tst_FocusIndxs(owner, list, 2, 1, 0);
|
||||
}
|
||||
@Test public void Grid() {
|
||||
@Test public void Grid() {
|
||||
ini_Subs(owner, list, xy_(20, 20), xy_(0, 20), xy_(20, 0), xy_(0, 0));
|
||||
tst_FocusIndxs(owner, list, 0, 1, 2, 3);
|
||||
|
||||
GfuiFocusOrderer.OrderByX(owner);
|
||||
tst_FocusIndxs(owner, list, 3, 2, 1, 0);
|
||||
}
|
||||
@Test public void Deep() {
|
||||
@Test public void Deep() {
|
||||
ini_Subs(owner, list, xy_(20, 0), xy_(0, 0));
|
||||
GfuiElem sub0 = sub_(owner, 0), sub1 = sub_(owner, 1);
|
||||
ini_Subs(sub0, list, xy_(20, 0), xy_(0, 0));
|
||||
@@ -51,7 +51,7 @@ public class GfuiFocusOrderer_tst {
|
||||
GfuiFocusOrderer.OrderByX(owner);
|
||||
tst_FocusIndxs(owner, list, 3, 0, 5, 4, 2, 1);
|
||||
}
|
||||
@Test public void Manusl() {
|
||||
@Test public void Manusl() {
|
||||
ini_Subs(owner, list, xy_(0, 0), xy_(20, 0));
|
||||
tst_FocusIndxs(owner, list, 0, 1);
|
||||
|
||||
|
||||
@@ -1,20 +1,32 @@
|
||||
/*
|
||||
XOWA: the XOWA Offline Wiki Application
|
||||
Copyright (C) 2012-2017 gnosygnu@gmail.com
|
||||
|
||||
XOWA is licensed under the terms of the General Public License (GPL) Version 3,
|
||||
or alternatively under the terms of the Apache License Version 2.0.
|
||||
|
||||
You may use XOWA according to either of these licenses as is most appropriate
|
||||
for your project on a case-by-case basis.
|
||||
|
||||
The terms of each license can be found in the source code repository:
|
||||
|
||||
GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt
|
||||
Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt
|
||||
*/
|
||||
package gplx.gfui.controls.windows; import gplx.*; import gplx.gfui.*; import gplx.gfui.controls.*;
|
||||
import gplx.gfui.ipts.*; import gplx.gfui.controls.elems.*;
|
||||
/*
|
||||
XOWA: the XOWA Offline Wiki Application
|
||||
Copyright (C) 2012-2017 gnosygnu@gmail.com
|
||||
|
||||
XOWA is licensed under the terms of the General Public License (GPL) Version 3,
|
||||
or alternatively under the terms of the Apache License Version 2.0.
|
||||
|
||||
You may use XOWA according to either of these licenses as is most appropriate
|
||||
for your project on a case-by-case basis.
|
||||
|
||||
The terms of each license can be found in the source code repository:
|
||||
|
||||
GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt
|
||||
Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt
|
||||
*/
|
||||
package gplx.gfui.controls.windows; import gplx.GfoMsg;
|
||||
import gplx.Gfo_invk;
|
||||
import gplx.Gfo_invk_;
|
||||
import gplx.GfsCtx;
|
||||
import gplx.gfui.PointAdp;
|
||||
import gplx.gfui.RectAdp;
|
||||
import gplx.gfui.RectAdp_;
|
||||
import gplx.gfui.SizeAdp;
|
||||
import gplx.gfui.controls.elems.GfuiElem;
|
||||
import gplx.gfui.ipts.IptBnd_;
|
||||
import gplx.gfui.ipts.IptCfg_;
|
||||
import gplx.gfui.ipts.IptEventType_;
|
||||
import gplx.gfui.ipts.IptKey_;
|
||||
import gplx.gfui.ipts.IptMouseBtn_;
|
||||
public class GfuiForm_menu implements Gfo_invk {
|
||||
public GfuiWin Form() {return form;} GfuiWin form;
|
||||
void Visible_toggle(GfoMsg msg) {
|
||||
@@ -45,7 +57,7 @@ public class GfuiForm_menu implements Gfo_invk {
|
||||
// form.CmdsA().Del(GfuiWin.Invk_Minimize);
|
||||
// form.CmdsA().Del(GfuiStatusBoxBnd.Invk_ShowTime);
|
||||
IptBnd_.cmd_to_(IptCfg_.Null, form, this, Visible_hide_cmd, IptKey_.Escape);
|
||||
IptBnd_.cmd_to_(IptCfg_.Null, owner, this, Visible_toggle_cmd, IptKey_.add_(IptKey_.Ctrl, IptKey_.Space), IptMouseBtn_.Right);
|
||||
IptBnd_.cmd_to_(IptCfg_.Null, owner, this, Visible_toggle_cmd, IptKey_.add_(IptKey_.MOD_1ST, IptKey_.Space), IptMouseBtn_.Right);
|
||||
|
||||
form.TaskbarParkingWindowFix(owner.OwnerWin()); // else ContextMenu shows up as WindowsFormsParkingWindow
|
||||
form.QuitMode_(GfuiQuitMode.Suspend);
|
||||
|
||||
@@ -1,34 +1,44 @@
|
||||
/*
|
||||
XOWA: the XOWA Offline Wiki Application
|
||||
Copyright (C) 2012-2017 gnosygnu@gmail.com
|
||||
|
||||
XOWA is licensed under the terms of the General Public License (GPL) Version 3,
|
||||
or alternatively under the terms of the Apache License Version 2.0.
|
||||
|
||||
You may use XOWA according to either of these licenses as is most appropriate
|
||||
for your project on a case-by-case basis.
|
||||
|
||||
The terms of each license can be found in the source code repository:
|
||||
|
||||
GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt
|
||||
Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt
|
||||
*/
|
||||
package gplx.gfui.controls.windows; import gplx.*; import gplx.gfui.*; import gplx.gfui.controls.*;
|
||||
import java.awt.Color;
|
||||
import java.awt.Font;
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.awt.event.ActionListener;
|
||||
import javax.swing.AbstractButton;
|
||||
import javax.swing.BorderFactory;
|
||||
import javax.swing.JComponent;
|
||||
import javax.swing.JFrame;
|
||||
import javax.swing.JMenu;
|
||||
import javax.swing.JMenuBar;
|
||||
import javax.swing.JMenuItem;
|
||||
import javax.swing.JSeparator;
|
||||
import javax.swing.border.EmptyBorder;
|
||||
import gplx.gfui.draws.*; import gplx.gfui.ipts.*; import gplx.gfui.layouts.*; import gplx.gfui.kits.core.*; import gplx.gfui.controls.gxws.*;
|
||||
import gplx.langs.gfs.*;
|
||||
/*
|
||||
XOWA: the XOWA Offline Wiki Application
|
||||
Copyright (C) 2012-2017 gnosygnu@gmail.com
|
||||
|
||||
XOWA is licensed under the terms of the General Public License (GPL) Version 3,
|
||||
or alternatively under the terms of the Apache License Version 2.0.
|
||||
|
||||
You may use XOWA according to either of these licenses as is most appropriate
|
||||
for your project on a case-by-case basis.
|
||||
|
||||
The terms of each license can be found in the source code repository:
|
||||
|
||||
GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt
|
||||
Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt
|
||||
*/
|
||||
package gplx.gfui.controls.windows; import gplx.Char_;
|
||||
import gplx.Err_;
|
||||
import gplx.GfoMsg;
|
||||
import gplx.GfoMsgUtl;
|
||||
import gplx.Gfo_invk;
|
||||
import gplx.Gfo_invk_;
|
||||
import gplx.GfsCtx;
|
||||
import gplx.Hash_adp;
|
||||
import gplx.Hash_adp_;
|
||||
import gplx.Int_;
|
||||
import gplx.String_;
|
||||
import gplx.gfui.controls.gxws.GxwWin;
|
||||
import gplx.gfui.draws.ColorAdp;
|
||||
import gplx.gfui.draws.ColorAdpCache;
|
||||
import gplx.gfui.draws.ColorAdp_;
|
||||
import gplx.gfui.draws.FontStyleAdp;
|
||||
import gplx.gfui.ipts.IptBnd_;
|
||||
import gplx.gfui.ipts.IptKey;
|
||||
import gplx.gfui.ipts.IptKey_;
|
||||
import gplx.gfui.kits.core.GfuiEnv_;
|
||||
import gplx.gfui.layouts.GftBand;
|
||||
import gplx.gfui.layouts.GftGrid;
|
||||
import gplx.langs.gfs.GfsCore;
|
||||
|
||||
import javax.swing.*;
|
||||
import java.awt.*;
|
||||
public class GfuiMenuBar implements Gfo_invk {
|
||||
public Object Under() {return winMenu;}
|
||||
public boolean Visible() {return visible;} private boolean visible;
|
||||
@@ -130,7 +140,7 @@ public class GfuiMenuBar implements Gfo_invk {
|
||||
root = GfuiMenuBarItm.root_(winMenu);
|
||||
itms.Add(root.Key(), root);
|
||||
this.win = win;
|
||||
IptBnd_.cmd_to_(GfuiEnv_.IptBndMgr_win, win, this, Invk_visible_toggle, IptKey_.add_(IptKey_.Ctrl, IptKey_.Shift, IptKey_.F12));
|
||||
IptBnd_.cmd_to_(GfuiEnv_.IptBndMgr_win, win, this, Invk_visible_toggle, IptKey_.add_(IptKey_.MOD_1ST, IptKey_.Shift, IptKey_.F12));
|
||||
win.SubItms_add(SubItms_key, this);
|
||||
}
|
||||
Hash_adp itms = Hash_adp_.New(); GfuiWin win;
|
||||
|
||||
@@ -1,23 +1,51 @@
|
||||
/*
|
||||
XOWA: the XOWA Offline Wiki Application
|
||||
Copyright (C) 2012-2017 gnosygnu@gmail.com
|
||||
|
||||
XOWA is licensed under the terms of the General Public License (GPL) Version 3,
|
||||
or alternatively under the terms of the Apache License Version 2.0.
|
||||
|
||||
You may use XOWA according to either of these licenses as is most appropriate
|
||||
for your project on a case-by-case basis.
|
||||
|
||||
The terms of each license can be found in the source code repository:
|
||||
|
||||
GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt
|
||||
Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt
|
||||
*/
|
||||
package gplx.gfui.controls.windows; import gplx.*; import gplx.gfui.*; import gplx.gfui.controls.*;
|
||||
import java.awt.Window;
|
||||
import gplx.gfui.ipts.*; import gplx.gfui.layouts.*; import gplx.gfui.kits.core.*; import gplx.gfui.controls.gxws.*; import gplx.gfui.controls.elems.*; import gplx.gfui.controls.customs.*;
|
||||
import gplx.core.envs.*; import gplx.gfui.imgs.*;
|
||||
public class GfuiWin extends GfuiElemBase {
|
||||
/*
|
||||
XOWA: the XOWA Offline Wiki Application
|
||||
Copyright (C) 2012-2017 gnosygnu@gmail.com
|
||||
|
||||
XOWA is licensed under the terms of the General Public License (GPL) Version 3,
|
||||
or alternatively under the terms of the Apache License Version 2.0.
|
||||
|
||||
You may use XOWA according to either of these licenses as is most appropriate
|
||||
for your project on a case-by-case basis.
|
||||
|
||||
The terms of each license can be found in the source code repository:
|
||||
|
||||
GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt
|
||||
Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt
|
||||
*/
|
||||
package gplx.gfui.controls.windows; import gplx.Datetime_now;
|
||||
import gplx.GfoMsg;
|
||||
import gplx.Gfo_evt_mgr_;
|
||||
import gplx.Gfo_invk_cmd;
|
||||
import gplx.Gfo_invk_cmd_mgr;
|
||||
import gplx.GfsCtx;
|
||||
import gplx.Keyval_hash;
|
||||
import gplx.List_adp;
|
||||
import gplx.List_adp_;
|
||||
import gplx.String_;
|
||||
import gplx.UsrDlg_;
|
||||
import gplx.UsrMsg;
|
||||
import gplx.core.envs.Env_;
|
||||
import gplx.gfui.SizeAdp;
|
||||
import gplx.gfui.SizeAdp_;
|
||||
import gplx.gfui.controls.customs.GfuiStatusBoxBnd;
|
||||
import gplx.gfui.controls.elems.GfuiElemBase;
|
||||
import gplx.gfui.controls.elems.GfuiElemKeys;
|
||||
import gplx.gfui.controls.gxws.GxwElem;
|
||||
import gplx.gfui.controls.gxws.GxwElemFactory_;
|
||||
import gplx.gfui.controls.gxws.GxwWin;
|
||||
import gplx.gfui.imgs.IconAdp;
|
||||
import gplx.gfui.ipts.IptBnd_;
|
||||
import gplx.gfui.ipts.IptCfg_;
|
||||
import gplx.gfui.ipts.IptEventData;
|
||||
import gplx.gfui.ipts.IptKey_;
|
||||
import gplx.gfui.kits.core.GfuiEnv_;
|
||||
import gplx.gfui.kits.core.Gfui_kit;
|
||||
import gplx.gfui.kits.core.Gfui_kit_;
|
||||
import gplx.gfui.layouts.GftGrid;
|
||||
|
||||
import java.awt.*;
|
||||
public class GfuiWin extends GfuiElemBase {
|
||||
private GxwWin win; private List_adp loadList = List_adp_.New();
|
||||
public void Show() {win.ShowWin();}
|
||||
public void Hide() {win.HideWin();}
|
||||
@@ -25,7 +53,7 @@ public class GfuiWin extends GfuiElemBase {
|
||||
public IconAdp Icon() {return win.IconWin();} public GfuiWin Icon_(IconAdp icon) {win.IconWin_set(icon); return this;}
|
||||
public boolean Pin() {return win.Pin();} public GfuiWin Pin_(boolean v) {win.Pin_set(v); return this;}
|
||||
public GfuiWin Pin_() {return Pin_(true);} public void Pin_toggle() {Pin_(!Pin());}
|
||||
@gplx.Virtual public void Quit() {GfuiQuitMode.Exec(this, quitMode);}
|
||||
public void Quit() {GfuiQuitMode.Exec(this, quitMode);}
|
||||
public boolean Maximized() {return win.Maximized();} public void Maximized_(boolean v) {win.Maximized_(v);}
|
||||
public boolean Minimized() {return win.Minimized();} public void Minimized_(boolean v) {win.Minimized_(v);}
|
||||
public GfuiQuitMode QuitMode() {return quitMode;} public GfuiWin QuitMode_(GfuiQuitMode val) {quitMode = val; return this;} private GfuiQuitMode quitMode = GfuiQuitMode.ExitApp; // easier to debug
|
||||
@@ -44,9 +72,9 @@ public class GfuiWin extends GfuiElemBase {
|
||||
win = (GxwWin)underElem;
|
||||
win.OpenedCmd_set(Gfo_invk_cmd.New_by_key(this, Evt_Opened));
|
||||
Gfo_evt_mgr_.Sub(this, GfuiElemKeys.IptRcvd_evt, keyCmdMgr, GfuiWinKeyCmdMgr.CheckForHotKey_cmd);
|
||||
IptBnd_.cmd_(IptCfg_.Null, this, StopAppByAltF4_evt, IptKey_.Alt.Add(IptKey_.F4));
|
||||
// IptBnd_.cmd_to_(IptCfg_.Null, this, GfoConsoleWin.Instance, GfoConsoleWin.Invk_Show, IptKey_.Ctrl.Add(IptKey_.Alt).Add(IptKey_.E));
|
||||
IptBnd_.cmd_(IptCfg_.Null, this, Invk_ShowFocusOwner, IptKey_.add_(IptKey_.Ctrl, IptKey_.Alt, IptKey_.F12));
|
||||
IptBnd_.cmd_(IptCfg_.Null, this, StopAppByAltF4_evt, IptKey_.MOD_2ND.Add(IptKey_.F4));
|
||||
// IptBnd_.cmd_to_(IptCfg_.Null, this, GfoConsoleWin.Instance, GfoConsoleWin.Invk_Show, IptKey_.MOD_1ST.Add(IptKey_.MOD_2ND).Add(IptKey_.E));
|
||||
IptBnd_.cmd_(IptCfg_.Null, this, Invk_ShowFocusOwner, IptKey_.add_(IptKey_.MOD_1ST, IptKey_.MOD_2ND, IptKey_.F12));
|
||||
loadList.Add(keyCmdMgr); loadList.Add(GfuiTipTextMgr.Instance);
|
||||
focusMgr = GfuiWinFocusMgr.new_(this);
|
||||
}
|
||||
@@ -55,9 +83,9 @@ public class GfuiWin extends GfuiElemBase {
|
||||
win = (GxwWin)this.UnderElem();
|
||||
win.OpenedCmd_set(Gfo_invk_cmd.New_by_key(this, Evt_Opened));
|
||||
Gfo_evt_mgr_.Sub(this, GfuiElemKeys.IptRcvd_evt, keyCmdMgr, GfuiWinKeyCmdMgr.CheckForHotKey_cmd);
|
||||
IptBnd_.cmd_(IptCfg_.Null, this, StopAppByAltF4_evt, IptKey_.Alt.Add(IptKey_.F4));
|
||||
IptBnd_.cmd_to_(IptCfg_.Null, this, GfoConsoleWin.Instance, GfoConsoleWin.Invk_Show, IptKey_.Ctrl.Add(IptKey_.Alt).Add(IptKey_.E));
|
||||
IptBnd_.cmd_(IptCfg_.Null, this, Invk_ShowFocusOwner, IptKey_.add_(IptKey_.Ctrl, IptKey_.Alt, IptKey_.F12));
|
||||
IptBnd_.cmd_(IptCfg_.Null, this, StopAppByAltF4_evt, IptKey_.MOD_2ND.Add(IptKey_.F4));
|
||||
IptBnd_.cmd_to_(IptCfg_.Null, this, GfoConsoleWin.Instance, GfoConsoleWin.Invk_Show, IptKey_.MOD_1ST.Add(IptKey_.MOD_2ND).Add(IptKey_.E));
|
||||
IptBnd_.cmd_(IptCfg_.Null, this, Invk_ShowFocusOwner, IptKey_.add_(IptKey_.MOD_1ST, IptKey_.MOD_2ND, IptKey_.F12));
|
||||
loadList.Add(keyCmdMgr); loadList.Add(GfuiTipTextMgr.Instance);
|
||||
focusMgr = GfuiWinFocusMgr.new_(this);
|
||||
}
|
||||
|
||||
@@ -1,23 +1,27 @@
|
||||
/*
|
||||
XOWA: the XOWA Offline Wiki Application
|
||||
Copyright (C) 2012-2017 gnosygnu@gmail.com
|
||||
|
||||
XOWA is licensed under the terms of the General Public License (GPL) Version 3,
|
||||
or alternatively under the terms of the Apache License Version 2.0.
|
||||
|
||||
You may use XOWA according to either of these licenses as is most appropriate
|
||||
for your project on a case-by-case basis.
|
||||
|
||||
The terms of each license can be found in the source code repository:
|
||||
|
||||
GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt
|
||||
Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt
|
||||
*/
|
||||
package gplx.gfui.controls.windows; import gplx.*; import gplx.gfui.*; import gplx.gfui.controls.*;
|
||||
/*
|
||||
XOWA: the XOWA Offline Wiki Application
|
||||
Copyright (C) 2012-2017 gnosygnu@gmail.com
|
||||
|
||||
XOWA is licensed under the terms of the General Public License (GPL) Version 3,
|
||||
or alternatively under the terms of the Apache License Version 2.0.
|
||||
|
||||
You may use XOWA according to either of these licenses as is most appropriate
|
||||
for your project on a case-by-case basis.
|
||||
|
||||
The terms of each license can be found in the source code repository:
|
||||
|
||||
GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt
|
||||
Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt
|
||||
*/
|
||||
package gplx.gfui.controls.windows; import gplx.Err_;
|
||||
import gplx.List_adp;
|
||||
import gplx.List_adp_;
|
||||
import gplx.gfui.controls.elems.GfuiElem;
|
||||
import gplx.gfui.controls.gxws.GxwElem;
|
||||
import gplx.gfui.controls.gxws.GxwTextMemo_lang;
|
||||
import java.awt.Component;
|
||||
import java.awt.Container;
|
||||
import java.awt.FocusTraversalPolicy;
|
||||
import gplx.gfui.controls.gxws.*; import gplx.gfui.controls.elems.*;
|
||||
public class GfuiWinFocusMgr {
|
||||
public List_adp SubElems() {return subElems;} List_adp subElems = List_adp_.New();
|
||||
public void InitForm() {this.Init(win);}
|
||||
@@ -71,7 +75,7 @@ class FocusTraversalPolicy_cls_base extends FocusTraversalPolicy {
|
||||
GfuiElem elem = null;
|
||||
try {elem = (GfuiElem)elems.Get_at(idx);}
|
||||
catch (Exception e) {
|
||||
System.out.println(idx);
|
||||
System.out.println("getComponentAfter:" + e.getMessage() + ":" + idx);
|
||||
Err_.Noop(e);
|
||||
}
|
||||
if (elem == null) return c; // FIXME: why is elem null?; REP: add new tab through history and then close out
|
||||
@@ -107,7 +111,7 @@ class FocusTraversalPolicy_cls_base extends FocusTraversalPolicy {
|
||||
}
|
||||
}
|
||||
catch (Exception e) {
|
||||
System.out.println(idx);
|
||||
System.out.println("getComponentBefore:" + e.getMessage() + ":" + idx);
|
||||
Err_.Noop(e);
|
||||
}
|
||||
if (elem == null) return c; // FIXME: why is elem null?; REP: add new tab through history and then close out
|
||||
|
||||
@@ -1,18 +1,18 @@
|
||||
/*
|
||||
XOWA: the XOWA Offline Wiki Application
|
||||
Copyright (C) 2012-2017 gnosygnu@gmail.com
|
||||
|
||||
XOWA is licensed under the terms of the General Public License (GPL) Version 3,
|
||||
or alternatively under the terms of the Apache License Version 2.0.
|
||||
|
||||
You may use XOWA according to either of these licenses as is most appropriate
|
||||
for your project on a case-by-case basis.
|
||||
|
||||
The terms of each license can be found in the source code repository:
|
||||
|
||||
GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt
|
||||
Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt
|
||||
*/
|
||||
/*
|
||||
XOWA: the XOWA Offline Wiki Application
|
||||
Copyright (C) 2012-2017 gnosygnu@gmail.com
|
||||
|
||||
XOWA is licensed under the terms of the General Public License (GPL) Version 3,
|
||||
or alternatively under the terms of the Apache License Version 2.0.
|
||||
|
||||
You may use XOWA according to either of these licenses as is most appropriate
|
||||
for your project on a case-by-case basis.
|
||||
|
||||
The terms of each license can be found in the source code repository:
|
||||
|
||||
GPLv3 License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-GPLv3.txt
|
||||
Apache License: https://github.com/gnosygnu/xowa/blob/master/LICENSE-APACHE2.txt
|
||||
*/
|
||||
package gplx.gfui.controls.windows; import gplx.*; import gplx.gfui.*; import gplx.gfui.controls.*;
|
||||
import gplx.gfui.ipts.*; import gplx.gfui.controls.elems.*; import gplx.gfui.controls.standards.*;
|
||||
import gplx.core.lists.*; import gplx.core.bits.*;
|
||||
|
||||
Reference in New Issue
Block a user