// Nizhnyaya Navadvipa library - author Navadvipa Chandra das e-mail navadvipa.chandra.das@nizhnyaya-navadvipa.ru
#include <vcl.h>
#pragma hdrstop

#include "VCL_NNFlagBox.h"
#include "VCL_NNFmRes.h"
#pragma resource "*.res"
#pragma package(smart_init)
//---------------------------------------------------------------------------
// ValidCtrCheck is used to assure that the components created do not have
// any pure virtual functions.
//

static inline void ValidCtrCheck(TNNVFlagBox *)
{
        new TNNVFlagBox(NULL);
}
//---------------------------------------------------------------------------
__fastcall TNNVFlagBox::TNNVFlagBox(TComponent* Owner)
  : inherited(Owner), fcaFree( false )
  , fTreeInvertVisible( true )
  , fFieldNo( NULL )
  , fFieldName( NULL )
  , fShowInWindowList( false )
  , fEventOwner( NULL )
{
}
//---------------------------------------------------------------------------
namespace Vcl_nnflagbox
{
  void __fastcall PACKAGE Register()
  {
    TComponentClass classes[1] = {__classid(TNNVFlagBox)};
    RegisterComponents( L"VCL Nizhnyaya Navadvipa", classes, 0);
  }
}
//---------------------------------------------------------------------------

void __fastcall TNNVFlagBox::DoPrepare()
{
  TfmvRes *fm = dynamic_cast< TfmvRes* >( EventOwner );
  if ( fm ) fm->CloseOnDeactiv = false;

  if ( fOnPrepare ) fOnPrepare( this );
}

void __fastcall TNNVFlagBox::DoUnPrepare()
{
  TfmvRes *fm = dynamic_cast< TfmvRes* >( EventOwner );
  if ( fm ) fm->CloseOnDeactiv = true;

  if ( fOnUnPrepare ) fOnUnPrepare( this );
}

