summaryrefslogtreecommitdiff
path: root/Plugins/extraicons/ExtraIcon.cpp
diff options
context:
space:
mode:
authorpescuma <pescuma@c086bb3d-8645-0410-b8da-73a8550f86e7>2009-04-17 01:59:38 +0000
committerpescuma <pescuma@c086bb3d-8645-0410-b8da-73a8550f86e7>2009-04-17 01:59:38 +0000
commitd27127d44576580e3a0000590b6179f06cc67b8e (patch)
treef5643bfb5d73ec3e4089c9cc6dcf44e5740e8ac9 /Plugins/extraicons/ExtraIcon.cpp
parentfc229f1f9ff3600a9708da57f5629e14673011b7 (diff)
extraicons: new options dialog
git-svn-id: http://pescuma.googlecode.com/svn/trunk/Miranda@167 c086bb3d-8645-0410-b8da-73a8550f86e7
Diffstat (limited to 'Plugins/extraicons/ExtraIcon.cpp')
-rw-r--r--Plugins/extraicons/ExtraIcon.cpp64
1 files changed, 62 insertions, 2 deletions
diff --git a/Plugins/extraicons/ExtraIcon.cpp b/Plugins/extraicons/ExtraIcon.cpp
index 89775f1..3e33f5b 100644
--- a/Plugins/extraicons/ExtraIcon.cpp
+++ b/Plugins/extraicons/ExtraIcon.cpp
@@ -19,9 +19,10 @@
#include "commons.h"
-ExtraIcon::ExtraIcon(const char *name, const char *description, const char *descIcon, MIRANDAHOOKPARAM OnClick,
+ExtraIcon::ExtraIcon(int id, const char *name, const char *description, const char *descIcon, MIRANDAHOOKPARAM OnClick,
LPARAM param) :
- name(name), description(description), descIcon(descIcon), OnClick(OnClick), onClickParam(param), slot(-1)
+ id(id), name(name), description(description), descIcon(descIcon), OnClick(OnClick), onClickParam(param), slot(-1),
+ position(1000)
{
}
@@ -64,6 +65,21 @@ void ExtraIcon::setSlot(int slot)
this->slot = slot;
}
+int ExtraIcon::getPosition() const
+{
+ return position;
+}
+
+void ExtraIcon::setPosition(int position)
+{
+ this->position = position;
+}
+
+int ExtraIcon::getID() const
+{
+ return id;
+}
+
bool ExtraIcon::isEnabled() const
{
return slot >= 0;
@@ -94,3 +110,47 @@ void ExtraIcon::onClick(HANDLE hContact)
OnClick((WPARAM) hContact, (LPARAM) ConvertToClistSlot(slot), onClickParam);
}
+int ExtraIcon::compare(const ExtraIcon *other) const
+{
+ int ret = getPosition() - other->getPosition();
+ if (ret != 0)
+ return ret;
+ return getID() - other->getID();
+}
+
+bool ExtraIcon::operator==(const ExtraIcon & other) const
+{
+ int c = compare(&other);
+ return c == 0;
+}
+
+bool ExtraIcon::operator!=(const ExtraIcon & other) const
+{
+ int c = compare(&other);
+ return c != 0;
+}
+
+bool ExtraIcon::operator<(const ExtraIcon & other) const
+{
+ int c = compare(&other);
+ return c < 0;
+}
+
+bool ExtraIcon::operator<=(const ExtraIcon & other) const
+{
+ int c = compare(&other);
+ return c <= 0;
+}
+
+bool ExtraIcon::operator>(const ExtraIcon & other) const
+{
+ int c = compare(&other);
+ return c > 0;
+}
+
+bool ExtraIcon::operator>=(const ExtraIcon & other) const
+{
+ int c = compare(&other);
+ return c >= 0;
+}
+