www.pudn.com > CommSettings.rar > UnitAbout.cpp


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

#include <vcl.h>
#pragma hdrstop

#include "UnitAbout.h"
#include "yb_base.h"
//---------------------------------------------------------------------------
#pragma package(smart_init)
#pragma resource "*.dfm"
TFormAbout *FormAbout;
//---------------------------------------------------------------------------
__fastcall TFormAbout::TFormAbout(TComponent* Owner)
: TForm(Owner)
{
Font->Name = AppLang.FontName;
Font->Charset = AppLang.Charset;
Font->Size = AppLang.FontSize;

LabelCaption->Font->Name = AppLang.FontName;
LabelCaption->Font->Charset = AppLang.Charset;
LabelCaption->Font->Size = 12;

LabelHomepage->Font->Color = clBlue;
LabelHomepage->Font->Style = TFontStyles()<<fsUnderline;

LabelEmail->Font->Color = clBlue;
LabelEmail->Font->Style = TFontStyles()<<fsUnderline;

TMsgStrings Msgs;
Caption = Msgs.Str_About + Application->Title + Msgs.Str_DotDotDot;
LabelCaption ->Caption = Application->Title;
LabelVersion ->Caption = Msgs.Str_CRgtVersion ; //"版本: 1.00"
LabelCo ->Caption = Msgs.Str_CRgtCoName ; //"Copyright (c) Victor Chen"
LabelHomepage->Caption = Msgs.Str_CRgtHomePage; //"http://www.cppfans.com"
LabelHomepage->Hint = Msgs.Str_CRgtHomePage; //"http://www.cppfans.com"
LabelEmail ->Caption = Msgs.Str_CRgtAuEmail ; //"victor@cppfans.com"
LabelEmail ->Hint = Msgs.Str_CRgtAuMailTo; //"mailto:victor@cppfans.com"
LabelPmtUser ->Caption = Msgs.Str_User ; //"用户"
LabelPmtOrgn ->Caption = Msgs.Str_Orgn ; //"单位"
BnOK ->Caption = Msgs.Str_OK ; //"确定"

TSysInfo sinf;
LabelOSVer->Caption = AnsiString().sprintf(">s >d.>02d.>04d >s", sinf.OS->OSName, sinf.OS->MajorVer, sinf.OS->MinorVer, sinf.OS->BuildNum, sinf.OS->OtherInfo);
LabelUser->Caption = sinf.OS->RegUser;
LabelUserOrg->Caption = sinf.OS->RegOrg;
}
//---------------------------------------------------------------------------
void __fastcall TFormAbout::LabelHomepageClick(TObject *Sender)
{
ShellExecute(Application->Handle, "open", TMsgStrings().Str_CRgtHomePage.c_str(), NULL, "", SW_SHOWNORMAL);
}
//---------------------------------------------------------------------------
void __fastcall TFormAbout::LabelEmailClick(TObject *Sender)
{
ShellExecute(Application->Handle, "open", TMsgStrings().Str_CRgtAuMailTo.c_str(), NULL, "", SW_SHOWNORMAL);
}
//---------------------------------------------------------------------------
void __fastcall TFormAbout::BnOKClick(TObject *Sender)
{
ModalResult = IDOK;
}
//---------------------------------------------------------------------------
__fastcall TFormAbout::TMsgStrings::TMsgStrings()
{
switch(AppLang.LangType)
{
case TAppLang::ltGbk:
_Msg = _Msg_Chs;
break;

case TAppLang::ltBig5:
_Msg = _Msg_Cht;
break;

default:
_Msg = _Msg_Enu;
break;
}
}
//---------------------------------------------------------------------------

AnsiString __fastcall TFormAbout::TMsgStrings::fGetMsg(int mt)
{
return AppLang.FromGBK(_Msg[mt]);
}
//---------------------------------------------------------------------------

char *TFormAbout::TMsgStrings::_Msg_Chs[] =
{
"关于" , // 0 Str_About
"……" , // 1 Str_DotDotDot
"用户:" , // 2 Str_User
"单位:" , // 3 Str_Orgn
"版本: 1.3.3.3" , // 4 Str_CRgtVersion
"Copyright (C) Victor Chen", // 5 Str_CRgtCoName
"http://www.cppfans.com" , // 6 Str_CRgtHomePage
"victor@cppfans.com" , // 7 Str_CRgtAuEmail
"mailto:victor@cppfans.com", // 8 Str_CRgtAuMailTo
"确定" , // 9 Str_OK
"设置(&amt;S)..." , //10 Str_Settings
"关于(&amt;A)..." , //11 Str_MenuAbout
};
//---------------------------------------------------------------------------

char *TFormAbout::TMsgStrings::_Msg_Cht[] =
{
"關於" , // 0 Str_About
"……" , // 1 Str_DotDotDot
"用戶:" , // 2 Str_User
"單位:" , // 3 Str_Orgn
"版本: 1.3.3.3" , // 4 Str_CRgtVersion
"Copyright (C) Victor Chen", // 5 Str_CRgtCoName
"http://www.cppfans.com" , // 6 Str_CRgtHomePage
"victor@cppfans.com" , // 7 Str_CRgtAuEmail
"mailto:victor@cppfans.com", // 8 Str_CRgtAuMailTo
"確定" , // 9 Str_OK
"設置(&amt;S)..." , //10 Str_Settings
"關於(&amt;A)..." , //11 Str_MenuAbout
};
//---------------------------------------------------------------------------

char *TFormAbout::TMsgStrings::_Msg_Enu[] =
{
"About " , //0 Str_About
"..." , //1 Str_DotDotDot
"User:" , //2 Str_User
"Orgn:" , //3 Str_Orgn
"Version: 1.3.3.3" , //4 Str_CRgtVersion
"Copyright (C) Victor Chen", //5 Str_CRgtCoName
"http://www.cppfans.com" , //6 Str_CRgtHomePage
"victor@cppfans.com" , //7 Str_CRgtAuEmail
"mailto:victor@cppfans.com", //8 Str_CRgtAuMailTo
"OK" , //9 Str_OK
"&amt;Settings..." , //10 Str_Settings
"&amt;About..." , //11 Str_MenuAbout
};
//---------------------------------------------------------------------------