// count of items in the list
size_t GetCount() const { return m_count; }
- // return TRUE if this list is empty
+ // return true if this list is empty
bool IsEmpty() const { return m_count == 0; }
// operations
// removes node from the list but doesn't delete it (returns pointer
// to the node or NULL if it wasn't found in the list)
wxNodeBase *DetachNode(wxNodeBase *node);
- // delete element from list, returns FALSE if node not found
+ // delete element from list, returns false if node not found
bool DeleteNode(wxNodeBase *node);
// finds object pointer and deletes node (and object if DeleteContents
- // is on), returns FALSE if object not found
+ // is on), returns false if object not found
bool DeleteObject(void *object);
// search (all return NULL if item not found)
#define WX_DECLARE_LIST_WITH_DECL(elementtype, listname, decl) \
typedef elementtype _WX_LIST_ITEM_TYPE_##listname; \
WX_DECLARE_LIST_2(elementtype, listname, wx##listname##Node, decl)
-
+
#define WX_DECLARE_EXPORTED_LIST(elementtype, listname) \
WX_DECLARE_LIST_WITH_DECL(elementtype, listname, class WXDLLEXPORT)
// copying the string list: the strings are copied, too (extremely
// inefficient!)
- wxStringList(const wxStringList& other) : wxStringListBase() { DeleteContents(TRUE); DoCopy(other); }
+ wxStringList(const wxStringList& other) : wxStringListBase() { DeleteContents(true); DoCopy(other); }
wxStringList& operator=(const wxStringList& other)
{ Clear(); DoCopy(other); return *this; }
// operations
// makes a copy of the string
wxNode *Add(const wxChar *s);
-
+
// Append to beginning of list
wxNode *Prepend(const wxChar *s);
bool Delete(const wxChar *s);
- wxChar **ListToArray(bool new_copies = FALSE) const;
+ wxChar **ListToArray(bool new_copies = false) const;
bool Member(const wxChar *s) const;
// alphabetic sort
typedef void (wxEvtHandler::*wxListEventFunction)(wxListEvent&);
-#define EVT_LIST_BEGIN_DRAG(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_LIST_BEGIN_DRAG, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxListEventFunction, & fn ), NULL ),
-#define EVT_LIST_BEGIN_RDRAG(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_LIST_BEGIN_RDRAG, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxListEventFunction, & fn ), NULL ),
-#define EVT_LIST_BEGIN_LABEL_EDIT(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_LIST_BEGIN_LABEL_EDIT, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxListEventFunction, & fn ), NULL ),
-#define EVT_LIST_END_LABEL_EDIT(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_LIST_END_LABEL_EDIT, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxListEventFunction, & fn ), NULL ),
-#define EVT_LIST_DELETE_ITEM(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_LIST_DELETE_ITEM, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxListEventFunction, & fn ), NULL ),
-#define EVT_LIST_DELETE_ALL_ITEMS(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_LIST_DELETE_ALL_ITEMS, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxListEventFunction, & fn ), NULL ),
-#define EVT_LIST_GET_INFO(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_LIST_GET_INFO, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxListEventFunction, & fn ), NULL ),
-#define EVT_LIST_SET_INFO(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_LIST_SET_INFO, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxListEventFunction, & fn ), NULL ),
-#define EVT_LIST_KEY_DOWN(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_LIST_KEY_DOWN, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxListEventFunction, & fn ), NULL ),
-#define EVT_LIST_INSERT_ITEM(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_LIST_INSERT_ITEM, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxListEventFunction, & fn ), NULL ),
-
-#define EVT_LIST_COL_CLICK(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_LIST_COL_CLICK, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxListEventFunction, & fn ), NULL ),
-#define EVT_LIST_COL_RIGHT_CLICK(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_LIST_COL_RIGHT_CLICK, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxListEventFunction, & fn ), NULL ),
-#define EVT_LIST_COL_BEGIN_DRAG(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_LIST_COL_BEGIN_DRAG, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxListEventFunction, & fn ), NULL ),
-#define EVT_LIST_COL_DRAGGING(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_LIST_COL_DRAGGING, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxListEventFunction, & fn ), NULL ),
-#define EVT_LIST_COL_END_DRAG(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_LIST_COL_END_DRAG, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxListEventFunction, & fn ), NULL ),
-
-#define EVT_LIST_ITEM_SELECTED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_LIST_ITEM_SELECTED, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxListEventFunction, & fn ), NULL ),
-#define EVT_LIST_ITEM_DESELECTED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_LIST_ITEM_DESELECTED, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxListEventFunction, & fn ), NULL ),
-#define EVT_LIST_ITEM_RIGHT_CLICK(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_LIST_ITEM_RIGHT_CLICK, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxListEventFunction, & fn ), (wxObject *) NULL ),
-#define EVT_LIST_ITEM_MIDDLE_CLICK(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_LIST_ITEM_MIDDLE_CLICK, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxListEventFunction, & fn ), (wxObject *) NULL ),
-#define EVT_LIST_ITEM_ACTIVATED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_LIST_ITEM_ACTIVATED, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxListEventFunction, & fn ), (wxObject *) NULL ),
-#define EVT_LIST_ITEM_FOCUSED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_LIST_ITEM_FOCUSED, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxListEventFunction, & fn ), (wxObject *) NULL ),
-
-#define EVT_LIST_CACHE_HINT(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_LIST_CACHE_HINT, id, -1, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxListEventFunction, & fn ), (wxObject *) NULL ),
+#define EVT_LIST_BEGIN_DRAG(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_LIST_BEGIN_DRAG, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxListEventFunction, & fn ), NULL ),
+#define EVT_LIST_BEGIN_RDRAG(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_LIST_BEGIN_RDRAG, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxListEventFunction, & fn ), NULL ),
+#define EVT_LIST_BEGIN_LABEL_EDIT(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_LIST_BEGIN_LABEL_EDIT, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxListEventFunction, & fn ), NULL ),
+#define EVT_LIST_END_LABEL_EDIT(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_LIST_END_LABEL_EDIT, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxListEventFunction, & fn ), NULL ),
+#define EVT_LIST_DELETE_ITEM(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_LIST_DELETE_ITEM, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxListEventFunction, & fn ), NULL ),
+#define EVT_LIST_DELETE_ALL_ITEMS(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_LIST_DELETE_ALL_ITEMS, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxListEventFunction, & fn ), NULL ),
+#define EVT_LIST_GET_INFO(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_LIST_GET_INFO, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxListEventFunction, & fn ), NULL ),
+#define EVT_LIST_SET_INFO(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_LIST_SET_INFO, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxListEventFunction, & fn ), NULL ),
+#define EVT_LIST_KEY_DOWN(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_LIST_KEY_DOWN, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxListEventFunction, & fn ), NULL ),
+#define EVT_LIST_INSERT_ITEM(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_LIST_INSERT_ITEM, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxListEventFunction, & fn ), NULL ),
+
+#define EVT_LIST_COL_CLICK(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_LIST_COL_CLICK, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxListEventFunction, & fn ), NULL ),
+#define EVT_LIST_COL_RIGHT_CLICK(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_LIST_COL_RIGHT_CLICK, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxListEventFunction, & fn ), NULL ),
+#define EVT_LIST_COL_BEGIN_DRAG(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_LIST_COL_BEGIN_DRAG, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxListEventFunction, & fn ), NULL ),
+#define EVT_LIST_COL_DRAGGING(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_LIST_COL_DRAGGING, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxListEventFunction, & fn ), NULL ),
+#define EVT_LIST_COL_END_DRAG(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_LIST_COL_END_DRAG, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxListEventFunction, & fn ), NULL ),
+
+#define EVT_LIST_ITEM_SELECTED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_LIST_ITEM_SELECTED, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxListEventFunction, & fn ), NULL ),
+#define EVT_LIST_ITEM_DESELECTED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_LIST_ITEM_DESELECTED, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxListEventFunction, & fn ), NULL ),
+#define EVT_LIST_ITEM_RIGHT_CLICK(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_LIST_ITEM_RIGHT_CLICK, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxListEventFunction, & fn ), (wxObject *) NULL ),
+#define EVT_LIST_ITEM_MIDDLE_CLICK(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_LIST_ITEM_MIDDLE_CLICK, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxListEventFunction, & fn ), (wxObject *) NULL ),
+#define EVT_LIST_ITEM_ACTIVATED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_LIST_ITEM_ACTIVATED, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxListEventFunction, & fn ), (wxObject *) NULL ),
+#define EVT_LIST_ITEM_FOCUSED(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_LIST_ITEM_FOCUSED, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxListEventFunction, & fn ), (wxObject *) NULL ),
+
+#define EVT_LIST_CACHE_HINT(id, fn) DECLARE_EVENT_TABLE_ENTRY( wxEVT_COMMAND_LIST_CACHE_HINT, id, wxID_ANY, (wxObjectEventFunction) (wxEventFunction) wxStaticCastEvent( wxListEventFunction, & fn ), (wxObject *) NULL ),
#endif // wxUSE_LISTCTRL
// multiple selection logic
virtual bool IsSelected(int n) const = 0;
- virtual void SetSelection(int n, bool select = TRUE) = 0;
- virtual void Select(int n) { SetSelection(n, TRUE); }
- void Deselect(int n) { SetSelection(n, FALSE); }
+ virtual void SetSelection(int n, bool select = true) = 0;
+ virtual void Select(int n) { SetSelection(n, true); }
+ void Deselect(int n) { SetSelection(n, false); }
void DeselectAll(int itemToLeaveSelected = -1);
- virtual bool SetStringSelection(const wxString& s, bool select = TRUE);
+ virtual bool SetStringSelection(const wxString& s, bool select = true);
// works for single as well as multiple selection listboxes (unlike
// GetSelection which only works for listboxes with single selection)
// listbox and ensures that it is visible i.e. not scrolled out of view
void AppendAndEnsureVisible(const wxString& s);
- // return TRUE if the listbox allows multiple selection
+ // return true if the listbox allows multiple selection
bool HasMultipleSelection() const
{
return (m_windowStyle & wxLB_MULTIPLE) ||
(m_windowStyle & wxLB_EXTENDED);
}
- // return TRUE if this listbox is sorted
+ // return true if this listbox is sorted
bool IsSorted() const { return (m_windowStyle & wxLB_SORT) != 0; }
// emulate selecting or deselecting the item event.GetInt() (depending on
public:
wxListView() { }
wxListView( wxWindow *parent,
- wxWindowID winid = -1,
+ wxWindowID winid = wxID_ANY,
const wxPoint& pos = wxDefaultPosition,
const wxSize& size = wxDefaultSize,
long style = wxLC_REPORT,
// ---------------------
// [de]select an item
- void Select(long n, bool on = TRUE)
+ void Select(long n, bool on = true)
{
SetItemState(n, on ? wxLIST_STATE_SELECTED : 0, wxLIST_STATE_SELECTED);
}
long GetFirstSelected() const
{ return GetNextSelected(-1); }
- // return TRUE if the item is selected
+ // return true if the item is selected
bool IsSelected(long index)
{ return GetItemState(index, wxLIST_STATE_SELECTED) != 0; }
value = 0;
percent = 0;
otherEdge = wxTop;
- done = FALSE;
+ done = false;
otherWin = (wxWindowBase *) NULL;
}
percent = 0;
otherEdge = wxTop;
otherWin = (wxWindowBase *) NULL;
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
// Try to satisfy constraint
{
if (relationship == wxAbsolute)
{
- done = TRUE;
- return TRUE;
+ done = true;
+ return true;
}
switch (myEdge)
if (edgePos != -1)
{
value = edgePos - margin;
- done = TRUE;
- return TRUE;
+ done = true;
+ return true;
}
else
- return FALSE;
+ return false;
}
case wxRightOf:
{
if (edgePos != -1)
{
value = edgePos + margin;
- done = TRUE;
- return TRUE;
+ done = true;
+ return true;
}
else
- return FALSE;
+ return false;
}
case wxPercentOf:
{
if (edgePos != -1)
{
value = (int)(edgePos*(((float)percent)*0.01) + margin);
- done = TRUE;
- return TRUE;
+ done = true;
+ return true;
}
else
- return FALSE;
+ return false;
}
case wxUnconstrained:
{
if (constraints->right.GetDone() && constraints->width.GetDone())
{
value = (constraints->right.GetValue() - constraints->width.GetValue() + margin);
- done = TRUE;
- return TRUE;
+ done = true;
+ return true;
}
else if (constraints->centreX.GetDone() && constraints->width.GetDone())
{
value = (int)(constraints->centreX.GetValue() - (constraints->width.GetValue()/2) + margin);
- done = TRUE;
- return TRUE;
+ done = true;
+ return true;
}
else
- return FALSE;
+ return false;
}
case wxAsIs:
{
int y;
win->GetPosition(&value, &y);
- done = TRUE;
- return TRUE;
+ done = true;
+ return true;
}
default:
break;
if (edgePos != -1)
{
value = edgePos - margin;
- done = TRUE;
- return TRUE;
+ done = true;
+ return true;
}
else
- return FALSE;
+ return false;
}
case wxRightOf:
{
if (edgePos != -1)
{
value = edgePos + margin;
- done = TRUE;
- return TRUE;
+ done = true;
+ return true;
}
else
- return FALSE;
+ return false;
}
case wxPercentOf:
{
if (edgePos != -1)
{
value = (int)(edgePos*(((float)percent)*0.01) - margin);
- done = TRUE;
- return TRUE;
+ done = true;
+ return true;
}
else
- return FALSE;
+ return false;
}
case wxUnconstrained:
{
if (constraints->left.GetDone() && constraints->width.GetDone())
{
value = (constraints->left.GetValue() + constraints->width.GetValue() - margin);
- done = TRUE;
- return TRUE;
+ done = true;
+ return true;
}
else if (constraints->centreX.GetDone() && constraints->width.GetDone())
{
value = (int)(constraints->centreX.GetValue() + (constraints->width.GetValue()/2) - margin);
- done = TRUE;
- return TRUE;
+ done = true;
+ return true;
}
else
- return FALSE;
+ return false;
}
case wxAsIs:
{
win->GetSize(&w, &h);
win->GetPosition(&x, &y);
value = x + w;
- done = TRUE;
- return TRUE;
+ done = true;
+ return true;
}
default:
break;
if (edgePos != -1)
{
value = edgePos - margin;
- done = TRUE;
- return TRUE;
+ done = true;
+ return true;
}
else
- return FALSE;
+ return false;
}
case wxBelow:
{
if (edgePos != -1)
{
value = edgePos + margin;
- done = TRUE;
- return TRUE;
+ done = true;
+ return true;
}
else
- return FALSE;
+ return false;
}
case wxPercentOf:
{
if (edgePos != -1)
{
value = (int)(edgePos*(((float)percent)*0.01) + margin);
- done = TRUE;
- return TRUE;
+ done = true;
+ return true;
}
else
- return FALSE;
+ return false;
}
case wxUnconstrained:
{
if (constraints->bottom.GetDone() && constraints->height.GetDone())
{
value = (constraints->bottom.GetValue() - constraints->height.GetValue() + margin);
- done = TRUE;
- return TRUE;
+ done = true;
+ return true;
}
else if (constraints->centreY.GetDone() && constraints->height.GetDone())
{
value = (constraints->centreY.GetValue() - (constraints->height.GetValue()/2) + margin);
- done = TRUE;
- return TRUE;
+ done = true;
+ return true;
}
else
- return FALSE;
+ return false;
}
case wxAsIs:
{
int x;
win->GetPosition(&x, &value);
- done = TRUE;
- return TRUE;
+ done = true;
+ return true;
}
default:
break;
if (edgePos != -1)
{
value = edgePos + margin;
- done = TRUE;
- return TRUE;
+ done = true;
+ return true;
}
else
- return FALSE;
+ return false;
}
case wxBelow:
{
if (edgePos != -1)
{
value = edgePos - margin;
- done = TRUE;
- return TRUE;
+ done = true;
+ return true;
}
else
- return FALSE;
+ return false;
}
case wxPercentOf:
{
if (edgePos != -1)
{
value = (int)(edgePos*(((float)percent)*0.01) - margin);
- done = TRUE;
- return TRUE;
+ done = true;
+ return true;
}
else
- return FALSE;
+ return false;
}
case wxUnconstrained:
{
if (constraints->top.GetDone() && constraints->height.GetDone())
{
value = (constraints->top.GetValue() + constraints->height.GetValue() - margin);
- done = TRUE;
- return TRUE;
+ done = true;
+ return true;
}
else if (constraints->centreY.GetDone() && constraints->height.GetDone())
{
value = (constraints->centreY.GetValue() + (constraints->height.GetValue()/2) - margin);
- done = TRUE;
- return TRUE;
+ done = true;
+ return true;
}
else
- return FALSE;
+ return false;
}
case wxAsIs:
{
win->GetSize(&w, &h);
win->GetPosition(&x, &y);
value = h + y;
- done = TRUE;
- return TRUE;
+ done = true;
+ return true;
}
default:
break;
if (edgePos != -1)
{
value = edgePos - margin;
- done = TRUE;
- return TRUE;
+ done = true;
+ return true;
}
else
- return FALSE;
+ return false;
}
case wxRightOf:
{
if (edgePos != -1)
{
value = edgePos + margin;
- done = TRUE;
- return TRUE;
+ done = true;
+ return true;
}
else
- return FALSE;
+ return false;
}
case wxPercentOf:
{
if (edgePos != -1)
{
value = (int)(edgePos*(((float)percent)*0.01) + margin);
- done = TRUE;
- return TRUE;
+ done = true;
+ return true;
}
else
- return FALSE;
+ return false;
}
case wxUnconstrained:
{
if (constraints->left.GetDone() && constraints->width.GetDone())
{
value = (int)(constraints->left.GetValue() + (constraints->width.GetValue()/2) + margin);
- done = TRUE;
- return TRUE;
+ done = true;
+ return true;
}
else if (constraints->right.GetDone() && constraints->width.GetDone())
{
value = (int)(constraints->left.GetValue() - (constraints->width.GetValue()/2) + margin);
- done = TRUE;
- return TRUE;
+ done = true;
+ return true;
}
else
- return FALSE;
+ return false;
}
default:
break;
if (edgePos != -1)
{
value = edgePos - margin;
- done = TRUE;
- return TRUE;
+ done = true;
+ return true;
}
else
- return FALSE;
+ return false;
}
case wxBelow:
{
if (edgePos != -1)
{
value = edgePos + margin;
- done = TRUE;
- return TRUE;
+ done = true;
+ return true;
}
else
- return FALSE;
+ return false;
}
case wxPercentOf:
{
if (edgePos != -1)
{
value = (int)(edgePos*(((float)percent)*0.01) + margin);
- done = TRUE;
- return TRUE;
+ done = true;
+ return true;
}
else
- return FALSE;
+ return false;
}
case wxUnconstrained:
{
if (constraints->bottom.GetDone() && constraints->height.GetDone())
{
value = (int)(constraints->bottom.GetValue() - (constraints->height.GetValue()/2) + margin);
- done = TRUE;
- return TRUE;
+ done = true;
+ return true;
}
else if (constraints->top.GetDone() && constraints->height.GetDone())
{
value = (int)(constraints->top.GetValue() + (constraints->height.GetValue()/2) + margin);
- done = TRUE;
- return TRUE;
+ done = true;
+ return true;
}
else
- return FALSE;
+ return false;
}
default:
break;
if (edgePos != -1)
{
value = (int)(edgePos*(((float)percent)*0.01));
- done = TRUE;
- return TRUE;
+ done = true;
+ return true;
}
else
- return FALSE;
+ return false;
}
case wxAsIs:
{
{
int h;
win->GetSize(&value, &h);
- done = TRUE;
- return TRUE;
+ done = true;
+ return true;
}
- else return FALSE;
+ else return false;
}
case wxUnconstrained:
{
if (constraints->left.GetDone() && constraints->right.GetDone())
{
value = constraints->right.GetValue() - constraints->left.GetValue();
- done = TRUE;
- return TRUE;
+ done = true;
+ return true;
}
else if (constraints->centreX.GetDone() && constraints->left.GetDone())
{
value = (int)(2*(constraints->centreX.GetValue() - constraints->left.GetValue()));
- done = TRUE;
- return TRUE;
+ done = true;
+ return true;
}
else if (constraints->centreX.GetDone() && constraints->right.GetDone())
{
value = (int)(2*(constraints->right.GetValue() - constraints->centreX.GetValue()));
- done = TRUE;
- return TRUE;
+ done = true;
+ return true;
}
else
- return FALSE;
+ return false;
}
default:
break;
if (edgePos != -1)
{
value = (int)(edgePos*(((float)percent)*0.01));
- done = TRUE;
- return TRUE;
+ done = true;
+ return true;
}
else
- return FALSE;
+ return false;
}
case wxAsIs:
{
{
int w;
win->GetSize(&w, &value);
- done = TRUE;
- return TRUE;
+ done = true;
+ return true;
}
- else return FALSE;
+ else return false;
}
case wxUnconstrained:
{
if (constraints->top.GetDone() && constraints->bottom.GetDone())
{
value = constraints->bottom.GetValue() - constraints->top.GetValue();
- done = TRUE;
- return TRUE;
+ done = true;
+ return true;
}
else if (constraints->top.GetDone() && constraints->centreY.GetDone())
{
value = (int)(2*(constraints->centreY.GetValue() - constraints->top.GetValue()));
- done = TRUE;
- return TRUE;
+ done = true;
+ return true;
}
else if (constraints->bottom.GetDone() && constraints->centreY.GetDone())
{
value = (int)(2*(constraints->bottom.GetValue() - constraints->centreY.GetValue()));
- done = TRUE;
- return TRUE;
+ done = true;
+ return true;
}
else
- return FALSE;
+ return false;
}
default:
break;
default:
break;
}
- return FALSE;
+ return false;
}
// Get the value of this edge or dimension, or if this is not determinable, -1.
int noChanges = 0;
bool done = width.GetDone();
- bool newDone = (done ? TRUE : width.SatisfyConstraint(this, win));
+ bool newDone = (done ? true : width.SatisfyConstraint(this, win));
if (newDone != done)
noChanges ++;
done = height.GetDone();
- newDone = (done ? TRUE : height.SatisfyConstraint(this, win));
+ newDone = (done ? true : height.SatisfyConstraint(this, win));
if (newDone != done)
noChanges ++;
done = left.GetDone();
- newDone = (done ? TRUE : left.SatisfyConstraint(this, win));
+ newDone = (done ? true : left.SatisfyConstraint(this, win));
if (newDone != done)
noChanges ++;
done = top.GetDone();
- newDone = (done ? TRUE : top.SatisfyConstraint(this, win));
+ newDone = (done ? true : top.SatisfyConstraint(this, win));
if (newDone != done)
noChanges ++;
done = right.GetDone();
- newDone = (done ? TRUE : right.SatisfyConstraint(this, win));
+ newDone = (done ? true : right.SatisfyConstraint(this, win));
if (newDone != done)
noChanges ++;
done = bottom.GetDone();
- newDone = (done ? TRUE : bottom.SatisfyConstraint(this, win));
+ newDone = (done ? true : bottom.SatisfyConstraint(this, win));
if (newDone != done)
noChanges ++;
done = centreX.GetDone();
- newDone = (done ? TRUE : centreX.SatisfyConstraint(this, win));
+ newDone = (done ? true : centreX.SatisfyConstraint(this, win));
if (newDone != done)
noChanges ++;
done = centreY.GetDone();
- newDone = (done ? TRUE : centreY.SatisfyConstraint(this, win));
+ newDone = (done ? true : centreY.SatisfyConstraint(this, win));
if (newDone != done)
noChanges ++;
bool wxListBoxBase::SetStringSelection(const wxString& s, bool select)
{
int sel = FindString(s);
- wxCHECK_MSG( sel != -1, FALSE,
+ wxCHECK_MSG( sel != wxNOT_FOUND, false,
wxT("invalid string in SetStringSelection") );
SetSelection(sel, select);
- return TRUE;
+ return true;
}
void wxListBoxBase::DeselectAll(int itemToLeaveSelected)
else // single selection
{
int sel = GetSelection();
- if ( sel != -1 && sel != itemToLeaveSelected )
+ if ( sel != wxNOT_FOUND && sel != itemToLeaveSelected )
{
Deselect(sel);
}
{
int n = FindString(s);
- wxCHECK_RET( n != -1, wxT("invalid string in wxListBox::SetFirstItem") );
+ wxCHECK_RET( n != wxNOT_FOUND, wxT("invalid string in wxListBox::SetFirstItem") );
DoSetFirstItem(n);
}
m_nodeFirst =
m_nodeLast = (wxNodeBase *) NULL;
m_count = 0;
- m_destroy = FALSE;
+ m_destroy = false;
m_keyType = keyType;
}
bool wxListBase::DeleteNode(wxNodeBase *node)
{
if ( !DetachNode(node) )
- return FALSE;
+ return false;
DoDeleteNode(node);
- return TRUE;
+ return true;
}
bool wxListBase::DeleteObject(void *object)
if ( current->GetData() == object )
{
DeleteNode(current);
- return TRUE;
+ return true;
}
}
// not found
- return FALSE;
+ return false;
}
void wxListBase::Clear()
if ( wxStrcmp(current->GetData(), s) == 0 )
{
DeleteNode(current);
- return TRUE;
+ return true;
}
}
// not found
- return FALSE;
+ return false;
}
void wxStringList::DoCopy(const wxStringList& other)
wxStringList::wxStringList()
{
- DeleteContents(TRUE);
+ DeleteContents(true);
}
// Variable argument list, terminated by a zero
// Makes new storage for the strings
wxStringList::wxStringList (const wxChar *first, ...)
{
- DeleteContents(TRUE);
+ DeleteContents(true);
if ( !first )
return;
va_end(ap);
}
-// Only makes new strings if arg is TRUE
+// Only makes new strings if arg is true
wxChar **wxStringList::ListToArray(bool new_copies) const
{
wxChar **string_array = new wxChar *[GetCount()];
{
const wxChar *s1 = node->GetData();
if (s == s1 || wxStrcmp (s, s1) == 0)
- return TRUE;
+ return true;
}
- return FALSE;
+ return false;
}
#ifdef __WXWINCE__
{
return (wxNode *)wxStringListBase::Append(MYcopystring(s));
}
-
+
wxNode *wxStringList::Prepend(const wxChar *s)
{
return (wxNode *)wxStringListBase::Insert(MYcopystring(s));
if ( ms_bAutoCreate && ms_pLogger == NULL ) {
// prevent infinite recursion if someone calls wxLogXXX() from
// wxApp::CreateLogTarget()
- static bool s_bInGetActiveTarget = FALSE;
+ static bool s_bInGetActiveTarget = false;
if ( !s_bInGetActiveTarget ) {
- s_bInGetActiveTarget = TRUE;
+ s_bInGetActiveTarget = true;
// ask the application to create a log target for us
if ( wxTheApp != NULL )
else
ms_pLogger = new wxLogStderr;
- s_bInGetActiveTarget = FALSE;
+ s_bInGetActiveTarget = false;
// do nothing if it fails - what can we do?
}
void wxLog::DontCreateOnDemand()
{
- ms_bAutoCreate = FALSE;
+ ms_bAutoCreate = false;
// this is usually called at the end of the program and we assume that it
// is *always* called at the end - so we free memory here to avoid false
wxLogChain::wxLogChain(wxLog *logger)
{
- m_bPassMessages = TRUE;
+ m_bPassMessages = true;
m_logNew = logger;
m_logOld = wxLog::SetActiveTarget(this);
// ----------------------------------------------------------------------------
wxLog *wxLog::ms_pLogger = (wxLog *)NULL;
-bool wxLog::ms_doLog = TRUE;
-bool wxLog::ms_bAutoCreate = TRUE;
-bool wxLog::ms_bVerbose = FALSE;
+bool wxLog::ms_doLog = true;
+bool wxLog::ms_bAutoCreate = true;
+bool wxLog::ms_bVerbose = false;
wxLogLevel wxLog::ms_logLevel = wxLOG_Max; // log everything by default
bool wxLongLongWx::operator<(const wxLongLongWx& ll) const
{
if ( m_hi < ll.m_hi )
- return TRUE;
+ return true;
else if ( m_hi == ll.m_hi )
return m_lo < ll.m_lo;
else
- return FALSE;
+ return false;
}
bool wxULongLongWx::operator<(const wxULongLongWx& ll) const
{
if ( m_hi < ll.m_hi )
- return TRUE;
+ return true;
else if ( m_hi == ll.m_hi )
return m_lo < ll.m_lo;
else
- return FALSE;
+ return false;
}
bool wxLongLongWx::operator>(const wxLongLongWx& ll) const
{
if ( m_hi > ll.m_hi )
- return TRUE;
+ return true;
else if ( m_hi == ll.m_hi )
return m_lo > ll.m_lo;
else
- return FALSE;
+ return false;
}
bool wxULongLongWx::operator>(const wxULongLongWx& ll) const
{
if ( m_hi > ll.m_hi )
- return TRUE;
+ return true;
else if ( m_hi == ll.m_hi )
return m_lo > ll.m_lo;
else
- return FALSE;
+ return false;
}
// bitwise operators
//
// with 0 <= abs(remainder) < abs(divisor)
bool negRemainder = dividend.m_hi < 0;
- bool negQuotient = FALSE; // assume positive
+ bool negQuotient = false; // assume positive
if ( dividend.m_hi < 0 )
{
negQuotient = !negQuotient;
if ( ll < 0 )
{
ll.Negate();
- neg = TRUE;
+ neg = true;
}
else
{
- neg = FALSE;
+ neg = false;
}
while ( ll != 0 )