Started work on graphical network map
authorVictor Kirhenshtein <victor@netxms.org>
Wed, 6 Oct 2004 12:52:10 +0000 (12:52 +0000)
committerVictor Kirhenshtein <victor@netxms.org>
Wed, 6 Oct 2004 12:52:10 +0000 (12:52 +0000)
20 files changed:
.gitattributes
src/console/win32/MapFrame.cpp
src/console/win32/MapFrame.h
src/console/win32/MapView.cpp
src/console/win32/MapView.h
src/console/win32/globals.cpp
src/console/win32/icons/ovl_status_critical.ico [new file with mode: 0644]
src/console/win32/icons/ovl_status_disabled.ico [new file with mode: 0644]
src/console/win32/icons/ovl_status_major.ico [new file with mode: 0644]
src/console/win32/icons/ovl_status_minor.ico [new file with mode: 0644]
src/console/win32/icons/ovl_status_testing.ico [new file with mode: 0644]
src/console/win32/icons/ovl_status_unknown.ico [new file with mode: 0644]
src/console/win32/icons/ovl_status_unmanaged.ico [new file with mode: 0644]
src/console/win32/icons/ovl_status_warning.ico [new file with mode: 0644]
src/console/win32/nxcon.clw
src/console/win32/nxcon.cpp
src/console/win32/nxcon.dsp
src/console/win32/nxcon.h
src/console/win32/nxcon.rc
src/console/win32/resource.h

index 04eb34f..8c70b3c 100644 (file)
@@ -261,6 +261,14 @@ src/console/win32/icons/e-mail.ico -text
 src/console/win32/icons/exec.ico -text
 src/console/win32/icons/graph.ico -text
 src/console/win32/icons/log.ico -text
+src/console/win32/icons/ovl_status_critical.ico -text
+src/console/win32/icons/ovl_status_disabled.ico -text
+src/console/win32/icons/ovl_status_major.ico -text
+src/console/win32/icons/ovl_status_minor.ico -text
+src/console/win32/icons/ovl_status_testing.ico -text
+src/console/win32/icons/ovl_status_unknown.ico -text
+src/console/win32/icons/ovl_status_unmanaged.ico -text
+src/console/win32/icons/ovl_status_warning.ico -text
 src/console/win32/icons/passwd.ico -text
 src/console/win32/icons/question.ico -text
 src/console/win32/icons/rexec.ico -text
index 17f8b58..b6a9b12 100644 (file)
@@ -18,10 +18,14 @@ IMPLEMENT_DYNCREATE(CMapFrame, CMDIChildWnd)
 
 CMapFrame::CMapFrame()
 {
+   m_pRootObject = NULL;
+   m_pImageList = NULL;
+   m_dwHistoryPos = 0;
 }
 
 CMapFrame::~CMapFrame()
 {
+   delete m_pImageList;
 }
 
 
@@ -29,7 +33,12 @@ BEGIN_MESSAGE_MAP(CMapFrame, CMDIChildWnd)
        //{{AFX_MSG_MAP(CMapFrame)
        ON_WM_CREATE()
        ON_WM_SIZE()
+       ON_WM_SETFOCUS()
+       ON_COMMAND(ID_VIEW_REFRESH, OnViewRefresh)
+       ON_COMMAND(ID_OBJECT_OPEN, OnObjectOpen)
+       ON_COMMAND(ID_OBJECT_OPENPARENT, OnObjectOpenparent)
        //}}AFX_MSG_MAP
+       ON_NOTIFY(NM_DBLCLK, IDC_LIST_VIEW, OnListViewDblClk)
 END_MESSAGE_MAP()
 
 /////////////////////////////////////////////////////////////////////////////
@@ -51,15 +60,35 @@ BOOL CMapFrame::PreCreateWindow(CREATESTRUCT& cs)
 int CMapFrame::OnCreate(LPCREATESTRUCT lpCreateStruct) 
 {
    RECT rect;
+   int i;
 
        if (CMDIChildWnd::OnCreate(lpCreateStruct) == -1)
                return -1;
        
    // Create and initialize map view
    GetClientRect(&rect);
-   m_wndMapView.Create(NULL, NULL, WS_CHILD | WS_VISIBLE, rect, this, 0);
+   //m_wndMapView.Create(NULL, NULL, WS_CHILD | WS_VISIBLE, rect, this, 0);
+   m_wndMapView.Create(WS_CHILD | WS_VISIBLE | LVS_ICON | LVS_SHOWSELALWAYS, rect, this, IDC_LIST_VIEW);
    
-       return 0;
+   // Create image list
+   m_pImageList = new CImageList;
+   m_pImageList->Create(g_pObjectNormalImageList);
+   m_iStatusImageBase = m_pImageList->GetImageCount();
+   m_pImageList->Add(theApp.LoadIcon(IDI_OVL_STATUS_WARNING));
+   m_pImageList->Add(theApp.LoadIcon(IDI_OVL_STATUS_MINOR));
+   m_pImageList->Add(theApp.LoadIcon(IDI_OVL_STATUS_MAJOR));
+   m_pImageList->Add(theApp.LoadIcon(IDI_OVL_STATUS_CRITICAL));
+   m_pImageList->Add(theApp.LoadIcon(IDI_OVL_STATUS_UNKNOWN));
+   m_pImageList->Add(theApp.LoadIcon(IDI_OVL_STATUS_UNMANAGED));
+   m_pImageList->Add(theApp.LoadIcon(IDI_OVL_STATUS_DISABLED));
+   m_pImageList->Add(theApp.LoadIcon(IDI_OVL_STATUS_TESTING));
+   for(i = STATUS_WARNING; i <= STATUS_TESTING; i++)
+      m_pImageList->SetOverlayImage(m_iStatusImageBase + i - 1, i);
+   m_wndMapView.SetImageList(m_pImageList, LVSIL_NORMAL);
+
+   PostMessage(WM_COMMAND, ID_VIEW_REFRESH, 0);
+
+   return 0;
 }
 
 
@@ -73,3 +102,161 @@ void CMapFrame::OnSize(UINT nType, int cx, int cy)
        
    m_wndMapView.SetWindowPos(NULL, 0, 0, cx, cy, SWP_NOZORDER);        
 }
+
+
+//
+// WM_SETFOCUS message handler
+//
+
+void CMapFrame::OnSetFocus(CWnd* pOldWnd) 
+{
+       CMDIChildWnd::OnSetFocus(pOldWnd);
+
+   m_wndMapView.SetFocus();
+}
+
+
+//
+// WM_COMMAND::ID_VIEW_REFRESH message handler
+//
+
+void CMapFrame::OnViewRefresh() 
+{
+   NXC_OBJECT *pObject;
+   DWORD i;
+   CString strFullString, strTitle;
+
+       if (strFullString.LoadString(IDR_MAPFRAME))
+               AfxExtractSubString(strTitle, strFullString, CDocTemplate::docName);
+
+   m_wndMapView.DeleteAllItems();
+   if (m_pRootObject == NULL)
+   {
+      pObject = NXCGetTopologyRootObject();
+      if (pObject != NULL)
+         AddObjectToView(pObject);
+
+      pObject = NXCGetServiceRootObject();
+      if (pObject != NULL)
+         AddObjectToView(pObject);
+   
+      pObject = NXCGetTemplateRootObject();
+      if (pObject != NULL)
+         AddObjectToView(pObject);
+
+      // add object name to title
+      strTitle += " - [root]";
+   }
+   else
+   {
+      for(i = 0; i < m_pRootObject->dwNumChilds; i++)
+      {
+         pObject = NXCFindObjectById(m_pRootObject->pdwChildList[i]);
+         if (pObject != NULL)
+            if (!pObject->bIsDeleted)
+               AddObjectToView(pObject);
+      }
+
+      // add object name to title
+      strTitle += " - [";
+      strTitle += m_pRootObject->szName;
+      strTitle += "]";
+   }
+
+   ::SetWindowText(m_hWnd, strTitle);
+}
+
+
+//
+// Add object to view
+//
+
+void CMapFrame::AddObjectToView(NXC_OBJECT *pObject)
+{
+   LVITEM item;
+
+   item.mask = LVIF_IMAGE | LVIF_PARAM | LVIF_TEXT | LVIF_STATE;
+   item.iItem = 0x7FFFFFFF;
+   item.iSubItem = 0;
+   item.pszText = pObject->szName;
+   item.iImage = GetObjectImageIndex(pObject);
+   item.lParam = (LPARAM)pObject;
+   item.stateMask = LVIS_OVERLAYMASK;
+   item.state = INDEXTOOVERLAYMASK(pObject->iStatus);
+   m_wndMapView.InsertItem(&item);
+}
+
+
+//
+// Handler for WM_NOTIFY::NM_DBLCLK from IDC_LIST_VIEW
+//
+
+void CMapFrame::OnListViewDblClk(LPNMITEMACTIVATE pNMHDR, LRESULT *pResult)
+{
+   PostMessage(WM_COMMAND, ID_OBJECT_OPEN, 0);
+}
+
+
+//
+// WM_COMMAND::ID_OBJECT_OPEN message handler
+//
+
+void CMapFrame::OnObjectOpen() 
+{
+   NXC_OBJECT *pObject;
+
+   pObject = GetSelectedObject();
+   if (pObject != NULL)
+   {
+      if (m_dwHistoryPos < OBJECT_HISTORY_SIZE)
+         m_pObjectHistory[m_dwHistoryPos++] = m_pRootObject;
+      m_pRootObject = pObject;
+      PostMessage(WM_COMMAND, ID_VIEW_REFRESH, 0);
+   }
+}
+
+
+//
+// WM_COMMAND::ID_OBJECT_OPENPARENT message handler
+//
+
+void CMapFrame::OnObjectOpenparent() 
+{
+   if (m_pRootObject != NULL)
+   {
+      if (m_dwHistoryPos > 0)
+      {
+         m_pRootObject = m_pObjectHistory[--m_dwHistoryPos];
+      }
+      else
+      {
+         if (m_pRootObject->dwNumParents > 0)
+         {
+            m_pRootObject = NXCFindObjectById(m_pRootObject->pdwParentList[0]);
+         }
+         else
+         {
+            m_pRootObject = NULL;
+         }
+      }
+      PostMessage(WM_COMMAND, ID_VIEW_REFRESH, 0);
+   }
+}
+
+
+//
+// Get currently selected object, if any
+//
+
+NXC_OBJECT *CMapFrame::GetSelectedObject()
+{
+   int iItem;
+   NXC_OBJECT *pObject = NULL;
+
+   if (m_wndMapView.GetSelectedCount() == 1)
+   {
+      iItem = m_wndMapView.GetSelectionMark();
+      pObject = (NXC_OBJECT *)m_wndMapView.GetItemData(iItem);
+   }
+   return pObject;
+}
index ee51a69..e8b7369 100644 (file)
@@ -8,6 +8,10 @@
 //
 
 #include "MapView.h"
+#include "..\..\..\INCLUDE\nxclapi.h"  // Added by ClassView
+
+#define OBJECT_HISTORY_SIZE      512
+
 
 /////////////////////////////////////////////////////////////////////////////
 // CMapFrame frame
@@ -33,14 +37,26 @@ public:
 
 // Implementation
 protected:
-       CMapView m_wndMapView;
+       int m_iStatusImageBase;
+       DWORD m_dwHistoryPos;
+       NXC_OBJECT *m_pObjectHistory[OBJECT_HISTORY_SIZE];
+       NXC_OBJECT *GetSelectedObject(void);
+       void AddObjectToView(NXC_OBJECT *pObject);
+       CImageList *m_pImageList;
+       NXC_OBJECT *m_pRootObject;
+       CListCtrl m_wndMapView;
        virtual ~CMapFrame();
 
        // Generated message map functions
        //{{AFX_MSG(CMapFrame)
        afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
        afx_msg void OnSize(UINT nType, int cx, int cy);
+       afx_msg void OnSetFocus(CWnd* pOldWnd);
+       afx_msg void OnViewRefresh();
+       afx_msg void OnObjectOpen();
+       afx_msg void OnObjectOpenparent();
        //}}AFX_MSG
+   afx_msg void OnListViewDblClk(LPNMITEMACTIVATE pNMHDR, LRESULT *pResult);
        DECLARE_MESSAGE_MAP()
 };
 
index 70bd174..af87382 100644 (file)
@@ -23,9 +23,9 @@ CMapView::~CMapView()
 }
 
 
-BEGIN_MESSAGE_MAP(CMapView, CWnd)
+BEGIN_MESSAGE_MAP(CMapView, CListCtrl)
        //{{AFX_MSG_MAP(CMapView)
-               // NOTE - the ClassWizard will add and remove mapping macros here.
+       ON_WM_PAINT()
        //}}AFX_MSG_MAP
 END_MESSAGE_MAP()
 
@@ -33,11 +33,45 @@ END_MESSAGE_MAP()
 /////////////////////////////////////////////////////////////////////////////
 // CMapView message handlers
 
-BOOL CMapView::PreCreateWindow(CREATESTRUCT& cs) 
+
+
+void CMapView::OnPaint() 
 {
-   if (cs.lpszClass == NULL)
-      cs.lpszClass = AfxRegisterWndClass(CS_HREDRAW | CS_VREDRAW, 
-                                         LoadCursor(NULL, IDC_ARROW),
-                                         CreateSolidBrush(RGB(255, 255, 255)), NULL);
-       return CWnd::PreCreateWindow(cs);
+   int i, iNumItems;
+   POINT pt;
+   RECT rect;
+   LVITEM item;
+   TCHAR szBuffer[256];
+   CFont *pFont;
+
+   // Setup DC
+       CPaintDC dc(this); // device context for painting
+   pFont = dc.SelectObject(GetFont());
+
+   iNumItems = GetItemCount();
+   for(i = 0; i < iNumItems; i++)
+   {
+      GetItemPosition(i, &pt);
+      
+      item.iItem = i;
+      item.iSubItem = 0;
+      item.mask = LVIF_IMAGE | LVIF_PARAM | LVIF_TEXT | LVIF_STATE;
+      item.cchTextMax = 256;
+      item.pszText = szBuffer;
+      GetItem(&item);
+
+      // Draw icon
+      GetImageList(LVSIL_NORMAL)->Draw(&dc, item.iImage, pt, 
+             item.state & LVIS_SELECTED ? ILD_SELECTED : ILD_TRANSPARENT);
+      
+      // Draw text under icon
+      rect.left = pt.x - 16;
+      rect.right = pt.x + 48;
+      rect.top = pt.y + 32;
+      rect.bottom = rect.top + 32;
+      dc.DrawText(item.pszText, _tcslen(item.pszText), &rect, DT_CENTER | DT_WORDBREAK);
+   }
+
+   // Cleanup DC
+   dc.SelectObject(pFont);
 }
index 2018b5f..4447948 100644 (file)
@@ -1,6 +1,7 @@
 #if !defined(AFX_MAPVIEW_H__9082BB7F_2C80_4E6E_9FDB_A4D4039C2CB1__INCLUDED_)
 #define AFX_MAPVIEW_H__9082BB7F_2C80_4E6E_9FDB_A4D4039C2CB1__INCLUDED_
 
+#include "..\..\..\INCLUDE\nxclapi.h"  // Added by ClassView
 #if _MSC_VER > 1000
 #pragma once
 #endif // _MSC_VER > 1000
@@ -10,7 +11,7 @@
 /////////////////////////////////////////////////////////////////////////////
 // CMapView window
 
-class CMapView : public CWnd
+class CMapView : public CListCtrl
 {
 // Construction
 public:
@@ -26,7 +27,6 @@ public:
        // ClassWizard generated virtual function overrides
        //{{AFX_VIRTUAL(CMapView)
        protected:
-       virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
        //}}AFX_VIRTUAL
 
 // Implementation
@@ -36,7 +36,7 @@ public:
        // Generated message map functions
 protected:
        //{{AFX_MSG(CMapView)
-               // NOTE - the ClassWizard will add and remove member functions here.
+       afx_msg void OnPaint();
        //}}AFX_MSG
        DECLARE_MESSAGE_MAP()
 };
index 296c1f9..0f931e0 100644 (file)
@@ -117,7 +117,7 @@ COLORREF g_statusColorTable[9] =
    RGB(248, 63, 1),     // Major
    RGB(200, 0, 0),      // Critical
    RGB(61, 12, 187),    // Unknown
-   RGB(255, 255, 130),  // Unmanaged
+   RGB(192, 192, 192),  // Unmanaged
    RGB(91, 0, 6),       // Disabled
    RGB(255, 135, 255)   // Testing
 };
diff --git a/src/console/win32/icons/ovl_status_critical.ico b/src/console/win32/icons/ovl_status_critical.ico
new file mode 100644 (file)
index 0000000..4afb8a9
Binary files /dev/null and b/src/console/win32/icons/ovl_status_critical.ico differ
diff --git a/src/console/win32/icons/ovl_status_disabled.ico b/src/console/win32/icons/ovl_status_disabled.ico
new file mode 100644 (file)
index 0000000..3bbfc12
Binary files /dev/null and b/src/console/win32/icons/ovl_status_disabled.ico differ
diff --git a/src/console/win32/icons/ovl_status_major.ico b/src/console/win32/icons/ovl_status_major.ico
new file mode 100644 (file)
index 0000000..f1d1cec
Binary files /dev/null and b/src/console/win32/icons/ovl_status_major.ico differ
diff --git a/src/console/win32/icons/ovl_status_minor.ico b/src/console/win32/icons/ovl_status_minor.ico
new file mode 100644 (file)
index 0000000..a7e2673
Binary files /dev/null and b/src/console/win32/icons/ovl_status_minor.ico differ
diff --git a/src/console/win32/icons/ovl_status_testing.ico b/src/console/win32/icons/ovl_status_testing.ico
new file mode 100644 (file)
index 0000000..9fdc975
Binary files /dev/null and b/src/console/win32/icons/ovl_status_testing.ico differ
diff --git a/src/console/win32/icons/ovl_status_unknown.ico b/src/console/win32/icons/ovl_status_unknown.ico
new file mode 100644 (file)
index 0000000..cf67ecb
Binary files /dev/null and b/src/console/win32/icons/ovl_status_unknown.ico differ
diff --git a/src/console/win32/icons/ovl_status_unmanaged.ico b/src/console/win32/icons/ovl_status_unmanaged.ico
new file mode 100644 (file)
index 0000000..7071654
Binary files /dev/null and b/src/console/win32/icons/ovl_status_unmanaged.ico differ
diff --git a/src/console/win32/icons/ovl_status_warning.ico b/src/console/win32/icons/ovl_status_warning.ico
new file mode 100644 (file)
index 0000000..0cfae8e
Binary files /dev/null and b/src/console/win32/icons/ovl_status_warning.ico differ
index 805c6ad..ea93e61 100644 (file)
@@ -15,22 +15,22 @@ Class4=CChildFrame
 Class7=CEventBrowser
 Class9=CMapView
 
-ResourceCount=85
+ResourceCount=86
 Resource1=IDD_THRESHOLD (English (U.S.))
-Resource2=IDR_MAINFRAME
+Resource2=IDD_THRESHOLD
 Resource3=IDM_VIEW_SPECIFIC (English (U.S.))
-Resource4=IDD_EDIT_RULE_ALARM
-Resource5=IDD_SELECT_OBJECT
+Resource4=IDD_REQUEST_PROCESSING
+Resource5=IDD_ABOUTBOX
 Class2=CChildView
 Class5=CAboutDlg
 Class6=CControlPanel
 Class8=CMapFrame
 Class10=CLoginDialog
-Resource6=IDD_USER_PROPERTIES
+Resource6=IDD_CREATE_TG
 Class11=CProgressDialog
-Resource7=IDD_CP_GENERAL
+Resource7=IDD_OBJECT_GENERAL
 Class12=CObjectBrowser
-Resource8=IDD_MIB_BROWSER
+Resource8=IDA_NETMAP
 Class13=CObjectPropDlg
 Resource9=IDD_CP_GENERAL (English (U.S.))
 Resource10=IDA_OBJECT_BROWSER (English (U.S.))
@@ -46,7 +46,7 @@ Resource17=IDD_SET_PASSWORD (English (U.S.))
 Class16=CDebugFrame
 Resource18=IDD_OBJECT_SECURITY (English (U.S.))
 Resource19=IDD_OBJECT_PROPERTIES (English (U.S.))
-Resource20=IDD_SELECT_USER
+Resource20=IDD_CREATE_NODE
 Class17=CObjectPreview
 Resource21=IDD_DCI_TRANSFORM (English (U.S.))
 Class18=CToolBox
@@ -59,32 +59,32 @@ Class23=CNodePropsGeneral
 Resource23=IDD_LOGIN (English (U.S.))
 Class24=CObjectPropCaps
 Class25=CObjectPropSheet
-Resource24=IDA_ALARM_BROWSER
+Resource24=IDD_SELECT_EVENT
 Class26=CRequestProcessingDlg
 Resource25=IDD_EDIT_EVENT (English (U.S.))
 Resource26=IDD_PROGRESS (English (U.S.))
-Resource27=IDD_ACTION_PROPERTIES
+Resource27=IDD_DCI_COLLECTION
 Resource28=IDD_USER_PROPERTIES (English (U.S.))
 Class27=CObjectPropsGeneral
 Resource29=IDA_ALARM_BROWSER (English (U.S.))
 Class28=CObjectPropsSecurity
 Resource30=IDD_CREATE_NODE (English (U.S.))
-Resource31=IDD_DCI_COLLECTION
-Resource32=IDD_EDIT_RULE_COMMENT
+Resource31=IDA_OBJECT_BROWSER
+Resource32=IDD_LOGIN
 Class29=CUserSelectDlg
-Resource33=IDD_NEW_USER
+Resource33=IDD_DCI_TRANSFORM
 Class30=CUserEditor
 Resource34=IDD_DCI_PROPERTIES
 Class31=CNewUserDlg
-Resource35=IDA_MDI_DEFAULT
-Resource36=IDD_CREATE_TG
+Resource35=IDD_MIB_BROWSER
+Resource36=IDD_DCI_THRESHOLDS
 Class32=CUserPropDlg
 Resource37=IDM_CONTEXT (English (U.S.))
-Resource38=IDD_SELECT_ACTION
+Resource38=IDD_NEW_USER
 Class33=CGroupPropDlg
-Resource39=IDD_OBJECT_PRESENTATION
-Resource40=IDA_OBJECT_BROWSER
-Resource41=IDD_DCI_TRANSFORM
+Resource39=IDD_OBJECT_CAPS
+Resource40=IDD_SELECT_OBJECT
+Resource41=IDD_SET_PASSWORD
 Resource42=IDD_SELECT_OBJECT (English (U.S.))
 Class34=CPasswordChangeDlg
 Class35=CNodeSummary
@@ -100,55 +100,55 @@ Class41=CGraphFrame
 Class42=CDCIThresholdsPage
 Resource46=IDA_MDI_DEFAULT (English (U.S.))
 Resource47=IDD_OBJECT_CAPS (English (U.S.))
-Resource48=IDD_REQUEST_PROCESSING
+Resource48=IDD_ACTION_PROPERTIES
 Class43=CThresholdDlg
 Resource49=IDD_SELECT_USER (English (U.S.))
-Resource50=IDD_GROUP_PROPERTIES
+Resource50=IDA_MDI_DEFAULT
 Class44=CMIBBrowserDlg
 Class45=CEventPolicyEditor
 Class46=CRuleList
 Class47=CRuleHeader
 Resource51=IDR_MAINFRAME (English (U.S.))
-Resource52=IDD_LOGIN
+Resource52=IDD_EDIT_RULE_SEVERITY
 Class48=CObjectSelDlg
-Resource53=IDD_ABOUTBOX
-Resource54=IDD_EDIT_RULE_SEVERITY
+Resource53=IDD_OBJECT_PRESENTATION
+Resource54=IDM_VIEW_SPECIFIC
 Class49=CRuleCommentDlg
-Resource55=IDD_OBJECT_GENERAL
+Resource55=IDD_SELECT_ACTION
 Class50=CEventSelDlg
-Resource56=IDD_SET_PASSWORD
+Resource56=IDD_EDIT_EVENT
 Resource57=IDD_REQUEST_PROCESSING (English (U.S.))
-Resource58=IDD_DCI_THRESHOLDS
+Resource58=IDA_EPP
 Resource59=IDD_ABOUTBOX (English (U.S.))
 Resource60=IDD_MIB_BROWSER (English (U.S.))
 Class51=CObjectPropsPresentation
 Resource61=IDD_OBJECT_PRESENTATION (English (U.S.))
-Resource62=IDD_OBJECT_CAPS
+Resource62=IDD_NEW_ACTION
 Class52=CRuleSeverityDlg
-Resource63=IDD_SELECT_EVENT
+Resource63=IDM_CONTEXT
 Class53=CRuleAlarmDlg
 Class54=CAlarmBrowser
 Resource64=IDD_SELECT_EVENT (English (U.S.))
-Resource65=IDM_VIEW_SPECIFIC
+Resource65=IDR_MAINFRAME
 Resource66=IDD_NEW_ACTION (English (U.S.))
 Resource67=IDD_DCI_COLLECTION (English (U.S.))
 Resource68=IDD_NEW_USER (English (U.S.))
 Class55=CConsolePropsGeneral
 Class56=CActionEditor
-Resource69=IDD_EDIT_EVENT
-Resource70=IDD_CREATE_NODE
+Resource69=IDD_EDIT_RULE_ALARM
+Resource70=IDD_GROUP_PROPERTIES
 Class57=CNewActionDlg
-Resource71=IDD_NEW_ACTION
+Resource71=IDD_OBJECT_SECURITY
 Class58=CEditActionDlg
-Resource72=IDA_EPP
+Resource72=IDD_EDIT_RULE_COMMENT
 Class59=CActionSelDlg
-Resource73=IDD_CREATE_CONTAINER
+Resource73=IDD_USER_PROPERTIES
 Resource74=IDD_EDIT_RULE_COMMENT (English (U.S.))
 Resource75=IDD_EDIT_RULE_ALARM (English (U.S.))
-Resource76=IDM_CONTEXT
+Resource76=IDD_OBJECT_NODE_GENERAL
 Class60=CCreateObjectDlg
 Class61=CCreateContainerDlg
-Resource77=IDD_OBJECT_NODE_GENERAL
+Resource77=IDD_CP_GENERAL
 Class62=CCreateNodeDlg
 Resource78=IDA_EPP (English (U.S.))
 Resource79=IDD_CREATE_CONTAINER (English (U.S.))
@@ -158,11 +158,12 @@ Resource81=IDD_ACTION_PROPERTIES (English (U.S.))
 Class64=CPollNodeDlg
 Resource82=IDD_POLL_NODE (English (U.S.))
 Class65=CNodePoller
-Resource83=IDD_OBJECT_SECURITY
-Resource84=IDD_THRESHOLD
+Resource83=IDD_CREATE_CONTAINER
+Resource84=IDA_ALARM_BROWSER
 Class66=CCreateTemplateDlg
 Class67=CCreateTGDlg
-Resource85=IDD_CREATE_TEMPLATE
+Resource85=IDD_SELECT_USER
+Resource86=IDD_CREATE_TEMPLATE
 
 [CLS:CConsoleApp]
 Type=0
@@ -297,7 +298,7 @@ VirtualFilter=mfWC
 Type=0
 HeaderFile=MapView.h
 ImplementationFile=MapView.cpp
-BaseClass=CWnd
+BaseClass=CListCtrl
 Filter=W
 VirtualFilter=WC
 LastObject=CMapView
@@ -635,7 +636,23 @@ Command53=ID_CONTROLPANEL_EVENTS
 Command54=ID_CONTROLPANEL_EVENTPOLICY
 Command55=ID_CONTROLPANEL_USERS
 Command56=ID_CONTROLPANEL_DCT
-CommandCount=56
+Command57=ID_OBJECT_OPEN
+Command58=ID_OBJECT_OPENPARENT
+Command59=ID_OBJECT_FIND
+Command60=ID_OBJECT_CREATE_NODE
+Command61=ID_OBJECT_CREATE_CONTAINER
+Command62=ID_OBJECT_CREATE_TEMPLATEGROUP
+Command63=ID_OBJECT_CREATE_TEMPLATE
+Command64=ID_OBJECT_BIND
+Command65=ID_OBJECT_RENAME
+Command66=ID_OBJECT_DELETE
+Command67=ID_OBJECT_MANAGE
+Command68=ID_OBJECT_UNMANAGE
+Command69=ID_OBJECT_POLL_STATUS
+Command70=ID_OBJECT_POLL_CONFIGURATION
+Command71=ID_OBJECT_DATACOLLECTION
+Command72=ID_OBJECT_PROPERTIES
+CommandCount=72
 
 [ACL:IDA_MDI_DEFAULT]
 Type=1
@@ -1248,7 +1265,22 @@ Command57=ID_ACTION_RENAME
 Command58=ID_ACTION_DELETE
 Command59=ID_ACTION_PROPERTIES
 Command60=ID_POLL_RESTART
-CommandCount=60
+Command61=ID_OBJECT_OPEN
+Command62=ID_OBJECT_OPENPARENT
+Command63=ID_OBJECT_CREATE_NODE
+Command64=ID_OBJECT_CREATE_CONTAINER
+Command65=ID_OBJECT_CREATE_TEMPLATEGROUP
+Command66=ID_OBJECT_CREATE_TEMPLATE
+Command67=ID_OBJECT_BIND
+Command68=ID_OBJECT_RENAME
+Command69=ID_OBJECT_DELETE
+Command70=ID_OBJECT_MANAGE
+Command71=ID_OBJECT_UNMANAGE
+Command72=ID_OBJECT_POLL_STATUS
+Command73=ID_OBJECT_POLL_CONFIGURATION
+Command74=ID_OBJECT_DATACOLLECTION
+Command75=ID_OBJECT_PROPERTIES
+CommandCount=75
 
 [MNU:IDM_CONTEXT (English (U.S.))]
 Type=1
@@ -2200,3 +2232,9 @@ Filter=D
 VirtualFilter=dWC
 LastObject=CCreateTGDlg
 
+[ACL:IDA_NETMAP]
+Type=1
+Class=?
+Command1=ID_OBJECT_OPENPARENT
+CommandCount=1
+
index 6fdec19..c10ea5a 100644 (file)
@@ -265,6 +265,10 @@ BOOL CConsoleApp::InitInstance()
    InsertMenu(m_hAlarmBrowserMenu, LAST_APP_MENU, MF_BYPOSITION | MF_POPUP, (UINT_PTR)GetSubMenu(hMenu, 0), "&Window");
    InsertMenu(m_hAlarmBrowserMenu, LAST_APP_MENU, MF_BYPOSITION | MF_POPUP, (UINT_PTR)GetSubMenu(hMenu, 6), "&Alarm");
 
+   m_hMapMenu = LoadAppMenu(hMenu);
+   InsertMenu(m_hMapMenu, LAST_APP_MENU, MF_BYPOSITION | MF_POPUP, (UINT_PTR)GetSubMenu(hMenu, 0), "&Window");
+   InsertMenu(m_hMapMenu, LAST_APP_MENU, MF_BYPOSITION | MF_POPUP, (UINT_PTR)GetSubMenu(hMenu, 9), "&Object");
+
        m_hMDIAccel = ::LoadAccelerators(hInstance, MAKEINTRESOURCE(IDA_MDI_DEFAULT));
        m_hAlarmBrowserAccel = ::LoadAccelerators(hInstance, MAKEINTRESOURCE(IDA_ALARM_BROWSER));
        m_hEventBrowserAccel = ::LoadAccelerators(hInstance, MAKEINTRESOURCE(IDA_MDI_DEFAULT));
@@ -272,6 +276,7 @@ BOOL CConsoleApp::InitInstance()
        m_hUserEditorAccel = ::LoadAccelerators(hInstance, MAKEINTRESOURCE(IDA_MDI_DEFAULT));
        m_hDCEditorAccel = ::LoadAccelerators(hInstance, MAKEINTRESOURCE(IDA_MDI_DEFAULT));
        m_hPolicyEditorAccel = ::LoadAccelerators(hInstance, MAKEINTRESOURCE(IDA_EPP));
+       m_hMapAccel = ::LoadAccelerators(hInstance, MAKEINTRESOURCE(IDA_NETMAP));
 
        // The main window has been initialized, so show and update it.
    if (bSetWindowPos)
@@ -542,7 +547,7 @@ void CConsoleApp::OnViewMap()
        CMainFrame* pFrame = STATIC_DOWNCAST(CMainFrame, m_pMainWnd);
 
        // create a new MDI child window
-       pFrame->CreateNewChild(RUNTIME_CLASS(CMapFrame), IDR_MAPFRAME, m_hMDIMenu, m_hMDIAccel);
+       pFrame->CreateNewChild(RUNTIME_CLASS(CMapFrame), IDR_MAPFRAME, m_hMapMenu, m_hMapAccel);
 }
 
 
index edc0c5a..a3f2964 100644 (file)
@@ -742,6 +742,38 @@ SOURCE=.\res\nxcon.rc2
 # End Source File
 # Begin Source File
 
+SOURCE=.\icons\ovl_status_critical.ico
+# End Source File
+# Begin Source File
+
+SOURCE=.\icons\ovl_status_disabled.ico
+# End Source File
+# Begin Source File
+
+SOURCE=.\icons\ovl_status_major.ico
+# End Source File
+# Begin Source File
+
+SOURCE=.\icons\ovl_status_minor.ico
+# End Source File
+# Begin Source File
+
+SOURCE=.\icons\ovl_status_testing.ico
+# End Source File
+# Begin Source File
+
+SOURCE=.\icons\ovl_status_unknown.ico
+# End Source File
+# Begin Source File
+
+SOURCE=.\icons\ovl_status_unmanaged.ico
+# End Source File
+# Begin Source File
+
+SOURCE=.\icons\ovl_status_warning.ico
+# End Source File
+# Begin Source File
+
 SOURCE=.\icons\passwd.ico
 # End Source File
 # Begin Source File
index 010495d..c29b639 100644 (file)
@@ -127,6 +127,8 @@ protected:
        HACCEL m_hDCEditorAccel;      // Accelerator for data collection editor
        HMENU m_hPolicyEditorMenu;    // Menu for event policy editor
        HACCEL m_hPolicyEditorAccel;  // Accelerator for event policy editor
+       HMENU m_hMapMenu;             // Menu for map view
+       HACCEL m_hMapAccel;           // Accelerator for map view
        
 public:
        void EventHandler(DWORD dwEvent, DWORD dwCode, void *pArg);
index 0fe5770..1d8b735 100644 (file)
@@ -92,6 +92,14 @@ IDI_DISABLED            ICON    DISCARDABLE     "icons\\disabled.ico"
 IDI_UNSUPPORTED         ICON    DISCARDABLE     "icons\\unsupported.ico"
 IDI_DATACOLLECT         ICON    DISCARDABLE     "icons\\datacoll.ico"
 IDI_DCT                 ICON    DISCARDABLE     "icons\\dctemplate.ico"
+IDI_OVL_STATUS_MINOR    ICON    DISCARDABLE     "icons\\ovl_status_minor.ico"
+IDI_OVL_STATUS_WARNING  ICON    DISCARDABLE     "icons\\ovl_status_warning.ico"
+IDI_OVL_STATUS_CRITICAL ICON    DISCARDABLE     "icons\\ovl_status_critical.ico"
+IDI_OVL_STATUS_MAJOR    ICON    DISCARDABLE     "icons\\ovl_status_major.ico"
+IDI_OVL_STATUS_UNKNOWN  ICON    DISCARDABLE     "icons\\ovl_status_unknown.ico"
+IDI_OVL_STATUS_UNMANAGED ICON    DISCARDABLE     "icons\\ovl_status_unmanaged.ico"
+IDI_OVL_STATUS_DISABLED ICON    DISCARDABLE     "icons\\ovl_status_disabled.ico"
+IDI_OVL_STATUS_TESTING  ICON    DISCARDABLE     "icons\\ovl_status_testing.ico"
 
 /////////////////////////////////////////////////////////////////////////////
 //
@@ -181,7 +189,7 @@ BEGIN
         MENUITEM "&Details...\tEnter",          ID_EVENTS_DETAILS
         MENUITEM "&Go to source",               ID_EVENTS_GOTOSOURCE
     END
-    POPUP "&Object"
+    POPUP "&Object (browser)"
     BEGIN
         POPUP "&View"
         BEGIN
@@ -290,6 +298,39 @@ BEGIN
         MENUITEM "&Users",                      ID_CONTROLPANEL_USERS
         MENUITEM "Data Collection &Templates",  ID_CONTROLPANEL_DCT
     END
+    POPUP "&Object (map)"
+    BEGIN
+        MENUITEM "&Open",                       ID_OBJECT_OPEN
+        MENUITEM "Open parent\tBksp",           ID_OBJECT_OPENPARENT
+        MENUITEM SEPARATOR
+        MENUITEM "&Find...\tCtrl+F",            ID_OBJECT_FIND
+        MENUITEM SEPARATOR
+        POPUP "&Create..."
+        BEGIN
+            MENUITEM "&Node...",                    ID_OBJECT_CREATE_NODE
+            MENUITEM "&Container...",               ID_OBJECT_CREATE_CONTAINER
+
+            MENUITEM "Template &group...",          ID_OBJECT_CREATE_TEMPLATEGROUP
+
+            MENUITEM "&Template...",                ID_OBJECT_CREATE_TEMPLATE
+
+        END
+        MENUITEM "&Bind...\tCtrl+B",            ID_OBJECT_BIND
+        MENUITEM "&Rename",                     ID_OBJECT_RENAME
+        MENUITEM "&Delete",                     ID_OBJECT_DELETE
+        MENUITEM SEPARATOR
+        MENUITEM "&Manage object(s)\tCtrl+M",   ID_OBJECT_MANAGE
+        MENUITEM "&Unmanage object(s)\tCtrl+U", ID_OBJECT_UNMANAGE
+        POPUP "P&oll"
+        BEGIN
+            MENUITEM "&Status\tCtrl+Alt+S",         ID_OBJECT_POLL_STATUS
+            MENUITEM "&Configuration\tCtrl+Alt+C",  ID_OBJECT_POLL_CONFIGURATION
+
+        END
+        MENUITEM SEPARATOR
+        MENUITEM "D&ata collection",            ID_OBJECT_DATACOLLECTION
+        MENUITEM "&Properties",                 ID_OBJECT_PROPERTIES
+    END
 END
 
 IDM_CONTEXT MENU DISCARDABLE 
@@ -428,6 +469,37 @@ BEGIN
     BEGIN
         MENUITEM "&Restart",                    ID_POLL_RESTART
     END
+    POPUP "Object"
+    BEGIN
+        MENUITEM "&Open",                       ID_OBJECT_OPEN
+        MENUITEM "Open parent",                 ID_OBJECT_OPENPARENT
+        MENUITEM SEPARATOR
+        POPUP "&Create"
+        BEGIN
+            MENUITEM "&Node...",                    ID_OBJECT_CREATE_NODE
+            MENUITEM "&Container...",               ID_OBJECT_CREATE_CONTAINER
+
+            MENUITEM "Template &group...",          ID_OBJECT_CREATE_TEMPLATEGROUP
+
+            MENUITEM "&Template...",                ID_OBJECT_CREATE_TEMPLATE
+
+        END
+        MENUITEM "&Bind...",                    ID_OBJECT_BIND
+        MENUITEM "&Rename",                     ID_OBJECT_RENAME
+        MENUITEM "&Delete",                     ID_OBJECT_DELETE
+        MENUITEM SEPARATOR
+        MENUITEM "&Manage",                     ID_OBJECT_MANAGE
+        MENUITEM "&Unmanage",                   ID_OBJECT_UNMANAGE
+        POPUP "P&oll"
+        BEGIN
+            MENUITEM "&Status",                     ID_OBJECT_POLL_STATUS
+            MENUITEM "&Configuration",              ID_OBJECT_POLL_CONFIGURATION
+
+        END
+        MENUITEM SEPARATOR
+        MENUITEM "D&ata collection",            ID_OBJECT_DATACOLLECTION
+        MENUITEM "&Properties...",              ID_OBJECT_PROPERTIES
+    END
 END
 
 
@@ -502,6 +574,11 @@ BEGIN
     VK_DELETE,      ID_ALARM_DELETE,        VIRTKEY, NOINVERT
 END
 
+IDA_NETMAP ACCELERATORS DISCARDABLE 
+BEGIN
+    VK_BACK,        ID_OBJECT_OPENPARENT,   VIRTKEY, NOINVERT
+END
+
 
 /////////////////////////////////////////////////////////////////////////////
 //
@@ -1496,7 +1573,7 @@ BEGIN
     IDS_NXC_INIT_FAILED     "NetXMS client library initialization failed."
     IDR_CTRLPANEL           "\nControl Panel\nControl Panel"
     IDR_EVENTS              "\nEvent Browser\nEvent Browser"
-    IDS_MAPFRAME            "\nNetwork Map\nNetwork Map"
+    IDR_MAPFRAME            "\nNetwork Map\nNetwork Map"
     IDR_ALARMS              "\nAlarm Browser\nAlarm Browser"
 END
 
index 2200a84..9add4d4 100644 (file)
 #define IDD_POLL_NODE                   228
 #define IDD_CREATE_TG                   229
 #define IDD_CREATE_TEMPLATE             230
+#define IDA_NETMAP                      231
+#define IDI_OVL_STATUS_MINOR            232
+#define IDI_OVL_STATUS_WARNING          233
+#define IDI_OVL_STATUS_CRITICAL         234
+#define IDI_OVL_STATUS_MAJOR            235
+#define IDI_OVL_STATUS_UNKNOWN          236
+#define IDI_OVL_STATUS_UNMANAGED        237
+#define IDI_OVL_STATUS_DISABLED         238
+#define IDI_OVL_STATUS_TESTING          239
 #define ID_EDIT_BOX                     525
 #define IDC_EDIT_SERVER                 1000
 #define IDC_EDIT_LOGIN                  1001
 #define ID_ITEM_COPY                    32882
 #define ID_OBJECT_CREATE_TEMPLATEGROUP  32883
 #define ID_OBJECT_CREATE_TEMPLATE       32884
+#define ID_OBJECT_OPEN                  32885
+#define ID_OBJECT_OPENPARENT            32887
 #define IDS_GETFOLDERPATH_FAILED        61216
 #define IDS_WORKDIR_CREATION_FAILED     61217
 
 #ifdef APSTUDIO_INVOKED
 #ifndef APSTUDIO_READONLY_SYMBOLS
 #define _APS_3D_CONTROLS                     1
-#define _APS_NEXT_RESOURCE_VALUE        231
-#define _APS_NEXT_COMMAND_VALUE         32885
+#define _APS_NEXT_RESOURCE_VALUE        240
+#define _APS_NEXT_COMMAND_VALUE         32889
 #define _APS_NEXT_CONTROL_VALUE         1173
 #define _APS_NEXT_SYMED_VALUE           120
 #endif