#define	INCL_WINSYS
#define INCL_WINSTDDLGS
#define INCL_WINSTDSPIN
#define INCL_NLS
#define INCL_SW

#include <os2.h>

#include "listpm.h"

ICON        WIN_UICLLISTER "G:\\pe\\local\\os2\\VACPP40\\list\\LISTPM.ICO"
MENU WIN_UICLLISTER
BEGIN

    SUBMENU "~File",                   IDM_FILE, MIS_TEXT
    BEGIN
        MENUITEM "~New file open",     IDM_OPENNEW, MIS_TEXT
        MENUITEM "~Replace file",      IDM_REPLACEFILE, MIS_TEXT
        MENUITEM "C~lose \tF3",        SC_CLOSE, MIS_TEXT | MIS_SYSCOMMAND
    END

    SUBMENU "~Edit",                   IDM_EDIT, MIS_TEXT
    BEGIN
        MENUITEM "~Copy to clipboard \tCtrl+Ins", IDM_COPYTOCLIPBOARD, MIS_TEXT
        MENUITEM "~Search\tCtrl+F",    IDM_SEARCH, MIS_TEXT
        MENUITEM "Search ~again\tCtrl+N", IDM_AGAIN, MIS_TEXT
    END

    SUBMENU "~Options",                IDM_OPTIONS, MIS_TEXT
    BEGIN

        SUBMENU "~Word wrapped",       IDM_WORDWRAP, MIS_TEXT
        BEGIN
            MENUITEM "O~n",            IDM_ON, MIS_TEXT
            MENUITEM "O~ff",           IDM_OFF, MIS_TEXT, MIA_CHECKED
        END
        MENUITEM "Fon~t",              IDM_FONT, MIS_TEXT

        SUBMENU "Color",               IDM_COLOR, MIS_TEXT
        BEGIN
            MENUITEM "Text area foreground color", MLE_FOR, MIS_TEXT
            MENUITEM "Text area background color", MLE_BACK, MIS_TEXT
            MENUITEM "Foreground color", IDM_FORC, MIS_TEXT
            MENUITEM "Background color", IDM_BCKC, MIS_TEXT
            MENUITEM "Disabled foreground color", IDM_DISFORC, MIS_TEXT
            MENUITEM "Disabled background color", IDM_DISBCKC, MIS_TEXT
            MENUITEM "Hilite foreground color", IDM_HIFORC, MIS_TEXT
            MENUITEM "Hilite background color", IDM_HIBCKC, MIS_TEXT
            MENUITEM "Active color",   IDM_ACTIVEC, MIS_TEXT
            MENUITEM "Inactive color", IDM_INACTIVEC, MIS_TEXT
            MENUITEM "Shadow color",   IDM_SHADOWC, MIS_TEXT
            MENUITEM "Title bar active color", IDM_TACTIVEC, MIS_TEXT
            MENUITEM "Title bar inactive color", IDM_TINACTIVEC, MIS_TEXT
            MENUITEM "Title bar active text area background color",
                      TITLE_ACTTEXTBACK, MIS_TEXT
            MENUITEM "Title bar active text area foreground color",
                      TITLE_ACTTEXTFOR, MIS_TEXT
            MENUITEM "Title bar inactive text area background color",
                      TITLE_INACTTEXTBACK, MIS_TEXT
            MENUITEM "Title bar inactive text area foreground color",
                      TITLE_INACTTEXTFOR, MIS_TEXT
        END
    END

    SUBMENU "~Help",                   IDM_HELP, MIS_TEXT | MIS_HELP
    BEGIN
        MENUITEM "~General help",      SC_HELPEXTENDED, MIS_TEXT |
                 MIS_SYSCOMMAND
        MENUITEM "Help ~index",        SC_HELPINDEX, MIS_TEXT | MIS_SYSCOMMAND
        MENUITEM "~Keys help",         SC_HELPKEYS, MIS_TEXT | MIS_SYSCOMMAND
        MENUITEM "~Program author",    IDM_PROGRAMAUTHOR, MIS_TEXT
        MENUITEM "~Copyright",         IDM_COPYRIGHT, MIS_TEXT
        MENUITEM "~Gnu public licence", IDM_GNUPUBLICLICENCE, MIS_TEXT
    END
END

ACCELTABLE WIN_UICLLISTER PRELOAD
BEGIN
    VK_INSERT,  IDM_COPYTOCLIPBOARD, VIRTUALKEY, CONTROL
    VK_F3,      SC_CLOSE, VIRTUALKEY, SYSCOMMAND
    "x",        SC_CLOSE, CHAR, ALT, SYSCOMMAND
    "X",        SC_CLOSE, CHAR, ALT, SYSCOMMAND
    "n",        IDM_OPENNEW, CHAR, ALT
    "N",        IDM_OPENNEW, CHAR, ALT
    "r",        IDM_REPLACEFILE, CHAR, ALT
    "R",        IDM_REPLACEFILE, CHAR, ALT
    VK_ESC,     SC_CLOSE, VIRTUALKEY, SYSCOMMAND
    "t",        IDM_FONT, CHAR, ALT
    "T",        IDM_FONT, CHAR, ALT
    "c",        SC_CLOSE, CHAR, ALT, SYSCOMMAND
    "s",        IDM_SEARCH, CHAR, ALT
    "S",        IDM_SEARCH, CHAR, ALT
    "a",        IDM_AGAIN, CHAR, ALT
    "A",        IDM_AGAIN, CHAR, ALT
    "f",        IDM_SEARCH, CHAR, CONTROL
    "F",        IDM_SEARCH, CHAR, CONTROL
    "n",        IDM_AGAIN, CHAR, CONTROL, ALT
    "N",        IDM_AGAIN, CHAR, CONTROL, ALT
    "F",        IDM_SEARCH, CHAR, CONTROL
    "f",        IDM_SEARCH, CHAR, CONTROL
    "N",        IDM_AGAIN, CHAR, CONTROL
    "n",        IDM_AGAIN, CHAR, CONTROL
END

WINDOWTEMPLATE WIN_UICLLISTER 850
BEGIN
    WINDOW "Paul Elliott's Lister", WIN_UICLLISTER, 2, 27, 513, 182, WC_FRAME,
                FS_NOBYTEALIGN | FS_BORDER | WS_CLIPSIBLINGS | WS_SAVEBITS,
                FCF_TITLEBAR | FCF_SYSMENU | FCF_MENU | FCF_ACCELTABLE
    BEGIN
        CONTROL "",                    MLE_TEXT, 112, 65, 64, 33, WC_MLE,
                                            MLS_HSCROLL | MLS_READONLY |
                                            MLS_VSCROLL | MLS_DISABLEUNDO |
                                            WS_TABSTOP | WS_VISIBLE
                CTLDATA 32, 0, -1/*65535*/, -1/*65535*/, 0, 0, 0, 0, 0, 0, 0, 0, 4, 0, 0, 0
                PRESPARAMS PP_FONTNAMESIZE, "2.System VIO"
    END
END

DLGTEMPLATE DLG_COPYRIGHT 850 MOVEABLE DISCARDABLE
BEGIN
    DIALOG "(C) Paul Elliott,1999", DLG_COPYRIGHT, 90, 93, 241, 49,
                FS_NOBYTEALIGN | FS_DLGBORDER | WS_CLIPSIBLINGS | WS_SAVEBITS,
                FCF_TITLEBAR | FCF_SYSMENU
    BEGIN
        CONTROL "ListPM version 01, Copyright (C) 1999 Paul Elliott ListPM comes with ABSOLUTELY NO WARRANTY; for details consult HELP. This is free software, and you are welcome to redistribute it under certain conditions; consult HELP for details.",
                                       ST_COPYRIGHT, 3, 1, 233, 43, WC_STATIC,
                                            SS_TEXT | DT_LEFT | DT_TOP |
                                            DT_WORDBREAK | WS_GROUP |
                                            WS_VISIBLE
    END
END

MESSAGETABLE MOVEABLE DISCARDABLE
BEGIN
    ERR_NOTREAD,                        "File is not readable."
END

STRINGTABLE MOVEABLE DISCARDABLE
BEGIN
    STR_TITLEREPLACE,                   "Next file to display in current Window."
    STR_TITLENEW,                       "Open new file in new Window."
    STR_TITLE,                          "Lister,   (C) Paul Elliott 1999"
    STR_FONTTITLE,                      "Font to display file."
    STR_DEFAULTFONT,                    "Should this font be made the default font for all list windows?"
    STR_EXENAME,                        "ListPM"
    STR_ENTRYTITLE,                     "Text to search for"
    STR_EXACTCASE,                      "Exact case"
    STR_FORWARD,                        "Forward"
    STR_REVERSE,                        "Reverse"
    STR_SEARCH,                         "Search"
    STR_TLPRE,                          "ListPm - "
    STR_ACTIVEC,                        "Active Color"
    STR_BCKC,                           "Background Color"
    STR_DISBCKC,                        "Disabled Background Color"
    STR_DISFORC,                        "Disabled Foreground Color"
    STR_FORC,                           "Foreground Color"
    STR_HIFORC,                         "Hilite Foreground Color"
    STR_HIBCKC,                         "Hilite Background Color"
    STR_INACTIVEC,                      "Inactive Color"
    STR_SHADOWC,                        "Shadow Color"
    STR_MLE_BACK,                       "Text area background color"
    STR_MLE_FOR,                        "Text area foreground color"
    STR_TITLE_ACTTEXTBACK,              "Title bar active text area background color"
    STR_TITLE_ACTTEXTFOR,               "Title bar active text area foreground color"
    STR_TITLE_INACTTEXTBACK,            "Title bar inactive text area background color"
    STR_TITLE_INACTTEXTFOR,             "Title bar inactive text area foreground color"
    STR_COLORSAVEQUERY,                 "Save the new color as a stored default for all list windows?"
    STR_REVERTQUERY,                    "Revert to the original distributed color as the stored default for all list windows?"
    STR_TACTIVEC,                       "Title bar active color"
    STR_TBCKC,                          "Title bar background color"
    STR_TFORC,                          "Title bar foreground color"
    STR_TDISBCKC,                       "Title bar disabled background color"
    STR_TDISFORC,                       "Title bar disabled foreground color"
    STR_THIBCKC,                        "Title bar hilite background color"
    STR_THIFORC,                        "Title bar hilite foreground color"
    STR_TINACTIVEC,                     "Title bar inactive color"
    STR_TSHADOWC,                       "Title bar shadow color"
END
DEFAULTICON  "G:\\pe\\local\\os2\\VACPP40\\list\\LISTPM.ICO"
HELPSUBTABLE SUBTABLE_LIST
SUBITEMSIZE 2
BEGIN
    HELPSUBITEM MLE_TEXT,           305
    HELPSUBITEM IDM_FILE,           306
    HELPSUBITEM IDM_OPENNEW,        307
    HELPSUBITEM IDM_REPLACEFILE,    309
    HELPSUBITEM SC_CLOSE,           Close
    HELPSUBITEM IDM_EDIT,           311
    HELPSUBITEM IDM_COPYTOCLIPBOARD,312
    HELPSUBITEM IDM_OPTIONS,        313
    HELPSUBITEM IDM_WORDWRAP,       314
    HELPSUBITEM IDM_FONT,           317
    HELPSUBITEM IDM_ON,             315
    HELPSUBITEM IDM_OFF,            316
    HELPSUBITEM SC_HELPEXTENDED,    323
    HELPSUBITEM SC_HELPINDEX,       324
    HELPSUBITEM SC_HELPKEYS,        326
    HELPSUBITEM MLE_TEXT,           305
    HELPSUBITEM IDM_KEYSHELP,       321
    HELPSUBITEM WIN_UICLLISTER,     Do
    HELPSUBITEM IDM_COPYRIGHT,      Copyright
    HELPSUBITEM IDM_GNUPUBLICLICENCE,GNU
    HELPSUBITEM IDM_PROGRAMAUTHOR,  Author
    HELPSUBITEM IDM_SEARCH,         Search
    HELPSUBITEM IDM_AGAIN,          Searchagain
    HELPSUBITEM IDM_COLOR,          334
    HELPSUBITEM MLE_BACK,           334
    HELPSUBITEM MLE_FOR,            334
    HELPSUBITEM IDM_FORC,           334
    HELPSUBITEM IDM_BCKC,           334
    HELPSUBITEM IDM_DISBCKC,        334
    HELPSUBITEM IDM_DISFORC,        334
    HELPSUBITEM IDM_HIBCKC,         334
    HELPSUBITEM IDM_HIFORC,         334
    HELPSUBITEM IDM_ACTIVEC,        334
    HELPSUBITEM IDM_INACTIVEC,      334
    HELPSUBITEM IDM_SHADOWC,        334
    HELPSUBITEM IDM_TACTIVEC,       334
    HELPSUBITEM IDM_TINACTIVEC,     334
    HELPSUBITEM IDM_TBCKC,          334
    HELPSUBITEM IDM_TDISBCKC,       334
    HELPSUBITEM IDM_TDISFORC,       334
    HELPSUBITEM IDM_TFORC,          334
    HELPSUBITEM IDM_THIBCKC,        334
    HELPSUBITEM IDM_THIFORC,        334
    HELPSUBITEM IDM_TSHADOWC,       334
    HELPSUBITEM TITLE_ACTTEXTBACK,  334
    HELPSUBITEM TITLE_ACTTEXTFOR,   334
    HELPSUBITEM TITLE_INACTTEXTBACK,334
    HELPSUBITEM TITLE_INACTTEXTFOR, 334
END
HELPTABLE ID_HELPTABLE
BEGIN
    HELPITEM    WIN_UICLLISTER,     SUBTABLE_LIST,       Do
    HELPITEM    DLG_SEARCHFORTEXT,  SUBTABLE_SEARCH,     SearchDialog
END
DLGTEMPLATE DLG_SEARCHFORTEXT 850 MOVEABLE DISCARDABLE
BEGIN
    DIALOG "Search for Text", DLG_SEARCHFORTEXT, 54, 90, 283, 61,
                FS_NOBYTEALIGN | FS_DLGBORDER | WS_CLIPSIBLINGS | WS_SAVEBITS,
                FCF_TITLEBAR | FCF_SYSMENU
    BEGIN
        CONTROL "",                    ENT_TEXT, 16, 44, 247, 10, WC_ENTRYFIELD,
                                            ES_AUTOSCROLL | ES_MARGIN |
                                            ES_AUTOTAB | ES_COMMAND |
                                            WS_TABSTOP | WS_VISIBLE
                CTLDATA 8, 32, 0, 0
        CONTROL "~Exact case",         BOX_CASE, 29, 11, 60, 10, WC_BUTTON,
                                            BS_AUTOCHECKBOX | WS_TABSTOP |
                                            WS_VISIBLE
        CONTROL "~Forward match",      BUT_FORWARD, 143, 29, 78, 10, WC_BUTTON,
                                            BS_AUTORADIOBUTTON | WS_GROUP |
                                            WS_TABSTOP | WS_VISIBLE
                CTLDATA 6, 1, 0
        CONTROL "~Reverse match",      BUT_REVERSE, 141, 10, 79, 10, WC_BUTTON,
                                            BS_AUTORADIOBUTTON | WS_TABSTOP |
                                            WS_VISIBLE
    END
END



ACCELTABLE DLG_SEARCHFORTEXT PRELOAD
BEGIN
    VK_ENTER,   SC_CLOSE, VIRTUALKEY, SYSCOMMAND
    VK_NEWLINE, SC_CLOSE, VIRTUALKEY, SYSCOMMAND
END



HELPTABLE TABLE_SEARCH
BEGIN
    HELPITEM    DLG_SEARCHFORTEXT,  SUBTABLE_SEARCH,     SearchDialog
END
HELPSUBTABLE SUBTABLE_SEARCH
SUBITEMSIZE 2
BEGIN
    HELPSUBITEM ENT_TEXT,           SearchDialog
    HELPSUBITEM BOX_CASE,           EXact
    HELPSUBITEM BUT_FORWARD,        Forward
    HELPSUBITEM BUT_REVERSE,        xReverse
    HELPSUBITEM SC_HELPEXTENDED,    SearchDialog
END
