Icons

 

The Icon()has been added to LScript. This object type is designed to construct and house a bitmapped pattern of pixels. These pattern of pixels represent a complete user- defined text character (or "dingbat"). Icon characters are active only during an active Requester panel.

The maximum dimension of each character is 16 pixels wide by 14 tall. Characters are defined by placing character strings into an array. The width of each character string should not exceed the maximum width, while the number of strings in each array should not exceed the maximum height. In each character string a period character ('.') indicates a zero-pixel value (off), while any non-period character will represent a one-pixel value (on). Each array is provided to the Icon() constructor for construction and storage of the monochrome character image.

folder_icon = @ "..1111..........",
                ".1....111111....",
                ".1..........1...",
                ".1..........1...",
                ".1...1111111111.",
                ".1..1..........1",
                ".1.1..........1.",
                ".11..........1..",
                ".111111111111..."
                @;


eyes_icon = @ "................",
              "................",
              "...mmm...mmm....",
              "......m.m.......",
              "....mm...mm.....",
              "...m..m.m..m....",
              "..m.mm.m.mm.m...",
              "..m.m..m.m..m...",
              "..m....m....m...",
              "...m..m.m..m....",
              "....mm...mm.....",
              "................",
              "................"
              @;

@define FOLDER 1
@define EYES 2

generic
{
    icon[FOLDER] = Icon(folder_icon);
    icon[EYES] = Icon(eyes_icon);

    reqbegin("Testing Icons");

    c1 = ctlbutton("Open File " + icon[FOLDER],75,"bfunc1");
    c2 = ctlstring(icon[EYES].asStr() + " Browse","testing");

    reqpost();
}

bfunc1
{
    ...
}

Icons can then be embedded in any character string that will be processed and displayed by LScript (button or control label text, listbox entries, etc.).