git-svn-id: https://192.168.0.254/svn/Componentes.Terceros.DevExpressVCL@7 05c56307-c608-d34a-929d-697000501d7a
129 lines
4.8 KiB
C++
129 lines
4.8 KiB
C++
//---------------------------------------------------------------------------
|
|
|
|
#include <vcl.h>
|
|
#include "shellapi.hpp"
|
|
#pragma hdrstop
|
|
|
|
#include "SummaryGroupDemoMain.h"
|
|
#include "SummaryGroupDemoData.h"
|
|
#include "AboutDemoForm.h"
|
|
//---------------------------------------------------------------------------
|
|
#pragma package(smart_init)
|
|
#pragma link "cxClasses"
|
|
#pragma link "cxControls"
|
|
#pragma link "cxCustomData"
|
|
#pragma link "cxData"
|
|
#pragma link "cxDBData"
|
|
#pragma link "cxEdit"
|
|
#pragma link "cxFilter"
|
|
#pragma link "cxGraphics"
|
|
#pragma link "cxGrid"
|
|
#pragma link "cxGridCustomTableView"
|
|
#pragma link "cxGridCustomView"
|
|
#pragma link "cxGridDBTableView"
|
|
#pragma link "cxGridLevel"
|
|
#pragma link "cxGridTableView"
|
|
#pragma link "cxStyles"
|
|
#pragma link "cxGridCustomPopupMenu"
|
|
#pragma link "cxGridPopupMenu"
|
|
#pragma link "cxLookAndFeels"
|
|
#pragma resource "*.dfm"
|
|
TSummaryGroupDemoMainForm *SummaryGroupDemoMainForm;
|
|
//---------------------------------------------------------------------------
|
|
__fastcall TSummaryGroupDemoMainForm::TSummaryGroupDemoMainForm(TComponent* Owner)
|
|
: TForm(Owner)
|
|
{
|
|
}
|
|
//---------------------------------------------------------------------------
|
|
|
|
void __fastcall TSummaryGroupDemoMainForm::miAboutClick(TObject *Sender)
|
|
{
|
|
ShowAboutDemoForm();
|
|
}
|
|
//---------------------------------------------------------------------------
|
|
|
|
void __fastcall TSummaryGroupDemoMainForm::miExitClick(TObject *Sender)
|
|
{
|
|
Close();
|
|
}
|
|
//---------------------------------------------------------------------------
|
|
|
|
void __fastcall TSummaryGroupDemoMainForm::FormShow(TObject *Sender)
|
|
{
|
|
if(SummaryGroupDemoDataDM->tblOrders->Active) {
|
|
tvOrders->DataController->Groups->FullExpand();
|
|
tvOrders->Controller->GoToFirst();
|
|
}
|
|
}
|
|
//---------------------------------------------------------------------------
|
|
|
|
void __fastcall TSummaryGroupDemoMainForm::miSelectedRedcordsOnlyClick(
|
|
TObject *Sender)
|
|
{
|
|
TcxDataSummary* ASummary = Grid->FocusedView->DataController->Summary;
|
|
if(ASummary->Options.Contains(soSelectedRecords))
|
|
ASummary->Options = ASummary->Options>>soSelectedRecords;
|
|
else
|
|
ASummary->Options = ASummary->Options<<soSelectedRecords;
|
|
((TMenuItem*)Sender)->Checked = !((TMenuItem*)Sender)->Checked;
|
|
}
|
|
//---------------------------------------------------------------------------
|
|
|
|
void __fastcall TSummaryGroupDemoMainForm::miIgnoreNullValuesClick(
|
|
TObject *Sender)
|
|
{
|
|
TcxDataSummary* ASummary = Grid->FocusedView->DataController->Summary;
|
|
if(ASummary->Options.Contains(soNullIgnore))
|
|
ASummary->Options = ASummary->Options>>soNullIgnore;
|
|
else
|
|
ASummary->Options = ASummary->Options<<soNullIgnore;
|
|
((TMenuItem*)Sender)->Checked = !((TMenuItem*)Sender)->Checked;
|
|
}
|
|
//---------------------------------------------------------------------------
|
|
|
|
void __fastcall TSummaryGroupDemoMainForm::miMultiSelectClick(
|
|
TObject *Sender)
|
|
{
|
|
TcxGridDBTableView* AView = (TcxGridDBTableView*)Grid->FocusedView;
|
|
AView->OptionsSelection->MultiSelect = !AView->OptionsSelection->MultiSelect;
|
|
((TMenuItem*)Sender)->Checked = !((TMenuItem*)Sender)->Checked;
|
|
}
|
|
//---------------------------------------------------------------------------
|
|
|
|
void __fastcall TSummaryGroupDemoMainForm::GridFocusedViewChanged(
|
|
TcxCustomGrid *Sender, TcxCustomGridView *APrevFocusedView,
|
|
TcxCustomGridView *AFocusedView)
|
|
{
|
|
TcxGridDBTableView* AView = (TcxGridDBTableView*)Grid->FocusedView;
|
|
miSelectedRedcordsOnly->Checked = AView->DataController->Summary->Options.Contains(soSelectedRecords);
|
|
miIgnoreNullValues->Checked = AView->DataController->Summary->Options.Contains(soNullIgnore);
|
|
miMultiSelect->Checked = AView->OptionsSelection->MultiSelect;
|
|
miGroupFooterAlwaysShow->Checked = AView->OptionsView->GroupFooters == gfAlwaysVisible;
|
|
miGroupFooterNeverToShow->Checked = AView->OptionsView->GroupFooters == gfInvisible;
|
|
miGroupFooterShowWhenExpand->Checked = AView->OptionsView->GroupFooters == gfVisibleWhenExpanded;
|
|
|
|
}
|
|
//---------------------------------------------------------------------------
|
|
|
|
void __fastcall TSummaryGroupDemoMainForm::miGroupFooterClick(
|
|
TObject *Sender)
|
|
{
|
|
TcxGridDBTableView* AView = (TcxGridDBTableView*)Grid->FocusedView;
|
|
AView->OptionsView->GroupFooters =
|
|
(TcxGridGroupFootersMode)((TMenuItem*)Sender)->Tag;
|
|
((TMenuItem*)Sender)->Checked = true;
|
|
}
|
|
//---------------------------------------------------------------------------
|
|
|
|
void __fastcall TSummaryGroupDemoMainForm::tvOrdersStylesGetGroupStyle(
|
|
TcxGridTableView *Sender, TcxCustomGridRecord *ARecord, int ALevel,
|
|
TcxStyle *&AStyle)
|
|
{
|
|
if(ALevel % 2 == 0)
|
|
AStyle = SummaryGroupDemoDataDM->stGreyLight;
|
|
else
|
|
AStyle = SummaryGroupDemoDataDM->stBlueSky;
|
|
}
|
|
//---------------------------------------------------------------------------
|
|
|