Componentes.Terceros.DevExp.../official/x.36/ExpressVerticalGrid/Demos/CBuilder/Common/DemoBasicMain.cpp

130 lines
4.3 KiB
C++
Raw Normal View History

//---------------------------------------------------------------------------
#include <vcl.h>
#pragma hdrstop
#include "DemoBasicMain.h"
#include "DemoRating.h"
#include "DemoBasicAbout.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma link "cxLookAndFeels"
#pragma resource "*.dfm"
TDemoBasicMainForm *DemoBasicMainForm;
//---------------------------------------------------------------------------
__fastcall TDemoBasicMainForm::TDemoBasicMainForm(TComponent* Owner)
: TForm(Owner)
{
Application->HelpFile = "..\\..\\Help\\cxVertGrid.hlp";
}
//---------------------------------------------------------------------------
void __fastcall TDemoBasicMainForm::actProductsExecute(TObject *Sender)
{
OpenWebPage("http://www.devexpress.com/products/index.asp");
}
//---------------------------------------------------------------------------
void __fastcall TDemoBasicMainForm::actDownloadsExecute(TObject *Sender)
{
OpenWebPage("http://www.devexpress.com/downloads/index.asp");
}
//---------------------------------------------------------------------------
void __fastcall TDemoBasicMainForm::actForumExecute(TObject *Sender)
{
OpenWebPage("http://24.234.251.34/dxforum/dxforumisapi.dll/");
}
//---------------------------------------------------------------------------
void __fastcall TDemoBasicMainForm::actDXOnTheWebExecute(TObject *Sender)
{
OpenWebPage("http://www.devexpress.com/index.shtm");
}
//---------------------------------------------------------------------------
void __fastcall TDemoBasicMainForm::actExitExecute(TObject *Sender)
{
Close();
}
//---------------------------------------------------------------------------
void __fastcall TDemoBasicMainForm::actShowDemoDescriptionExecute(TObject *Sender)
{
lbDescrip->Visible = !lbDescrip->Visible;
((TCustomAction*)Sender)->Checked = !((TCustomAction*)Sender)->Checked;
}
//---------------------------------------------------------------------------
void __fastcall TDemoBasicMainForm::actHelpExecute(TObject *Sender)
{
Application->HelpCommand(HELP_FINDER, 0);
}
//---------------------------------------------------------------------------
void __fastcall TDemoBasicMainForm::actRateDemoExecute(TObject *Sender)
{
TDemoRatingForm *AForm = new TDemoRatingForm(this);
try{
AForm->ShowModal();
}
__finally{
delete AForm;
}
}
//---------------------------------------------------------------------------
void __fastcall TDemoBasicMainForm::actAboutExecute(TObject *Sender)
{
ShowAbout(true, false);
}
//---------------------------------------------------------------------------
void __fastcall TDemoBasicMainForm::actMyDevExpressExecute(TObject *Sender)
{
OpenWebPage("http://www->mydevexpress->com");
}
//---------------------------------------------------------------------------
void __fastcall TDemoBasicMainForm::LookAndFeelChange(TObject *Sender)
{
if (((TMenuItem*)Sender)->Tag > 3){
cxLookAndFeelController->NativeStyle =
!cxLookAndFeelController->NativeStyle;
((TMenuItem*)Sender)->Checked = cxLookAndFeelController->NativeStyle;
}
else{
((TMenuItem*)Sender)->Checked = true;
cxLookAndFeelController->Kind = (TcxLookAndFeelKind)((TMenuItem*)Sender)->Tag;
cxLookAndFeelController->NativeStyle = false;
miNativeStyle->Checked = false;
}
}
//---------------------------------------------------------------------------
void __fastcall TDemoBasicMainForm::AdjustAboutText(TStrings *AAboutText)
{
AAboutText->Assign(memAboutText->Lines);
}
//---------------------------------------------------------------------------
void __fastcall TDemoBasicMainForm::ShowAbout(bool AModal, bool AOnTop)
{
if (DemoBasicAboutForm == NULL)
DemoBasicAboutForm = new TDemoBasicAboutForm(this);
AdjustAboutText(DemoBasicAboutForm->reDemoInfo->Lines);
DemoBasicAboutForm->lbDemoName->Caption =
ChangeFileExt(ExtractFileName(Application->ExeName),"");
if (AOnTop)
DemoBasicAboutForm->FormStyle = fsStayOnTop;
else
DemoBasicAboutForm->FormStyle = fsNormal;
if (AModal)
DemoBasicAboutForm->ShowModal();
else
DemoBasicAboutForm->Show();
}
//---------------------------------------------------------------------------