Initial commit
This commit is contained in:
+122
@@ -0,0 +1,122 @@
|
||||
//---------------------------------------------------------------------------
|
||||
|
||||
#ifndef HelpPanelUnitH
|
||||
#define HelpPanelUnitH
|
||||
|
||||
#include "SkinScrollBarUnit.h"
|
||||
#include <Vcl.Imaging.pngimage.hpp>
|
||||
|
||||
#define COLOR_BORDER RGB(164,115,70)
|
||||
#define COLOR_QUESTION RGB(255,0,0)
|
||||
#define COLOR_ANSWER RGB(0,0,255)
|
||||
|
||||
#include <vector>
|
||||
using namespace std;
|
||||
|
||||
#define MODE_NUM 5
|
||||
|
||||
typedef struct{
|
||||
wstring str1;
|
||||
wstring str2;
|
||||
} TWSPAIR;
|
||||
|
||||
typedef vector< TWSPAIR* > TWSPAIRLIST;
|
||||
|
||||
typedef struct tagLineString{
|
||||
int flag;
|
||||
wstring strText;
|
||||
|
||||
tagLineString(){
|
||||
flag = 0;
|
||||
}
|
||||
} TLineString;
|
||||
|
||||
typedef vector< TLineString* > TTEXTLINE;
|
||||
namespace HelpPanelUnit
|
||||
{
|
||||
|
||||
//---------------------------------------------------------------------------
|
||||
class TPanel : public Extctrls::TPanel
|
||||
{
|
||||
private:
|
||||
//背景及小节栏图片
|
||||
TBitmap *m_imgBackground,
|
||||
*m_imgBarTitle;
|
||||
// TWSPAIRLIST m_lstWStrPair[MODE_NUM];
|
||||
// TWSPAIRLIST m_lstFeedback;
|
||||
TTEXTLINE m_lstLines;
|
||||
TLabel *m_lblCoinPage;
|
||||
|
||||
int m_iMode; //显示模式 0=常见问题,1=我要提问,2=网站公告,3=空间消息
|
||||
int m_iLastMode; //上次显示模式
|
||||
|
||||
char m_CharBuf[2048];
|
||||
|
||||
void CalcViewArea();
|
||||
void ReadData();
|
||||
|
||||
void __fastcall LinkClick(TObject *Sender);
|
||||
void __fastcall LinkMouseEnter(TObject *Sender);
|
||||
void __fastcall LinkMouseLeave(TObject *Sender);
|
||||
|
||||
MESSAGE void __fastcall WMEraseBkgnd(Winapi::Messages::TWMEraseBkgnd &Message);
|
||||
MESSAGE void __fastcall WMSize(Winapi::Messages::TWMSize &Message);
|
||||
MESSAGE void __fastcall WMVScroll(Winapi::Messages::TWMScroll &Message);
|
||||
MESSAGE void __fastcall WMMouseWheel(TWMMouseWheel &Message);
|
||||
|
||||
BEGIN_MESSAGE_MAP
|
||||
MESSAGE_HANDLER(WM_ERASEBKGND, TWMEraseBkgnd, WMEraseBkgnd)
|
||||
MESSAGE_HANDLER(WM_SIZE, TWMSize, WMSize)
|
||||
MESSAGE_HANDLER(WM_VSCROLL, TWMVScroll, WMVScroll)
|
||||
MESSAGE_HANDLER(WM_MOUSEWHEEL, TWMMouseWheel, WMMouseWheel)
|
||||
END_MESSAGE_MAP(Vcl::Extctrls::TPanel)
|
||||
|
||||
//protected:
|
||||
//显示相关
|
||||
int m_nRowShow,
|
||||
m_nBeginShowRow,
|
||||
m_nRowNum,
|
||||
|
||||
m_nPosFlag,
|
||||
m_nPosText,
|
||||
|
||||
/* m_iFirstRowMode0,
|
||||
m_iFirstRowMode1,
|
||||
m_iFirstQAMode0,
|
||||
m_iFirstQAMode1,
|
||||
*/
|
||||
m_aFirstRow[MODE_NUM],
|
||||
m_aFirstTitle[MODE_NUM],
|
||||
|
||||
m_nRowWidth,
|
||||
m_nRowHight,
|
||||
|
||||
m_nLeftBound,
|
||||
m_nRightBound,
|
||||
m_nTopBound,
|
||||
m_nBottomBound;
|
||||
|
||||
TSkinScrollBar *m_sbVert;
|
||||
|
||||
virtual void __fastcall CreateWnd();
|
||||
virtual void __fastcall Paint(void);
|
||||
|
||||
void RefreshTextLines();
|
||||
|
||||
public:
|
||||
void ScrollView( int nPos, bool bRedraw=true );
|
||||
void SetMode( int iMode );
|
||||
void AddFeedback( wstring str );
|
||||
void SaveFirstRow();
|
||||
void InitialVars();
|
||||
void SetTextFontSize(int size);
|
||||
|
||||
__fastcall virtual TPanel(System::Classes::TComponent* AOwner);
|
||||
__fastcall ~TPanel();
|
||||
};
|
||||
|
||||
}
|
||||
|
||||
using namespace HelpPanelUnit;
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user