#include "CompressDialogRes.h"
#include "../../GuiCommon.rc"

#define xc 400
#define yc 304

#undef gSize
#undef gSpace
#undef g0xs
#undef g1x
#undef g1xs
#undef g2xs
#undef g3x
#undef g3xs
#undef g4x
#undef g4x2
#undef g4xs
#undef g4xs2

#define gSize 192
#define gSpace 24

#define g1xs 88
#define g0xs (gSize - g1xs)
#define g1x  (m + g0xs)

#define g3xs 40
#define g2xs (gSize - g3xs)
#define g3x  (m + g2xs)

#define g4x (m + gSize + gSpace)
#define g4x2 (g4x + m)
#define g4xs (xc - gSize - gSpace)
#define g4xs2 (g4xs - m - m)

#define yOpt 72
#define yPsw 128

IDD_DIALOG_COMPRESS MY_DIALOG
CAPTION "Add to Archive"
BEGIN
  LTEXT    "&Archive:", IDC_STATIC_COMPRESS_ARCHIVE, m, m, xc, 8
  COMBOBOX  IDC_COMPRESS_COMBO_ARCHIVE, m, 18, xc - bxsDots - 12, 126, MY_COMBO_WITH_EDIT
  PUSHBUTTON  "...", IDC_COMPRESS_BUTTON_SET_ARCHIVE, xs - m - bxsDots, 17, bxsDots, bys, WS_GROUP

  LTEXT     "Archive &format:", IDC_STATIC_COMPRESS_FORMAT,     m,  41, g0xs, 8
  COMBOBOX  IDC_COMPRESS_COMBO_FORMAT,     g1x, 39,  g1xs , 80, MY_COMBO | CBS_SORT
  
  LTEXT     "Compression &level:",IDC_STATIC_COMPRESS_LEVEL,    m,  62, g0xs, 8
  COMBOBOX  IDC_COMPRESS_COMBO_LEVEL,      g1x, 60,  g1xs,  80, MY_COMBO
  
  LTEXT     "Compression &method:",IDC_STATIC_COMPRESS_METHOD,  m,  83, g0xs, 8
  COMBOBOX  IDC_COMPRESS_COMBO_METHOD,     g1x, 81,  g1xs,  80, MY_COMBO

  LTEXT     "&Dictionary size:",IDC_STATIC_COMPRESS_DICTIONARY, m, 104, g0xs, 8
  COMBOBOX  IDC_COMPRESS_COMBO_DICTIONARY, g1x, 102, g1xs,  167, MY_COMBO

  LTEXT     "&Word size:",IDC_STATIC_COMPRESS_ORDER,            m, 125, g0xs, 8
  COMBOBOX  IDC_COMPRESS_COMBO_ORDER,      g1x, 123, g1xs,  141, MY_COMBO

  LTEXT     "&Solid Block size:",IDC_STATIC_COMPRESS_SOLID,        m, 146, g0xs, 8
  COMBOBOX  IDC_COMPRESS_COMBO_SOLID,      g1x, 144, g1xs,  140, MY_COMBO

  LTEXT     "&Number of CPU threads:",IDC_STATIC_COMPRESS_THREADS, m, 167, g0xs, 8
  COMBOBOX  IDC_COMPRESS_COMBO_THREADS,   g1x, 165, g1xs - 35,  140, MY_COMBO
  RTEXT     "1", IDC_COMPRESS_HARDWARE_THREADS, g1x + g1xs - 35 + 10, 167, 25, 8

  
  LTEXT     "Memory usage for Compressing:", IDC_STATIC_COMPRESS_MEMORY,      m, 190, g2xs, 8
  RTEXT     "0", IDC_STATIC_COMPRESS_MEMORY_VALUE,   g3x, 190, g3xs, 8
  
  LTEXT     "Memory usage for Decompressing:", IDC_STATIC_COMPRESS_MEMORY_DE, m, 206, g2xs, 8
  RTEXT     "0",IDC_STATIC_COMPRESS_MEMORY_DE_VALUE, g3x, 206, g3xs, 8


  LTEXT     "Split to &volumes, bytes:", IDC_STATIC_COMPRESS_VOLUME, m, 225, gSize, 8
  COMBOBOX  IDC_COMPRESS_COMBO_VOLUME, m, 237, gSize, 73, MY_COMBO_WITH_EDIT

  LTEXT     "&Parameters:",IDC_STATIC_COMPRESS_PARAMETERS, m, 260, xc, 8
  EDITTEXT  IDC_COMPRESS_EDIT_PARAMETERS, m, 272, xc, 14, ES_AUTOHSCROLL

  LTEXT     "&Update mode:",IDC_STATIC_COMPRESS_UPDATE_MODE, g4x, 39, g4xs, 8
  COMBOBOX  IDC_COMPRESS_COMBO_UPDATE_MODE, g4x, 51, g4xs, 80, MY_COMBO

  GROUPBOX  "Options",IDC_STATIC_COMPRESS_OPTIONS, g4x, yOpt, g4xs, 48
  CONTROL   "Create SF&X archive",IDC_COMPRESS_SFX, MY_CHECKBOX,
            g4x2, yOpt + 14, g4xs2, 10
  CONTROL   "Compress shared files",IDC_COMPRESS_SHARED, MY_CHECKBOX,
            g4x2, yOpt + 30, g4xs2, 10
  
  GROUPBOX  "Encryption",IDC_COMPRESS_ENCRYPTION, g4x, yPsw, g4xs, 127

  LTEXT     "Enter password:",IDC_STATIC_COMPRESS_PASSWORD1, g4x2, yPsw + 14, g4xs2, 8
  EDITTEXT  IDC_COMPRESS_EDIT_PASSWORD1, g4x2, yPsw + 26, g4xs2, 14, ES_PASSWORD | ES_AUTOHSCROLL
  LTEXT     "Reenter password:",IDC_STATIC_COMPRESS_PASSWORD2, g4x2, yPsw + 46, g4xs2, 8
  EDITTEXT  IDC_COMPRESS_EDIT_PASSWORD2, g4x2, yPsw + 58, g4xs2, 14, ES_PASSWORD | ES_AUTOHSCROLL

  CONTROL   "Show Password",IDC_COMPRESS_CHECK_SHOW_PASSWORD,MY_CHECKBOX,
            g4x2, yPsw + 79, g4xs2, 10

  LTEXT     "&Encryption method:",IDC_STATIC_COMPRESS_ENCRYPTION_METHOD, g4x2, yPsw + 95, 100, 8
  COMBOBOX  IDC_COMPRESS_COMBO_ENCRYPTION_METHOD, g4x2 + 100, yPsw + 93, g4xs2 - 100,  198, MY_COMBO

  CONTROL   "Encrypt file &names", IDC_COMPRESS_CHECK_ENCRYPT_FILE_NAMES, MY_CHECKBOX,
            g4x2, yPsw + 111, g4xs2, 10
  
  DEFPUSHBUTTON  "OK",         IDOK, bx3, by, bxs, bys, WS_GROUP
  PUSHBUTTON     "Cancel", IDCANCEL, bx2, by, bxs, bys
  PUSHBUTTON     "Help",     IDHELP, bx1, by, bxs, bys
END


#ifdef UNDER_CE

#undef m
#undef xc
#undef yc

#define m 4
#define xc 152
#define yc 160


IDD_DIALOG_COMPRESS_2 MY_DIALOG
CAPTION "Add to Archive"
MY_FONT
BEGIN
  // LTEXT    "&Archive:", IDC_STATIC_COMPRESS_ARCHIVE, m, m + 1, 32, 8
  COMBOBOX  IDC_COMPRESS_COMBO_ARCHIVE, m, m, xc - bxsDots - m, 126, MY_COMBO_WITH_EDIT
  PUSHBUTTON  "...", IDC_COMPRESS_BUTTON_SET_ARCHIVE, xs - m - bxsDots, m, bxsDots, 12, WS_GROUP

  COMBOBOX  IDC_COMPRESS_COMBO_FORMAT, m      , 22, 32, 80, MY_COMBO | CBS_SORT
  COMBOBOX  IDC_COMPRESS_COMBO_LEVEL,  m +  36, 22, 68, 80, MY_COMBO
  COMBOBOX  IDC_COMPRESS_COMBO_METHOD, m + 108, 22, 44, 80, MY_COMBO

  COMBOBOX  IDC_COMPRESS_COMBO_DICTIONARY,    m, 40, 40, 80, MY_COMBO
  COMBOBOX  IDC_COMPRESS_COMBO_ORDER,   m +  44, 40, 32, 80, MY_COMBO
  COMBOBOX  IDC_COMPRESS_COMBO_SOLID,   m +  80, 40, 40, 80, MY_COMBO
  COMBOBOX  IDC_COMPRESS_COMBO_THREADS, m + 124, 40, 28, 80, MY_COMBO

  LTEXT     "Split to &volumes, bytes:", IDC_STATIC_COMPRESS_VOLUME, m, 60, 32, 8
  COMBOBOX  IDC_COMPRESS_COMBO_VOLUME, m + 32, 58, 44, 73, MY_COMBO_WITH_EDIT
  LTEXT     "&Parameters:",IDC_STATIC_COMPRESS_PARAMETERS, m + 80, 60, 48, 8
  EDITTEXT  IDC_COMPRESS_EDIT_PARAMETERS, m + 128, 58, 24, 13, ES_AUTOHSCROLL

  COMBOBOX  IDC_COMPRESS_COMBO_UPDATE_MODE, m, 76, 88, 80, MY_COMBO
  CONTROL   "SF&X", IDC_COMPRESS_SFX, MY_CHECKBOX, m + 92, 77, 60, 10

  CONTROL   "Compress shared files", IDC_COMPRESS_SHARED, MY_CHECKBOX, m, 94, xc, 10
  
  LTEXT     "Enter password:", IDC_STATIC_COMPRESS_PASSWORD1, m, 112, 60, 8
  EDITTEXT  IDC_COMPRESS_EDIT_PASSWORD1, m + 60, 110, 44, 13, ES_PASSWORD | ES_AUTOHSCROLL
  CONTROL   "Show Password", IDC_COMPRESS_CHECK_SHOW_PASSWORD, MY_CHECKBOX, m + 108, 112, 44, 10

  COMBOBOX  IDC_COMPRESS_COMBO_ENCRYPTION_METHOD, m, 128, 48, 198, MY_COMBO
  CONTROL   "Encrypt file &names", IDC_COMPRESS_CHECK_ENCRYPT_FILE_NAMES, MY_CHECKBOX, m + 52, 130, 100, 10
  
  OK_CANCEL
END

#endif

STRINGTABLE
BEGIN
    IDS_METHOD_STORE        "Store"
    IDS_METHOD_NORMAL       "Normal"
    IDS_METHOD_MAXIMUM      "Maximum"
    IDS_METHOD_FAST         "Fast"
    IDS_METHOD_FASTEST      "Fastest"
    IDS_METHOD_ULTRA        "Ultra"

    IDS_COMPRESS_NON_SOLID "Non-solid"
    IDS_COMPRESS_SOLID "Solid"

    IDS_COMPRESS_UPDATE_MODE_ADD "Add and replace files"
    IDS_COMPRESS_UPDATE_MODE_UPDATE "Update and add files"
    IDS_COMPRESS_UPDATE_MODE_FRESH "Freshen existing files"
    IDS_COMPRESS_UPDATE_MODE_SYNCHRONIZE "Synchronize files"
    IDS_COMPRESS_SET_ARCHIVE_DIALOG_TITLE "Browse"
    IDS_COMPRESS_SPLIT_CONFIRM_MESSAGE "Specified volume size: {0} bytes.\nAre you sure you want to split archive into such volumes?"

    IDS_OPEN_TYPE_ALL_FILES "All Files"

    IDS_PASSWORD_USE_ASCII  "Use only English letters, numbers and special characters (!, #, $, ...) for password."
    IDS_PASSWORD_PASSWORDS_DO_NOT_MATCH  "Passwords do not match"
    IDS_PASSWORD_IS_TOO_LONG "Password is too long"
END
