#include <wg_toolbar.h>
Inheritance diagram for wGui::CToolBar:
Definition at line 40 of file wg_toolbar.h.
Constructs a new ToolBar
WindowRect | A CRect that defines the outer limits of the control | |
pParent | A pointer to the parent window |
Definition at line 34 of file wg_toolbar.cpp.
References wGui::COLOR_LIGHTGRAY, wGui::CMessage::CTRL_SINGLELCLICK, wGui::CWindow::Draw(), wGui::CMessageServer::Instance(), wGui::CWindow::m_BackgroundColor, and wGui::CMessageServer::RegisterMessageClient().
void wGui::CToolBar::InsertButton | ( | CButton * | pButton, | |
long int | iButtonID = 0 , |
|||
unsigned int | iPosition = 0 | |||
) |
Add a button to the toolbar The toolbar will become the button's parent The toolbar will catch all CTRL_SINGLELCLICK messages from the buttons and will post a CTRL_SINGLELCLICK message from the toolbar with the iButtonID value as the iNewValue
pButton | A pointer to the button to be inserted, inserts a spacer if this is NULL | |
iButtonID | An identifier that the toolbar will return when a button is clicked on, defaults to 0 | |
iPosition | The position to insert the button at (defaults to adding to the beginning of the toolbar) |
Definition at line 49 of file wg_toolbar.cpp.
References m_vpButtons, RepositionButtons(), and wGui::CWindow::SetNewParent().
Referenced by AppendButton().
void wGui::CToolBar::AppendButton | ( | CButton * | pButton, | |
long int | iButtonID = 0 | |||
) |
Add a button to the end of toolbar The toolbar will become the button's parent The toolbar will catch all CTRL_SINGLELCLICK messages from the buttons and will post a CTRL_SINGLELCLICK message from the toolbar with the iButtonID value as the iNewValue
pButton | A pointer to the button to be inserted, inserts a spacer if this is NULL | |
iButtonID | An identifier that the toolbar will return when a button is clicked on, defaults to 0 |
Definition at line 68 of file wg_toolbar.cpp.
References InsertButton(), and m_vpButtons.
void wGui::CToolBar::RemoveButton | ( | unsigned int | iPosition | ) |
Remove a button from the toolbar This will automatically delete the button
iPosition | The position of the button to remove, an exception will be thrown if this is out of range |
Definition at line 74 of file wg_toolbar.cpp.
References m_vpButtons.
unsigned int wGui::CToolBar::GetButtonCount | ( | void | ) | [inline] |
Gets the number of items on the toolbar (including spacers)
Definition at line 77 of file wg_toolbar.h.
References m_vpButtons.
long int wGui::CToolBar::GetButtonID | ( | unsigned int | iPosition | ) | [inline] |
iPosition | The position of the button to get the ID for. An exception will be thrown if this is out of range. |
Definition at line 81 of file wg_toolbar.h.
References m_vpButtons.
int wGui::CToolBar::GetButtonPosition | ( | long int | iButtonID | ) |
iButtonID | The ID of the button to get the position for |
Definition at line 92 of file wg_toolbar.cpp.
References m_vpButtons.
void wGui::CToolBar::SetWindowRect | ( | const CRect & | WindowRect | ) | [virtual] |
CWindow overrides Giving a control a new WindowRect will move and resize the control
WindowRect | A CRect that defines the outer limits of the control |
Reimplemented from wGui::CWindow.
Definition at line 130 of file wg_toolbar.cpp.
References wGui::CWindow::m_ClientRect, wGui::CWindow::m_WindowRect, RepositionButtons(), wGui::CWindow::SetWindowRect(), and wGui::CRect::SizeRect().
bool wGui::CToolBar::HandleMessage | ( | CMessage * | pMessage | ) | [virtual] |
CToolBars handle CTRL_SINGLELCLICK messages
pMessage | A pointer to the message |
Reimplemented from wGui::CWindow.
Definition at line 138 of file wg_toolbar.cpp.
References wGui::CMessage::CTRL_SINGLELCLICK, wGui::CMessage::Destination(), wGui::CWindow::HandleMessage(), wGui::CMessageServer::Instance(), wGui::CWindow::m_pParentWindow, m_vpButtons, wGui::CMessage::MessageType(), wGui::CMessageServer::QueueMessage(), and wGui::CMessage::Source().