creaImageIO_lib
creaImageIOWxTreeView.cpp File Reference
#include <creaImageIOWxTreeView.h>
#include <creaImageIOGimmickView.h>
#include <wx/splitter.h>
#include <wx/gdicmn.h>
#include <boost/date_time/gregorian/gregorian.hpp>
#include <creaImageIOGimmick.h>
Include dependency graph for creaImageIOWxTreeView.cpp:

Go to the source code of this file.

Namespaces

namespace  creaImageIO
 

Functions

int wxCALLBACK CompareFunctionStrings (long item1, long item2, long sortData)
 Comparing function for ordering algorithm. Takes parameters as strings. More...
 
int wxCALLBACK CompareFunctionInts (long item1, long item2, long sortData)
 Comparing function for ordering algorithm. Takes parameters as ints. More...
 

Function Documentation

int wxCALLBACK CompareFunctionInts ( long  item1,
long  item2,
long  sortData 
)

Comparing function for ordering algorithm. Takes parameters as ints.

Definition at line 80 of file creaImageIOWxTreeView.cpp.

References creaImageIO::ItemData::attr.

Referenced by creaImageIO::WxTreeView::SortLevel().

81 {
84 
85  const std::string& s1(*(data1->attr));
86  const std::string& s2(*(data2->attr));
87 
88  int val1=atoi(s1.c_str());
89  int val2=atoi(s2.c_str());
90 
91  if(sortData==1)
92  {
93  // inverse the order
94  if (val1 < val2)
95  return 1;
96  if (val1 > val2)
97  return -1;
98 
99  return 0;
100  }
101  else
102  {
103  if (val1 < val2)
104  return -1;
105  if (val1 > val2)
106  return 1;
107 
108  return 0;
109 
110  }
111 
112 }

Here is the caller graph for this function:

int wxCALLBACK CompareFunctionStrings ( long  item1,
long  item2,
long  sortData 
)

Comparing function for ordering algorithm. Takes parameters as strings.

Definition at line 48 of file creaImageIOWxTreeView.cpp.

References creaImageIO::ItemData::attr.

Referenced by creaImageIO::WxTreeView::SortLevel().

49 {
52 
53  const std::string& s1(*(data1->attr));
54  const std::string& s2(*(data2->attr));
55  if(sortData==1)
56  {
57  // inverse the order
58  if (s1 < s2)
59  return 1;
60  if (s1 > s2)
61  return -1;
62 
63  return 0;
64  }
65  else
66  {
67  if (s1 < s2)
68  return -1;
69  if (s1 > s2)
70  return 1;
71 
72  return 0;
73 
74  }
75 }

Here is the caller graph for this function: