Initial commit
This commit is contained in:
@@ -0,0 +1,77 @@
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
#include <vcl.h>
|
||||
#pragma hdrstop
|
||||
|
||||
#include "AboutFormUnit.h"
|
||||
#include "GlobalUnit.h"
|
||||
//---------------------------------------------------------------------------
|
||||
#pragma package(smart_init)
|
||||
#pragma link "PNGButton"
|
||||
#pragma resource "*.dfm"
|
||||
TAboutForm *AboutForm;
|
||||
//---------------------------------------------------------------------------
|
||||
__fastcall TAboutForm::TAboutForm(TComponent* Owner)
|
||||
: TForm(Owner)
|
||||
{
|
||||
Font->Color = RGB(60,43,23);
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
void __fastcall TAboutForm::FormCreate(TObject *Sender)
|
||||
{
|
||||
SetTransparent( this );
|
||||
|
||||
m_lblVersion->Caption = g_strCurrentVersion;
|
||||
|
||||
int wMaj, wMin, wMod, wBld;
|
||||
sscanf( g_strCurrentVersion, "%d.%d.%d.%d", &wMaj, &wMin, &wMod, &wBld );
|
||||
|
||||
if( wMaj==0 )
|
||||
m_lblType->Caption = L"测试版";
|
||||
else
|
||||
m_lblType->Caption = L"正式版";
|
||||
|
||||
m_lblType->Left = m_lblVersion->Left + m_lblVersion->Width + 3;
|
||||
|
||||
int nOnline, nLocal;
|
||||
f_CS_GetStyleNums( nOnline, nLocal );
|
||||
char strNums[64];
|
||||
sprintf( strNums, "在线/已下载风格数: %d/%d", nOnline, nLocal );
|
||||
m_lblStyleNums->Caption = strNums;
|
||||
|
||||
m_lblURL->Caption = g_strServerURL;
|
||||
|
||||
//绘制圆角窗体
|
||||
HRGN hRgn = CreateRoundRectRgn( 0, 0, Width+1, Height+2, 20, 20 );
|
||||
SetWindowRgn( Handle, hRgn, false );
|
||||
DeleteObject( hRgn );
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
void __fastcall TAboutForm::WMNCHitTest(TWMNCHitTest &Msg)
|
||||
{
|
||||
TForm::Dispatch(&Msg);
|
||||
|
||||
if( Msg.Result==HTCLIENT && Msg.YPos<Top+24 && Msg.XPos<Left+275 )
|
||||
Msg.Result = HTCAPTION;
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
void __fastcall TAboutForm::URLClick(TObject *Sender)
|
||||
{
|
||||
if( m_lblURL->Caption.Length()>0 ){
|
||||
ShellExecute(Handle,NULL, m_lblURL->Caption.c_str(), NULL,NULL,SW_SHOWNORMAL);
|
||||
}
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
void __fastcall TAboutForm::FormKeyDown(TObject *Sender, WORD &Key, TShiftState Shift)
|
||||
{
|
||||
switch( Key ){
|
||||
case VK_RETURN:
|
||||
case VK_ESCAPE:
|
||||
case ' ':
|
||||
ModalResult = mrCancel;
|
||||
break;
|
||||
}
|
||||
}
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user