#ifndef __SC2201_H
#define __SC2201_H

#ifndef __SCSELECT_H
#include "scselect.h"
#endif

class TSelection_ext_mask : public TSelection_mask
{
  TRelation*     _pcon_rel;
  TCursor* _pcon_cur_k1;
  TCursor* _pcon_cur_k2;
 
  TCursor_sheet* _pcon_sh_k1;
  TCursor_sheet* _pcon_sh_k2;
  
protected:  
  void select_pcon_range(int grf, int cof,long sof,int grt,int cot, long sot);
  void select_pcon_range(TString& desfr, TString& desto);
  void set_pcon_limits();

  virtual void reset_sheets();
  static bool bfrompcon_handler(TMask_field& f, KEY k);
  static bool btopcon_handler(TMask_field& f, KEY k);
  static bool ffrompcon_handler(TMask_field& f, KEY k);
  static bool ftopcon_handler(TMask_field& f, KEY k);
  static bool bresetpcon_handler(TMask_field& f, KEY k);
  static bool bselectpcon_handler(TMask_field& f, KEY k);
  static bool rpcon_handler(TMask_field& f, KEY k);
  static bool rsortpcon_handler(TMask_field& f, KEY k);

public:
  virtual TCursor_sheet& cur_sheet();     

  TSelection_ext_mask(const char* name); 
  virtual ~TSelection_ext_mask();
};

#endif
