webscape/derived/UIBundle.m3


MODULE UIBundle;
Generated by m3bundle; see its manpage.

IMPORT Bundle, BundleRep, Text;
IMPORT Thread, Wr, TextWr;

TYPE T = Bundle.T OBJECT OVERRIDES
           get      := LookUp;
           getNames := GetNames;
         END;

TYPE Texts = REF ARRAY OF TEXT;

VAR
  bundle: T     := NIL;
  names : Texts := NIL;

PROCEDURE Get(): Bundle.T =
  BEGIN
    IF (bundle = NIL) THEN bundle := NEW (T) END;
    RETURN bundle;
  END Get;

PROCEDURE GetNames (<*UNUSED*> self: T): Texts =
  BEGIN
    IF names = NIL THEN
      names := NEW (Texts, NUMBER (Names));
      names^ := Names;
    END;
    RETURN names;
  END GetNames;

PROCEDURE LookUp (<*UNUSED*> self: T;  element: TEXT): TEXT =
  BEGIN
    FOR i := 0 TO LAST (Names)-1 DO
      IF Text.Equal (Names[i], element) THEN
        IF Elements[i] = NIL THEN Elements[i] := GetElt (i) END;
        RETURN Elements[i];
      END;
    END;
    RETURN NIL;
  END LookUp;

CONST Names = ARRAY [0..1] OF TEXT {
  "ui.fv",
  NIL
};

VAR Elements := ARRAY [0..1] OF TEXT {
  NIL (* E0 .. E0_0 *),
  NIL
};

PROCEDURE GetElt (n: INTEGER): TEXT =
  <*FATAL Thread.Alerted, Wr.Failure *>
  VAR wr := TextWr.New ();
  BEGIN
    CASE n OF
    | 0 =>
        Wr.PutText (wr, E0);
        Wr.PutText (wr, E0_0);
    ELSE (*skip*)
    END;
    RETURN TextWr.ToText (wr);
  END GetElt;

CONST E0 =
   "(ZSplit \n  (Font (Family \"helvetica\") (PointSize 120) (WeightName \""
 & "Bold\"))\n  (LabelFont (Family \"helvetica\") (PointSize 120) (WeightNa"
 & "me \"Bold\"))\n  (Macro T BOA (a) `(Shape (Width + 0) ,a))\n  (Macro B "
 & "BOA (name label) `(HBox (Glue 2) (Filter (Button (Name ,name) ,label)))"
 & ")\n  (Macro MB BOA (name label) `(MButton (Name ,name) (Text LeftAlign "
 & "(Margin 14.5) ,label)))\n  (Macro MBC BOA (name label) `(Choice MenuSty"
 & "le CheckMark (Name ,name) (Text LeftAlign ,label)))\n  (Macro MBB BOA ("
 & "name label) `(Boolean MenuStyle CheckMark (Name ,name) (Text LeftAlign "
 & ",label)))\n  (VBox \n    (Glue 4)\n    (HBox \n      (Glue 10)\n      ("
 & "B back \"Back\")\n      (B forward \"Forward\")\n      (B home \"Home\""
 & ")\n      (Glue 10)\n      (B reload \"Reload\")\n      (B open \"Open.."
 & ".\")\n      (Glue 10)\n      (B stop \"Stop\")\n      (Text %pageCounts"
 & " \"a/b\")\n      (Menu (HBox \"  \" (Pixmap \"menuArrow.pbm\")(Pixmap \""
 & "menuArrow.pbm\")(Pixmap \"menuArrow.pbm\") \"  \")\n        (Radio %dis"
 & "playStyle =displayImages (VBox\n          (MBC displayUgly       \"Ugly"
 & " (but fast?) Text\")\n          (MBC displayNoImages   \"No Images\")\n"
 & "          (MBC displayImages     \"Images\")\n          (MBC displayBac"
 & "kground \"Images in background\")\n          Chisel\n          (MBB use"
 & "Zippers \"Use Zippers\")\n          Chisel\n          (MB debug \"Debug"
 & "ging stuff\")\n      )))\n      (Glue 2)  \n      (Guard (B quit \"Quit"
 & "\"))\n      (Glue 10))\n    (Glue 4)\n    (HBox \n      (Glue 5) \n    "
 & "  (T \"Location:  \")\n      (Frame Lowered (BgColor \"VeryLightGray\")"
 & " (Filter (TypeIn ExpandOnDemand %url)))\n      (Glue 20))\n    (Glue 4)"
 & "\n    (Bar 2)\n    (Shape (Height + 0) (Text (BgColor \"white\") %title"
 & " \"???\"))\n    (Bar)\n    (Shape (Width 600 - 300 + Inf) (Height 500 -"
 & " 400 + Inf) (Generic %contents)))\n(ZChassis (Title \"Open Location\") "
 & "%OpenDlg\n  (Filter Dormant (Rim (Pen 20)\n    (VBox\n      (HBox \n   "
 & "     (T \"Open Location:\")\n        (Shape (Width 200 + Inf) \n       "
 & "   (Frame Lowered (BgColor \"VeryLightGray\") (TypeIn ExpandOnDemand %o"
 & "penurl))))\n        (Glue 10)\n        (Chisel)\n      ";

CONST E0_0 =
   "  (Glue 10)\n        (HBox \n          (Border (CloseButton %openopen \""
 & "Open\")) \n          Fill Fill \n          (B openclear \"Clear\") \n  "
 & "        Fill\n          (B openpaste \"Paste\") \n          Fill Fill \n"
 & "          (CloseButton \"Cancel\"))))))\n)  \n";

BEGIN
END UIBundle.