patblt

  name="google_ads_frame" marginwidth="0" marginheight="0" src="http://pagead2.googlesyndication.com/pagead/ads?client=ca-pub-5572165936844014&dt=1193665761703&lmt=1193665780&format=336x280_as&output=html&correlator=1193665761687&url=http%3A%2F%2Fwww.codeguru.cn%2Fpublic%2Fiframe%2Fwinapiiframe.htm&color_bg=FFFFFF&color_text=000000&color_link=000000&color_url=FFFFFF&color_border=FFFFFF&ad_type=text&ga_vid=1285758818.1193665762&ga_sid=1193665762&ga_hid=111695597&flash=9&u_h=768&u_w=1024&u_ah=740&u_aw=1024&u_cd=32&u_tz=480&u_his=8&u_java=true" frameborder="0" width="336" scrolling="no" height="280" allowtransparency="allowtransparency">     函数功能:该函数使用当前选入指定设备环境中的刷子绘制给定的矩形区域。通过使用给出的光栅操作来对该刷子的颜色和表面颜色进行组合。

    函数原型:BOOL PatBlt(HDC hdc, int nXLeft, int nYLeft, int nWidth, int nHeight, DWORD dwRop);

    参数:

    hdc:设备环境句柄。

    nXLeft:指定要填充的矩形左上角的X轴坐标,坐标按逻辑单位表示。

    nYLeft:指定要填充的矩形左上角的Y轴坐标,坐标按逻辑单位表示。

    nWidth:指定矩形的宽度,按逻辑单位表示宽度。

    nHeight:指定矩形的高度,按逻辑单位表示高度。

    dwRop:指定光栅操作码。该操作码可以取下列值,这些值的含义如下:

    PATCOPY:将指定的模式拷贝到目标位图中。

    PATINVERT:使用布尔OR(或)操作符将指定模式的颜色与目标矩形的颜色进行组合。

    DSTINVERT:将目标矩形反向。

    BLACKNESS:使用物理调色板中与索引0相关的颜色填充目标矩形。(对于缺省的物理调色板而言,该颜色为黑色)。

    WHITENESS:使用物理调色板中与索引1有关的颜色来填充目标矩形。(对于缺省的物理调色板而言,该颜色为白色)。

    返回值:如果函数执行成功,则返回值为非零;如果函数执行失败,则返回值为0。

    Windows NT:若想获得更多错误信息,请调用GetLastError函数。

    备注:该函数的参数dwRop取值限定为全部256个三元光栅操作有限子集。特别地,涉及源矩形的操作码不能使用。

    并非所有设备都支持PalBlt函数。有关更多的信息,请参考函数GetDeviceCaps中有关RC_BITBLT特性的描述。

    速查:Windows NT:3.1及以上版本;Windows:95及以上版本;Windows CE:1.0及以上版本;头文件:wingdi.h:库文件:gdi32.lib。

#include <windows.h> #include <windowsx.h> #define ID_TIMER 1 #define STRMAXLEN 25 //一个显示列的最大长度 #define STRMINLEN 8 //一个显示列的最小长度 LRESULT CALLBACK WndProc (HWND, UINT, WPARAM, LPARAM) ; ////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////// typedef struct tagCharChain //整个当作屏幕的一个显示列,这是个双向列表 { struct tagCharChain *prev; //链表的前个元素 TCHAR ch; //一个显示列中的一个字符 struct tagCharChain *next; //链表的后个元素 }CharChain, *pCharChain; typedef struct tagCharColumn { CharChain *head, *current, *point; int x, y, iStrLen; //显示列的开始显示的x,y坐标,iStrLen是这个列的长度 int iStopTimes, iMustStopTimes; //已经停滞的次数和必须停滞的次数,必须停滞的次数是随机的 }CharColumn, *pCharColumn; int WINAPI WinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, PSTR szCmdLine, int iCmdShow) { static TCHAR szAppName[] = TEXT ("matrix") ; HWND hwnd ; MSG msg ; WNDCLASS wndclass ; wndclass.style = CS_HREDRAW | CS_VREDRAW ; // class style wndclass.lpfnWndProc = WndProc ; wndclass.cbClsExtra = 0 ; wndclass.cbWndExtra = 0 ; wndclass.hInstance = hInstance ; wndclass.hIcon = LoadIcon (NULL, IDI_APPLICATION) ; wndclass.hCursor = LoadCursor (NULL, IDC_ARROW) ; wndclass.hbrBackground = (HBRUSH) GetStockObject (BLACK_BRUSH) ; wndclass.lpszMenuName = NULL ; wndclass.lpszClassName = szAppName ; if(!RegisterClass (&wndclass)) { MessageBox (NULL, TEXT ("此程序必须运行在NT下!"), szAppName, MB_ICONERROR) ; return 0; } hwnd = CreateWindow (szAppName, NULL, WS_DLGFRAME | WS_THICKFRAME | WS_POPUP, // windows style 0, 0, GetSystemMetrics(SM_CXSCREEN), GetSystemMetrics(SM_CYSCREEN), NULL, NULL, hInstance, NULL) ; ShowWindow (hwnd, SW_SHOWMAXIMIZED) ; //最大化显示 show windows UpdateWindow (hwnd) ; ShowCursor(FALSE); //隐藏鼠标光标 srand ((int) GetCurrentTime ()) ; //初始化随机数发生器 while (GetMessage (&msg, NULL, 0, 0)) { TranslateMessage (&msg) ; DispatchMessage (&msg) ; } ShowCursor(TRUE); //显示鼠标光标 return msg.wParam ; } TCHAR randomChar() //随机字符产生函数 { return (TCHAR)(rand()%(126-33)+33); //33到126之间 } int init(CharColumn *cc, int cyScreen, int x) //初始化 { int j; cc->iStrLen = rand()%(STRMAXLEN-STRMINLEN) + STRMINLEN; //显示列的长度 cc->x = x+3 ; //显示列的开始显示的x坐标 cc->y =rand()%3?rand()%cyScreen:0; //显示列的开始显示的y坐标 cc->iMustStopTimes = rand()%6 ; cc->iStopTimes = 0 ; cc->head = cc->current = (pCharChain)calloc(cc->iStrLen, sizeof(CharChain)); //生成显示列 for(j=0; j<cc->iStrLen-1; j++) { cc->current->prev = cc->point; //cc->point一个显示列的前个元素 cc->current->ch = '\0'; cc->current->next = cc->current+1; //cc->current+1一个显示列的后个元素 cc->point = cc->current++; //cc->point = cc->current; cc->current++; } cc->current->prev = cc->point; //最后一个节点 cc->current->ch = '\0'; cc->current->next = cc->head; cc->head->prev = cc->current; //头节点的前一个为此链的最后一个元素 cc->current = cc->point = cc->head; //free掉申请的内存要用current当参数 cc->head->ch = randomChar(); // 对链表头的 元素填充 return 0; } LRESULT CALLBACK WndProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) { HDC hdc ; //ctn 用来确定一个显示链是否 向下前进,如果等待次数超过必须等待的次数,ctn就代表要向下前进 int i, j, temp, ctn; //j为一个显示链中除链表头外的在屏幕上显示的y坐标,temp绿色过度到黑色之用 static HDC hdcMem; HFONT hFont; static HBITMAP hBitmap; static int cxScreen, cyScreen; //屏幕的宽度 高度. static int iFontWidth=10, iFontHeight=15, iColumnCount; //字体的宽度 高度, 列数 static CharColumn *ccChain; switch (message) { case WM_CREATE: cxScreen = GetSystemMetrics(SM_CXSCREEN) ; //屏幕宽度 cyScreen = GetSystemMetrics(SM_CYSCREEN) ; SetTimer (hwnd, ID_TIMER, 10, NULL) ; hdc = GetDC(hwnd); hdcMem = CreateCompatibleDC(hdc); hBitmap = CreateCompatibleBitmap(hdc, cxScreen, cyScreen); SelectObject(hdcMem, hBitmap); ReleaseDC(hwnd, hdc); //创建字体 hFont = CreateFont(iFontHeight, iFontWidth-5, 0, 0, FW_BOLD, 0, 0, 0, DEFAULT_CHARSET, OUT_DEFAULT_PRECIS, CLIP_DEFAULT_PRECIS, DRAFT_QUALITY, FIXED_PITCH | FF_SWISS, TEXT("Fixedsys")); SelectObject(hdcMem, hFont); DeleteObject (hFont) ; SetBkMode(hdcMem, TRANSPARENT); //设置背景模式为 透明 iColumnCount = cxScreen/(iFontWidth*3/2); //屏幕所显示字母雨的列数 ccChain = (pCharColumn)calloc(iColumnCount, sizeof(CharColumn)); for(i=0; i<iColumnCount; i++) { init(ccChain+i, cyScreen, (iFontWidth*3/2)*i); } return 0 ; case WM_TIMER: hdc = GetDC(hwnd); PatBlt (hdcMem, 0, 0, cxScreen, cyScreen, BLACKNESS) ; //将内存设备映像刷成黑色 for(i=0; i<iColumnCount; i++) { ctn = (ccChain+i)->iStopTimes++ > (ccChain+i)->iMustStopTimes; // (ccChain+i)->point = (ccChain+i)->head; //point用于遍历整个显示列 //第一个字符显示为 白色 SetTextColor(hdcMem, RGB(255, 255, 255)); TextOut(hdcMem, (ccChain+i)->x, (ccChain+i)->y, &((ccChain+i)->point->ch), 1); j = (ccChain+i)->y; (ccChain+i)->point = (ccChain+i)->point->next; //遍历整个显示列,将这个显示列里的字符从下往上显示 temp = 0 ; //temp绿色过度到黑色之用 while((ccChain+i)->point != (ccChain+i)->head && (ccChain+i)->point->ch) { SetTextColor(hdcMem, RGB(0, 255-(255*(temp++)/(ccChain+i)->iStrLen), 0)); TextOut(hdcMem, (ccChain+i)->x, j-=iFontHeight, &((ccChain+i)->point->ch), 1); (ccChain+i)->point = (ccChain+i)->point->next; } if(ctn) (ccChain+i)->iStopTimes = 0 ; else continue; (ccChain+i)->y += iFontHeight; //下次开始显示的y坐标 为当前的y坐标加上 一个字符的高度 //如果开始显示的y坐标减去 整个显示列的长度超过了屏幕的高度 if( (ccChain+i)->y-(ccChain+i)->iStrLen*iFontHeight > cyScreen) { free( (ccChain+i)->current ); init(ccChain+i, cyScreen, (iFontWidth*3/2)*i); } //链表的头 为此链表的前个元素,因为下次开始显示的时候 就相当与在整个显示列的开头添加个元素,然后在开始往上显示 (ccChain+i)->head = (ccChain+i)->head->prev; (ccChain+i)->head->ch = randomChar(); } BitBlt(hdc, 0, 0, cxScreen, cyScreen, hdcMem, 0, 0, SRCCOPY); ReleaseDC(hwnd, hdc); return 0; case WM_RBUTTONDOWN: KillTimer (hwnd, ID_TIMER) ; return 0; case WM_RBUTTONUP: SetTimer (hwnd, ID_TIMER, 10, NULL) ; return 0; //处理善后工作 case WM_KEYDOWN: case WM_LBUTTONDOWN: case WM_DESTROY: KillTimer (hwnd, ID_TIMER) ; DeleteObject(hBitmap); DeleteDC(hdcMem); for(i=0; i<iColumnCount; i++) { free( (ccChain+i)->current ); } free(ccChain); PostQuitMessage (0) ; return 0 ; } return DefWindowProc (hwnd, message, wParam, lParam) ; } 修改bug
07-16
#include "stdafx.h" #include "grouptybase.h" #include "sp_drawView.h" #include "HmLayer.h" #include "yc.h" #include "HuaMian.h" #include <Shlwapi.h> #include "TysView.h" #include "NewGroupPage.h" #include "dll_draw.h" #include "DlgGroupScale.h" #ifdef _DEBUG #define new DEBUG_NEW #undef THIS_FILE static char THIS_FILE[] = __FILE__; #endif IMPLEMENT_SERIAL(CGroupTyBase,CTyBase, 0) float CGroupTyBase::c_xScale=1.0; float CGroupTyBase::c_yScale=1.0; BOOL CGroupTyBase::c_bText=true; BOOL CGroupTyBase::c_bBmp=false; CGroupTyBase::CGroupTyBase(int vId/*=0*/,CHMLayer* pLayer/*=NULL*/) :CTyBase(vId,pLayer) { m_bCreating=false; m_ArrChilds.RemoveAll(); m_LayerID=0; memset(&m_groupTypeInfo,0,sizeof(SGroupInfo)); memset(&m_groupRtuInfo,0,sizeof(S_GROUPRTU)); for (int i=0;i<MAX_GRP_RTU_NUM;i++) { m_groupRtuInfo.rtu[i].node_id=-1; m_groupRtuInfo.rtu[i].line_id=-1; m_groupRtuInfo.rtu[i].rtu_id=-1; m_groupRtuInfo.rtu[i].rtu_type=-1; } m_xScale=1; m_yScale=1; m_bText=c_bText; m_bBmp=c_bBmp; } DRAW_TY CGroupTyBase::GetTyType() { return tyGroup; } CGroupTyBase::CGroupTyBase(CTyBaseList* pList) :CTyBase(0,NULL) { m_LayerID=0; m_bCreating=false; m_ArrChilds.RemoveAll(); m_dwFlag=m_dwFlag|0x1; memset(&m_groupTypeInfo,0,sizeof(SGroupInfo)); memset(&m_groupRtuInfo,0,sizeof(S_GROUPRTU)); if (pList==NULL) return; BOOL bRoot; POSITION pos=pList->GetHeadPosition(); while (pos!=NULL) { CTyBase* pTy=pList->GetNext(pos); pTy->IsGroupTy(bRoot); if (bRoot==true) { assert(false); continue; } AddTy(pTy); } m_xScale=1; m_yScale=1; m_bText=c_bText; m_bBmp=c_bBmp; } CGroupTyBase::CGroupTyBase(LPCSTR filepath) :CTyBase(0,NULL) { m_bCreating=false; m_ArrChilds.RemoveAll(); m_LayerID=0; m_dwFlag=m_dwFlag| 0x1; memset(&m_groupTypeInfo,0,sizeof(SGroupInfo)); memset(&m_groupRtuInfo,0,sizeof(S_GROUPRTU)); m_xScale=1; m_yScale=1; m_bText=c_bText; m_bBmp=c_bBmp; if (filepath==NULL) return; if (PathFileExists(filepath)==false) return; CFileException fe; CFile vFile; char path_buffer[_MAX_PATH]; char drive[_MAX_DRIVE]; char dir[_MAX_DIR]; char fname[_MAX_FNAME]; char ext[_MAX_EXT]; _splitpath(filepath,drive,dir,fname,ext); if (!vFile.Open(filepath, CFile::modeRead|CFile::shareDenyWrite, &fe)) return; TRY { CWaitCursor wait; SaveGroupFile(&vFile,false); if (stricmp(m_groupTypeInfo.Name,fname)!=0) { fname[63]=0x0; strcpy(m_groupTypeInfo.Name,fname); } m_Id=0; int count=m_ArrChilds.GetCount(); for (int i=0;i<count;i++) { tagShowProp* pProp=m_ArrChilds.GetAt(i); assert(pProp!=NULL); if (pProp==NULL) continue; if (pProp->pChildTy==NULL) continue; pProp->pChildTy->m_Id=0; } vFile.Close(); } CATCH_ALL(e) { vFile.Close(); } END_CATCH_ALL } CGroupTyBase::~CGroupTyBase(void) { RemoveSelf(); int count=m_ArrChilds.GetCount(); for (int i=0;i<count;i++) { tagShowProp* pProp=m_ArrChilds.GetAt(i); assert(pProp!=NULL); if (pProp==NULL) continue; if (pProp->pChildTy==NULL) continue; delete pProp->pChildTy; delete pProp; } m_ArrChilds.RemoveAll(); } void CGroupTyBase::DisMissGroup(void) //组合图元拆卸 { if (m_pHMLayer!=NULL) m_pHMLayer->OnRemoveTy(this); m_dwFlag=m_dwFlag&0xfffffffe; int count=m_ArrChilds.GetCount(); for (int i=0;i<count;i++) { tagShowProp* pProp=m_ArrChilds.GetAt(i); assert(pProp!=NULL); if (pProp==NULL) continue; if (pProp->pChildTy==NULL) continue; pProp->pChildTy->DisMissGroup(); delete pProp; } m_ArrChilds.RemoveAll(); } //查找某个子图元的位置,通过子图元的指针 int CGroupTyBase::FindChildTy(CTyBase * pTy) { int ret=-1; int count=m_ArrChilds.GetCount(); for (int i=0;i<count;i++) { tagShowProp* pProp=m_ArrChilds.GetAt(i); assert(pProp!=NULL); if (pProp==NULL) continue; if (pTy==pProp->pChildTy) { ret=i; break; } } return ret; } //查找某个子图元,通过子图元的显示类型 CTyBase * CGroupTyBase::FindChildTyObj(int vShowPropType) { CTyBase * ret=NULL; int count=m_ArrChilds.GetCount(); for (int i=0;i<count;i++) { tagShowProp* pProp=m_ArrChilds.GetAt(i); assert(pProp!=NULL); if (pProp==NULL) continue; if (vShowPropType==pProp->showType) { ret=pProp->pChildTy; break; } } return ret; } //获取显示属性量 bool CGroupTyBase::GetPropCode(int vShowPropType,char* codeEname) { bool ret=false; memset(codeEname,0,sizeof(char)*17); CYC * pTy=(CYC*) FindChildTyObj(vShowPropType); if (pTy==NULL) return ret; ret=true; strcpy(codeEname,pTy->m_yc.ename); return ret; } //查找某个子图元的位置,通过子图元的显示类型 int CGroupTyBase::FindChildTy(int vShowPropType) { int ret=-1; int count=m_ArrChilds.GetCount(); for (int i=0;i<count;i++) { tagShowProp* pProp=m_ArrChilds.GetAt(i); assert(pProp!=NULL); if (pProp==NULL) continue; if (vShowPropType==pProp->showType) { ret=i; break; } } return ret; } void CGroupTyBase::RemoveChildTy(CTyBase * pTy,CDrawInfoBase * pView) { assert(pTy!=NULL); if (pTy==NULL) return; if (pView!=NULL) { pView->InvalidateTy(this); } RectStruct oldRt; RectStruct newRt; memset(&oldRt,0,sizeof(RectStruct)); memset(&newRt,0,sizeof(RectStruct)); GetRect(&oldRt.x0,&oldRt.y0,&oldRt.x1,&oldRt.y1); int pos=FindChildTy(pTy); if (pos>=0) { m_ArrChilds.RemoveAt(pos); pTy->m_pGroup=NULL; SetModifiedFlag(true); } GetRect(&newRt.x0,&newRt.y0,&newRt.x1,&newRt.y1); if (m_pHMLayer!=NULL) m_pHMLayer->OnPositionChangedTy(this,oldRt,newRt); if (pView!=NULL) { pView->InvalidateTy(this); } } /*向容器里增加一个子图元 //参数: int showType-子图元属性编码 <0-属性无效(组合对象用) 0-主显示属性 >0 */ void CGroupTyBase::AddTy(CTyBase *pTy,int showType,CDrawInfoBase * pView) { assert(pTy!=NULL); if (pTy==NULL) return; RectStruct oldRt; RectStruct newRt; memset(&oldRt,0,sizeof(RectStruct)); memset(&newRt,0,sizeof(RectStruct)); GetRect(&oldRt.x0,&oldRt.y0,&oldRt.x1,&oldRt.y1); pTy->m_pGroup=this; if (pView!=NULL) { pView->InvalidateTy(this); } if (showType<0) { int pos=FindChildTy(pTy); if (pos<0) { tagShowProp* pProp=new tagShowProp; memset(pProp,0,sizeof(pProp)); pProp->pChildTy=pTy; pProp->showType=showType; m_ArrChilds.Add(pProp); pTy->m_pGroup=this; SetModifiedFlag(true); } } else { int pos=FindChildTy(showType); if (pos<0) { tagShowProp* pProp=new tagShowProp; memset(pProp,0,sizeof(pProp)); pProp->pChildTy=pTy; pProp->showType=showType; if (showType==0) m_ArrChilds.InsertAt(0,pProp); else m_ArrChilds.Add(pProp); pTy->m_pGroup=this; SetModifiedFlag(true); } } GetRect(&newRt.x0,&newRt.y0,&newRt.x1,&newRt.y1); if (m_pHMLayer!=NULL) m_pHMLayer->OnPositionChangedTy(this,oldRt,newRt); if (pView!=NULL) { pView->InvalidateTy(this); } } //添加子图元进入指定的画面层 void CGroupTyBase::AddChildTyToLayer(CHMLayer* pLayer) { if (pLayer==NULL) return; CTyBase* pTy=NULL; int count=m_ArrChilds.GetCount(); for (int i=0;i<count;i++) { tagShowProp* pProp=m_ArrChilds[i]; assert(pProp!=NULL); if (pProp==NULL) continue; pTy=pProp->pChildTy; assert(pTy!=NULL); if (pTy==NULL) continue; if (pTy->m_pHMLayer==NULL) pLayer->Add(pTy); } } void CGroupTyBase::GetRect(float *minX, float *minY, float *maxX, float *maxY) { float minX1=0,minX2=0,minY1=0,minY2=0,maxX1=0,maxX2=0,maxY1=0,maxY2=0; if ((m_dwFlag&0x1)==0) return; //设备图元还没有装载完毕 bool bFirst=true; CTyBase* pTy=NULL; int count=m_ArrChilds.GetCount(); for (int i=0;i<count;i++) { tagShowProp* pProp=m_ArrChilds[i]; assert(pProp!=NULL); if (pProp==NULL) continue; pTy=pProp->pChildTy; //assert(pTy!=NULL); if (pTy==NULL) continue; if (bFirst) { pTy->GetRect(&minX1,&minY1,&maxX1,&maxY1); if ((minX1==maxX1)&&(maxY1==minY1)&&(minX1==0)&&(minY1==0)) continue; bFirst=false; } else { pTy->GetRect(&minX2,&minY2,&maxX2,&maxY2); if ((minX2==maxX2)&&(maxY2==minY2)&&(minX2==0)&&(minY2==0)) continue; if (minX2<minX1) minX1=minX2; if (minY2<minY1) minY1=minY2; if (maxX2>maxX1) maxX1=maxX2; if (maxY2>maxY1) maxY1=maxY2; } } if (bFirst==false) { *minX=minX1; *minY=minY1; *maxX=maxX1; *maxY=maxY1; } } //BOOL CGroupTyBase::PointInObj(float x, float y,float errRange) //{ // BOOL ret=false; // int count=m_ArrChilds.GetCount(); // if (count==0) return ret; // CTyBase* pTy=NULL; // // for (int i=0;i<count;i++) // { // pTy=m_ArrChilds[i]->pChildTy; // assert(pTy!=NULL); // if (pTy==NULL) continue; // ret=pTy->PointInObj(x,y,errRange); // if (ret==true) break; // // } // return ret; // //} BOOL CGroupTyBase::PointInObj(float x, float y,float errRange) { assert(errRange>=0); if (m_bDelete) return FALSE; BOOL ret=FALSE; RectStruct rt,rt2,rt3; GetRect(&rt.x0,&rt.y0,&rt.x1,&rt.y1); rt2=rt; rt2.InflateRect(errRange+5,errRange+5); ret=PointInRect(x,y,rt2); return ret; } void CGroupTyBase::Ty_Serialize(CArchive & ar) { int count=0; if(ar.IsStoring()) { ar.Write((char *)&m_groupTypeInfo,sizeof(SGroupInfo)); ar.Write((char*)&m_groupRtuInfo,sizeof(S_GROUPRTU)); ar.Write((char *)&m_xScale,sizeof(float)); ar.Write((char *)&m_yScale,sizeof(float)); ar.Write((char *)&m_bText,sizeof(BOOL)); ar.Write((char *)&m_bBmp,sizeof(BOOL)); int num=m_ArrChilds.GetCount(); for (int i=0;i<num;i++) { tagShowProp* pProp=m_ArrChilds[i]; assert(pProp!=NULL); assert(pProp!=NULL); assert(pProp->pChildTy!=NULL); if (pProp==NULL) continue; if (pProp->pChildTy==NULL) continue; if (pProp->pChildTy->m_bDelete==true) continue; count++; } ar<<count; for (int i=0;i<num;i++) { //CRuntime_Class //CObject* pObject = pClass->CreateObject(); tagShowProp* pProp=m_ArrChilds[i]; assert(pProp!=NULL); assert(pProp->pChildTy!=NULL); if (pProp==NULL) continue; if (pProp->pChildTy==NULL) continue; if (pProp->pChildTy->m_bDelete==true) continue; ar<<pProp->showType; ar<<pProp->pChildTy; } } else { ar.Read((char *)&m_groupTypeInfo,sizeof(SGroupInfo)); m_groupTypeInfo.Name[0]=0x0; ar.Read((char*)&m_groupRtuInfo,sizeof(S_GROUPRTU)); int i; for (i=0;i<m_groupRtuInfo.rtu_count;i++) { m_groupRtuInfo.rtu[i].node_id=-1; m_groupRtuInfo.rtu[i].rtu_id=-1; m_groupRtuInfo.rtu[i].name[0]=0x0; } ar.Read((char *)&m_xScale,sizeof(float)); ar.Read((char *)&m_yScale,sizeof(float)); ar.Read((char *)&m_bText,sizeof(BOOL)); ar.Read((char *)&m_bBmp,sizeof(BOOL)); ar>>count; for (i=0;i<count;i++) { tagShowProp* pProp=new tagShowProp; memset(pProp,0,sizeof(pProp)); ar>>pProp->showType; ar>>pProp->pChildTy; pProp->pChildTy = pProp->pChildTy->Clone(); pProp->pChildTy->m_pGroup=this; m_ArrChilds.Add(pProp); } } } BOOL CGroupTyBase::IsGroupTy(BOOL& vRoot) { vRoot=true; return true; } void CGroupTyBase::DrawBounds(CDC * pDC,CDrawInfoBase *pView) { float minX=0,minY=0,maxX=0,maxY=0; GetRect(&minX,&minY,&maxX,&maxY); if ((minX==maxX)&&(minY==maxY)&&(minX==0)&&(minY==0)) //无效 return; CPoint pt1,pt2; pt1=pView->UPtoLP(minX,minY); pt2=pView->UPtoLP(maxX,maxY); CRect rt; rt.SetRect(pt1,pt2); rt.NormalizeRect(); rt.InflateRect(5,5); LOGBRUSH logBrush2; logBrush2.lbStyle =BS_HATCHED; //BS_SOLID|BS_HATCHED; logBrush2.lbColor = RGB(200,200,255); logBrush2.lbHatch=HS_DIAGCROSS; CPen pen; pen.CreatePen(PS_SOLID|PS_GEOMETRIC|PS_ENDCAP_ROUND, 4, &logBrush2); CPen * pOldPen=pDC->SelectObject(&pen); int holdDrawMode=pDC->SetROP2(R2_COPYPEN); CBrush brush,*pOldBrush; LOGBRUSH logbrush; logbrush.lbStyle=BS_NULL; brush.CreateBrushIndirect(&logbrush); pOldBrush=pDC->SelectObject(&brush); pDC->Rectangle(&rt); pDC->SelectObject(pOldBrush); pDC->SetROP2(holdDrawMode); pDC->SelectObject(pOldPen); } void CGroupTyBase::DrawTracker(CDC *pDC, CDrawInfoBase *pView, TrackerState state) { //CTyBase::DrawTracker(pDC,pView,state); ASSERT_VALID(this); assert(pView!=NULL); switch (state) { case normal: case active: break; case selected: { DrawBounds(pDC,pView); int nHandleCount = GetHandleCount(); for (int nHandle = 1; nHandle <= nHandleCount; nHandle += 1) { CRect rt=GetHandleLogRect(nHandle,pView); pDC->PatBlt(rt.left,rt.top, rt.Width(),rt.Height(), DSTINVERT); } } break; } } //int CGroupTyBase::GetHandleCount() //{ // return 0; //} //获取子图元列表 void CGroupTyBase::GetChildTyList(CTyBaseList& vList) { vList.RemoveAll(); int count=m_ArrChilds.GetCount(); for (int i=0;i<count;i++) { tagShowProp* pProp=m_ArrChilds[i]; assert(pProp!=NULL); assert(pProp->pChildTy!=NULL); if (pProp->pChildTy==NULL) continue; vList.AddTail(pProp->pChildTy); } } void CGroupTyBase::Ty_Move(float xLen, float yLen,CDrawInfoBase * pView) { if (pView!=NULL) pView->InvalidateTy(this); CTyBase* pTy=NULL; int count=m_ArrChilds.GetCount(); for (int i=0;i<count;i++) { tagShowProp* pProp=m_ArrChilds[i]; assert(pProp!=NULL); assert(pProp->pChildTy!=NULL); if (pProp->pChildTy==NULL) continue; pProp->pChildTy->Move(xLen,yLen,pView); } if (pView!=NULL) pView->InvalidateTy(this); } //释放所有被选择的子图元 void CGroupTyBase::DeSelectChildTy(CTysView* pView) { assert(pView!=NULL); if (pView==NULL) return; CTyBase* pTy=NULL; int count=m_ArrChilds.GetCount(); for (int i=0;i<count;i++) { tagShowProp* pProp=m_ArrChilds[i]; assert(pProp!=NULL); pTy=pProp->pChildTy; assert(pTy!=NULL); if (pTy==NULL) continue; pView->Deselect(pTy); } } void CGroupTyBase::OnChildMoveReCallEvent(CTyBase* pChildTy,float xLen, float yLen,CDrawInfoBase * pView) { } //从某画面层里删除自己 void CGroupTyBase::RemoveSelf() { if ((m_dwFlag&0x1)==0) //设备图元还没有装载完毕 { if (m_pHMLayer!=NULL) m_pHMLayer->Remove(this); return; } //先在切割表中删除自己 if (m_pHMLayer!=NULL) m_pHMLayer->OnRemoveTy(this); CTyBase* pTy=NULL; int count=m_ArrChilds.GetCount(); for (int i=0;i<count;i++) { tagShowProp* pProp=m_ArrChilds[i]; assert(pProp!=NULL); pTy=pProp->pChildTy; assert(pTy!=NULL); if (pTy==NULL) continue; if (pTy->m_pHMLayer==NULL) continue; pTy->m_pGroup=NULL;//防止迭代重入 pTy->m_pHMLayer->Remove(pTy); } if (m_pHMLayer!=NULL) m_pHMLayer->Remove(this); } ///通过菜单删除自己 void CGroupTyBase::SetDelete(CDrawInfoBase * pView) { if (m_bDelete==true) return; //对删除嵌套解扣 //先根据当前面积,在切割表中删除自己 if (m_pHMLayer!=NULL) m_pHMLayer->OnRemoveTy(this); if (pView!=NULL) pView->InvalidateTy(this); CTyBaseList vList; CTyBase* pTy=NULL; int count=m_ArrChilds.GetCount(); for (int i=0;i<count;i++) { tagShowProp* pProp=m_ArrChilds[i]; assert(pProp!=NULL); pTy=pProp->pChildTy; assert(pTy!=NULL); if (pTy==NULL) continue; vList.AddTail(pTy); //pTy->SetDelete(bDelete,true,pView); } POSITION pos=vList.GetHeadPosition(); while (pos!=NULL) { pTy=vList.GetNext(pos); assert(pTy!=NULL); if (pTy==NULL) continue; pTy->SetDelete(pView); } vList.RemoveAll(); m_bDelete=true; if (pView!=NULL) pView->InvalidateTy(this); } //通过菜单删除自己,触发的删除事件 void CGroupTyBase::OnDeleteEvent(BOOL bDelete,CDrawInfoBase * pView) { } //存盘 void CGroupTyBase::SaveGroupFile(CFile *file, BOOL Yn) { if (file==NULL) { assert(false); return; } CTyBase* pTy=NULL; CTyBaseList vList; WORD vMVer,vEVer; int count=0; DRAW_TY tystyle; if (Yn==true) { vMVer=CHuaMian::m_wMVersion; vEVer=CHuaMian::m_wEVersion; file->Write((char*)&vMVer,sizeof(WORD)); file->Write((char*)&vEVer,sizeof(WORD)); file->Write((char *)&m_groupTypeInfo,sizeof(SGroupInfo)); file->Write((char *)&m_groupRtuInfo,sizeof(S_GROUPRTU)); GetChildTyList(vList); count=vList.GetCount(); file->Write((char*)&count,sizeof(int)); POSITION pos=vList.GetHeadPosition(); while (pos!=NULL) { pTy=vList.GetNext(pos); if (!pTy->m_bDelete) { tystyle=pTy->GetTyType(); assert(tystyle!=tyNone); file->Write((char *)&tystyle,sizeof(tystyle)); pTy->Save(file,vMVer,vEVer,Yn); } } } else { file->Read((char*)&vMVer,sizeof(WORD)); file->Read((char*)&vEVer,sizeof(WORD)); //比较画面文件版本号 if ((vMVer>CHuaMian::m_wMVersion)||((vMVer==CHuaMian::m_wMVersion) &&((vEVer>CHuaMian::m_wEVersion)))) { //pException=new CPicFileException(); //pException->m_errno=CPicFileException::HIGHVERSION; //throw(pException); assert(false); return; } file->Read((char *)&m_groupTypeInfo,sizeof(SGroupInfo)); file->Read((char *)&m_groupRtuInfo,sizeof(S_GROUPRTU)); file->Read((char *)&count,sizeof(int)); for (int i=0;i<count;i++) { file->Read((char *)&tystyle,sizeof(tystyle)); pTy=CTyBase::CreateTy(tystyle); if (pTy==NULL) return; pTy->Save(file,vMVer,vEVer,Yn); AddTy(pTy); //CGroupTyBase* pGrp=(CGroupTyBase*) pTy; //CHMLayer * pLayer=NULL; //pLayer=FindLayer(pGrp->m_LayerID); //assert(pLayer!=NULL); //if (pLayer==NULL) continue; //pGrp->AssemblyChildTy(pLayer); //pLayer->Add(pTy,true); } } } //void CGroupTyBase::Ty_Save_Version(CFile *file, BOOL Yn,WORD vMVer,WORD vEVer) void CGroupTyBase::Ty_Save(CFile* file,WORD mVer,WORD eVer,BOOL Yn) { assert(file!=NULL); assert(m_bDelete==false); if (file==NULL) return; int count=0; //int posNumber; CTyBase* pTy=NULL; if (Yn) { int iLayerNo=m_pHMLayer->GetLayerID(); file->Write((char *)&iLayerNo,sizeof(int)); file->Write((char *)&m_groupTypeInfo,sizeof(SGroupInfo)); file->Write((char *)&m_groupRtuInfo,sizeof(S_GROUPRTU)); file->Write((char *)&m_xScale,sizeof(float)); file->Write((char *)&m_yScale,sizeof(float)); file->Write((char *)&m_bText,sizeof(BOOL)); file->Write((char *)&m_bBmp,sizeof(BOOL)); char buf[65]; memset(buf,0,sizeof(char)); file->Write(buf,sizeof(char)*65); //num=m_TyList.GetCount(); int num=m_ArrChilds.GetCount(); for (int i=0;i<num;i++) { tagShowProp* pProp=m_ArrChilds[i]; assert(pProp!=NULL); assert(pProp!=NULL); assert(pProp->pChildTy!=NULL); if (pProp==NULL) continue; if (pProp->pChildTy==NULL) continue; if (pProp->pChildTy->m_bDelete==true) continue; count++; } file->Write((char *)&count,sizeof(count)); for (int i=0;i<num;i++) { //CRuntime_Class //CObject* pObject = pClass->CreateObject(); tagShowProp* pProp=m_ArrChilds[i]; assert(pProp!=NULL); assert(pProp->pChildTy!=NULL); if (pProp==NULL) continue; pTy=pProp->pChildTy; if (pTy==NULL) continue; if (pTy->m_bDelete==true) continue; file->Write((char *)&(pProp->showType),sizeof(int)); file->Write((char *)&(pTy->m_Id),sizeof(int)); } } else { file->Read((char *)&(m_LayerID),sizeof(int)); file->Read((char *)&m_groupTypeInfo,sizeof(SGroupInfo)); file->Read((char *)&m_groupRtuInfo,sizeof(S_GROUPRTU)); file->Read((char *)&m_xScale,sizeof(float)); file->Read((char *)&m_yScale,sizeof(float)); file->Read((char *)&m_bText,sizeof(BOOL)); file->Read((char *)&m_bBmp,sizeof(BOOL)); char buf[65]; memset(buf,0,sizeof(char)); file->Read(buf,sizeof(char)*65); file->Read((char *)&count,sizeof(count)); int tyID; for (int i=0;i<count;i++) { tagShowProp* pProp= new tagShowProp; file->Read((char *)&(pProp->showType),sizeof(int)); file->Read((char *)&tyID,sizeof(int)); pProp->pChildTy=(CTyBase*)(char*)tyID; m_ArrChilds.Add(pProp); } } } //图层装载完毕事件 void CGroupTyBase::OnAfterLoadLayerEvent(void) { CTyBase::OnAfterLoadLayerEvent(); assert(m_pHMLayer!=NULL); if (m_pHMLayer==NULL) return; int count=m_ArrChilds.GetCount(); int tyID; CTyBase* pTy; for (int i=0;i<count;i++) { tagShowProp* pProp=m_ArrChilds.GetAt(i); assert(pProp!=NULL); tyID=(int)(char*)(pProp->pChildTy); pTy=m_pHMLayer->FindTyBase(tyID); assert(pTy!=NULL); if (pTy==NULL) { m_ArrChilds[i]->pChildTy=NULL; continue; } m_ArrChilds[i]->pChildTy=pTy; pTy->m_pGroup=this; } } //拼装组合图元 void CGroupTyBase::AssemblyChildTy(CHMLayer* pLayer) { if (pLayer==NULL) return; if ((m_dwFlag&0x1)==0) return; m_dwFlag=m_dwFlag|0x1; int count=m_ArrChilds.GetCount(); int tyID; CTyBase* pTy; for (int i=0;i<count;i++) { tagShowProp* pProp=m_ArrChilds.GetAt(i); assert(pProp!=NULL); tyID=(int)(char*)(pProp->pChildTy); CHMLayerList *layers = &(pLayer->m_pHuaMian->m_HMLayerList); POSITION pos=layers->GetHeadPosition(); while (pos!=NULL) { pLayer=layers->GetNext(pos); if (pLayer!=NULL) { pTy=pLayer->FindTyBase(tyID); if(pTy != NULL) break; } } //assert(pTy!=NULL); if (pTy==NULL) { m_ArrChilds[i]->pChildTy=NULL; continue; } m_ArrChilds[i]->pChildTy=pTy; pTy->m_pGroup=this; } } //图元加入层前 void CGroupTyBase::OnAddLayerBeforeEvent(tagAddLayerEvent* pInfo) { if (pInfo==NULL) return; if (pInfo->pLayer==NULL) return; int count=m_ArrChilds.GetCount(); int tyID; CTyBase* pTy; for (int i=0;i<count;i++) { tagShowProp* pProp=m_ArrChilds.GetAt(i); assert(pProp!=NULL); //tyID=(int)(char*)(pProp->pChildTy); //pTy=m_pHMLayer->FindTyBase(tyID); pTy=pProp->pChildTy; assert(pTy!=NULL); if (pTy==NULL) continue; if (pTy->m_pHMLayer==pInfo->pLayer) continue; pTy->m_pGroup=this; pInfo->pLayer->Add(pTy,pInfo->blNumberChanged); } } //图元加入层后 void CGroupTyBase::OnAddLayerAfterEvent(tagAddLayerEvent* pInfo) { } //返回组图元的最大外接矩形(文字除外) void CGroupTyBase::GetGroupRect(float *minX,float *minY,float *maxX,float *maxY) { float minX1=0,minX2=0,minY1=0,minY2=0,maxX1=0,maxX2=0,maxY1=0,maxY2=0; if ((m_dwFlag&0x1)==0) return; //设备图元还没有装载完毕 bool bFirst=true; CTyBase* pTy=NULL; int count=m_ArrChilds.GetCount(); for (int i=0;i<count;i++) { tagShowProp* pProp=m_ArrChilds[i]; assert(pProp!=NULL); if (pProp==NULL) continue; pTy=pProp->pChildTy; assert(pTy!=NULL); if (pTy==NULL) continue; if (pTy->IsTextTy()==true) continue; if (bFirst) { pTy->GetRect(&minX1,&minY1,&maxX1,&maxY1); if ((minX1==maxX1)&&(maxY1==minY1)&&(minX1==0)&&(minY1==0)) continue; bFirst=false; } else { pTy->GetRect(&minX2,&minY2,&maxX2,&maxY2); if ((minX2==maxX2)&&(maxY2==minY2)&&(minX2==0)&&(minY2==0)) continue; if (minX2<minX1) minX1=minX2; if (minY2<minY1) minY1=minY2; if (maxX2>maxX1) maxX1=maxX2; if (maxY2>maxY1) maxY1=maxY2; } } if (bFirst==false) { *minX=minX1; *minY=minY1; *maxX=maxX1; *maxY=maxY1; } } void CGroupTyBase::DrawGroup(CDC *pDC, CDrawInfoBase *pView) { int count=m_ArrChilds.GetCount(); CTyBase* pTy; for (int i=0;i<count;i++) { tagShowProp* pProp=m_ArrChilds.GetAt(i); assert(pProp!=NULL); pTy=pProp->pChildTy; assert(pTy!=NULL); if (pTy==NULL) continue; if (pTy->IsTextTy()==true) continue; pTy->DrawDC(pDC,pView); } } //自动转换组合图元的点参数 void CGroupTyBase::ParamReplaceGroup(void) { CStringList ruleList; CString str; str.Format("3,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d,%d",m_groupRtuInfo.rtu_count, m_groupRtuInfo.rtu[0].node_id,m_groupRtuInfo.rtu[0].line_id,m_groupRtuInfo.rtu[0].rtu_id, m_groupRtuInfo.rtu[1].node_id,m_groupRtuInfo.rtu[1].line_id,m_groupRtuInfo.rtu[1].rtu_id, m_groupRtuInfo.rtu[2].node_id,m_groupRtuInfo.rtu[2].line_id,m_groupRtuInfo.rtu[2].rtu_id, m_groupRtuInfo.rtu[3].node_id,m_groupRtuInfo.rtu[3].line_id,m_groupRtuInfo.rtu[3].rtu_id); ruleList.AddTail(str); int count=m_ArrChilds.GetCount(); CTyBase* pTy; for (int i=0;i<count;i++) { tagShowProp* pProp=m_ArrChilds.GetAt(i); assert(pProp!=NULL); pTy=pProp->pChildTy; assert(pTy!=NULL); if (pTy==NULL) continue; pTy->ParamReplace(ruleList); } SetModifiedFlag(true); } void CGroupTyBase::OnEditProperties(CDrawInfoBase * pView) { CDlgGroupScale dlg; CPropertySheet Property; Property.AddPage(&dlg); Property.SetTitle("组合图元属性.."); //Property.m_psh.dwFlags|=PSH_NOAPPLYNOW; //dlg.m_psp.dwFlags&=~PSP_HASHELP; dlg.SetContent(m_xScale,m_yScale,m_bText,m_bBmp); //dlg.SetGroupInfo(&m_groupTypeInfo); if(Property.DoModal()==IDOK) { float xScale,yScale; BOOL bText,bBmp; dlg.GetContent(xScale,yScale,bText,bBmp); SetModifiedFlag(true); SetGroupScale(xScale,yScale,bText,bBmp,pView); c_xScale=m_xScale; c_yScale=m_yScale; c_bText=m_bText; c_bBmp=m_bBmp; } } void CGroupTyBase::OnEditProperties_2(CDrawInfoBase * pView) { CNewGroupPage dlg; CPropertySheet Property; Property.AddPage(&dlg); Property.SetTitle("组合图元模板属性.."); Property.m_psh.dwFlags|=PSH_NOAPPLYNOW; dlg.m_psp.dwFlags&=~PSP_HASHELP; dlg.SetGroupInfo(&m_groupTypeInfo); if(Property.DoModal()==IDOK) { dlg.GetGroupInfo(&m_groupTypeInfo); m_groupRtuInfo.rtu_count=m_groupTypeInfo.nRtuCount; for (int i=0;i<MAX_GRP_RTU_NUM;i++) { strcpy(m_groupRtuInfo.rtu[i].name,m_groupTypeInfo.RtuInfo[i].Name); m_groupRtuInfo.rtu[i].rtu_type=m_groupTypeInfo.RtuInfo[i].nModType; } SetModifiedFlag(true); } } //创建组合模板的一个实例 BOOL CGroupTyBase::OnCreateSample(CDrawInfoBase * pView) { BOOL ret=false; if (g_DLL.m_pFunc_ShowFindRtuDlg==NULL) return ret; S_GROUPRTU rec; memset(&rec,0,sizeof(S_GROUPRTU)); memcpy(&rec,&m_groupRtuInfo,sizeof(S_GROUPRTU)); ret=true; if ((*g_DLL.m_pFunc_ShowFindRtuDlg)(&rec)==true) { for (int i=0;i<rec.rtu_count;i++) { if (rec.rtu[i].rtu_id==-1) { ret=false; continue; } } memcpy(&m_groupRtuInfo,&rec,sizeof(S_GROUPRTU)); ParamReplaceGroup(); } else { ret = false; } // ret=true; return ret; } //获取组合图元的单元配置参数 BOOL CGroupTyBase::GetGroupTyRtuParam(S_GROUPRTU& vParam) { memcpy(&vParam,&m_groupRtuInfo,sizeof(S_GROUPRTU)); return true; } int CGroupTyBase::GetHandleCount() { return 8; } PointStruct CGroupTyBase::GetHandle(int nHandle) { ASSERT_VALID(this); PointStruct pt; float x0,y0,x1,y1; GetRect(&x0,&y0,&x1,&y1); switch (nHandle) { default: ASSERT(FALSE); case 1: pt.x = x0; pt.y = y0; break; case 2: pt.x = (x1+x0)/2; pt.y = y0; break; case 3: pt.x = x1; pt.y = y0; break; case 4: pt.x = x1; pt.y = (y0+y1)/2; break; case 5: pt.x = x1; pt.y = y1; break; case 6: pt.x = (x1+x0)/2; pt.y = y1; break; case 7: pt.x = x0; pt.y = y1; break; case 8: pt.x = x0; pt.y = (y0+y1)/2; break; } return pt; } HCURSOR CGroupTyBase::GetHandleCursor(int nHandle) { ASSERT_VALID(this); LPCTSTR id; switch (nHandle) { default: ASSERT(FALSE); case 1: case 5: id=IDC_SIZENWSE; break; case 2: case 6: id=IDC_SIZENS; break; case 3: case 7: id=IDC_SIZENESW; break; case 4: case 8: id=IDC_SIZEWE; break; } return AfxGetApp()->LoadStandardCursor(id); } void CGroupTyBase::SetGroupScale(float xScale, float yScale,BOOL bText,BOOL bBmp,CDrawInfoBase *pView) { if ((xScale==m_xScale)&&(yScale==m_yScale)&&(m_bText==bText)&&(m_bBmp==bBmp)) { return; } float x0,y0,x1,y1; GetRect(&x0,&y0,&x1,&y1); PointStruct point; memset(&point,0,sizeof(PointStruct)); point.x=x0+(x1-x0)/m_xScale; point.y=y0+(y1-y0)/m_yScale; Ty_MoveHandleTo(5,point,pView,0); m_bText=bText; m_bBmp=bBmp; GetRect(&x0,&y0,&x1,&y1); point.x=x0+(x1-x0)*xScale; point.y=y0+(y1-y0)*yScale; Ty_MoveHandleTo(5,point,pView,0); //m_xScale=xScale; //m_yScale=yScale; } void CGroupTyBase::Ty_MoveHandleTo(int nHandle, PointStruct point, CDrawInfoBase *pView,UINT nFlags) { //assert(pView!=NULL); if (pView!=NULL) pView->InvalidateTy(this); CPixelTranslate vTranslate; tagTranslateInfo vInfo; memset(&vInfo,0,sizeof(tagTranslateInfo)); GetRect(&vInfo.vSrcX0,&vInfo.vSrcY0,&vInfo.vSrcX1,&vInfo.vSrcY1); vInfo.vDstX=point.x; vInfo.vDstY=point.y; vInfo.nFlags=nFlags; vInfo.vHandle=nHandle; vInfo.pView=pView; vInfo.bText=m_bText; float xScale=-1,yScale=-1; vTranslate.GetXYScale(xScale,yScale,vInfo); // if ((xScale>4)||(xScale<0.01)) // assert(false); if (xScale>0) { xScale=m_xScale*xScale; if ((xScale>20)||(xScale<0.1)) return; m_xScale=xScale; } if (yScale>0) { yScale=m_yScale*yScale; if ((yScale>20)||(yScale<0.1)) return; m_yScale=yScale; } RectStruct rt1,rt2; // Ty_MoveHandleTo(nHandle,point,pView,nFlags); CTyBase* pTy=NULL; CHMLayer *pLayer = NULL; int count=m_ArrChilds.GetCount(); for (int i=0;i<count;i++) { tagShowProp* pProp=m_ArrChilds[i]; assert(pProp!=NULL); pTy=pProp->pChildTy; assert(pTy!=NULL); if (pTy==NULL) continue; pTy->GetRect(&rt1.x0,&rt1.y0,&rt1.x1,&rt1.y1); pTy->OnEvent_GroupMoveHandleTo(&vTranslate,vInfo); pLayer = pTy->m_pHMLayer; if (pLayer!=NULL) { pTy->GetRect(&rt2.x0,&rt2.y0,&rt2.x1,&rt2.y1); pLayer->OnPositionChangedTy(pTy,rt1,rt2); } } if (pView!=NULL) pView->InvalidateTy(this); }
最新发布
07-17
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值