//---------------------------------------------------------------------------

#include <vcl.h>
#include "ITSSkinF.h"
#include "ITSUtilF.h"
#include "ITSDbF.h"
#include "AppGlobalF.h"
#include "CDSCCamCtlrF.h"
#pragma hdrstop

#include "VDSM101MF.h"
#include "ITS_OPLibF.h"

//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma link "cxButtons"
#pragma link "cxContainer"
#pragma link "cxControls"
#pragma link "cxDropDownEdit"
#pragma link "cxEdit"
#pragma link "cxGraphics"
#pragma link "cxGroupBox"
#pragma link "cxLabel"
#pragma link "cxLookAndFeelPainters"
#pragma link "cxLookAndFeels"
#pragma link "cxMaskEdit"
#pragma link "cxSpinEdit"
#pragma link "cxTextEdit"
#pragma link "dxSkinBlue"
#pragma link "dxSkinsCore"
#pragma link "dxSkinBlack"
#pragma link "dxSkinMcSkin"
#pragma resource "*.dfm"

TVDSM101M *VDSM101M = NULL;
//---------------------------------------------------------------------------
__fastcall TVDSM101M::TVDSM101M(TComponent* Owner)
    : TForm(Owner)
{
    ITSSkin_Load(this);
    //CMM_LoadForm(g_sFormsDir, this);

    FUpdated = false;
}
//---------------------------------------------------------------------------

void __fastcall TVDSM101M::CommClose()
{
    try
    {
        //CMM_SaveForm(g_sFormsDir, this);
    }
    catch(...)
    {
    }
}
//---------------------------------------------------------------------------

void __fastcall TVDSM101M::FormShow(TObject *Sender)
{
    APP_FillCode(Cb_CMRA_DRCT_CD, "VDSC");

    CbCCAM->Properties->Items->Clear();
    CbCCAM->Properties->Items->Add("  ¾øÀ½  ");
    FOR_STL(TCCamCtlr*, pObj, CCamCtlrManager->FLists)
    {
        if (pObj->DEL_YN == "Y") continue;

        CbCCAM->Properties->Items->Add("[" + pObj->CCAM_CTLR_NMBR + "] " + pObj->CCAM_NM);
    }
    CbCCAM->ItemIndex = 0;

    Refresh();
}
//---------------------------------------------------------------------------

String __fastcall TVDSM101M::GetCCAM_NMBR()
{
    if (CbCCAM->ItemIndex == 0) return "";
    return APP_GetCode(CbCCAM);
}
//---------------------------------------------------------------------------

void __fastcall TVDSM101M::BtnCloseClick(TObject *Sender)
{
    FUpdated = false;
    Close();
}
//---------------------------------------------------------------------------

void __fastcall TVDSM101M::FormClose(TObject *Sender, TCloseAction &Action)
{
    CommClose();
    VDSM101M = NULL;
    //Action = caFree;
}
//---------------------------------------------------------------------------

void __fastcall TVDSM101M::BtnSaveClick(TObject *Sender)
{
    FUpdated = true;
    Close();
}
//---------------------------------------------------------------------------

