[SVN-NetXMS] revision 3413

From: NetXMS.org SVN Server <svn_at_DOMAIN_REMOVED>
Date: Tue, 19 Aug 2008 17:49:57 +0300

* { font-family: Consolas, Lucida Console, Courier New; font-size: 100%; }
h1 { font-size: 150%; }
td.linenos { background-color: #f0f0f0; padding-right: 10px; }
span.lineno { background-color: #f0f0f0; padding: 0 5px 0 5px; }
pre { line-height: 100%; width: 100%; }
.highlight span { width: 100%; display:-moz-inline-stack; display:inline-block; zoom:1; *display:inline; }
body { background: #ffffff; }
body .c { color: #999988; font-style: italic } /* Comment */
body .err { color: #a61717; background-color: #e3d2d2 } /* Error */
body .k { font-weight: bold } /* Keyword */
body .o { font-weight: bold } /* Operator */
body .cm { color: #999988; font-style: italic } /* Comment.Multiline */
body .cp { color: #999999; font-weight: bold } /* Comment.Preproc */
body .c1 { color: #999988; font-style: italic } /* Comment.Single */
body .cs { color: #999999; font-weight: bold; font-style: italic } /* Comment.Special */
body .gd { color: #000000; background-color: #ffdddd } /* Generic.Deleted */
body .ge { font-style: italic } /* Generic.Emph */
body .gr { color: #aa0000 } /* Generic.Error */
body .gh { color: #999999 } /* Generic.Heading */
body .gi { color: #000000; background-color: #ddffdd } /* Generic.Inserted */
body .go { color: #888888 } /* Generic.Output */
body .gp { color: #555555 } /* Generic.Prompt */
body .gs { font-weight: bold } /* Generic.Strong */
body .gu { color: #aaaaaa } /* Generic.Subheading */
body .gt { color: #aa0000 } /* Generic.Traceback */
body .kc { font-weight: bold } /* Keyword.Constant */
body .kd { font-weight: bold } /* Keyword.Declaration */
body .kp { font-weight: bold } /* Keyword.Pseudo */
body .kr { font-weight: bold } /* Keyword.Reserved */
body .kt { color: #445588; font-weight: bold } /* Keyword.Type */
body .m { color: #009999 } /* Literal.Number */
body .s { color: #bb8844 } /* Literal.String */
body .na { color: #008080 } /* Name.Attribute */
body .nb { color: #999999 } /* Name.Builtin */
body .nc { color: #445588; font-weight: bold } /* Name.Class */
body .no { color: #008080 } /* Name.Constant */
body .ni { color: #800080 } /* Name.Entity */
body .ne { color: #990000; font-weight: bold } /* Name.Exception */
body .nf { color: #990000; font-weight: bold } /* Name.Function */
body .nn { color: #555555 } /* Name.Namespace */
body .nt { color: #000080 } /* Name.Tag */
body .nv { color: #008080 } /* Name.Variable */
body .ow { font-weight: bold } /* Operator.Word */
body .w { color: #bbbbbb } /* Text.Whitespace */
body .mf { color: #009999 } /* Literal.Number.Float */
body .mh { color: #009999 } /* Literal.Number.Hex */
body .mi { color: #009999 } /* Literal.Number.Integer */
body .mo { color: #009999 } /* Literal.Number.Oct */
body .sb { color: #bb8844 } /* Literal.String.Backtick */
body .sc { color: #bb8844 } /* Literal.String.Char */
body .sd { color: #bb8844 } /* Literal.String.Doc */
body .s2 { color: #bb8844 } /* Literal.String.Double */
body .se { color: #bb8844 } /* Literal.String.Escape */
body .sh { color: #bb8844 } /* Literal.String.Heredoc */
body .si { color: #bb8844 } /* Literal.String.Interpol */
body .sx { color: #bb8844 } /* Literal.String.Other */
body .sr { color: #808000 } /* Literal.String.Regex */
body .s1 { color: #bb8844 } /* Literal.String.Single */
body .ss { color: #bb8844 } /* Literal.String.Symbol */
body .bp { color: #999999 } /* Name.Builtin.Pseudo */
body .vc { color: #008080 } /* Name.Variable.Class */
body .vg { color: #008080 } /* Name.Variable.Global */
body .vi { color: #008080 } /* Name.Variable.Instance */
body .il { color: #009999 } /* Literal.Number.Integer.Long */

Info

Revision:3413
Author:victor

Date:2008-08-19 17:49:56 +0300 (Tue, 19 Aug 2008)

Comment:implemented map rename

Changes
U trunk/src/console/win32/MapManager.cpp
U trunk/src/console/win32/MapManager.h

Diff
Modified: trunk/src/console/win32/MapManager.cpp
===================================================================
--- trunk/src/console/win32/MapManager.cpp 2007-09-23 14:25:04 UTC (rev 3412)
+++ trunk/src/console/win32/MapManager.cpp 2008-08-19 14:49:56 UTC (rev 3413)
@@ -5,6 +5,7 @@
 #include &quot;nxcon.h&quot;
 #include &quot;MapManager.h&quot;
 #include &quot;CreateNetMapDlg.h&quot;
+#include &quot;InputBox.h&quot;
 
 #ifdef _DEBUG
 #define new DEBUG_NEW
@@ -40,7 +41,6 @@
         ON_COMMAND(ID_MAP_RENAME, OnMapRename)
         ON_UPDATE_COMMAND_UI(ID_MAP_RENAME, OnUpdateMapRename)
         //}}AFX_MSG_MAP
- ON_NOTIFY(LVN_ENDLABELEDIT, ID_LIST_VIEW, OnListViewEndLabelEdit)
 END_MESSAGE_MAP()
 
 
@@ -69,8 +69,8 @@
 
         GetClientRect(&amp;rect);
         m_wndListCtrl.Create(WS_CHILD | WS_VISIBLE | LVS_REPORT | LVS_EDITLABELS, rect, this, ID_LIST_VIEW);
- m_wndListCtrl.InsertColumn(0, _T(&quot;Name&quot;), LVCFMT_LEFT, 150);
- m_wndListCtrl.InsertColumn(1, _T(&quot;ID&quot;), LVCFMT_LEFT, 60);
+ m_wndListCtrl.InsertColumn(0, _T(&quot;ID&quot;), LVCFMT_LEFT, 60);
+ m_wndListCtrl.InsertColumn(1, _T(&quot;Name&quot;), LVCFMT_LEFT, 150);
         m_wndListCtrl.InsertColumn(2, _T(&quot;Root object&quot;), LVCFMT_LEFT, 150);
         m_wndListCtrl.SetExtendedStyle(LVS_EX_GRIDLINES | LVS_EX_FULLROWSELECT);
         LoadListCtrlColumns(m_wndListCtrl, _T(&quot;MapManager&quot;), _T(&quot;ListCtrl&quot;));
@@ -136,12 +136,12 @@
         {
                 for(i = 0; i &lt; numMaps; i++)
                 {
- item = m_wndListCtrl.InsertItem(i, mapList[i].szName);
+ _stprintf(buffer, _T(&quot;%d&quot;), mapList[i].dwMapId);
+ item = m_wndListCtrl.InsertItem(i, buffer);
                         if (item != -1)
                         {
                                 m_wndListCtrl.SetItemData(item, mapList[i].dwMapId);
- _stprintf(buffer, _T(&quot;%d&quot;), mapList[i].dwMapId);
- m_wndListCtrl.SetItemText(item, 1, buffer);
+ m_wndListCtrl.SetItemText(item, 1, mapList[i].szName);
                                 object = NXCFindObjectById(g_hSession, mapList[i].dwObjectId);
                                 m_wndListCtrl.SetItemText(item, 2, (object != NULL) ? object-&gt;szName : _T(&quot;&lt;unknown&gt;&quot;));
                         }
@@ -173,12 +173,12 @@
                                     &amp;mapId, _T(&quot;Creating new network map...&quot;));
                 if (rcc == RCC_SUCCESS)
                 {
- item = m_wndListCtrl.InsertItem(0x7FFFFFFF, dlg.m_strName);
+ _stprintf(buffer, _T(&quot;%d&quot;), mapId);
+ item = m_wndListCtrl.InsertItem(0x7FFFFFFF, buffer);
                         if (item != -1)
                         {
                                 m_wndListCtrl.SetItemData(item, mapId);
- _stprintf(buffer, _T(&quot;%d&quot;), mapId);
- m_wndListCtrl.SetItemText(item, 1, buffer);
+ m_wndListCtrl.SetItemText(item, 1, dlg.m_strName);
                                 object = NXCFindObjectById(g_hSession, dlg.m_dwRootObj);
                                 m_wndListCtrl.SetItemText(item, 2, (object != NULL) ? object-&gt;szName : _T(&quot;&lt;unknown&gt;&quot;));
                         }
@@ -239,23 +239,33 @@
 
 void CMapManager::OnMapRename()
 {
+ CInputBox dlg;
+ int item;
+ DWORD rcc;
+
         if (m_wndListCtrl.GetSelectedCount() != 1)
                 return;
 
- m_wndListCtrl.EditLabel(m_wndListCtrl.GetSelectionMark());
+ item = m_wndListCtrl.GetSelectionMark();
+ dlg.m_strTitle = _T(&quot;Rename Map&quot;);
+ dlg.m_strHeader = _T(&quot;Enter new map name&quot;);
+ dlg.m_strText = m_wndListCtrl.GetItemText(item, 1);
+ if (dlg.DoModal() == IDOK)
+ {
+ rcc = DoRequestArg3(NXCRenameMap, g_hSession, (void *)m_wndListCtrl.GetItemData(item),
+ (void *)((LPCTSTR)dlg.m_strText), _T(&quot;Renaming map...&quot;));
+ if (rcc == RCC_SUCCESS)
+ {
+ m_wndListCtrl.SetItemText(item, 1, dlg.m_strText);
+ }
+ else
+ {
+ theApp.ErrorBox(rcc, _T(&quot;Unable to rename map: %s&quot;));
+ }
+ }
 }
 
 void CMapManager::OnUpdateMapRename(CCmdUI* pCmdUI)
 {
         pCmdUI-&gt;Enable(m_wndListCtrl.GetSelectedCount() == 1);
 }
-
-
-//
-// Handler for end label edit
-//
-
-void CMapManager::OnListViewEndLabelEdit(LPNMLISTVIEW pNMHDR, LRESULT *pResult)
-{
- *pResult = 0;
-}

Modified: trunk/src/console/win32/MapManager.h
===================================================================
--- trunk/src/console/win32/MapManager.h 2007-09-23 14:25:04 UTC (rev 3412)
+++ trunk/src/console/win32/MapManager.h 2008-08-19 14:49:56 UTC (rev 3413)
@@ -48,7 +48,6 @@
         afx_msg void OnMapRename();
         afx_msg void OnUpdateMapRename(CCmdUI* pCmdUI);
         //}}AFX_MSG
- afx_msg void OnListViewEndLabelEdit(LPNMLISTVIEW pNMHDR, LRESULT *pResult);
         DECLARE_MESSAGE_MAP()
 };
 
Received on Tue Aug 19 2008 - 17:49:57 EEST

This archive was generated by hypermail 2.2.0 : Tue Aug 19 2008 - 17:49:55 EEST