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

📄 graphbmp.h

📁 一个用C++Builder写的日记本程序
💻 H
字号:
//---------------------------------------------------------------------------

#ifndef GraphBmpH
#define GraphBmpH
//---------------------------------------------------------------------------
#include <Graphics.hpp>
#include <ExtCtrls.hpp>
#include <vector>
#include <IniFiles.hpp>
#include <list>
using namespace std;

typedef class tag_NoteInfo
{
public:
    int     m_iNoteNo;
    int     m_iNoteIndex;
    bool    m_bShow;
    String  m_szNote;
    __fastcall tag_NoteInfo()
    {
        m_bShow = true;
    }
}NOTEINFO,*LPNOTEINFO;

typedef vector<NOTEINFO>             vecNoteInfo;
typedef vector<NOTEINFO>::iterator   vecNoteInfoIt;

class Find_NoteInfoByNo
{
private:
    int m_iNoteNo;
public:
    __fastcall Find_NoteInfoByNo(int iNoteNo):m_iNoteNo(iNoteNo){}
    bool operator()(const NOTEINFO &NoteInfo)
    {
        return (m_iNoteNo == NoteInfo.m_iNoteNo);
    }
};

class Find_NoteInfoByIndex
{
private:
    int m_iNoteIndex;
public:
    __fastcall Find_NoteInfoByIndex(int iNoteIndex):m_iNoteIndex(iNoteIndex){}
    bool operator()(const NOTEINFO &NoteInfo)
    {
        return (m_iNoteIndex == NoteInfo.m_iNoteIndex);
    }
};

typedef class tag_BitmapVet
{
public:
    WORD                    m_wBitmapIndex;
    int                     m_iNoteNo;
    String                  m_szNote;
    TRect                   m_Rect;
    Graphics::TBitmap       *m_pBitmap;
    bool                    m_bFree;
    Graphics::TBitmap       *m_pPointBmp;
    int                     m_iCopyLeft;
public:
    __fastcall tag_BitmapVet()
    {
        m_szNote = "";
        m_Rect.left = 0;
        m_Rect.top = 0;
        m_Rect.right = 0;
        m_Rect.Bottom = 0;
        m_bFree = true;
        m_pBitmap = new Graphics::TBitmap();
        m_wBitmapIndex = 0;
        m_pPointBmp = NULL;
        m_iCopyLeft = -1;
    }
    int __fastcall InitData();
    int __fastcall DrawNoteText(TColor BackColor,TColor FontColor,int iFontSize,String szNote);

    __fastcall  ~tag_BitmapVet()
    {
        delete m_pBitmap;
    }

}BITMAPVET,*LPBITMAPVET;

class Find_BitmapByIndex
{
private:
    WORD    m_wBitmapIndex;
public:
    __fastcall  Find_BitmapByIndex(WORD wBitmapIndex):m_wBitmapIndex(wBitmapIndex){}
    bool operator ()(const LPBITMAPVET pBitmap)
    {
        return (m_wBitmapIndex == pBitmap->m_wBitmapIndex);
    }
};

typedef list<LPBITMAPVET>                       LPBitmapList;
typedef list<LPBITMAPVET>::iterator             LPBitmapListIt;

typedef vector<LPBITMAPVET>                     VetBitmapList;
typedef vector<LPBITMAPVET>::iterator           VetBitmapListIt;

class TMainData : public TObject
{
private:
    int __fastcall ReadConfigFile(void);

protected:

public:
    Graphics::TBitmap     *m_pMainBmp;
    Graphics::TBitmap     *m_pLastBmp;
    Graphics::TBitmap     *m_pSetupBmp;
    Graphics::TBitmap     *m_pMinBmp;
    Graphics::TBitmap     *m_pCloseBmp;
    Graphics::TBitmap     *m_pPointBmp;
    Graphics::TBitmap     *m_pQQBmp;

    int                   m_iHeight;
    vecNoteInfo           m_vNoteInfo;
    TColor                m_pBackColor;
    TColor                m_pFontColor;
    int                   m_iRate;
    bool                  m_bBigFont;
    String                m_szFileName;
    int                   m_iNoteNo;
    LPBitmapList          m_pBitmapList;
    WORD                  m_wBitmapIndex;
    TDateTime             m_ConfigDay;
    bool                  m_bShowHide;
    __fastcall TMainData();
    __fastcall ~TMainData();
    int __fastcall WriteConfigFile(void);
    LPNOTEINFO __fastcall GetNoteInfoByNo(int iNoteNo, int & iFind);
    int __fastcall AddNoteInfo(NOTEINFO NoteInfo);
    int __fastcall HideNoteInfoByNo(int iNoteNo,bool bFlag);
    int __fastcall UpdateNoteInfoByNo(int iNoteNo, String szMsg);
    void __fastcall DestroyBitmapList(void);
    LPBITMAPVET __fastcall GetAFreeBitmap(void);
    void __fastcall SetBitmapToFree(WORD wBitmapIndex);
    LPNOTEINFO __fastcall GetNextNote(int iNoteNo);
    void __fastcall SetAllBitmapFree(void);
    LPNOTEINFO __fastcall GetFirstNote(void);
    int __fastcall ClearNoteInfo(void);

};

#endif

⌨️ 快捷键说明

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