// my comment
// generated by Fast Light User Interface Designer (fluid) version 1.0108

#include "../br_core/i18n.hpp"
#include "DisplcmFinder_UI.h"
#include "../br_core/Run_DisplcmFinder.hpp"
static br::Br2HdrManager & theBr2Hdr = br::Br2Hdr::Instance(); 

void DisplcmFinder_UI::cb_input_M_start__i(Fl_Int_Input*, void*) {
  putValuesToParams();
}
void DisplcmFinder_UI::cb_input_M_start_(Fl_Int_Input* o, void* v) {
  ((DisplcmFinder_UI*)(o->parent()->parent()->parent()->parent()->user_data()))->cb_input_M_start__i(o,v);
}

void DisplcmFinder_UI::cb_input_N_start__i(Fl_Int_Input*, void*) {
  putValuesToParams();
}
void DisplcmFinder_UI::cb_input_N_start_(Fl_Int_Input* o, void* v) {
  ((DisplcmFinder_UI*)(o->parent()->parent()->parent()->parent()->user_data()))->cb_input_N_start__i(o,v);
}

void DisplcmFinder_UI::cb_input_max_num__i(Fl_Int_Input*, void*) {
  putValuesToParams();
}
void DisplcmFinder_UI::cb_input_max_num_(Fl_Int_Input* o, void* v) {
  ((DisplcmFinder_UI*)(o->parent()->parent()->parent()->parent()->user_data()))->cb_input_max_num__i(o,v);
}

void DisplcmFinder_UI::cb_input_subtr__i(Fl_Int_Input*, void*) {
  putValuesToParams();
}
void DisplcmFinder_UI::cb_input_subtr_(Fl_Int_Input* o, void* v) {
  ((DisplcmFinder_UI*)(o->parent()->parent()->parent()->parent()->user_data()))->cb_input_subtr__i(o,v);
}

void DisplcmFinder_UI::cb_input_add__i(Fl_Int_Input*, void*) {
  putValuesToParams();
}
void DisplcmFinder_UI::cb_input_add_(Fl_Int_Input* o, void* v) {
  ((DisplcmFinder_UI*)(o->parent()->parent()->parent()->parent()->user_data()))->cb_input_add__i(o,v);
}

void DisplcmFinder_UI::cb_input_min_rho__i(Fl_Float_Input*, void*) {
  putValuesToParams();
}
void DisplcmFinder_UI::cb_input_min_rho_(Fl_Float_Input* o, void* v) {
  ((DisplcmFinder_UI*)(o->parent()->parent()->parent()->parent()->user_data()))->cb_input_min_rho__i(o,v);
}

void DisplcmFinder_UI::cb_bttn_default__i(Fl_Button*, void*) {
  default_values();
}
void DisplcmFinder_UI::cb_bttn_default_(Fl_Button* o, void* v) {
  ((DisplcmFinder_UI*)(o->parent()->parent()->parent()->user_data()))->cb_bttn_default__i(o,v);
}

void DisplcmFinder_UI::cb_choice_verbose__i(Fl_Choice*, void*) {
  putValuesToParams();
}
void DisplcmFinder_UI::cb_choice_verbose_(Fl_Choice* o, void* v) {
  ((DisplcmFinder_UI*)(o->parent()->parent()->parent()->user_data()))->cb_choice_verbose__i(o,v);
}

Fl_Menu_Item DisplcmFinder_UI::menu_choice_verbose_[] = {
 {_("0"), 0,  0, 0, 0, FL_NORMAL_LABEL, 0, 14, 0},
 {_("1"), 0,  0, 0, 0, FL_NORMAL_LABEL, 0, 14, 0},
 {_("2"), 0,  0, 0, 0, FL_NORMAL_LABEL, 0, 14, 0},
 {0,0,0,0,0,0,0,0,0}
};

void DisplcmFinder_UI::cb_choice_imgA__i(ImageNumberChoice* o, void*) {
  o->last_set_value(o->value());
}
void DisplcmFinder_UI::cb_choice_imgA_(ImageNumberChoice* o, void* v) {
  ((DisplcmFinder_UI*)(o->parent()->parent()->parent()->user_data()))->cb_choice_imgA__i(o,v);
}

void DisplcmFinder_UI::cb_choice_imgB__i(ImageNumberChoice* o, void*) {
  o->last_set_value(o->value());
}
void DisplcmFinder_UI::cb_choice_imgB_(ImageNumberChoice* o, void* v) {
  ((DisplcmFinder_UI*)(o->parent()->parent()->parent()->user_data()))->cb_choice_imgB__i(o,v);
}

void DisplcmFinder_UI::cb_Single_i(Fl_Button*, void*) {
  run_single();
}
void DisplcmFinder_UI::cb_Single(Fl_Button* o, void* v) {
  ((DisplcmFinder_UI*)(o->parent()->parent()->parent()->user_data()))->cb_Single_i(o,v);
}

void DisplcmFinder_UI::cb_Run_i(Fl_Button*, void*) {
  Run_DisplcmFinder::run_for_all_actives();
}
void DisplcmFinder_UI::cb_Run(Fl_Button* o, void* v) {
  ((DisplcmFinder_UI*)(o->parent()->user_data()))->cb_Run_i(o,v);
}

void DisplcmFinder_UI::cb_Single1_i(Fl_Button*, void*) {
  run_single();
}
void DisplcmFinder_UI::cb_Single1(Fl_Button* o, void* v) {
  ((DisplcmFinder_UI*)(o->parent()->user_data()))->cb_Single1_i(o,v);
}

DisplcmFinder_UI::DisplcmFinder_UI() {
  { window_ = new Fl_Double_Window(455, 335, _("Offset Computation (Br2HDR)"));
    window_->user_data((void*)(this));
    { Fl_Tabs* o = new Fl_Tabs(0, 0, 455, 290);
      o->selection_color(FL_BACKGROUND2_COLOR);
      { Fl_Group* o = new Fl_Group(0, 25, 445, 260, _("Parameters"));
        { grp_input_ = new Fl_Group(10, 40, 405, 195);
          { input_M_start_ = new Fl_Int_Input(15, 50, 35, 20, _("Start size M of the Search areas (M x M)"));
            input_M_start_->box(FL_DOWN_BOX);
            input_M_start_->color(FL_BACKGROUND2_COLOR);
            input_M_start_->selection_color(FL_SELECTION_COLOR);
            input_M_start_->labeltype(FL_NORMAL_LABEL);
            input_M_start_->labelfont(0);
            input_M_start_->labelsize(14);
            input_M_start_->labelcolor(FL_FOREGROUND_COLOR);
            input_M_start_->callback((Fl_Callback*)cb_input_M_start_);
            input_M_start_->align(FL_ALIGN_RIGHT);
            input_M_start_->when(FL_WHEN_CHANGED);
          } // Fl_Int_Input* input_M_start_
          { input_N_start_ = new Fl_Int_Input(15, 80, 35, 20, _("Start size N of the Correlation areas (N x N)"));
            input_N_start_->box(FL_DOWN_BOX);
            input_N_start_->color(FL_BACKGROUND2_COLOR);
            input_N_start_->selection_color(FL_SELECTION_COLOR);
            input_N_start_->labeltype(FL_NORMAL_LABEL);
            input_N_start_->labelfont(0);
            input_N_start_->labelsize(14);
            input_N_start_->labelcolor(FL_FOREGROUND_COLOR);
            input_N_start_->callback((Fl_Callback*)cb_input_N_start_);
            input_N_start_->align(FL_ALIGN_RIGHT);
            input_N_start_->when(FL_WHEN_CHANGED);
          } // Fl_Int_Input* input_N_start_
          { input_max_num_ = new Fl_Int_Input(15, 110, 35, 20, _("Maximum number of Search areas in each dimension"));
            input_max_num_->box(FL_DOWN_BOX);
            input_max_num_->color(FL_BACKGROUND2_COLOR);
            input_max_num_->selection_color(FL_SELECTION_COLOR);
            input_max_num_->labeltype(FL_NORMAL_LABEL);
            input_max_num_->labelfont(0);
            input_max_num_->labelsize(14);
            input_max_num_->labelcolor(FL_FOREGROUND_COLOR);
            input_max_num_->callback((Fl_Callback*)cb_input_max_num_);
            input_max_num_->align(FL_ALIGN_RIGHT);
            input_max_num_->when(FL_WHEN_CHANGED);
          } // Fl_Int_Input* input_max_num_
          { input_subtr_ = new Fl_Int_Input(15, 140, 35, 20, _("Size to subtract from Search areas after each cycle"));
            input_subtr_->box(FL_DOWN_BOX);
            input_subtr_->color(FL_BACKGROUND2_COLOR);
            input_subtr_->selection_color(FL_SELECTION_COLOR);
            input_subtr_->labeltype(FL_NORMAL_LABEL);
            input_subtr_->labelfont(0);
            input_subtr_->labelsize(14);
            input_subtr_->labelcolor(FL_FOREGROUND_COLOR);
            input_subtr_->callback((Fl_Callback*)cb_input_subtr_);
            input_subtr_->align(FL_ALIGN_RIGHT);
            input_subtr_->when(FL_WHEN_CHANGED);
          } // Fl_Int_Input* input_subtr_
          { input_add_ = new Fl_Int_Input(15, 170, 35, 20, _("Size to add to Correlation areas after each cycle"));
            input_add_->box(FL_DOWN_BOX);
            input_add_->color(FL_BACKGROUND2_COLOR);
            input_add_->selection_color(FL_SELECTION_COLOR);
            input_add_->labeltype(FL_NORMAL_LABEL);
            input_add_->labelfont(0);
            input_add_->labelsize(14);
            input_add_->labelcolor(FL_FOREGROUND_COLOR);
            input_add_->callback((Fl_Callback*)cb_input_add_);
            input_add_->align(FL_ALIGN_RIGHT);
            input_add_->when(FL_WHEN_CHANGED);
          } // Fl_Int_Input* input_add_
          { input_min_rho_ = new Fl_Float_Input(15, 200, 35, 25, _("Minimum accepted correlation coefficient [-1...+1]"));
            input_min_rho_->box(FL_DOWN_BOX);
            input_min_rho_->color(FL_BACKGROUND2_COLOR);
            input_min_rho_->selection_color(FL_SELECTION_COLOR);
            input_min_rho_->labeltype(FL_NORMAL_LABEL);
            input_min_rho_->labelfont(0);
            input_min_rho_->labelsize(14);
            input_min_rho_->labelcolor(FL_FOREGROUND_COLOR);
            input_min_rho_->callback((Fl_Callback*)cb_input_min_rho_);
            input_min_rho_->align(FL_ALIGN_RIGHT);
            input_min_rho_->when(FL_WHEN_CHANGED);
          } // Fl_Float_Input* input_min_rho_
          grp_input_->end();
        } // Fl_Group* grp_input_
        { bttn_default_ = new Fl_Button(295, 250, 130, 20, _("Default values"));
          bttn_default_->callback((Fl_Callback*)cb_bttn_default_);
        } // Fl_Button* bttn_default_
        { choice_verbose_ = new Fl_Choice(25, 250, 45, 20, _("verbose (console)"));
          choice_verbose_->down_box(FL_BORDER_BOX);
          choice_verbose_->callback((Fl_Callback*)cb_choice_verbose_);
          choice_verbose_->align(FL_ALIGN_RIGHT);
          choice_verbose_->menu(menu_choice_verbose_);
        } // Fl_Choice* choice_verbose_
        o->end();
      } // Fl_Group* o
      { Fl_Group* o = new Fl_Group(0, 25, 455, 255, _("Single Run"));
        o->hide();
        { choice_imgA_ = new ImageNumberChoice(165, 180, 50, 20, _("Image A"));
          choice_imgA_->box(FL_FLAT_BOX);
          choice_imgA_->down_box(FL_BORDER_BOX);
          choice_imgA_->color(FL_BACKGROUND2_COLOR);
          choice_imgA_->selection_color(FL_SELECTION_COLOR);
          choice_imgA_->labeltype(FL_NORMAL_LABEL);
          choice_imgA_->labelfont(0);
          choice_imgA_->labelsize(14);
          choice_imgA_->labelcolor(FL_FOREGROUND_COLOR);
          choice_imgA_->callback((Fl_Callback*)cb_choice_imgA_);
          choice_imgA_->align(FL_ALIGN_LEFT);
          choice_imgA_->when(FL_WHEN_RELEASE);
        } // ImageNumberChoice* choice_imgA_
        { choice_imgB_ = new ImageNumberChoice(240, 180, 50, 20, _("Image B"));
          choice_imgB_->box(FL_FLAT_BOX);
          choice_imgB_->down_box(FL_BORDER_BOX);
          choice_imgB_->color(FL_BACKGROUND2_COLOR);
          choice_imgB_->selection_color(FL_SELECTION_COLOR);
          choice_imgB_->labeltype(FL_NORMAL_LABEL);
          choice_imgB_->labelfont(0);
          choice_imgB_->labelsize(14);
          choice_imgB_->labelcolor(FL_FOREGROUND_COLOR);
          choice_imgB_->callback((Fl_Callback*)cb_choice_imgB_);
          choice_imgB_->align(FL_ALIGN_RIGHT);
          choice_imgB_->when(FL_WHEN_RELEASE);
        } // ImageNumberChoice* choice_imgB_
        { Fl_Button* o = new Fl_Button(160, 215, 135, 25, _("Single Run"));
          o->callback((Fl_Callback*)cb_Single);
        } // Fl_Button* o
        o->end();
      } // Fl_Group* o
      //o->clear_visible_focus();
      o->end();
    } // Fl_Tabs* o
    { Fl_Button* o = new Fl_Button(45, 300, 180, 25, _("Run for all active images"));
      o->callback((Fl_Callback*)cb_Run);
    } // Fl_Button* o
    { Fl_Button* o = new Fl_Button(265, 300, 145, 25, _("Single Run"));
      o->callback((Fl_Callback*)cb_Single1);
    } // Fl_Button* o
    getValuesFromParams (DisplcmFinderCorrel_::init_params());
    window_->end();
  } // Fl_Double_Window* window_
}

Fl_Window* DisplcmFinder_UI::window() {
  return window_;
}
#include "../br_core/Run_DisplcmFinder.hpp"
#include "DisplcmFinder_UI_rest.cpp"
