예제 #1
0
 private void AddListElement() {
   // ScrollList should never exceed the number of elements in the current list.
   Frame newFrame =
       new Frame(
           "ScrollList" + ScrollList.size(),
           new DPair(0, 0, 0, 0),
           new DPair(1, 0, 0, LIST_ELEMENT_HEIGHT),
           Driver.ColorScheme,
           CenterScrollFrame);
   new TextLabel(
       "TopText",
       new DPair(0, 3, 0, 3),
       new DPair(1, -58, .5, -3),
       ColorExtension.Lighten(Driver.ColorScheme, .15),
       newFrame,
       "My Text",
       14);
   new TextLabel(
       "BottomText",
       new DPair(0, 0, .5, 0),
       new DPair(1, -52, .5, 0),
       Driver.ColorScheme,
       newFrame,
       "My Text",
       14);
   new Frame("Divider", new DPair(1, -52, 0, 2), new DPair(0, 2, 1, -4), Color.WHITE, newFrame);
   new TextButton(
       "Action",
       new DPair(1, -47, 0, 3),
       new DPair(0, 44, 1, -6),
       Driver.ColorScheme,
       newFrame,
       "Buy",
       14);
   new TextButton(
           "Action2",
           new DPair(1, -94, 0, 3),
           new DPair(0, 44, 1, -6),
           Driver.ColorScheme,
           newFrame,
           "Edit",
           14)
       .SetVisible(false);
   ScrollList.add(newFrame);
 }
예제 #2
0
  public final void MakeElements() {
    Color ColorScheme = Driver.ColorScheme;
    MainFrame =
        new Frame(
            "Library",
            new DPair(0, 0, 0, 0),
            new DPair(1, 0, 1, 0),
            ColorExtension.Lighten(ColorScheme, 1),
            null);
    leftPanel =
        new Frame(
            "LeftPanel", new DPair(0, 0, 0, 0), new DPair(0, 150, 1, 0), Color.WHITE, MainFrame);
    new Frame(
        "Stripe1",
        new DPair(0, 0, 0, 0),
        new DPair(0, 60, 1, 0),
        ColorExtension.Lighten(ColorScheme, .7),
        leftPanel);
    new Frame(
        "Stripe2",
        new DPair(0, 72, 0, 0),
        new DPair(0, 6, 1, 0),
        ColorExtension.Lighten(ColorScheme, .7),
        leftPanel);
    new Frame(
        "Stripe3",
        new DPair(1, -18, 0, 0),
        new DPair(0, 18, 1, 0),
        ColorExtension.Lighten(ColorScheme, .7),
        leftPanel);
    new TextButton(
        "LibraryButton",
        new DPair(0, 0, 0, 12),
        new DPair(1, -18, 0, 36),
        ColorScheme,
        leftPanel,
        "Library",
        18);
    new TextButton(
        "StoreButton",
        new DPair(0, 0, 0, 54),
        new DPair(1, -18, 0, 36),
        ColorScheme,
        leftPanel,
        "Store",
        18);
    new TextButton(
        "ViewAlbums",
        new DPair(0, 18, 0, 96),
        new DPair(1, -18, 0, 24),
        ColorScheme,
        leftPanel,
        "Albums",
        14);
    new TextButton(
        "ViewAudiobooks",
        new DPair(0, 18, 0, 126),
        new DPair(1, -18, 0, 24),
        ColorScheme,
        leftPanel,
        "Audiobooks",
        14);
    new TextButton(
        "ViewFilms",
        new DPair(0, 18, 0, 156),
        new DPair(1, -18, 0, 24),
        ColorScheme,
        leftPanel,
        "Films",
        14);
    ManagementButton =
        new TextButton(
            "ManagementButton",
            new DPair(0, 0, 0, 186),
            new DPair(1, -18, 0, 36),
            ColorScheme,
            leftPanel,
            "Mgmt Tools",
            18);
    AccountCredit =
        new TextButton(
            "AccountCredit",
            new DPair(0, 0, 1, -30),
            new DPair(1, 0, 0, 24),
            ColorScheme,
            leftPanel,
            "Credit: $25.00",
            14);
    new TextButton(
        "Help",
        new DPair(0, 0, 1, -60),
        new DPair(1, 0, 0, 24),
        ColorScheme,
        leftPanel,
        "Help",
        14);
    CenterScrollFrame =
        new Frame(
            "CenterFrame",
            new DPair(0, leftPanel.GetSize().xOffset + 10, 0, 10),
            new DPair(1, -leftPanel.GetSize().xOffset - 50, 1, -20),
            Color.WHITE,
            MainFrame);
    LibScroll =
        new ScrollBar(
            "Scroll",
            new DPair(1, -30, 0, 10),
            new DPair(0, 20, 1, -20),
            ColorScheme,
            MainFrame,
            2000,
            200);

    CreditAdd =
        new Frame(
            "CreditAdd", new DPair(.5, -100, .5, -40), new DPair(0, 200, 0, 80), ColorScheme, null);
    new Frame(
        "InsideBorder", new DPair(0, 2, 0, 2), new DPair(1, -4, 1, -4), Color.WHITE, CreditAdd);
    TextLabel Request =
        new TextLabel(
            "Request",
            new DPair(0, 4, 0, 4),
            new DPair(1, -8, 0, 20),
            Color.WHITE,
            CreditAdd,
            "Add credit to account.",
            12);
    Request.SetTextColor(Driver.ColorScheme);
    new TextBox(
        "Input",
        new DPair(0, 4, 0, 28),
        new DPair(1, -8, 0, 20),
        Color.WHITE,
        CreditAdd,
        "Credit",
        14,
        Color.BLACK);
    new TextButton(
        "CreditAdd",
        new DPair(.5, -20, 1, -24),
        new DPair(0, 40, 0, 20),
        Driver.ColorScheme,
        CreditAdd,
        "OK",
        14);

    ModifyItem =
        new Frame(
            "ModifyItem",
            new DPair(.5, -200, .5, -114),
            new DPair(0, 400, 0, 228),
            ColorScheme,
            null);
    new Frame(
        "InsideBorder", new DPair(0, 3, 0, 3), new DPair(1, -6, 1, -6), Color.WHITE, ModifyItem);
    new TextLabel(
            "Id",
            new DPair(0, 4, 0, 4),
            new DPair(0, 100, 0, 18),
            Color.WHITE,
            ModifyItem,
            "ID #000",
            12)
        .SetTextColor(Driver.ColorScheme);
    new TextLabel(
            "Title",
            new DPair(0, 4, 0, 26),
            new DPair(0, 100, 0, 18),
            Color.WHITE,
            ModifyItem,
            "Title: ",
            12)
        .SetTextColor(Driver.ColorScheme);
    new TextBox(
        "TitleInput",
        new DPair(0, 108, 0, 26),
        new DPair(1, -115, 0, 18),
        Color.WHITE,
        ModifyItem,
        "newtitle",
        12,
        Driver.ColorScheme);
    new TextLabel(
            "Artist",
            new DPair(0, 4, 0, 48),
            new DPair(0, 100, 0, 18),
            Color.WHITE,
            ModifyItem,
            "Artist: ",
            12)
        .SetTextColor(Driver.ColorScheme);
    new TextBox(
        "ArtistInput",
        new DPair(0, 108, 0, 48),
        new DPair(1, -115, 0, 18),
        Color.WHITE,
        ModifyItem,
        "newartist",
        12,
        Driver.ColorScheme);
    new TextLabel(
            "Year",
            new DPair(0, 4, 0, 70),
            new DPair(0, 100, 0, 18),
            Color.WHITE,
            ModifyItem,
            "Year: ",
            12)
        .SetTextColor(Driver.ColorScheme);
    new TextBox(
        "YearInput",
        new DPair(0, 108, 0, 70),
        new DPair(1, -115, 0, 18),
        Color.WHITE,
        ModifyItem,
        "newyear",
        12,
        Driver.ColorScheme);
    new TextLabel(
            "Genre",
            new DPair(0, 4, 0, 92),
            new DPair(0, 100, 0, 18),
            Color.WHITE,
            ModifyItem,
            "Genre: ",
            12)
        .SetTextColor(Driver.ColorScheme);
    new TextBox(
        "GenreInput",
        new DPair(0, 108, 0, 92),
        new DPair(1, -115, 0, 18),
        Color.WHITE,
        ModifyItem,
        "newgenre",
        12,
        Driver.ColorScheme);
    new TextLabel(
            "Cost",
            new DPair(0, 4, 0, 114),
            new DPair(0, 100, 0, 18),
            Color.WHITE,
            ModifyItem,
            "Cost: ",
            12)
        .SetTextColor(Driver.ColorScheme);
    new TextBox(
        "CostInput",
        new DPair(0, 108, 0, 114),
        new DPair(1, -115, 0, 18),
        Color.WHITE,
        ModifyItem,
        "newcost",
        12,
        Driver.ColorScheme);
    new TextLabel(
            "Duration",
            new DPair(0, 4, 0, 136),
            new DPair(0, 100, 0, 18),
            Color.WHITE,
            ModifyItem,
            "Duration: ",
            12)
        .SetTextColor(Driver.ColorScheme);
    new TextBox(
        "DurationInputH",
        new DPair(0, 108, 0, 136),
        new DPair(0, 40, 0, 18),
        Color.WHITE,
        ModifyItem,
        "newduration",
        12,
        Driver.ColorScheme);
    new TextBox(
        "DurationInputM",
        new DPair(0, 152, 0, 136),
        new DPair(0, 40, 0, 18),
        Color.WHITE,
        ModifyItem,
        "newduration",
        12,
        Driver.ColorScheme);
    new TextBox(
        "DurationInputS",
        new DPair(0, 194, 0, 136),
        new DPair(0, 40, 0, 18),
        Color.WHITE,
        ModifyItem,
        "newduration",
        12,
        Driver.ColorScheme);
    new TextLabel(
            "Preview",
            new DPair(0, 4, 0, 158),
            new DPair(0, 100, 0, 18),
            Color.WHITE,
            ModifyItem,
            "Preview: ",
            12)
        .SetTextColor(Driver.ColorScheme);
    new TextBox(
        "PreviewInput",
        new DPair(0, 108, 0, 158),
        new DPair(1, -115, 0, 18),
        Color.WHITE,
        ModifyItem,
        "newpreview",
        12,
        Driver.ColorScheme);
    new TextLabel(
            "Hidden",
            new DPair(0, 4, 0, 180),
            new DPair(0, 100, 0, 18),
            Color.WHITE,
            ModifyItem,
            "Hidden: ",
            12)
        .SetTextColor(Driver.ColorScheme);
    new CheckBox(
        "HiddenInput",
        new DPair(0, 108, 0, 180),
        new DPair(0, 100, 0, 18),
        Driver.ColorScheme,
        ModifyItem,
        "Hidden",
        12);
    new TextButton(
        "SubmitChanges",
        new DPair(0, 4, 1, -26),
        new DPair(0, 140, 0, 20),
        Driver.ColorScheme,
        ModifyItem,
        "Submit Changes",
        14);
    new TextButton(
        "CloseModifyWindow",
        new DPair(1, -30, 1, -26),
        new DPair(0, 26, 0, 20),
        Driver.ColorScheme,
        ModifyItem,
        "X",
        14);

    Help =
        new Frame(
            "HelpFrame",
            new DPair(0.5, -150, 0.5, -200),
            new DPair(0, 300, 0, 400),
            Driver.ColorScheme,
            null);
    new Frame("InsideBorder", new DPair(0, 3, 0, 3), new DPair(1, -6, 1, -6), Color.WHITE, Help);
    String[] info = {
      "View your personal library by pressing the",
      "\"Library\" button to the left. View everything",
      "available in the store by pressing \"Store\",",
      "or filter your results down to albums,",
      "audiobooks, or films by pressing the",
      "respective buttons. Purchase items by",
      "pressing the “Buy” button.",
      "",
      "Need more credit? Click the button in the",
      "lower left showing how much credit you",
      "have."
    };
    for (int i = 0; i < info.length; i++) {
      new TextLabel(
              "label",
              new DPair(0, 4, 0, i * 24 + 4),
              new DPair(1, -8, 0, 18),
              Color.WHITE,
              Help,
              info[i],
              12)
          .SetTextColor(Driver.ColorScheme);
    }
    new TextButton(
        "CloseHelpWindow",
        new DPair(.7, -4, 1, -26),
        new DPair(.3, 0, 0, 20),
        Driver.ColorScheme,
        Help,
        "Close",
        14);

    RatingWindow =
        new Frame(
            "Rating", new DPair(0, 0, 0, 0), new DPair(0, 120, 0, 146), Driver.ColorScheme, null);
    new TextLabel(
            "Rating",
            new DPair(0, 3, 0, 3),
            new DPair(1, -6, 0, 17),
            Color.WHITE,
            RatingWindow,
            "Rating",
            12)
        .SetTextColor(Driver.ColorScheme);
    new TextButton(
        "1star",
        new DPair(0, 3, 0, 23),
        new DPair(1, -6, 0, 17),
        Driver.ColorScheme,
        RatingWindow,
        "*",
        12);
    new TextButton(
        "2star",
        new DPair(0, 3, 0, 43),
        new DPair(1, -6, 0, 17),
        Driver.ColorScheme,
        RatingWindow,
        "**",
        12);
    new TextButton(
        "3star",
        new DPair(0, 3, 0, 63),
        new DPair(1, -6, 0, 17),
        Driver.ColorScheme,
        RatingWindow,
        "***",
        12);
    new TextButton(
        "4star",
        new DPair(0, 3, 0, 83),
        new DPair(1, -6, 0, 17),
        Driver.ColorScheme,
        RatingWindow,
        "****",
        12);
    new TextButton(
        "5star",
        new DPair(0, 3, 0, 103),
        new DPair(1, -6, 0, 17),
        Driver.ColorScheme,
        RatingWindow,
        "*****",
        12);
    new TextButton(
        "0star",
        new DPair(0, 3, 0, 123),
        new DPair(1, -6, 0, 17),
        Driver.ColorScheme,
        RatingWindow,
        "n/a",
        12);
  }