[SVN-NetXMS] revision 3344

From: NetXMS.org SVN Server <svn_at_DOMAIN_REMOVED>
Date: Fri, 27 Jun 2008 00:43:51 +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:3344
Author:alk

Date:2008-06-27 00:43:51 +0300 (Fri, 27 Jun 2008)

Comment:Code reformat

Changes
U trunk/src/client/console/libnxmc/objseldlg.cpp
U trunk/src/client/console/libnxmc/objseldlg.h

Diff
Modified: trunk/src/client/console/libnxmc/objseldlg.cpp
===================================================================
--- trunk/src/client/console/libnxmc/objseldlg.cpp 2008-06-26 21:40:28 UTC (rev 3343)
+++ trunk/src/client/console/libnxmc/objseldlg.cpp 2008-06-26 21:43:51 UTC (rev 3344)
@@ -41,11 +41,11 @@
 //
 
 nxObjectSelDlg::nxObjectSelDlg(wxWindow *parent)
- : wxDialog()
+ : wxDialog()
 {
         wxConfig::Get()-&gt;Read(_T(&quot;/ObjectSelDlg/SortMode&quot;), &amp;m_sortMode, 0);
         wxConfig::Get()-&gt;Read(_T(&quot;/ObjectSelDlg/SortDir&quot;), &amp;m_sortDir, 1);
-
+
         m_parentObjectId = 0;
         m_allowedClasses = SCL_NODE;
         m_isSelectAddress = false;
@@ -53,7 +53,7 @@
         m_isSingleSelection = true;
         m_isEmptySelectionAllowed = false;
         m_customAttributeFilter = NULL;
-
+
         wxXmlResource::Get()-&gt;LoadDialog(this, parent, _T(&quot;nxObjectSelDlg&quot;));
         GetSizer()-&gt;Fit(this);
 }
@@ -79,7 +79,7 @@
         wxListCtrl *wndListCtrl;
         int i, count;
         long item;
-
+
         wndListCtrl = XRCCTRL(*this, &quot;wndListCtrl&quot;, wxListCtrl);
         count = wndListCtrl-&gt;GetSelectedItemCount();
         for(i = 0, item = -1; i &lt; count;i++)
@@ -99,113 +99,113 @@
         DWORD i, numObjects;
         NXC_OBJECT_INDEX *index;
         long item;
- static DWORD classMask[15] = { 0, SCL_SUBNET, SCL_NODE, SCL_INTERFACE,
- SCL_NETWORK, SCL_CONTAINER, SCL_ZONE,
- SCL_SERVICEROOT, SCL_TEMPLATE, SCL_TEMPLATEGROUP,
- SCL_TEMPLATEROOT, SCL_NETWORKSERVICE,
- SCL_VPNCONNECTOR, SCL_CONDITION, SCL_CLUSTER };
-
+ static DWORD classMask[15] = { 0, SCL_SUBNET, SCL_NODE, SCL_INTERFACE,
+ SCL_NETWORK, SCL_CONTAINER, SCL_ZONE,
+ SCL_SERVICEROOT, SCL_TEMPLATE, SCL_TEMPLATEGROUP,
+ SCL_TEMPLATEROOT, SCL_NETWORKSERVICE,
+ SCL_VPNCONNECTOR, SCL_CONDITION, SCL_CLUSTER };
+
         wndListCtrl = XRCCTRL(*this, &quot;wndListCtrl&quot;, wxListCtrl);
         if (wndListCtrl == NULL)
         {
                 wxLogError(_T(&quot;INTERNAL ERROR: wndListCtrl is NULL in nxObjectSelDlg::TransferDataToWindow&quot;));
                 return false;
         }
-
+
         wxImageList *imgList = NXMCGetImageListCopy(IMAGE_LIST_OBJECTS_SMALL);
         imgList-&gt;Add(wxXmlResource::Get()-&gt;LoadIcon(_T(&quot;icoSortUp&quot;)));
         imgList-&gt;Add(wxXmlResource::Get()-&gt;LoadIcon(_T(&quot;icoSortDown&quot;)));
         wndListCtrl-&gt;AssignImageList(imgList, wxIMAGE_LIST_SMALL);
-
- width = wndListCtrl-&gt;GetClientSize().x;
- if (m_isSelectAddress)
- {
- wndListCtrl-&gt;InsertColumn(0, _T(&quot;Interface&quot;), wxLIST_FORMAT_LEFT,
- width - 150 - wxSystemSettings::GetMetric(wxSYS_VSCROLL_X));
- wndListCtrl-&gt;InsertColumn(1, _T(&quot;IP Address&quot;), wxLIST_FORMAT_LEFT, 150);
- }
- else
- {
- wndListCtrl-&gt;InsertColumn(0, _T(&quot;Name&quot;), wxLIST_FORMAT_LEFT,
- width - 100 - wxSystemSettings::GetMetric(wxSYS_VSCROLL_X));
- wndListCtrl-&gt;InsertColumn(1, _T(&quot;Class&quot;), wxLIST_FORMAT_LEFT, 100);
- }
- if (m_isSingleSelection)
- {
+
+ width = wndListCtrl-&gt;GetClientSize().x;
+ if (m_isSelectAddress)
+ {
+ wndListCtrl-&gt;InsertColumn(0, _T(&quot;Interface&quot;), wxLIST_FORMAT_LEFT,
+ width - 150 - wxSystemSettings::GetMetric(wxSYS_VSCROLL_X));
+ wndListCtrl-&gt;InsertColumn(1, _T(&quot;IP Address&quot;), wxLIST_FORMAT_LEFT, 150);
+ }
+ else
+ {
+ wndListCtrl-&gt;InsertColumn(0, _T(&quot;Name&quot;), wxLIST_FORMAT_LEFT,
+ width - 100 - wxSystemSettings::GetMetric(wxSYS_VSCROLL_X));
+ wndListCtrl-&gt;InsertColumn(1, _T(&quot;Class&quot;), wxLIST_FORMAT_LEFT, 100);
+ }
+ if (m_isSingleSelection)
+ {
                 wndListCtrl-&gt;SetSingleStyle(wxLC_SINGLE_SEL);
- }
-
- // Fill in object list
- if (m_parentObjectId == 0)
- {
- NXCLockObjectIndex(NXMCGetSession());
- index = (NXC_OBJECT_INDEX *)NXCGetObjectIndex(NXMCGetSession(), &amp;numObjects);
- for(i = 0; i &lt; numObjects; i++)
- if ((classMask[index[i].object-&gt;iClass] &amp; m_allowedClasses) &amp;&amp;
- (!index[i].object-&gt;bIsDeleted))
- {
- item = wndListCtrl-&gt;InsertItem(0x7FFFFFFF, index[i].object-&gt;szName,
- index[i].object-&gt;iClass);
- wndListCtrl-&gt;SetItem(item, 1, NXMCGetClassName(index[i].object-&gt;iClass));
- wndListCtrl-&gt;SetItemData(item, index[i].object-&gt;dwId);
- }
- NXCUnlockObjectIndex(NXMCGetSession());
- }
- else
- {
- NXC_OBJECT *object, *child;
- TCHAR buffer[16];
-
- object = NXCFindObjectById(NXMCGetSession(), m_parentObjectId);
- if (object != NULL)
- {
- for(i = 0; i &lt; object-&gt;dwNumChilds; i++)
- {
- child = NXCFindObjectById(NXMCGetSession(), object-&gt;pdwChildList[i]);
- if (child != NULL)
- {
- if (m_isSelectAddress)
- {
- if ((child-&gt;iClass == OBJECT_INTERFACE) &amp;&amp;
- (child-&gt;dwIpAddr != 0) &amp;&amp; (!child-&gt;bIsDeleted))
- {
- item = wndListCtrl-&gt;InsertItem(0x7FFFFFFF, child-&gt;szName, OBJECT_INTERFACE);
- wndListCtrl-&gt;SetItem(item, 1, IpToStr(child-&gt;dwIpAddr, buffer));
- wndListCtrl-&gt;SetItemData(item, object-&gt;pdwChildList[i]);
- }
- }
- else
- {
- if ((classMask[child-&gt;iClass] &amp; m_allowedClasses) &amp;&amp;
- (!child-&gt;bIsDeleted))
- {
- item = wndListCtrl-&gt;InsertItem(0x7FFFFFFF, child-&gt;szName, child-&gt;iClass);
- wndListCtrl-&gt;SetItem(item, 1, NXMCGetClassName(child-&gt;iClass));
- wndListCtrl-&gt;SetItemData(item, object-&gt;pdwChildList[i]);
- }
- }
- }
- }
-
- if (m_isSelectAddress &amp;&amp; m_isShowLoopback)
- {
- item = wndListCtrl-&gt;InsertItem(0x7FFFFFFF, _T(&quot;&lt;loopback&gt;&quot;), OBJECT_INTERFACE);
- wndListCtrl-&gt;SetItem(item, 1, _T(&quot;127.0.0.1&quot;));
- wndListCtrl-&gt;SetItemData(item, 0);
- }
- }
- }
-
+ }
+
+ // Fill in object list
+ if (m_parentObjectId == 0)
+ {
+ NXCLockObjectIndex(NXMCGetSession());
+ index = (NXC_OBJECT_INDEX *)NXCGetObjectIndex(NXMCGetSession(), &amp;numObjects);
+ for(i = 0; i &lt; numObjects; i++)
+ if ((classMask[index[i].object-&gt;iClass] &amp; m_allowedClasses) &amp;&amp;
+ (!index[i].object-&gt;bIsDeleted))
+ {
+ item = wndListCtrl-&gt;InsertItem(0x7FFFFFFF, index[i].object-&gt;szName,
+ index[i].object-&gt;iClass);
+ wndListCtrl-&gt;SetItem(item, 1, NXMCGetClassName(index[i].object-&gt;iClass));
+ wndListCtrl-&gt;SetItemData(item, index[i].object-&gt;dwId);
+ }
+ NXCUnlockObjectIndex(NXMCGetSession());
+ }
+ else
+ {
+ NXC_OBJECT *object, *child;
+ TCHAR buffer[16];
+
+ object = NXCFindObjectById(NXMCGetSession(), m_parentObjectId);
+ if (object != NULL)
+ {
+ for(i = 0; i &lt; object-&gt;dwNumChilds; i++)
+ {
+ child = NXCFindObjectById(NXMCGetSession(), object-&gt;pdwChildList[i]);
+ if (child != NULL)
+ {
+ if (m_isSelectAddress)
+ {
+ if ((child-&gt;iClass == OBJECT_INTERFACE) &amp;&amp;
+ (child-&gt;dwIpAddr != 0) &amp;&amp; (!child-&gt;bIsDeleted))
+ {
+ item = wndListCtrl-&gt;InsertItem(0x7FFFFFFF, child-&gt;szName, OBJECT_INTERFACE);
+ wndListCtrl-&gt;SetItem(item, 1, IpToStr(child-&gt;dwIpAddr, buffer));
+ wndListCtrl-&gt;SetItemData(item, object-&gt;pdwChildList[i]);
+ }
+ }
+ else
+ {
+ if ((classMask[child-&gt;iClass] &amp; m_allowedClasses) &amp;&amp;
+ (!child-&gt;bIsDeleted))
+ {
+ item = wndListCtrl-&gt;InsertItem(0x7FFFFFFF, child-&gt;szName, child-&gt;iClass);
+ wndListCtrl-&gt;SetItem(item, 1, NXMCGetClassName(child-&gt;iClass));
+ wndListCtrl-&gt;SetItemData(item, object-&gt;pdwChildList[i]);
+ }
+ }
+ }
+ }
+
+ if (m_isSelectAddress &amp;&amp; m_isShowLoopback)
+ {
+ item = wndListCtrl-&gt;InsertItem(0x7FFFFFFF, _T(&quot;&lt;loopback&gt;&quot;), OBJECT_INTERFACE);
+ wndListCtrl-&gt;SetItem(item, 1, _T(&quot;127.0.0.1&quot;));
+ wndListCtrl-&gt;SetItemData(item, 0);
+ }
+ }
+ }
+
         SortObjects();
-
- // Disable &quot;None&quot; button if empty selection is not allowed
- if (!m_isEmptySelectionAllowed)
- {
+
+ // Disable &quot;None&quot; button if empty selection is not allowed
+ if (!m_isEmptySelectionAllowed)
+ {
                 wxButton *btn = XRCCTRL(*this, &quot;btnNone&quot;, wxButton);
                 if (btn != NULL)
                         btn-&gt;Hide();
- }
-
+ }
+
         return true;
 }
 
@@ -217,7 +217,7 @@
 void nxObjectSelDlg::OnInitDialog(wxInitDialogEvent &amp;event)
 {
         wxWindow *wnd;
-
+
         wnd = FindWindowById(wxID_OK, this);
         if (wnd != NULL)
                 ((wxButton *)wnd)-&gt;SetDefault();
@@ -237,31 +237,31 @@
         int rc;
         TCHAR name1[MAX_OBJECT_NAME], name2[MAX_OBJECT_NAME];
         NXC_OBJECT *obj1, *obj2;
-
+
         switch(mode)
         {
- case 0: // Name
- NXCGetComparableObjectName(NXMCGetSession(), item1, name1);
- NXCGetComparableObjectName(NXMCGetSession(), item2, name2);
- rc = _tcsicmp(name1, name2);
- break;
- case 1: // Class or IP address
- obj1 = NXCFindObjectById(NXMCGetSession(), item1);
- obj2 = NXCFindObjectById(NXMCGetSession(), item2);
- if (sortData &amp; 0x4000) // IP address
- {
- rc = COMPARE_NUMBERS(obj1-&gt;dwIpAddr, obj2-&gt;dwIpAddr);
- }
- else
- {
- rc = _tcsicmp(NXMCGetClassName(obj1-&gt;iClass), NXMCGetClassName(obj2-&gt;iClass));
- }
- break;
- default:
- rc = 0;
- break;
+ case 0: // Name
+ NXCGetComparableObjectName(NXMCGetSession(), item1, name1);
+ NXCGetComparableObjectName(NXMCGetSession(), item2, name2);
+ rc = _tcsicmp(name1, name2);
+ break;
+ case 1: // Class or IP address
+ obj1 = NXCFindObjectById(NXMCGetSession(), item1);
+ obj2 = NXCFindObjectById(NXMCGetSession(), item2);
+ if (sortData &amp; 0x4000) // IP address
+ {
+ rc = COMPARE_NUMBERS(obj1-&gt;dwIpAddr, obj2-&gt;dwIpAddr);
+ }
+ else
+ {
+ rc = _tcsicmp(NXMCGetClassName(obj1-&gt;iClass), NXMCGetClassName(obj2-&gt;iClass));
+ }
+ break;
+ default:
+ rc = 0;
+ break;
         }
-
+
         return (sortData &amp; 0x8000) ? rc : -rc;
 }
 
@@ -274,7 +274,7 @@
 {
         wxListCtrl *wndListCtrl = XRCCTRL(*this, &quot;wndListCtrl&quot;, wxListCtrl);
         wndListCtrl-&gt;SortItems(CompareObjects, m_sortMode | ((m_sortDir == 1) ? 0x8000 : 0) | (m_isSelectAddress ? 0x4000 : 0));
-
+
         wxListItem col;
 // col.SetColumn(m_sortMode);
         col.SetMask(wxLIST_MASK_IMAGE);
@@ -290,14 +290,14 @@
 void nxObjectSelDlg::OnListColumnClick(wxListEvent &amp;event)
 {
         wxListCtrl *wndListCtrl = XRCCTRL(*this, &quot;wndListCtrl&quot;, wxListCtrl);
-
+
 // wndListCtrl-&gt;ClearColumnImage(m_sortMode);
         wxListItem col;
 // col.SetColumn(m_sortMode);
         col.SetMask(wxLIST_MASK_IMAGE);
         col.SetImage(-1);
         wndListCtrl-&gt;SetColumn(m_sortMode, col);
-
+
         if (m_sortMode == event.GetColumn())
         {
                 m_sortDir = -m_sortDir;

Modified: trunk/src/client/console/libnxmc/objseldlg.h
===================================================================
--- trunk/src/client/console/libnxmc/objseldlg.h 2008-06-26 21:40:28 UTC (rev 3343)
+++ trunk/src/client/console/libnxmc/objseldlg.h 2008-06-26 21:43:51 UTC (rev 3344)
@@ -30,18 +30,18 @@
 // Allowed classes
 //
 
-#define SCL_NODE 0x0001
-#define SCL_INTERFACE 0x0002
-#define SCL_CONTAINER 0x0004
-#define SCL_SUBNET 0x0008
-#define SCL_NETWORK 0x0010
-#define SCL_SERVICEROOT 0x0020
-#define SCL_ZONE 0x0040
-#define SCL_NETWORKSERVICE 0x0080
-#define SCL_TEMPLATE 0x0100
-#define SCL_TEMPLATEGROUP 0x0200
-#define SCL_TEMPLATEROOT 0x0400
-#define SCL_VPNCONNECTOR 0x0800
+#define SCL_NODE 0x0001
+#define SCL_INTERFACE 0x0002
+#define SCL_CONTAINER 0x0004
+#define SCL_SUBNET 0x0008
+#define SCL_NETWORK 0x0010
+#define SCL_SERVICEROOT 0x0020
+#define SCL_ZONE 0x0040
+#define SCL_NETWORKSERVICE 0x0080
+#define SCL_TEMPLATE 0x0100
+#define SCL_TEMPLATEGROUP 0x0200
+#define SCL_TEMPLATEROOT 0x0400
+#define SCL_VPNCONNECTOR 0x0800
 #define SCL_CONDITION 0x1000
 #define SCL_CLUSTER 0x2000
 
@@ -55,17 +55,17 @@
 private:
         int m_sortMode;
         int m_sortDir;
-
+
         void SortObjects();
-
+
 protected:
         virtual bool TransferDataFromWindow(void);
         virtual bool TransferDataToWindow(void);
-
+
 public:
         nxObjectSelDlg(wxWindow *parent);
         virtual ~nxObjectSelDlg();
-
+
         DWORD m_parentObjectId;
         DWORD m_allowedClasses;
         bool m_isSelectAddress;
@@ -74,13 +74,13 @@
         bool m_isEmptySelectionAllowed;
         TCHAR *m_customAttributeFilter;
         wxArrayLong m_objectList;
-
+
 // Event handlers
 protected:
         void OnInitDialog(wxInitDialogEvent &amp;event);
         void OnListColumnClick(wxListEvent &amp;event);
         void OnListItemActivate(wxListEvent &amp;event);
-
+
         DECLARE_EVENT_TABLE()
 };
 
Received on Fri Jun 27 2008 - 00:43:51 EEST

This archive was generated by hypermail 2.2.0 : Fri Jun 27 2008 - 00:38:53 EEST