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
2014-09-07 22:38:50 -04:00
parent be63adc5af
commit a022d7f26c
293 changed files with 2546 additions and 1942 deletions

View File

@@ -23,7 +23,8 @@ public class Swt_app_browser {
public static void main(String[] args) {
Display display = new Display();
Shell shell = new Shell(display);
System.setProperty("org.eclipse.swt.browser.XULRunnerPath", "C:\\xowa\\bin\\windows\\xulrunner");
try {
System.setProperty("org.eclipse.swt.browser.XULRunnerPath", "E:\\موسوعات\\Xowa\\bin\\windows\\xulrunner");
Swt_app_browser_mgr mgr = new Swt_app_browser_mgr(shell);
New_btn(shell, 0, "loa&d", new Swt_app_browser_cmd_load(mgr));
New_btn(shell, 1, "&free", new Swt_app_browser_cmd_free(mgr));
@@ -35,6 +36,9 @@ public class Swt_app_browser {
}
mgr.Free();
display.dispose();
} catch (SWTError e) {
Tfds.Write("a");
}
}
private static Button New_btn(Shell shell, int idx, String text, SelectionListener lnr) {
Button rv = new Button(shell, SWT.BORDER);
@@ -55,8 +59,8 @@ class Swt_app_browser_mgr {
browser.setBounds(0, 40, size.x, size.y - 40);
}
// browser.setUrl("about:blank");
browser.setUrl("file:///C:/temp.html");
// browser.setText(Io_mgr._.LoadFilStr("C:\\temp.html"));
// browser.setUrl("file:///C:/temp.html");
browser.setText("hello");
}
public void Free() {
if (browser != null) {

View File

@@ -83,8 +83,8 @@ public class Swt_tab_mgr implements Gxw_tab_mgr, Swt_control, FocusListener, Gfo
Gfui_tab_itm_data tab_data = Get_tab_data(itm);
CTabItem next_tab = Tabs_select_after_closing_itm(tab_data); // NOTE: must calc next_tab before calling Pub_tab_closed; latter will recalc idx
Pub_tab_closed(tab_data.Key()); // NOTE: dispose does not call event for .close; must manually raise event;
itm.dispose();
this.Tabs_select_by_itm(next_tab);
itm.dispose();
}
@Override public void Tabs_select_by_idx(int i) {
if (i == Gfui_tab_itm_data.Idx_null) return; // 0 tabs; return;