55 lines
1.9 KiB
C++
55 lines
1.9 KiB
C++
//---------------------------------------------------------------------------
|
|
/////////////////////////////////
|
|
////////安装 记得在生成编译包的工程和使用工程中加图片 Res\System\close.png -->L"PngImage_Close"
|
|
/////////////////////////////////
|
|
|
|
#ifndef GeneralDialogPanelH
|
|
#define GeneralDialogPanelH
|
|
//---------------------------------------------------------------------------
|
|
#include <SysUtils.hpp>
|
|
#include <Classes.hpp>
|
|
#include <Vcl.Controls.hpp>
|
|
#include <Vcl.ExtCtrls.hpp>
|
|
#include <Vcl.Imaging.pngimage.hpp>
|
|
#include <Vcl.Imaging.jpeg.hpp>
|
|
#include <Vcl.Graphics.hpp>
|
|
//---------------------------------------------------------------------------
|
|
class CBTPNButton;
|
|
#define LEN_BKG_EXTERNAL_ROUND 1
|
|
#define LEN_BKG_EXTERNAL_FRMAE 1
|
|
#define LEN_BKG_INTERNAL_LINE 23
|
|
//---------------------------------------------------------------------------
|
|
class PACKAGE TGeneralDialogPanel : public TPanel
|
|
{
|
|
private:
|
|
TNotifyEvent FOnCanceled; // 关闭窗口事件
|
|
|
|
TPngImage *m_imgClose;
|
|
CBTPNButton *m_btnClose;
|
|
|
|
void __fastcall CloseClick(TObject *Sender);
|
|
|
|
MESSAGE void __fastcall WMEraseBkgnd(Winapi::Messages::TWMEraseBkgnd &Message);
|
|
MESSAGE void __fastcall WMSize(Winapi::Messages::TWMSize &Message);
|
|
BEGIN_MESSAGE_MAP
|
|
MESSAGE_HANDLER(WM_ERASEBKGND, TWMEraseBkgnd, WMEraseBkgnd)
|
|
MESSAGE_HANDLER(WM_SIZE, TWMSize, WMSize)
|
|
END_MESSAGE_MAP(Vcl::Extctrls::TPanel)
|
|
|
|
protected:
|
|
|
|
virtual void __fastcall Paint(void);
|
|
virtual void __fastcall CreateWnd();
|
|
DYNAMIC void __fastcall MouseDown(System::Uitypes::TMouseButton Button,
|
|
System::Classes::TShiftState Shift, int X, int Y);
|
|
public:
|
|
__fastcall TGeneralDialogPanel(TComponent* Owner);
|
|
__fastcall ~TGeneralDialogPanel();
|
|
|
|
__published:
|
|
__property TNotifyEvent OnCanceled = {write = FOnCanceled, read = FOnCanceled};
|
|
};
|
|
//---------------------------------------------------------------------------
|
|
#endif
|
|
|