mirror of
https://github.com/gnosygnu/xowa.git
synced 2026-03-02 03:49:30 +00:00
v2.10.3.1
This commit is contained in:
@@ -47,7 +47,7 @@ public class GfoConsoleWin implements GfoInvkAble, UsrMsgWkr {
|
||||
IptBnd_.cmd_to_(IptCfg_.Null, consoleBox, cmds, GfoConsoleWinCmds.Invk_Clear, IptKey_.add_(IptKey_.Ctrl, IptKey_.Alt, IptKey_.C));
|
||||
logger = new GfuiTextBoxLogger(this).Init(statusBox);
|
||||
// gplx.ios.GfioApp.InitGfs();
|
||||
UsrDlg_._.Reg(UsrMsgWkr_.Type_Note, this);
|
||||
UsrDlg_.Instance.Reg(UsrMsgWkr_.Type_Note, this);
|
||||
|
||||
win.Lyt_activate();
|
||||
win.Lyt().Bands_add(GftBand.fillWidth_());
|
||||
@@ -82,7 +82,7 @@ public class GfoConsoleWin implements GfoInvkAble, UsrMsgWkr {
|
||||
return this;
|
||||
} public static final String Invk_Show = "Show"
|
||||
;
|
||||
public static final GfoConsoleWin _ = new GfoConsoleWin(); GfoConsoleWin() {}
|
||||
public static final GfoConsoleWin Instance = new GfoConsoleWin(); GfoConsoleWin() {}
|
||||
}
|
||||
class GfoConsoleWinCmds implements GfoInvkAble {
|
||||
GfuiWin win; GfuiTextBox consoleFilBox, consoleBox, statusBox, resultBox;
|
||||
@@ -92,8 +92,8 @@ class GfoConsoleWinCmds implements GfoInvkAble {
|
||||
consoleBox = (GfuiTextBox)win.SubElems().Get_by("consoleBox");
|
||||
resultBox = (GfuiTextBox)win.SubElems().Get_by("resultBox");
|
||||
statusBox = (GfuiTextBox)win.SubElems().Get_by("statusBox");
|
||||
GfsCore._.AddObj(this, "gfoConsoleWin");
|
||||
GfsCore._.ExecRegy("gplx.gfui.GfoConsoleWin.ini");
|
||||
GfsCore.Instance.AddObj(this, "gfoConsoleWin");
|
||||
GfsCore.Instance.ExecRegy("gplx.gfui.GfoConsoleWin.ini");
|
||||
}
|
||||
public void Results_add(String s) {
|
||||
if (!String_.Has_at_end(s, GfuiTextBox_.NewLine))
|
||||
@@ -106,9 +106,9 @@ class GfoConsoleWinCmds implements GfoInvkAble {
|
||||
String cmdText = consoleBox.SelLen() == 0 ? consoleBox.Text() : consoleBox.SelText();
|
||||
String cmd = FixNewLines(cmdText);
|
||||
GfoMsg runMsg = GfoMsg_.Null;
|
||||
try {runMsg = GfsCore._.MsgParser().ParseToMsg(cmd);} catch (Exception e) {statusBox.Text_("invalid gfml " + Err_.Message_gplx_full(e)); return;}
|
||||
try {runMsg = GfsCore.Instance.MsgParser().ParseToMsg(cmd);} catch (Exception e) {statusBox.Text_("invalid gfml " + Err_.Message_gplx_full(e)); return;}
|
||||
GfsCtx ctx = GfsCtx.new_();
|
||||
Object rv = GfsCore._.ExecMany(ctx, runMsg);
|
||||
Object rv = GfsCore.Instance.ExecMany(ctx, runMsg);
|
||||
resultBox.Text_(Object_.Xto_str_strict_or_empty(rv));
|
||||
}
|
||||
void Help() {
|
||||
@@ -120,9 +120,9 @@ class GfoConsoleWinCmds implements GfoInvkAble {
|
||||
try {runMsg = GfmlDataNde.XtoMsgNoRoot(cmd);} catch (Exception e) {statusBox.Text_("invalid gfml " + Err_.Message_gplx_full(e)); return;}
|
||||
GfsCtx ctx = GfsCtx.new_();
|
||||
try {
|
||||
Object rv = GfsCore._.ExecOne(ctx, runMsg);
|
||||
Object rv = GfsCore.Instance.ExecOne(ctx, runMsg);
|
||||
if (rv != GfoInvkAble_.Rv_handled && rv != GfoInvkAble_.Rv_unhandled) {
|
||||
UsrDlg_._.Note(Object_.Xto_str_strict_or_empty(rv));
|
||||
UsrDlg_.Instance.Note(Object_.Xto_str_strict_or_empty(rv));
|
||||
}
|
||||
// Results_add(FixNewLines(ctx.Results_XtoStr()));
|
||||
} catch (Exception e) {statusBox.Text_("help failed " + Err_.Message_gplx_full(e)); return;}
|
||||
@@ -137,7 +137,7 @@ class GfoConsoleWinCmds implements GfoInvkAble {
|
||||
}
|
||||
else
|
||||
url = Io_url_.new_any_(consoleFilStr);
|
||||
Io_mgr.I.SaveFilStr(url, consoleBox.Text());
|
||||
Io_mgr.Instance.SaveFilStr(url, consoleBox.Text());
|
||||
}
|
||||
void Load() {
|
||||
String consoleFilStr = consoleFilBox.Text();
|
||||
@@ -149,7 +149,7 @@ class GfoConsoleWinCmds implements GfoInvkAble {
|
||||
dir = dir.OwnerDir();
|
||||
}
|
||||
Io_url url = GfuiIoDialogUtl.SelectFile(dir); if (url == Io_url_.Empty) return;
|
||||
consoleBox.Text_(Io_mgr.I.LoadFilStr(url));
|
||||
consoleBox.Text_(Io_mgr.Instance.LoadFilStr(url));
|
||||
}
|
||||
String FixNewLines(String cmd) {
|
||||
cmd = String_.Replace(cmd, "\n", "\r\n");
|
||||
@@ -193,7 +193,7 @@ class GfoConsoleWinCmds implements GfoInvkAble {
|
||||
Io_url v = m.ReadIoUrl("v");
|
||||
if (ctx.Deny()) return this;
|
||||
consoleFilBox.Text_(v.Xto_api());
|
||||
consoleBox.Text_(Io_mgr.I.LoadFilStr(v));
|
||||
consoleBox.Text_(Io_mgr.Instance.LoadFilStr(v));
|
||||
}
|
||||
else return win.Invk(ctx, ikey, k, m);
|
||||
return this;
|
||||
|
||||
@@ -48,5 +48,5 @@ class GfuiFocusXferBnd implements InjectAble, GfoInvkAble {
|
||||
else return GfoInvkAble_.Rv_unhandled;
|
||||
return this;
|
||||
} public static final String Invk_FocusNext = "FocusNext", Invk_FocusPrev = "FocusPrev";
|
||||
public static final GfuiFocusXferBnd _ = new GfuiFocusXferBnd(); GfuiFocusXferBnd() {}
|
||||
public static final GfuiFocusXferBnd Instance = new GfuiFocusXferBnd(); GfuiFocusXferBnd() {}
|
||||
}
|
||||
@@ -47,8 +47,8 @@ public class GfuiMenuBar implements GfoInvkAble {
|
||||
root.ForeColor_(ColorAdp_.Black).BackColor_(ColorAdp_.White);
|
||||
root.ExecProps();
|
||||
curOwnerItm = root;
|
||||
GfsCore._.AddObj(this, "GfuiMenuBar_");
|
||||
GfsCore._.ExecRegy("gplx.gfui.GfuiMenuBar.ini");
|
||||
GfsCore.Instance.AddObj(this, "GfuiMenuBar_");
|
||||
GfsCore.Instance.ExecRegy("gplx.gfui.GfuiMenuBar.ini");
|
||||
}
|
||||
catch (Exception e) {GfuiEnv_.ShowMsg(Err_.Message_gplx_full(e));}
|
||||
}
|
||||
@@ -79,7 +79,7 @@ public class GfuiMenuBar implements GfoInvkAble {
|
||||
GfuiMenuBarItm itm = GfuiMenuBarItm.sub_(curOwnerItm);
|
||||
itm.Type_(GfuiMenuBarItmType.Spr);
|
||||
itm.Text_(text);
|
||||
itm.Key_(curOwnerItm.Key() + "." + text + Int_.Xto_str(separatorIdx++));
|
||||
itm.Key_(curOwnerItm.Key() + "." + text + Int_.To_str(separatorIdx++));
|
||||
itm.ExecProps();
|
||||
}
|
||||
else if (ctx.Match(k, Invk_RegCmd)) {
|
||||
@@ -197,8 +197,8 @@ class GfuiMenuBarItm {
|
||||
if (mnem != '\0') itm.setMnemonic(mnem);
|
||||
}
|
||||
void SetProps(JComponent itm) {
|
||||
if (backColor != null) itm.setBackground(ColorAdpCache._.GetNativeColor(backColor));
|
||||
if (foreColor != null) itm.setForeground(ColorAdpCache._.GetNativeColor(foreColor));
|
||||
if (backColor != null) itm.setBackground(ColorAdpCache.Instance.GetNativeColor(backColor));
|
||||
if (foreColor != null) itm.setForeground(ColorAdpCache.Instance.GetNativeColor(foreColor));
|
||||
itm.setFont(MakeFont(itm.getFont()));
|
||||
if (String_.Len(tipText) > 0) itm.setToolTipText(tipText);
|
||||
}
|
||||
@@ -258,7 +258,7 @@ class GxwBorderFactory {
|
||||
class GfuiMenuBarItmCmd implements ActionListener {
|
||||
public void actionPerformed(ActionEvent ev) {
|
||||
try {
|
||||
GfsCore._.ExecOne(GfsCtx._, GfuiMenuBarItm.CmdMsg(itm));
|
||||
GfsCore.Instance.ExecOne(GfsCtx.Instance, GfuiMenuBarItm.CmdMsg(itm));
|
||||
}
|
||||
catch (Exception e) {
|
||||
GfuiEnv_.ShowMsg(Err_.Message_gplx_full(e));
|
||||
|
||||
@@ -29,5 +29,5 @@ class GfuiTipTextMgr implements GfuiWinOpenAble {
|
||||
ToolTipManager.sharedInstance().setReshowDelay(0);
|
||||
jcomp.setToolTipText(sub.TipText());
|
||||
}
|
||||
public static final GfuiTipTextMgr _ = new GfuiTipTextMgr();
|
||||
public static final GfuiTipTextMgr Instance = new GfuiTipTextMgr();
|
||||
}
|
||||
|
||||
@@ -45,9 +45,9 @@ public class GfuiWin extends GfuiElemBase {
|
||||
win.OpenedCmd_set(GfoInvkAbleCmd.new_(this, Evt_Opened));
|
||||
GfoEvMgr_.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._, GfoConsoleWin.Invk_Show, IptKey_.Ctrl.Add(IptKey_.Alt).Add(IptKey_.E));
|
||||
// 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));
|
||||
loadList.Add(keyCmdMgr); loadList.Add(GfuiTipTextMgr._);
|
||||
loadList.Add(keyCmdMgr); loadList.Add(GfuiTipTextMgr.Instance);
|
||||
focusMgr = GfuiWinFocusMgr.new_(this);
|
||||
}
|
||||
@Override public void ctor_GfuiBox_base(KeyValHash ctorArgs) {
|
||||
@@ -56,16 +56,16 @@ public class GfuiWin extends GfuiElemBase {
|
||||
win.OpenedCmd_set(GfoInvkAbleCmd.new_(this, Evt_Opened));
|
||||
GfoEvMgr_.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._, GfoConsoleWin.Invk_Show, IptKey_.Ctrl.Add(IptKey_.Alt).Add(IptKey_.E));
|
||||
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));
|
||||
loadList.Add(keyCmdMgr); loadList.Add(GfuiTipTextMgr._);
|
||||
loadList.Add(keyCmdMgr); loadList.Add(GfuiTipTextMgr.Instance);
|
||||
focusMgr = GfuiWinFocusMgr.new_(this);
|
||||
}
|
||||
@Override public GxwElem UnderElem_make(KeyValHash ctorArgs) {
|
||||
String type = (String)ctorArgs.FetchValOr(GfuiWin_.InitKey_winType, GfuiWin_.InitKey_winType_app);
|
||||
if (String_.Eq(type, GfuiWin_.InitKey_winType_tool)) return GxwElemFactory_._.win_tool_(ctorArgs);
|
||||
else if (String_.Eq(type, GfuiWin_.InitKey_winType_toaster)) return GxwElemFactory_._.win_toaster_(ctorArgs);
|
||||
else return GxwElemFactory_._.win_app_();
|
||||
if (String_.Eq(type, GfuiWin_.InitKey_winType_tool)) return GxwElemFactory_.Instance.win_tool_(ctorArgs);
|
||||
else if (String_.Eq(type, GfuiWin_.InitKey_winType_toaster)) return GxwElemFactory_.Instance.win_toaster_(ctorArgs);
|
||||
else return GxwElemFactory_.Instance.win_app_();
|
||||
}
|
||||
@Override public void Opened_cbk() {
|
||||
if (!smallOpenSize.Eq(SizeAdp_.Null)) super.Size_(smallOpenSize); // NOTE: call before opened = true, else Layout will happen again
|
||||
@@ -107,8 +107,8 @@ public class GfuiWin extends GfuiElemBase {
|
||||
else if (ctx.Match(k, Invk_Show)) Show();
|
||||
else if (ctx.Match(k, Evt_Opened)) Opened_cbk();
|
||||
else if (ctx.Match(k, StopAppByAltF4_evt)) StopAppByAltF4(IptEventData.ctx_(ctx, m));
|
||||
else if (ctx.Match(k, Invk_ShowFocusOwner)) GfuiEnv_.ShowMsg(GfuiFocusMgr._.FocusedElem().Key_of_GfuiElem());
|
||||
else if (ctx.Match(k, GfuiStatusBoxBnd.Invk_ShowTime)) {UsrDlg_._.Note(UsrMsg.new_(DateAdp_.Now().toString())); return this;}
|
||||
else if (ctx.Match(k, Invk_ShowFocusOwner)) GfuiEnv_.ShowMsg(GfuiFocusMgr.Instance.FocusedElem().Key_of_GfuiElem());
|
||||
else if (ctx.Match(k, GfuiStatusBoxBnd.Invk_ShowTime)) {UsrDlg_.Instance.Note(UsrMsg.new_(DateAdp_.Now().toString())); return this;}
|
||||
else if (ctx.MatchIn(k, Invk_Close, GfuiQuitMode.Destroy_cmd)) Close();
|
||||
else if (ctx.MatchIn(k, Invk_Hide, GfuiQuitMode.Suspend_cmd)) Hide();
|
||||
else {
|
||||
|
||||
@@ -60,9 +60,9 @@ public class GfuiWin_toaster extends GfuiWin { public void ShowPopup(GfuiWin own
|
||||
this.Pos_(screenX_max / 2 - this.Width()/2, PopupAnchorTop); //screenRect.Bottom - 1
|
||||
// gplx.gfui.npis.FormNpi.BringToFrontDoNotFocus(gplx.gfui.npis.ControlNpi.Hwnd(this.UnderElem()));
|
||||
if (!this.Visible()) {
|
||||
// GfuiElem last = GfuiFocusMgr._.FocusedElem();
|
||||
// GfuiElem last = GfuiFocusMgr.Instance.FocusedElem();
|
||||
this.Visible_on_();
|
||||
// GfuiFocusMgr._.FocusedElem_set(last);
|
||||
// GfuiFocusMgr.Instance.FocusedElem_set(last);
|
||||
}
|
||||
timer.Interval_(growingTimerInterval);
|
||||
popupState = PopupState.Growing;
|
||||
@@ -83,8 +83,8 @@ public class GfuiWin_toaster extends GfuiWin { public void ShowPopup(GfuiWin own
|
||||
timer.Enabled_on();
|
||||
}
|
||||
// public override boolean FocusGotCbk() {
|
||||
// GfuiElem last = GfuiFocusMgr._.FocusedElemPrev();
|
||||
// GfuiFocusMgr._.FocusedElem_set(last);
|
||||
// GfuiElem last = GfuiFocusMgr.Instance.FocusedElemPrev();
|
||||
// GfuiFocusMgr.Instance.FocusedElem_set(last);
|
||||
// last.Focus();
|
||||
// return false;
|
||||
// }
|
||||
@@ -124,7 +124,7 @@ public class GfuiWin_toaster extends GfuiWin { public void ShowPopup(GfuiWin own
|
||||
this.Pos_(this.X(), PopupAnchorTop); //this.Top - increment
|
||||
this.Size_(SizeAdp_.new_(this.Width(), this.Height() + increment));
|
||||
}
|
||||
@Override public GxwElem UnderElem_make(KeyValHash ctorArgs) {return GxwElemFactory_._.win_toaster_(ctorArgs);}
|
||||
@Override public GxwElem UnderElem_make(KeyValHash ctorArgs) {return GxwElemFactory_.Instance.win_toaster_(ctorArgs);}
|
||||
|
||||
@Override public void ctor_GfuiBox_base(KeyValHash ctorArgs) {
|
||||
super.ctor_GfuiBox_base(ctorArgs);
|
||||
|
||||
Reference in New Issue
Block a user