mirror of
https://github.com/gnosygnu/xowa.git
synced 2026-03-02 03:49:30 +00:00
Refactor: Clean up Int_ classes
This commit is contained in:
@@ -58,7 +58,7 @@ public class IptBnd_txt_range implements InjectAble, Gfo_invk, Gfo_evt_itm {
|
||||
if (String_.Eq(find, (String)list[i].Val())) idx = i;
|
||||
}
|
||||
if (idx == Int_.Min_value) { // try to find .Text in list.Keys
|
||||
int key = Int_.parse_or(txtBox.Text(), Int_.Min_value); if (key == Int_.Min_value) return Gfo_invk_.Rv_unhandled;
|
||||
int key = Int_.Parse_or(txtBox.Text(), Int_.Min_value); if (key == Int_.Min_value) return Gfo_invk_.Rv_unhandled;
|
||||
idx = GetByKey(key); if (idx == Int_.Min_value) return Gfo_invk_.Rv_unhandled;
|
||||
}
|
||||
ExecCmd(setCmd, idx);
|
||||
|
||||
@@ -32,7 +32,7 @@ public class IptBnd_upDownRange implements InjectAble, Gfo_invk, Gfo_evt_itm {
|
||||
else if (ctx.Match(k, Invk_TxtBox_inc)) ExecCmd(cmd, curVal + 1);
|
||||
else if (ctx.Match(k, Invk_TxtBox_exec)) {
|
||||
Object valObj = IntClassXtn.Instance.ParseOrNull(txtBox.Text()); if (valObj == null) throw Err_.new_wo_type("invalid int", "text", txtBox.Text());
|
||||
ExecCmd(doIt, Int_.cast(valObj));
|
||||
ExecCmd(doIt, Int_.Cast(valObj));
|
||||
}
|
||||
else if (ctx.Match(k, evt)) WhenEvt(ctx, m);
|
||||
else return Gfo_invk_.Rv_unhandled;
|
||||
|
||||
@@ -26,7 +26,7 @@ public class IptMouseWheel_ {
|
||||
else throw Err_.new_parse_type(IptMouseWheel.class, raw);
|
||||
}
|
||||
public static IptMouseWheel api_(Object obj) {
|
||||
int delta = Int_.cast(obj);
|
||||
int delta = Int_.Cast(obj);
|
||||
if (delta > 0) return Up;
|
||||
else if (delta < 0) return Down;
|
||||
else return None;
|
||||
|
||||
Reference in New Issue
Block a user