#include "dtwdemo.h"
#include "windows.h"

/////////////////////////////////////////////////////////////////////////////
//
// Icon
//

// Icon with lowest ID value placed first to ensure application icon
// remains consistent on all systems.
IDI_DTWDEMO             ICON    DISCARDABLE     "DTWDEMO.ICO"
IDI_SMALL               ICON    DISCARDABLE     "DTWDEMO.ICO"

/////////////////////////////////////////////////////////////////////////////
//
// Menu
//

IDC_DTWDEMO  MENU DISCARDABLE
BEGIN
    POPUP "&Source Selection Test"
    BEGIN
        MENUITEM "S&elect Source...",           IDM_SELECT_SOURCE
        MENUITEM "Select Source By &Name...",   IDM_SELECT_SOURCE_BY_NAME
        MENUITEM "Select &Default Source...",   IDM_SELECT_DEFAULT_SOURCE
        MENUITEM "Select Source &Custom...",    IDM_SELECT_SOURCE_CUSTOM
        MENUITEM SEPARATOR
        MENUITEM "Source &Properties...",       IDM_SOURCE_PROPS
        MENUITEM SEPARATOR
        MENUITEM "&Close Source...",            IDM_CLOSE_SOURCE
        MENUITEM SEPARATOR
        MENUITEM "E&xit Demo",                  IDM_EXIT
    END
    POPUP "&Acquire Test"
    BEGIN
        MENUITEM "Acquire Native...",           IDM_ACQUIRE_NATIVE
        MENUITEM "Acquire Buffered...",         IDM_ACQUIRE_BUFFERED
        POPUP "Acquire File ..."
        BEGIN
            POPUP "BigTIFF"
            BEGIN
                MENUITEM "No compression",              IDM_ACQUIREFILE_BIGTIFF_NOCOMPRESSION
                MENUITEM "Group 3",                     IDM_ACQUIREFILE_BIGTIFF_GROUP3
                MENUITEM "Group 4",                     IDM_ACQUIREFILE_BIGTIFF_GROUP4
                MENUITEM "Flate",                       IDM_ACQUIREFILE_BIGTIFF_FLATE
                MENUITEM "JPEG",                        IDM_ACQUIREFILE_BIGTIFF_JPEG
                MENUITEM "LZW",                         IDM_ACQUIREFILE_BIGTIFF_LZW
                MENUITEM "Packbits",                    IDM_ACQUIREFILE_BIGTIFF_PACKBITS
            END
            MENUITEM "BMP",                         IDM_ACQUIREFILE_BMP
            MENUITEM "BMP-RLE",                     IDM_ACQUIREFILE_BMPRLE
            MENUITEM "DCX",                         IDM_ACQUIREFILE_DCX
            MENUITEM "Enhanced Meta File (EMF)",    IDM_ACQUIREFILE_ENHANCEDMETAFILE
            MENUITEM "GIF",                         IDM_ACQUIREFILE_GIF
            MENUITEM "ICO",                         IDM_ACQUIREFILE_ICO
            MENUITEM "ICO-Vista",                   IDM_ACQUIREFILE_ICOVISTA
            MENUITEM "JPEG",                        IDM_ACQUIREFILE_JPEG
            MENUITEM "JPEG-2000",                   IDM_ACQUIREFILE_JPEG2000
            MENUITEM "JPEG-XR",                     IDM_ACQUIREFILE_JPEGXR
            MENUITEM "Paintshop (PSD)",             IDM_ACQUIREFILE_PAINTSHOP
            MENUITEM "PCX",                         IDM_ACQUIREFILE_PCX
            MENUITEM "PDF",                         IDM_ACQUIREFILE_PDF
            MENUITEM "PNG",                         IDM_ACQUIREFILE_PNG
            MENUITEM "PostScript (Level 1)",        IDM_ACQUIREFILE_POSTSCRIPTLEVEL1
            MENUITEM "PostScript (Level 2)",        IDM_ACQUIREFILE_POSTSCRIPTLEVEL2
            MENUITEM "SVG",                         IDM_ACQUIREFILE_SVG
            MENUITEM "SVGZ",                        IDM_ACQUIREFILE_SVGZ
            MENUITEM "Targa (TGA)",                 IDM_ACQUIREFILE_TGA
            MENUITEM "Targa-RLE",                   IDM_ACQUIREFILE_TGARLE
            MENUITEM "Text (OCR)",                  IDM_ACQUIREFILE_TEXT
            POPUP "TIFF"
            BEGIN
                MENUITEM "No compression",              IDM_ACQUIREFILE_TIFF_NOCOMPRESSION
                MENUITEM "Group 3",                     IDM_ACQUIREFILE_TIFF_GROUP3
                MENUITEM "Group 4",                     IDM_ACQUIREFILE_TIFF_GROUP4
                MENUITEM "Flate",                       IDM_ACQUIREFILE_TIFF_FLATE
                MENUITEM "JPEG",                        IDM_ACQUIREFILE_TIFF_JPEG
                MENUITEM "LZW",                         IDM_ACQUIREFILE_TIFF_LZW
                MENUITEM "Packbits",                    IDM_ACQUIREFILE_TIFF_PACKBITS
            END
            MENUITEM "WEBP",                        IDM_ACQUIREFILE_WEBP
            MENUITEM "Windows Meta File (WMF)",     IDM_ACQUIREFILE_WINDOWSMETAFILE
            MENUITEM "Wireless Bitmap (WBMP)",      IDM_ACQUIREFILE_WIRELESSBITMAP
        END
        POPUP "Acquire File (Source Mode)..."
        BEGIN
            MENUITEM "Windows BMP",                 IDM_ACQUIREFILESOURCE_WINDOWSBMP
            MENUITEM "JPEG (JFIF)",                 IDM_ACQUIREFILESOURCE_JPEG
            MENUITEM "TIFF",                        IDM_ACQUIREFILESOURCE_TIFF
            MENUITEM "TIFF (Multipage)",            IDM_ACQUIREFILESOURCE_TIFFMULTIPAGE
            MENUITEM "PNG",                         IDM_ACQUIREFILESOURCE_PNG
            MENUITEM "PDF",                         IDM_ACQUIREFILESOURCE_PDF
            MENUITEM "PDF/A",                       IDM_ACQUIREFILESOURCE_PDFA
            MENUITEM "PDF/A2",                      IDM_ACQUIREFILESOURCE_PDFA2
            MENUITEM "PDFRASTER",                   IDM_ACQUIREFILESOURCE_PDFRASTER
            MENUITEM "FlashPix (FPX)",              IDM_ACQUIREFILESOURCE_FLASHPIX
            MENUITEM "EXIF",                        IDM_ACQUIREFILESOURCE_EXIF
            MENUITEM "SPIFF",                       IDM_ACQUIREFILESOURCE_SPIFF
            MENUITEM "XBM",                         IDM_ACQUIREFILESOURCE_XBM
            MENUITEM "Macintosh PICT",              IDM_ACQUIREFILESOURCE_PICT
            MENUITEM "JP2 (JPEG ISO/IEC 15444-1)",  IDM_ACQUIREFILESOURCE_JP2
            MENUITEM "JPX (JPEG ISO/IEC 15444-2)",  IDM_ACQUIREFILESOURCE_JPX
            MENUITEM "DEJAVU",                      IDM_ACQUIREFILESOURCE_DEJAVU
        END
        MENUITEM SEPARATOR
        MENUITEM "Show Preview",                IDM_SHOW_PREVIEW
        MENUITEM "Use Source UI",               IDM_USE_SOURCE_UI
        MENUITEM "Discard Blank Pages...",      IDM_DISCARD_BLANKS
        MENUITEM "Show Barcode Information",    IDM_SHOW_BARCODEINFO
        MENUITEM SEPARATOR
        MENUITEM "Use GetMessage TWAIN Loop",   IDM_ACQUIRETEST_USEGETMESSAGE
    END
    POPUP "&TWAIN Logging"
    BEGIN
        MENUITEM "Logging Options...",          IDM_LOGGING_OPTIONS
    END
    POPUP "Language"
    BEGIN
        MENUITEM "Dutch",                       ID_LANGUAGE_DUTCH
        MENUITEM "English",                     ID_LANGUAGE_ENGLISH
        MENUITEM "French",                      ID_LANGUAGE_FRENCH
        MENUITEM "German",                      ID_LANGUAGE_GERMAN
        MENUITEM "Greek",                       ID_LANGUAGE_GREEK
        MENUITEM "Italian",                     ID_LANGUAGE_ITALIAN
        MENUITEM "Japanese",                    ID_LANGUAGE_JAPANESE
        MENUITEM "Korean",                      ID_LANGUAGE_KOREAN
        MENUITEM "Portuguese",                  ID_LANGUAGE_PORTUGUESE
        MENUITEM "Romanian",                    ID_LANGUAGE_ROMANIAN
        MENUITEM "Russian",                     ID_LANGUAGE_RUSSIAN
        MENUITEM "Simplified Chinese",          ID_LANGUAGE_SIMPLIFIEDCHINESE
        MENUITEM "Traditioanl Chinese",         ID_LANGUAGE_TRADITIONALCHINESE
        MENUITEM "Spanish",                     ID_LANGUAGE_SPANISH
        MENUITEM "Custom Language...",          ID_LANGUAGE_CUSTOMLANGUAGE
    END
    POPUP "&Help"
    BEGIN
        MENUITEM "&About ...",                  IDM_ABOUT
    END
END


/////////////////////////////////////////////////////////////////////////////
//
// Accelerator
//

IDC_EXAMPLE1 ACCELERATORS MOVEABLE PURE
BEGIN
    "?",            IDM_ABOUT,              ASCII,  ALT
    "/",            IDM_ABOUT,              ASCII,  ALT
END


/////////////////////////////////////////////////////////////////////////////
//
// Dialog
//

IDD_ABOUTBOX DIALOG DISCARDABLE  22, 17, 320, 125
STYLE DS_MODALFRAME | WS_CAPTION | WS_SYSMENU
CAPTION "About"
FONT 8, "MS Sans Serif"
BEGIN
    ICON            IDI_DTWDEMO,IDC_MYICON,14,9,16,16
    LTEXT           "DTWDEMO Example",IDC_STATIC,39,10,119,8, SS_NOPREFIX
    EDITTEXT        IDC_edCopyright, 39, 20, 280, 100, ES_MULTILINE | ES_AUTOVSCROLL | ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP 
                                                      | WS_VSCROLL | WS_HSCROLL
    DEFPUSHBUTTON   "OK",IDOK,250,6,30,11,WS_GROUP
END

IDD_dlgEnterSourceName DIALOG DISCARDABLE  0, 0, 175, 53
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Source Name"
FONT 8, "MS Sans Serif"
BEGIN
    EDITTEXT        IDC_edSourceName,61,13,101,14,ES_AUTOHSCROLL
    DEFPUSHBUTTON   "OK",IDOK,60,31,50,14
    PUSHBUTTON      "Cancel",IDCANCEL,113,31,50,14
    LTEXT           "Source Name:",IDC_STATIC,7,14,46,8
END

IDD_dlgEnterCustomLangName DIALOG DISCARDABLE  0, 0, 175, 53
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Language Name"
FONT 8, "MS Sans Serif"
BEGIN
    EDITTEXT        IDC_edLangName,61,13,101,14,ES_AUTOHSCROLL
    DEFPUSHBUTTON   "OK",IDOK,60,31,50,14
    PUSHBUTTON      "Cancel",IDCANCEL,113,31,50,14
    LTEXT           "Language Name:",IDC_STATIC,7,14,46,8
END

IDD_dlgSelectCustom DIALOG DISCARDABLE  0, 0, 229, 133
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Custom Select Source Dialog"
FONT 8, "MS Sans Serif"
BEGIN
    DEFPUSHBUTTON   "Select",IDOK,169,13,50,14
    PUSHBUTTON      "Cancel",IDCANCEL,169,28,50,14
    LISTBOX         IDC_lstSources,5,13,157,99,LBS_SORT |
                    LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP
    EDITTEXT        IDC_edNumSources,8,118,22,12,ES_RIGHT | ES_AUTOHSCROLL |
                    ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP
    LTEXT           "TWAIN Source(s) Available for Selection",IDC_STATIC,31,
                    118,129,8
    LTEXT           "Sorted Source Names:",IDC_STATIC,8,3,72,8
END

IDD_dlgProperties DIALOG DISCARDABLE  0, 0, 643, 260
STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Source Properties"
FONT 8, "MS Sans Serif"
BEGIN
    EDITTEXT        IDC_edProductName,84,17,155,14,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP
    EDITTEXT        IDC_edFamilyName,83,32,155,14,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP
    EDITTEXT        IDC_edManufacturer,83,47,155,14,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP
    EDITTEXT        IDC_edVersionInfo,83,62,155,14,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP
    EDITTEXT        IDC_edVersion,83,77,155,14,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP
    DEFPUSHBUTTON   "OK",IDOK,265,241,50,14
    PUSHBUTTON      "Cancel",IDCANCEL,326,241,50,14
    LTEXT           "Product Name:",IDC_STATIC,19,17,48,8
    LTEXT           "Family Name:",IDC_STATIC,24,32,43,8
    LTEXT           "Manufacturer:",IDC_STATIC,22,46,45,8
    LTEXT           "Version Info:",IDC_STATIC,27,61,40,8
    LTEXT           "Version:",IDC_STATIC,41,77,26,8
    GROUPBOX        "General Info",IDC_STATIC,6,4,237,91
    LISTBOX         IDC_lstCapabilities,13,114,116,98,LBS_SORT | LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_HSCROLL | WS_TABSTOP
    RTEXT           "Total Caps:",IDC_STATIC,147,116,37,8
    RTEXT           "Custom Caps:",IDC_STATIC,135,130,49,8
    RTEXT           "Extended Caps:",IDC_STATIC,133,145,51,8
    EDITTEXT        IDC_edTotalCaps,197,116,40,14,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP
    EDITTEXT        IDC_edCustomCaps,197,131,40,14,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP
    EDITTEXT        IDC_edExtendedCaps,197,146,40,14,ES_AUTOHSCROLL | ES_READONLY | NOT WS_BORDER | NOT WS_TABSTOP
    GROUPBOX        "Capability Info",IDC_STATIC,6,103,237,134
    GROUPBOX        "Custom DS Data",IDC_STATIC,250,4,172,233
    EDITTEXT        IDC_edDSData,258,15,153,203,ES_MULTILINE | ES_AUTOVSCROLL | ES_AUTOHSCROLL | ES_READONLY | WS_VSCROLL | WS_HSCROLL
    GROUPBOX        "JSON Details",IDC_STATIC,433,4,199,234
    EDITTEXT        IDC_edJSONDetails,438,15,189,217,ES_MULTILINE | ES_AUTOVSCROLL | ES_AUTOHSCROLL | ES_READONLY | WS_VSCROLL | WS_HSCROLL
    PUSHBUTTON      "Test Capability ...",IDC_btnTestCap,135,181,81,14
    PUSHBUTTON      "Reset All Capabilities",IDC_btnResetCapabilities,136,198,81,14
    PUSHBUTTON      "Show UI Only",IDC_btnShowUIIOnly,272,220,54,14
    PUSHBUTTON      "Refresh",IDC_btnRefreshShowUIOnly,345,220,50,14
    CONTROL         "Reset Caps On Exit",IDC_chkResetCapsOnClose,"Button",BS_AUTOCHECKBOX | WS_TABSTOP,15,218,103,10
END

#include "dibdisplay.rc"

IDD_dlgSettings DIALOG DISCARDABLE  0, 0, 152, 63
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Acquire Settings"
FONT 8, "MS Sans Serif"
BEGIN
    DEFPUSHBUTTON   "OK",IDOK,25,43,50,14
    PUSHBUTTON      "Cancel",IDCANCEL,76,43,50,14
    CONTROL         "Use Document Feeder",IDC_chkUseFeeder,"Button",
                    BS_AUTOCHECKBOX | WS_TABSTOP,9,5,96,10
    CONTROL         "Duplex Scanning",IDC_chkUseDuplex,"Button",
                    BS_AUTOCHECKBOX | WS_TABSTOP,9,19,84,10
END

IDD_dlgFileType DIALOG DISCARDABLE  0, 0, 189, 119
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "File Type"
FONT 8, "MS Sans Serif"
BEGIN
    DEFPUSHBUTTON   "OK",IDOK,69,91,50,14
    COMBOBOX        IDC_cmbFileType,5,17,171,94,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
    LTEXT           "Choose File Type:",IDC_STATIC,7,4,79,8
    LTEXT           "Choose File name:",IDC_STATIC,7,48,59,8
    EDITTEXT        IDC_edFileName,6,60,106,14,ES_AUTOHSCROLL
END

IDD_dlgDebug DIALOGEX 0, 0, 227, 159
STYLE DS_SETFONT | DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Log File Selection"
FONT 8, "MS Sans Serif", 0, 0, 0x0
BEGIN
    EDITTEXT        IDC_edLogFileName,66,44,136,13,ES_AUTOHSCROLL
    DEFPUSHBUTTON   "OK",IDOK,45,123,50,14
    PUSHBUTTON      "Cancel",IDCANCEL,133,123,50,14
    CONTROL         "No Logging",IDC_radNoLogging,"Button",BS_AUTORADIOBUTTON,13,20,51,10
    CONTROL         "Log to File:",IDC_radLogToFile,"Button",BS_AUTORADIOBUTTON,13,46,51,10
    CONTROL         "Log to Debug Monitor",IDC_radToMonitor,"Button",BS_AUTORADIOBUTTON,13,70,85,10
    CONTROL         "Log to Console", IDC_radToConsole, "Button", BS_AUTORADIOBUTTON, 13, 96, 85, 10
END

IDD_dlgBarCodes DIALOGEX 0, 0, 309, 176
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Bar Codes Found"
FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
    DEFPUSHBUTTON   "OK",IDOK,198,155,50,14
    PUSHBUTTON      "Cancel",IDCANCEL,252,155,50,14
    EDITTEXT        IDC_edBarCodes,15,15,278,134,ES_MULTILINE | ES_AUTOHSCROLL | ES_READONLY | WS_VSCROLL | WS_HSCROLL
END

IDD_dlgTestCap DIALOGEX 0, 0, 385, 264
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Test Capability"
FONT 8, "MS Shell Dlg", 400, 0, 0x1
BEGIN
    COMBOBOX        IDC_cmbGetTypes,26,36,77,60,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP
    COMBOBOX        IDC_cmbContainer,113,36,106,68,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP
    COMBOBOX        IDC_cmbDataType,231,36,68,67,CBS_DROPDOWNLIST | CBS_SORT | WS_VSCROLL | WS_TABSTOP
    PUSHBUTTON      "Test ",IDC_btnTest,163,52,50,14
    PUSHBUTTON      "Revert",IDC_btnReset,307,35,50,14
    LISTBOX         IDC_lstResults,25,77,341,53,LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_TABSTOP
    COMBOBOX        IDC_cmbSetTypes,26,163,87,60,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
    COMBOBOX        IDC_cmbContainerSet,113,163,106,68,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
    PUSHBUTTON      "Test",IDC_btnTestSet,167,180,50,14
    COMBOBOX        IDC_cmbDataTypeSet,231,163,68,67,CBS_DROPDOWNLIST | WS_VSCROLL | WS_TABSTOP
    PUSHBUTTON      "Revert",IDC_btnResetSet,307,162,50,14
    EDITTEXT        IDC_edSetInput,22,197,129,45,ES_MULTILINE | ES_AUTOHSCROLL | ES_WANTRETURN | WS_VSCROLL
    LISTBOX         IDC_lstResultsSet,230,197,137,45,LBS_NOINTEGRALHEIGHT | WS_VSCROLL | WS_HSCROLL | WS_TABSTOP
    DEFPUSHBUTTON   "OK",IDOK,145,244,50,14
    PUSHBUTTON      "Cancel",IDCANCEL,205,244,50,14
    LTEXT           "Get Operation:",IDC_STATIC,26,24,69,8
    LTEXT           "Container:",IDC_STATIC,113,24,35,8
    LTEXT           "Data Type:",IDC_STATIC,231,24,37,8
    LTEXT           "Results:",IDC_STATIC,25,64,27,8
    LTEXT           "Note: Testing using non-default container or data type may have undesirable results.",IDC_STATIC,48,10,288,8
    CONTROL         "",IDC_STATIC,"Static",SS_ETCHEDHORZ,7,142,369,1
    LTEXT           "Set Operation:",IDC_staticSetOperation,26,150,69,8
    LTEXT           "Data Type:",IDC_staticDataType,231,150,37,8
    LTEXT           "Container:",IDC_staticContainer,113,150,35,8
    LTEXT           "Results:",IDC_staticResults,228,186,27,8
    LTEXT           "Input: (One data item per line):",IDC_staticInput,24,186,102,8
    LTEXT           "",IDC_staticTestGetResults,215,55,49,8
END

IDD_dlgEnterFileName DIALOGEX 0, 0, 271, 61
STYLE DS_SETFONT | DS_MODALFRAME | DS_FIXEDSYS | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Save File"
FONT 8, "MS Shell Dlg"
BEGIN
    EDITTEXT        IDC_edSaveFileName,51,7,199,14,ES_AUTOHSCROLL
    DEFPUSHBUTTON   "OK",IDOK,82,35,50,14
    PUSHBUTTON      "Cancel",IDCANCEL,136,35,50,14
    LTEXT           "File Name:",IDC_STATIC,8,9,34,8
END

/////////////////////////////////////////////////////////////////////////////
//
// String Table
//

STRINGTABLE DISCARDABLE
BEGIN
    IDS_APP_TITLE           "DTWAIN Demo Program"
    IDC_DTWDEMO             "DTWAIN Demo Program"
END

/////////////////////////////////////////////////////////////////////////////
