git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@20679
c3d73ce0-8a6f-49c7-b76d-
6d57e0e08775
\helpref{wxToolBar::SetToolPacking}{wxtoolbarsettoolpacking}
\helpref{wxToolBar::SetToolPacking}{wxtoolbarsettoolpacking}
+\membersection{wxToolBar::GetToolPos}\label{wxtoolbargettoolpos}
+
+\constfunc{int}{GetToolPos}{\param{int }{toolId}}
+
+Returns the tool position in the toolbar, or wxNOT\_FOUND if the tool is not found.
+
\membersection{wxToolBar::GetToolSeparation}\label{wxtoolbargettoolseparation}
\constfunc{int}{GetToolSeparation}{\void}
\membersection{wxToolBar::GetToolSeparation}\label{wxtoolbargettoolseparation}
\constfunc{int}{GetToolSeparation}{\void}
\wxheading{See also}
\helpref{wxToolBar::GetToolState}{wxtoolbargettoolstate}
\wxheading{See also}
\helpref{wxToolBar::GetToolState}{wxtoolbargettoolstate}
class WXDLLEXPORT wxSize
{
public:
class WXDLLEXPORT wxSize
{
public:
- // members are public for compatibility (don't use them directly,
- // especially that there names were chosen very unfortunately - they should
- // have been called width and height)
+ // members are public for compatibility, don't use them directly.
int x, y;
// constructors
int x, y;
// constructors
virtual wxObject *GetToolClientData(int toolid) const;
virtual void SetToolClientData(int toolid, wxObject *clientData);
virtual wxObject *GetToolClientData(int toolid) const;
virtual void SetToolClientData(int toolid, wxObject *clientData);
+ // returns tool pos, or wxNOT_FOUND if tool isn't found
+ virtual int GetToolPos(int id) const;
+
// return TRUE if the tool is toggled
virtual bool GetToolState(int toolid) const;
// return TRUE if the tool is toggled
virtual bool GetToolState(int toolid) const;
tool->SetClientData(clientData);
}
tool->SetClientData(clientData);
}
+int wxToolBarBase::GetToolPos(int id) const
+{
+ size_t pos = 0;
+ wxToolBarToolsList::Node *node;
+
+ for ( node = m_tools.GetFirst(); node; node = node->GetNext() )
+ {
+ if ( node->GetData()->GetId() == id )
+ return pos;
+
+ pos++;
+ }
+
+ return wxNOT_FOUND;
+}
+
bool wxToolBarBase::GetToolState(int id) const
{
wxToolBarToolBase *tool = FindById(id);
bool wxToolBarBase::GetToolState(int id) const
{
wxToolBarToolBase *tool = FindById(id);