void PostScriptViews::DeleteViews () { Iterator i; First(i); while (!Done(i)) { DeleteView(i); } }
CAddApp::~CAddApp() { if( NULL != m_pBmp ) { DeleteObject(m_pBmp) ; m_pBmp = NULL ; } DeleteView(); }
BOOL COXSplitterWnd::RemoveRow(int nDelRow) { ASSERT(GetRowCount()>1); if(GetRowCount()<=1) { return FALSE; } ASSERT(nDelRow>=0 && nDelRow<GetRowCount()); ASSERT(::IsWindow(GetSafeHwnd())); // delete all views in specified row for(int nCol=0; nCol<m_nMaxCols; nCol++) { CWnd* pView=GetDlgItem(IdFromRowCol(nDelRow,nCol)); if(pView!=NULL) { DeleteView(nDelRow,nCol); } } // create new array of row info CRowColInfo* pRowInfo=new CRowColInfo[m_nMaxRows-1]; int nRow=0; for(nRow=0; nRow<m_nMaxRows-1; nRow++) { int nExistingRow=(nRow<nDelRow ? nRow : nRow+1); if(nExistingRow!=nDelRow) { // copy existing row data pRowInfo[nRow].nMinSize=m_pRowInfo[nExistingRow].nMinSize; pRowInfo[nRow].nIdealSize=m_pRowInfo[nExistingRow].nIdealSize; pRowInfo[nRow].nCurSize=m_pRowInfo[nExistingRow].nCurSize; } } // delete old array delete[] m_pRowInfo; // save new one m_pRowInfo=pRowInfo; // reset pane IDs (in forward direction) for(nRow=nDelRow+1; nRow<m_nMaxRows; nRow++) { for(int nCol=0; nCol<m_nMaxCols; nCol++) { CWnd* pView=GetDlgItem(IdFromRowCol(nRow,nCol)); ASSERT(pView!=NULL); pView->SetDlgCtrlID(IdFromRowCol(nRow-1,nCol)); } } // set new number of rows m_nMaxRows--; m_nRows=m_nMaxRows; return TRUE; }
BOOL COXSplitterWnd::RemoveColumn(int nDelCol) { ASSERT(GetColumnCount()>1); if(GetColumnCount()<=1) { return FALSE; } ASSERT(nDelCol>=0 && nDelCol<GetColumnCount()); ASSERT(::IsWindow(GetSafeHwnd())); // delete all views in specified column for(int nRow=0; nRow<m_nMaxRows; nRow++) { CWnd* pView=GetDlgItem(IdFromRowCol(nRow,nDelCol)); if(pView!=NULL) { DeleteView(nRow,nDelCol); } } // create new array of column info CRowColInfo* pColInfo=new CRowColInfo[m_nMaxCols-1]; int nCol=0; for(nCol=0; nCol<m_nMaxCols-1; nCol++) { int nExistingCol=(nCol<nDelCol ? nCol : nCol+1); if(nExistingCol!=nDelCol) { // copy existing column data pColInfo[nCol].nMinSize=m_pColInfo[nExistingCol].nMinSize; pColInfo[nCol].nIdealSize=m_pColInfo[nExistingCol].nIdealSize; pColInfo[nCol].nCurSize=m_pColInfo[nExistingCol].nCurSize; } } // delete old array delete[] m_pColInfo; // save new one m_pColInfo=pColInfo; // reset pane IDs (in forward direction) for(nCol=nDelCol+1; nCol<m_nMaxCols; nCol++) { for(int nRow=0; nRow<m_nMaxRows; nRow++) { CWnd* pView=GetDlgItem(IdFromRowCol(nRow,nCol)); ASSERT(pView!=NULL); pView->SetDlgCtrlID(IdFromRowCol(nRow,nCol-1)); } } // set new number of columns m_nMaxCols--; m_nCols=m_nMaxCols; return TRUE; }
void CKRSView::ReloadDataView() { m_ptmData = pgtmData; m_pcurGlub = pgcurGlub; ClearAllParamsBuffers(&m_MapParam, m_ptmData, m_pcurGlub); DeleteView(); InitViews(&m_wndDialogBar, &m_MapParam); CheckRegim(); m_wndDialogBar.m_PanelKnopki.Init(RT_NUM_LISTS, CSize(20,20), this); m_wndDialogBar.m_PanelKnopki.PushBtn(m_parOfView->GetNumActiveList()); CheckGrf(); }
//功能读入窗口,中枢函数,返回false的时候读入结束 bool userDatabase::userRead(){ cout << endl << username << ">" << endl; switch(mySql.read()){ case 0: return false; case 1: if(!CreateTable()) cout << "[Error] Create table error!" << endl; break; case 2: if(!CreateView()) cout << "[Error] Create view error!" << endl; break; case 3: if(!CreateIndex()) cout << "[Error] Create index error!" << endl; break; case 10: if(!InsertTable()) cout << "[Error] Insert error!" << endl; break; case 11: if(!SelectTable()) cout << "[Error] Select error!" << endl; break; case 12: if(!DeleteTable()) cout << "[Error] Drop table error!" << endl; break; case 13: if(!UpdateTable()) cout << "[Error] Update table error!" << endl; break; case 14: if(!DeleteData()) cout << "[Error] Delete data error!" << endl; break; case 15: if(!DeleteView()) cout << "[Error] Delete view error!" << endl; break; case 16: if(!GrantToUser()) cout << "[Error] Grant to user error!" << endl; break; case 20: readme.createHelp(); break; case 21: readme.selectHelp(); break; case 22: readme.insertHelp(); break; case 23: readme.dropHelp(); break; case 24: readme.updateHelp(); break; case 25: InputAllTable(); InputAllView(); InputAllIndex(); break; case 26: InputAllTable(); break; case 27: InputAllView(); break; case 28: InputAllIndex(); break; default : printf("[Error] SQL input error!\n"); break; } return true; };
void ShowViewListPage(char *m,char *n,struct list *lpublic,struct list *lsnmpd) { char IsDeleete[10] = { 0 }; char IsSubmit[5] = { 0 }; int i = 0,retu = 1,limit = 0,cl = 1; char menu_id[10] = { 0 }; char menu[15] = { 0 }; char select_slotid[10] = { 0 }; char temp[10] = { 0 }; unsigned int slot_id = 0; DBusConnection *select_connection = NULL; instance_parameter *paraHead = NULL,*paraNode = NULL; char *endptr = NULL; int ret = AC_MANAGE_DBUS_ERROR; STSNMPView *view_array = NULL; unsigned int view_num = 0; int j = 0; cgiHeaderContentType("text/html"); fprintf(cgiOut,"<html xmlns=\"http://www.w3.org/1999/xhtml\"><head>"); fprintf(cgiOut,"<meta http-equiv=Content-Type content=text/html; charset=gb2312>"); fprintf(cgiOut,"<title>SNMP V3</title>"); fprintf(cgiOut,"<link rel=stylesheet href=/style.css type=text/css>"\ "<style>"\ "#div1{ width:62px; height:18px; border:1px solid #666666; background-color:#f9f8f7;}"\ "#div2{ width:60px; height:15px; padding-left:5px; padding-top:3px}"\ "#link{ text-decoration:none; font-size: 12px}"\ "</style>"\ "</head>"\ "<script type=\"text/javascript\">"\ "function popMenu(objId)"\ "{"\ "var obj = document.getElementById(objId);"\ "if (obj.style.display == 'none')"\ "{"\ "obj.style.display = 'block';"\ "}"\ "else"\ "{"\ "obj.style.display = 'none';"\ "}"\ "}"\ "</script>"\ "<script src=/slotid_onchange.js>"\ "</script>"\ "<body>"); memset(select_slotid,0,sizeof(select_slotid)); cgiFormStringNoNewlines( "SLOT_ID", select_slotid, 10 ); list_instance_parameter(¶Head, SNMPD_SLOT_CONNECT); if(strcmp(select_slotid,"")==0) { if(paraHead) { snprintf(select_slotid,sizeof(select_slotid)-1,"%d",paraHead->parameter.slot_id); } } slot_id=strtoul(select_slotid,&endptr,10); get_slot_dbus_connection(slot_id,&select_connection,SNMPD_INSTANCE_MASTER_V3); memset(IsDeleete,0,sizeof(IsDeleete)); cgiFormStringNoNewlines("DeleteView", IsDeleete, 10); memset(IsSubmit,0,sizeof(IsSubmit)); cgiFormStringNoNewlines("SubmitFlag", IsSubmit, 5); if((strcmp(IsDeleete,"true")==0)&&(strcmp(IsSubmit,""))) { DeleteView(select_connection,lpublic,lsnmpd); } fprintf(cgiOut,"<form method=post>"\ "<div align=center>"\ "<table width=976 border=0 cellpadding=0 cellspacing=0>"\ "<tr>"\ "<td width=8 align=left valign=top background=/images/di22.jpg><img src=/images/youce4.jpg width=8 height=30/></td>"\ "<td width=51 align=left valign=bottom background=/images/di22.jpg><img src=/images/youce33.jpg width=37 height=24/></td>"\ "<td width=153 align=left valign=bottom id=titleen background=/images/di22.jpg>SNMP V3</td>"\ "<td width=690 align=right valign=bottom background=/images/di22.jpg>"); fprintf(cgiOut,"<table width=155 border=0 cellspacing=0 cellpadding=0>"\ "<tr>"\ "<td width=62 align=center><a href=wp_snmp.cgi?UN=%s target=mainFrame><img src=/images/%s border=0 width=62 height=20/></a></td>",m,search(lpublic,"img_ok")); fprintf(cgiOut,"<td width=62 align=center><a href=wp_snmp.cgi?UN=%s target=mainFrame><img src=/images/%s border=0 width=62 height=20/></a></td>",m,search(lpublic,"img_cancel")); fprintf(cgiOut,"</tr>"\ "</table>"); fprintf(cgiOut,"</td>"\ "<td width=74 align=right valign=top background=/images/di22.jpg><img src=/images/youce3.jpg width=31 height=30/></td>"\ "</tr>"\ "<tr>"\ "<td colspan=5 align=center valign=middle><table width=976 border=0 cellpadding=0 cellspacing=0 bgcolor=#f0eff0>"\ "<tr>"\ "<td width=12 align=left valign=top background=/images/di888.jpg> </td>"\ "<td width=948><table width=947 border=0 cellspacing=0 cellpadding=0>"\ "<tr height=4 valign=bottom>"\ "<td width=120> </td>"\ "<td width=827 valign=bottom><img src=/images/bottom_05.gif width=827 height=4/></td>"\ "</tr>"\ "<tr>"\ "<td><table width=120 border=0 cellspacing=0 cellpadding=0>"\ "<tr height=25>"\ "<td id=tdleft> </td>"\ "</tr>"); fprintf(cgiOut,"<tr height=26>"\ "<td align=left id=tdleft background=/images/bottom_bg.gif style=\"border-right:0\"><font id=%s>%s</font></td>",search(lpublic,"menu_san"),search(lsnmpd,"view_list")); /*突出显示*/ fprintf(cgiOut,"</tr>"); retu=checkuser_group(n); if(retu==0) /*管理员*/ { fprintf(cgiOut,"<tr height=25>"\ "<td align=left id=tdleft><a href=wp_view_add.cgi?UN=%s target=mainFrame class=top><font id=%s>%s</font></a></td>",m,search(lpublic,"menu_san"),search(lsnmpd,"add_view")); fprintf(cgiOut,"</tr>"); } fprintf(cgiOut,"<tr height=25>"\ "<td align=left id=tdleft><a href=wp_group_list.cgi?UN=%s target=mainFrame class=top><font id=%s>%s</font></a></td>",m,search(lpublic,"menu_san"),search(lsnmpd,"group_list")); fprintf(cgiOut,"</tr>"); if(retu==0) /*管理员*/ { fprintf(cgiOut,"<tr height=25>"\ "<td align=left id=tdleft><a href=wp_group_add.cgi?UN=%s target=mainFrame class=top><font id=%s>%s</font></a></td>",m,search(lpublic,"menu_san"),search(lsnmpd,"add_group")); fprintf(cgiOut,"</tr>"); } fprintf(cgiOut,"<tr height=25>"\ "<td align=left id=tdleft><a href=wp_v3user_list.cgi?UN=%s target=mainFrame class=top><font id=%s>%s</font></a></td>",m,search(lpublic,"menu_san"),search(lsnmpd,"v3user_list")); fprintf(cgiOut,"</tr>"); if(retu==0) /*管理员*/ { fprintf(cgiOut,"<tr height=25>"\ "<td align=left id=tdleft><a href=wp_v3user_add.cgi?UN=%s target=mainFrame class=top><font id=%s>%s</font></a></td>",m,search(lpublic,"menu_san"),search(lsnmpd,"add_v3user")); fprintf(cgiOut,"</tr>"); } limit = 0; ret = ac_manage_show_snmp_view(select_connection, &view_array, &view_num, NULL); if(AC_MANAGE_SUCCESS == ret) { if(view_num > 5) { limit = view_num - 5; } } if(retu == 1) /*普通用户*/ limit+=3; for(i=0;i<limit;i++) { fprintf(cgiOut,"<tr height=25>"\ "<td id=tdleft> </td>"\ "</tr>"); } fprintf(cgiOut,"</table>"\ "</td>"\ "<td align=left valign=top style=\"background-color:#ffffff; border-right:1px solid #707070; padding-left:30px; padding-top:10px\">"\ "<table width=463 border=0 bgcolor=#ffffff cellspacing=0 cellpadding=0>"); fprintf(cgiOut,"<tr style=\"padding-bottom:15px\">"\ "<td width=70><b>SLOT ID:</b></td>"\ "<td width=393>"\ "<select name=slot_id id=slot_id style=width:45px onchange=slotid_change(this,\"wp_view_list.cgi\",\"%s\")>",m); for(paraNode = paraHead; paraNode; paraNode = paraNode->next) { memset(temp,0,sizeof(temp)); snprintf(temp,sizeof(temp)-1,"%d",paraNode->parameter.slot_id); if(strcmp(select_slotid,temp) == 0) fprintf(cgiOut,"<option value='%s' selected=selected>%s",temp,temp); else fprintf(cgiOut,"<option value='%s'>%s",temp,temp); } fprintf(cgiOut,"</select>"\ "</td>"\ "</tr>"\ "<tr>"\ "<td colspan=2 valign=top align=center style=\"padding-bottom:5px\">"\ "<table frame=below rules=rows width=463 border=1>"\ "<tr align=left>"\ "<th width=150><font id=%s>%s</font></th>",search(lpublic,"menu_thead"),search(lsnmpd,"view_name")); fprintf(cgiOut,"<th width=150><font id=%s>%s</font></th>",search(lpublic,"menu_thead"),search(lsnmpd,"view_included_num")); fprintf(cgiOut,"<th width=150><font id=%s>%s</font></th>",search(lpublic,"menu_thead"),search(lsnmpd,"view_excluded_num")); fprintf(cgiOut,"<th width=13> </th>"\ "</tr>"); if((AC_MANAGE_SUCCESS == ret)&&(view_array)) { for(i = 0; i < view_num; i++) { memset(menu,0,sizeof(menu)); strncat(menu,"menuLists",sizeof(menu)-strlen(menu)-1); snprintf(menu_id,sizeof(menu_id)-1,"%d",i+1); strncat(menu,menu_id,sizeof(menu)-strlen(menu)-1); fprintf(cgiOut,"<tr align=left bgcolor=%s>",setclour(cl)); fprintf(cgiOut,"<td>%s</td>",view_array[i].name); fprintf(cgiOut,"<td>%d</td>",view_array[i].view_included.oid_num); fprintf(cgiOut,"<td>%d</td>",view_array[i].view_excluded.oid_num); fprintf(cgiOut,"<td>"); fprintf(cgiOut,"<div style=\"position:relative; z-index:%d\" onmouseover=\"popMenu('%s');\" onmouseout=\"popMenu('%s');\">",(view_num-i),menu,menu); fprintf(cgiOut,"<img src=/images/detail.gif>"\ "<div id=%s style=\"display:none; position:absolute; top:5px; left:0;\">",menu); fprintf(cgiOut,"<div id=div1>"); if(retu==0) /*管理员*/ { fprintf(cgiOut,"<div id=div2 onmouseover=\"this.style.backgroundColor='#b6bdd2'\" onmouseout=\"this.style.backgroundColor='#f9f8f7'\"><a id=link href=wp_view_add.cgi?UN=%s&AddFlag=1 target=mainFrame>%s</a></div>",m,search(lpublic,"ntp_add")); fprintf(cgiOut,"<div id=div2 onmouseover=\"this.style.backgroundColor='#b6bdd2'\" onmouseout=\"this.style.backgroundColor='#f9f8f7'\"><a id=link href=wp_view_list.cgi?UN=%s&DeleteView=%s&ViewName=%s&SLOT_ID=%s&SubmitFlag=1 target=mainFrame onclick=\"return confirm('%s')\">%s</a></div>",m,"true",view_array[i].name,select_slotid,search(lpublic,"confirm_delete"),search(lpublic,"delete")); fprintf(cgiOut,"<div id=div2 onmouseover=\"this.style.backgroundColor='#b6bdd2'\" onmouseout=\"this.style.backgroundColor='#f9f8f7'\"><a id=link href=wp_view_add.cgi?UN=%s&AddFlag=0&ViewName=%s&SLOT_ID=%d target=mainFrame>%s</a></div>",m,view_array[i].name,slot_id,search(lpublic,"config")); } fprintf(cgiOut,"<div id=div2 onmouseover=\"this.style.backgroundColor='#b6bdd2'\" onmouseout=\"this.style.backgroundColor='#f9f8f7'\"><a id=link href=wp_view_detail.cgi?UN=%s&ViewName=%s&SLOT_ID=%d target=mainFrame>%s</a></div>",m,view_array[i].name,slot_id,search(lpublic,"details")); fprintf(cgiOut,"</div>"\ "</div>"\ "</div>"\ "</td></tr>"); cl=!cl; } free_ac_manage_show_snmp_view(&view_array, view_num); } fprintf(cgiOut,"</table>"\ "</td>"\ "</tr>"\ "</table>"\ "</td>"\ "</tr>"\ "<tr height=4 valign=top>"\ "<td width=120 height=4 align=right valign=top><img src=/images/bottom_07.gif width=1 height=10/></td>"\ "<td width=827 height=4 valign=top bgcolor=#FFFFFF><img src=/images/bottom_06.gif width=827 height=15/></td>"\ "</tr>"\ "</table>"\ "</td>"\ "<td width=15 background=/images/di999.jpg> </td>"\ "</tr>"\ "</table></td>"\ "</tr>"\ "<tr>"\ "<td colspan=3 align=left valign=top background=/images/di777.jpg><img src=/images/di555.jpg width=61 height=62/></td>"\ "<td align=left valign=top background=/images/di777.jpg> </td>"\ "<td align=left valign=top background=/images/di777.jpg><img src=/images/di666.jpg width=74 height=62/></td>"\ "</tr>"\ "</table>"\ "</div>"\ "</form>"\ "</body>"\ "</html>"); free_instance_parameter_list(¶Head); }
AP_MSG_HANDLER_METHOD(WebViewModule, WebView_Destroy) { View* pView = FindView(pMsg->hView); DeleteView(pMsg->hView); pMsg->apStatus = ApMessage::Ok; }