colorfield.h

来自「用于开发Atmel的AVR系列单片机的GCC集成开发环境」· C头文件 代码 · 共 39 行

H
39
字号
//---------------------------------------------------------------------------
#ifndef ColorFieldH
#define ColorFieldH
//---------------------------------------------------------------------------
#include <SysUtils.hpp>
#include <Controls.hpp>
#include <Classes.hpp>
#include <Forms.hpp>
//---------------------------------------------------------------------------
class TColorField : public TGraphicControl
{
private:
         TColor FPalette[16];
         TColor FForeground, FBackground;
         void __fastcall DrawCell (int fieldnum);
         void __fastcall PutText (AnsiString text, int fieldnum);
         TColor __fastcall BuildTextColor (TColor back);
         int __fastcall ColorToCell (TColor col);
         void __fastcall SetForeground (TColor col);
         void __fastcall SetBackground (TColor col);
         TColor __fastcall GetForeground (void);
         TColor __fastcall GetBackground (void);
         TNotifyEvent FOnChange;

protected:
          void __fastcall Paint (void);
          DYNAMIC void __fastcall MouseDown(TMouseButton but, TShiftState shift, int x, int y);
          void __fastcall Change(void);
public:
	__fastcall TColorField(TComponent* Owner);

__published:
   __property TColor Foreground = {read=GetForeground, write=SetForeground, default=clBlack};
   __property TColor Background = {read=GetBackground, write=SetBackground, default=clBlack};
   __property TNotifyEvent OnChange = {read=FOnChange, write=FOnChange};
};
//---------------------------------------------------------------------------
#endif

⌨️ 快捷键说明

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