#pragma once

#include "../Common/Resource.h"


// SSZN grabber parameters dialog
class SSZNParamDialog : public CDialog
{
public:
  SSZNParamDialog(std::string cc, float pDist) :CDialog(IDD_SSZN_PARAMETERS),
    camera_config(cc), profiles_distance(pDist)
  {}

protected:
  DECLARE_MESSAGE_MAP()

  virtual void DoDataExchange(CDataExchange* pDX)
  {
    CDialog::DoDataExchange(pDX);
    DDX_Control(pDX, IDC_SSZN_FOLDER, camera_config_ctrl);
    DDX_Control(pDX, IDC_SSZN_PROFILES_DISTANCE, profiles_distance_ctrl);
  }

  virtual BOOL OnInitDialog()
  {
    CDialog::OnInitDialog();

    camera_config_ctrl.SetWindowText(CString(camera_config.c_str()));
    camera_config_ctrl.EnableFileBrowseButton(TEXT("ssp"), TEXT("ssp Files|*.ssp||"));

    profiles_distance_ctrl.SetWindowText(std::to_wstring(profiles_distance).c_str());

    return TRUE;
  }

  void OnOK()
  {
    CString str = _T("");
    camera_config_ctrl.GetWindowTextW(str);
    camera_config = CT2A(str.GetString());

    profiles_distance_ctrl.GetWindowTextW(str);
    profiles_distance = (float)_wtof(str);

    CDialog::EndDialog(1);
  }

  // edit controls
  CMFCEditBrowseCtrl camera_config_ctrl;
  CEdit profiles_distance_ctrl;

public:
  std::string camera_config;
  float profiles_distance;
};

BEGIN_MESSAGE_MAP(SSZNParamDialog, CDialog)
END_MESSAGE_MAP()

