www.pudn.com > 1.rar > i2elec.h
// I2Curve.h: interface for the CI2WBCurve class.
#ifndef _IASP2WHITEBOARDWHITEBOARDELECINCLUDEFILE_H_
#define _IASP2WHITEBOARDWHITEBOARDELECINCLUDEFILE_H_
class CI2WBBaseWB;
#include "I2BaseCtrl.h"
#include "I2ControlSet.h"
#include "I2BaseCSet.h"
#include "I2BaseWB.h"
typedef enum tagElecTypes
{
dtBattery,
dtLamp,
dtRes,
dtKey,
dtCap,
dtInd
}ElecTypes;
class CElecProp : public I2Dialog
{
public:
BOOL m_pressok;
CI2WBBaseCtrl* m_pawc;
CElecProp(CI2WBBaseCtrl*);
protected:
virtual void onInitliaze(const I2Dialog& dlg);
virtual void onCommand(const I2Dialog& dlg,WORD wID,WORD wNotifyCode);
};
class CI2WBElec : public CI2WBBaseCtrl
{
#define CLASSNAME_CI2WBELEC "CI2WBElec"
public:
VOID readFromStream(I2MemoryFileStream *stm,INT len,const I2Rect& r);
VOID writeToStream(I2MemoryFileStream *stm,BOOL fdata);
VOID OnRButtonUp(DWORD fwKeys,SHORT x,SHORT y,HWND hwnd,INT* fend);
VOID OnRButtonDown(DWORD fwKeys,SHORT x,SHORT y,HWND hwnd,INT* fend);
BOOL OnLButtonUp(DWORD fwKeys,SHORT x,SHORT y,HWND hwnd,INT* fend);
VOID OnMouseMove(DWORD fwKeys,SHORT x,SHORT y,HWND hwnd,INT* fend);
VOID OnLButtonDown(DWORD fwKeys,SHORT x,SHORT y,HWND hwnd,INT* fend);
BOOL OnLButtonDBLCLK(DWORD fwKeys,SHORT x,SHORT y,HWND hwnd);
VOID moveControl(INT xoffset,INT yoffset);
VOID paintControl(HDC hdc);
VOID getControlRect(I2Rect& r);
VOID OnAttribChange(INT type,INT mask,BOOL flocal);
VOID OnInplaceEditorNeedText(LPWB32FONT pfont,LPSTR* ptext);
VOID OnInplaceEditorReturnText(POINT pos,LPSTR text);
VOID set_Font(WB32FONT* pfont,INT mask);
BOOL OnDragFile(LPSTR filename,POINT p,CHAR* ptr,HWND hwnd);
VOID OnChangeData(RECT& rect);
CI2WBElec();
CI2WBElec(INT cid,VOID* wb);
~CI2WBElec();
//inherit from i2Object
EMPTY_I2OBJECT_IMPLEMENT(CI2WBControl,CLASSNAME_CI2WBCONTROL,CI2WBBaseCtrl)
char* toString(void)
{
return strdup("iasp2 white board electronic object");
}
protected:
ElecTypes m_type;
INT m_direction;
INT m_xpos;
INT m_ypos;
VOID paintBattery(HDC hdc,INT cx,INT cy);
VOID paintLamp(HDC hdc,INT cx,INT cy);
VOID paintRes(HDC hdc,INT cx,INT cy);
VOID paintKey(HDC hdc,INT cx,INT cy);
VOID paintCap(HDC hdc,INT cx,INT cy);
VOID paintInd(HDC hdc,INT cx,INT cy);
/* POINT m_pttrackstart;
POINT m_prev;
INT tracktype;
VOID beginTrack(INT* tracktype);
VOID trackPoint(HDC hdc,POINT p);
VOID endTrackPoint(HDC hdc,POINT p);
VOID trackRect(HDC hdc,const I2Rect& r);
VOID endTrackRect(HDC hdc,const I2Rect& r);
VOID trackClick(HDC hdc,POINT p,BOOL fclick);
VOID endTrackClick(HDC hdc,POINT p);
VOID paintPen(HDC hdc);
VOID paintLine(HDC hdc);
VOID paintHRect(HDC hdc);
VOID paintRect(HDC hdc);
VOID paintHCirc(HDC hdc);
VOID paintCirc(HDC hdc);
VOID paintHPoly(HDC hdc);
VOID paintPoly(HDC hdc);
VOID paintText(HDC hdc);
VOID paintImage(HDC hdc);
VOID rectFromPointList(I2Rect& rect);
VOID rectFromPoly(I2Rect& rect);
*/ VOID moveTo(INT xoffset,INT yoffset);
/* VOID movePointList(INT xoffset,INT yoffset);
VOID moveRect(INT xoffset,INT yoffset);
VOID movePoly(INT xoffset,INT yoffset);
LPSTR SysAllocAnsiString(LPSTR sz);
CPointList m_ptlist;
CPointList m_poly;
POINT m_pos;
CHAR* m_text;
I2Image img;
*/RECT m_rect;
CI2WBBaseWB* m_wb;
};
//template class I2List;
class CI2WBElecSet : public CI2WBBaseCSet
{
#define CLASSNAME_CI2WBELECSET "CI2WBElecSet"
public:
CI2WBElecSet();
~CI2WBElecSet();
VOID enumControlInfo(I2List& m_infolist);
VOID getControlCursor(INT cid,HCURSOR* pcur);
VOID getControlSetID(GUID* Value);
VOID createControl(INT cid,VOID* pwb,VOID** ppawc,HWND hwnd);
//inherit from object
EMPTY_I2OBJECT_IMPLEMENT(CI2WBControlSet,CLASSNAME_CI2WBCONTROLSET,CI2WBBaseCSet)
char* toString(void)
{
return strdup("iasp2 white board electronic object");
}
protected:
I2List m_infolist;
INT m_infopos;
HINSTANCE m_hInst;
};
#endif