1
0
mirror of https://github.com/gnosygnu/xowa.git synced 2026-03-02 03:49:30 +00:00
This commit is contained in:
gnosygnu
2015-05-03 22:30:22 -04:00
parent f4b95f5ce6
commit 0b5aa9aefe
207 changed files with 2339 additions and 1460 deletions

View File

@@ -17,7 +17,7 @@ along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package gplx.gfui; import gplx.*;
import gplx.gfml.*;
import gplx.threads.*;
import gplx.core.threads.*;
import java.awt.AWTKeyStroke;
import java.awt.Font;
import java.awt.Graphics;
@@ -81,7 +81,7 @@ public class GfuiEnv_ {
public static void ShowMsg(String message) {javax.swing.JOptionPane.showMessageDialog(null, message, "", javax.swing.JOptionPane.INFORMATION_MESSAGE, null);}
public static void BringToFront(ProcessAdp process) {}
public static void DoEvents(int milliseconds) {
ThreadAdp_.Sleep(milliseconds);
Thread_adp_.Sleep(milliseconds);
}
public static void Run(GfuiWin form) {javax.swing.SwingUtilities.invokeLater(new GfuiFormRunner(form));}
public static FontAdp System_font() {

View File

@@ -38,6 +38,7 @@ public interface Gfui_kit extends GfoInvkAble {
Gfui_tab_mgr New_tab_mgr(String key, GfuiElem owner, KeyVal... args);
GfuiTextBox New_text_box(String key, GfuiElem owner, KeyVal... args);
GfuiBtn New_btn(String key, GfuiElem owner, KeyVal... args);
GfuiLbl New_lbl(String key, GfuiElem owner, KeyVal... args);
Gfui_dlg_file New_dlg_file(byte type, String msg);
Gfui_dlg_msg New_dlg_msg(String msg);
ImageAdp New_img_load(Io_url path);

View File

@@ -67,6 +67,11 @@ public abstract class Gfui_kit_base implements Gfui_kit {
owner.SubElems().Add(rv);
return rv;
}
@gplx.Virtual public GfuiLbl New_lbl(String key, GfuiElem owner, KeyVal... args) {
GfuiLbl rv = GfuiLbl_.kit_(this, key, New_btn_impl(), ctor_args);
owner.SubElems().Add(rv);
return rv;
}
@gplx.Virtual public GfuiStatusBox New_status_box(String key, GfuiElem owner, KeyVal... args) {
GfuiStatusBox rv = GfuiStatusBox_.kit_(this, key, this.Factory().text_memo_());
owner.SubElems().Add(rv);

View File

@@ -42,7 +42,9 @@ import org.eclipse.swt.graphics.Point;
import org.eclipse.swt.graphics.Rectangle;
import org.eclipse.swt.widgets.Button;
import org.omg.PortableServer.THREAD_POLICY_ID;
import gplx.threads.*;
import gplx.core.threads.Thread_adp_;
import gplx.core.threads.*;
public class Swt_kit implements Gfui_kit {
private final KeyValHash ctor_args = KeyValHash.new_(); private final KeyValHash ctor_args_null = KeyValHash.new_();
private final HashAdp kit_args = HashAdp_.new_(); private Swt_msg_wkr_stop msg_wkr_stop;
@@ -125,7 +127,9 @@ public class Swt_kit implements Gfui_kit {
}
public GfuiInvkCmd New_cmd_sync (GfoInvkAble invk) {return new Swt_gui_cmd(this, gui_wtr, display, invk, Bool_.N);}
public GfuiInvkCmd New_cmd_async(GfoInvkAble invk) {return new Swt_gui_cmd(this, gui_wtr, display, invk, Bool_.Y);}
public GfuiWin New_win_utl(String key, GfuiWin owner, KeyVal... args) {return GfuiWin_.kit_(this, key, new Swt_win(shell), ctor_args_null); }
public GfuiWin New_win_utl(String key, GfuiWin owner, KeyVal... args) {
return GfuiWin_.kit_(this, key, new Swt_win(shell), ctor_args_null);
}
public GfuiWin New_win_app(String key, KeyVal... args) {
Swt_win win = new Swt_win(display);
this.shell = win.UnderShell();
@@ -137,6 +141,11 @@ public class Swt_kit implements Gfui_kit {
owner.SubElems().Add(rv);
return rv;
}
public GfuiLbl New_lbl(String key, GfuiElem owner, KeyVal... args) {
GfuiLbl rv = GfuiLbl_.kit_(this, key, new Swt_lbl(Swt_control_.cast_or_fail(owner), ctor_args), ctor_args);
owner.SubElems().Add(rv);
return rv;
}
public Gfui_html New_html(String key, GfuiElem owner, KeyVal... args) {
ctor_args.Clear();
// check cfg for browser type
@@ -262,7 +271,7 @@ class Swt_shell_close_lnr implements Listener, GfoInvkAble {
}
if (kit.Kit_sync_cmd_exists()) { // sync cmd is running; cannot shut down app else app just hangs; DATE:2015-04-13
event.doit = false; // cancel shutdown
ThreadAdp_.invk_(this, Invk_wait_for_sync_cmd).Start(); // wait for sync_cmd to end in background thread; call shutdown again when it does
Thread_adp_.invk_(this, Invk_wait_for_sync_cmd).Start(); // wait for sync_cmd to end in background thread; call shutdown again when it does
}
}
private void Wait_for_sync_cmd() { // THREAD:non-GUI
@@ -273,7 +282,7 @@ class Swt_shell_close_lnr implements Listener, GfoInvkAble {
usr_dlg.Log_many("", "", "swt:sync cmd done; shutting down");
break;
}
ThreadAdp_.Sleep(loop_wait);
Thread_adp_.Sleep(loop_wait);
loop_count++;
}
if (loop_count == loop_max)