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

#include <vcl.h>
#include "AppGlobalF.h"
#include "ITSSkinF.h"
#include "ITSUtilF.h"
#include "FrmVmsOprMainF.h"
#include "ITSLangTransF.h"
#pragma hdrstop

#include "VMS0300MF.h"
#include "VMSVIEWMF.h"

//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma link "cxContainer"
#pragma link "cxControls"
#pragma link "cxEdit"
#pragma link "cxGraphics"
#pragma link "cxGroupBox"
#pragma link "cxLabel"
#pragma link "cxLookAndFeelPainters"
#pragma link "cxLookAndFeels"
#pragma link "cxPC"
#pragma link "cxPCdxBarPopupMenu"
#pragma link "cxSplitter"
#pragma link "dxSkinBlack"
#pragma link "dxSkinBlue"
#pragma link "dxSkinCaramel"
#pragma link "dxSkinCoffee"
#pragma link "dxSkinDarkRoom"
#pragma link "dxSkinDarkSide"
#pragma link "dxSkinFoggy"
#pragma link "dxSkinGlassOceans"
#pragma link "dxSkiniMaginary"
#pragma link "dxSkinLilian"
#pragma link "dxSkinLiquidSky"
#pragma link "dxSkinLondonLiquidSky"
#pragma link "dxSkinMcSkin"
#pragma link "dxSkinMoneyTwins"
#pragma link "dxSkinOffice2007Black"
#pragma link "dxSkinOffice2007Blue"
#pragma link "dxSkinOffice2007Green"
#pragma link "dxSkinOffice2007Pink"
#pragma link "dxSkinOffice2007Silver"
#pragma link "dxSkinOffice2010Black"
#pragma link "dxSkinOffice2010Blue"
#pragma link "dxSkinOffice2010Silver"
#pragma link "dxSkinsCore"
#pragma link "dxSkinscxPCPainter"
#pragma link "dxSkinSeven"
#pragma link "dxSkinSharp"
#pragma link "dxSkinSilver"
#pragma link "dxSkinStardust"
#pragma link "cxClasses"
#pragma link "cxCustomData"
#pragma link "cxData"
#pragma link "cxDataStorage"
#pragma link "cxFilter"
#pragma link "cxGrid"
#pragma link "cxGridCustomTableView"
#pragma link "cxGridCustomView"
#pragma link "cxGridLevel"
#pragma link "cxGridTableView"
#pragma link "cxStyles"
#pragma link "cxTextEdit"
#pragma link "cxGridCardView"
#pragma link "cxGridCustomLayoutView"
#pragma link "cxCheckBox"
#pragma link "cxDropDownEdit"
#pragma link "cxImage"
#pragma link "cxButtons"
#pragma link "cxGridBandedTableView"
#pragma link "cxCalc"
#pragma link "FRAME_VmsStateF"
#pragma resource "*.dfm"
TVMS0300M *VMS0300M = NULL;

//---------------------------------------------------------------------------
__fastcall TVMS0300M::TVMS0300M(TComponent* Owner)
    : TForm(Owner)
{
    LangTrans->Translate(this, ITSDb_GetConnection());
    ITSSkin_Load(this);
    LoadLocalSkin();

    FRAMEVmsStateList1->PnlTop->Visible    = false;
    FRAMEVmsStateList1->PnlBottom->Visible = false;
    FRAMEVmsStateList1->ColumnSel->Visible = false;

    //if (FormStyle != fsMDIChild)    CMM_LoadForm(g_sFormsDir, this);
    PgFormTab->HideTabs = true;
}
//---------------------------------------------------------------------------

void __fastcall TVMS0300M::CommClose()
{
    try
    {
        //if (FormStyle != fsMDIChild)        CMM_SaveForm(g_sFormsDir, this);
    }
    catch(...)
    {
    }
}
//---------------------------------------------------------------------------

void __fastcall TVMS0300M::InitVmsStatus()
{
    FRAMEVmsStateList1->UpdateList();
}
//---------------------------------------------------------------------------

void __fastcall TVMS0300M::FormShow(TObject *Sender)
{
#if 0
ShowMessage(String(sizeof(INT_VMS_SAVE_REQ)));
ShowMessage(String(sizeof(INT_VMS_STATE)));
#endif
//ShowMessage(String(sizeof(short int)));
//ShowMessage(String(sizeof(short)));
    Refresh();
    InitVmsStatus();
    TmrShow->Enabled = true;
}
//---------------------------------------------------------------------------

void __fastcall TVMS0300M::FormActivate(TObject *Sender)
{
    ActivateForm(true);
}
//---------------------------------------------------------------------------

void __fastcall TVMS0300M::FormDeactivate(TObject *Sender)
{
    ActivateForm(false);
}
//---------------------------------------------------------------------------

void __fastcall TVMS0300M::LoadLocalSkin()
{
}
//---------------------------------------------------------------------------

void __fastcall TVMS0300M::TmrShowTimer(TObject *Sender)
{
    TmrShow->Enabled = false;
}
//---------------------------------------------------------------------------

void __fastcall TVMS0300M::FormClose(TObject *Sender, TCloseAction &Action)
{
    try {
        CommClose();

        VMS0300M = NULL;
        Action = caFree;
    } catch(...) {}
}
//---------------------------------------------------------------------------

void __fastcall TVMS0300M::OnMainFormMessage(TMessage &Msg)
{
}
//---------------------------------------------------------------------------

void __fastcall TVMS0300M::OnVmsStateRefreshMessage(TMessage &Msg)
{
    FRAMEVmsStateList1->RefreshStatus();
}
//---------------------------------------------------------------------------

void __fastcall TVMS0300M::OnVmsFormRefreshMessage(TMessage &Msg)
{
}
//---------------------------------------------------------------------------

void __fastcall TVMS0300M::ActivateForm(bool AActivate)
{
    if (AActivate) FRAMEVmsStateList1->RefreshStatus();
}
//---------------------------------------------------------------------------

