X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/d7463f75f9c170c29b4965d27dccf535ac32cfde..e0aeebed0a3003f455e2bd7e962143faa1dde4c8:/utils/configtool/src/utils.h diff --git a/utils/configtool/src/utils.h b/utils/configtool/src/utils.h index af00ed3273..1fbc6866ef 100644 --- a/utils/configtool/src/utils.h +++ b/utils/configtool/src/utils.h @@ -21,6 +21,8 @@ #ifndef _AP_UTILS_H_ #define _AP_UTILS_H_ +#include "wx/imaglist.h" + #ifndef DOXYGEN_SKIP /*! @@ -113,15 +115,15 @@ and has a convenient API. For example, the following adds icons for a checkbox item that can be: on/enabled, off/enabled, on/disabled,off/disabled. - m_iconTable.AddInfo("Checkbox", wxICON(checked), 0, TRUE); - m_iconTable.AddInfo("Checkbox", wxICON(checked_dis), 0, FALSE); - m_iconTable.AddInfo("Checkbox", wxICON(unchecked), 1, TRUE); - m_iconTable.AddInfo("Checkbox", wxICON(unchecked_dis), 1, FALSE); + m_iconTable.AddInfo("Checkbox", wxICON(checked), 0, true); + m_iconTable.AddInfo("Checkbox", wxICON(checked_dis), 0, false); + m_iconTable.AddInfo("Checkbox", wxICON(unchecked), 1, true); + m_iconTable.AddInfo("Checkbox", wxICON(unchecked_dis), 1, false); When you update the item image in response to (e.g.) user interaction, you can say something like this: - int iconId = m_iconTable.GetIconId("Checkbox", 0, FALSE); + int iconId = m_iconTable.GetIconId("Checkbox", 0, false); treeCtrl.SetItemImage(itemId, iconId, wxTreeItemIcon_Normal); treeCtrl.SetItemImage(itemId, iconId, wxTreeItemIcon_Selected); @@ -144,8 +146,8 @@ public: // enabled/disabled int GetStateCount() const { return m_maxStates; }; - void SetStateCount(int count) { m_maxStates; } - int GetIconId(int state, bool enabled = TRUE) const; + void SetStateCount(int count) { m_maxStates = count; } + int GetIconId(int state, bool enabled = true) const; void SetIconId(int state, bool enabled, int iconId); const wxString& GetName() const { return m_name; } @@ -178,7 +180,7 @@ public: wxIconInfo* FindInfo(const wxString& name) const; - int GetIconId(const wxString& name, int state, bool enabled = TRUE) const; + int GetIconId(const wxString& name, int state, bool enabled = true) const; bool SetIconId(const wxString& name, int state, bool enabled, int iconId) ; void SetImageList(wxImageList* imageList) { m_imageList = imageList; } @@ -196,5 +198,10 @@ wxOutputStream& operator <<(wxOutputStream&, long l); // Convert characters to HTML equivalents wxString ctEscapeHTMLCharacters(const wxString& str); +// Match 'matchText' against 'matchAgainst', optionally constraining to +// whole-word only. +bool ctMatchString(const wxString& matchAgainst, const wxString& matchText, bool wholeWordOnly); + + #endif // _AP_UTILS_H_