⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 button3d.h

📁 这是个16路采集器的上位机源码。该套程序是由C++builder开发的
💻 H
字号:
//---------------------------------------------------------------------------

#ifndef Button3DH
#define Button3DH
//---------------------------------------------------------------------------
#include <SysUtils.hpp>
#include <Controls.hpp>
#include <Classes.hpp>
#include <Forms.hpp>
#include "ColorDef.h"
//---------------------------------------------------------------------------
class PACKAGE TButton3D : public TCustomControl
{
private:
   HWND hP;

   int x,y,w,h;
   int FrameLn,ButtonState,pX,pY;
   int BtID,msgId;
   AnsiString FCaption;
   TFont      *FFont;
   Graphics::TBitmap      *FPicture;
   TNotifyEvent FOnClick;

    void __fastcall SetCaption(AnsiString caption);
    void __fastcall SetPicture( Graphics::TBitmap *Value);
    void __fastcall SetFont(TFont *Value);
    void __fastcall DrawFrame(TCanvas *DragDC,TRect Drect,
    DWORD BrightPenColor,
    DWORD DarkPenColor,int FrameLn);
protected:
    virtual void __fastcall  Paint();
    void __fastcall UpdateIt(TObject *Sender);
    void __fastcall MouseLeave(Messages::TMessage  &Message);
    DYNAMIC void __fastcall MouseDown(Controls::TMouseButton Button, Classes::TShiftState Shift, int X, int Y);
    DYNAMIC void __fastcall MouseUp(Controls::TMouseButton Button, Classes::TShiftState Shift, int X, int Y);

public:
     BEGIN_MESSAGE_MAP
      MESSAGE_HANDLER(CM_MOUSELEAVE,TMessage,MouseLeave)
     END_MESSAGE_MAP(TCustomControl);

     void __fastcall ClickState(int state);    /////state=1时,下压
     __fastcall TButton3D(TComponent* Owner);
     __fastcall ~TButton3D(void);
__published:
           __property ShowHint;
           __property Visible;
           __property Enabled;
           __property Hint;
           __property OnClick;
           __property OnMouseDown;
           __property OnMouseUp;
           __property AnsiString Caption = {read =FCaption, write=SetCaption};
           __property TFont *Font={read=FFont,write=SetFont};
           __property Graphics::TBitmap *Picture={read=FPicture,write=SetPicture};

};
//---------------------------------------------------------------------------
#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -