#pragma once

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


// IDS Ensenso grabber parameters dialog
class IDSEnsensoParamDialog : public CDialog
{
public:
  IDSEnsensoParamDialog(std::string cc) :
    CDialog(IDD_IDS_PARAMETERS), camera_config(cc)
  {}

protected:
  DECLARE_MESSAGE_MAP()

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

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

    camera_config_ctrl.SetWindowText(CString(camera_config.c_str()));

    camera_config_ctrl.EnableFileBrowseButton(TEXT("json"), TEXT("Json Files|*.json||"));

    return TRUE;
  }

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

    CDialog::EndDialog(1);
  }

  // edit controls
  CMFCEditBrowseCtrl camera_config_ctrl;

public:
  std::string camera_config;
};

BEGIN_MESSAGE_MAP(IDSEnsensoParamDialog, CDialog)
END_MESSAGE_MAP()

