git-svn-id: https://192.168.0.254/svn/Componentes.Terceros.DevExpressVCL@8 05c56307-c608-d34a-929d-697000501d7a
50 lines
1.6 KiB
C++
50 lines
1.6 KiB
C++
//---------------------------------------------------------------------------
|
|
|
|
#include <vcl.h>
|
|
#pragma hdrstop
|
|
|
|
#include "SampleDockingListBox.h"
|
|
//---------------------------------------------------------------------------
|
|
#pragma package(smart_init)
|
|
#pragma resource "*.dfm"
|
|
TSampleDockingListBoxFrame *SampleDockingListBoxFrame;
|
|
//---------------------------------------------------------------------------
|
|
__fastcall TSampleDockingListBoxFrame::TSampleDockingListBoxFrame(TComponent* Owner)
|
|
: TForm(Owner)
|
|
{
|
|
}
|
|
//---------------------------------------------------------------------------
|
|
void __fastcall TSampleDockingListBoxFrame::actAddExecute(TObject *Sender)
|
|
{
|
|
ListBox->Items->Add(Edit->Text);
|
|
}
|
|
//---------------------------------------------------------------------------
|
|
|
|
void __fastcall TSampleDockingListBoxFrame::actDeleteExecute(
|
|
TObject *Sender)
|
|
{
|
|
ListBox->Items->Delete(ListBox->ItemIndex);
|
|
}
|
|
//---------------------------------------------------------------------------
|
|
|
|
void __fastcall TSampleDockingListBoxFrame::actClearExecute(
|
|
TObject *Sender)
|
|
{
|
|
ListBox->Items->Clear();
|
|
}
|
|
//---------------------------------------------------------------------------
|
|
|
|
void __fastcall TSampleDockingListBoxFrame::actAddUpdate(TObject *Sender)
|
|
{
|
|
((TCustomAction*)Sender)->Enabled = Edit->Text != "";
|
|
}
|
|
//---------------------------------------------------------------------------
|
|
|
|
void __fastcall TSampleDockingListBoxFrame::actDeleteUpdate(
|
|
TObject *Sender)
|
|
{
|
|
((TCustomAction*)Sender)->Enabled = ListBox->ItemIndex != -1;
|
|
}
|
|
//---------------------------------------------------------------------------
|
|
|