historyeditbox.m 803 B

123456789101112131415161718192021222324252627282930313233
  1. #include <lib/std.mi>
  2. Global Button back, forward;
  3. Global Edit editbox;
  4. Global GuiObject xui;
  5. System.onScriptLoaded() {
  6. Group pgroup = getScriptGroup();
  7. if (pgroup == NULL) return;
  8. back = pgroup.findObject("historyeditbox.back.button");
  9. forward = pgroup.findObject("historyeditbox.forward.button");
  10. editbox = pgroup.findObject("historyeditbox.edit");
  11. xui = pgroup.getParent();
  12. if (xui != NULL) {
  13. if (StringToInteger(xui.getXmlParam("navbuttons")) == 0) {
  14. if (back != NULL) back.hide();
  15. if (forward != NULL) forward.hide();
  16. if (editbox != NULL) editbox.setXmlParam("w", "-17");
  17. }
  18. }
  19. }
  20. back.onLeftClick() {
  21. if (xui != NULL)
  22. xui.sendAction("back", "", 0, 0, 0, 0);
  23. }
  24. forward.onLeftClick() {
  25. if (xui != NULL)
  26. xui.sendAction("forward", "", 0, 0, 0, 0);
  27. }