#include <MNListBox.h>
Inheritance diagram for MNListBox:

Public Methods | |
| MNListBox (MNComponent *parent, int x, int y, int w, int h, int style=0, LPSTR *data=NULL, int ndata=0) | |
| Creates a new list box. | |
| void | AddString (LPSTR text, int index=END) |
| Adds a string to the list at the given index. | |
| void | AddStrings (LPSTR text[], int ntext, int index=END) |
| Adds the ginven strings to the list at the given index. | |
| void | RemoveString (int index) |
| Removes the string at the given index. | |
| LPSTR | GetString (int index) |
| Gets the string at the given index. | |
| LPSTR | operator[] (int index) |
| Gets the string at the given index. | |
| int | GetNumberOfItems () |
| Returns the number of items in the list box. | |
| LPSTR | GetSelectedString () |
| Gets the selected string. | |
| int | GetSelectedIndex () |
| Gets the index of the selected item. | |
| virtual void | RegisterComponent (HWND *hwnd, MNComponent *com) |
| Allows this component to recieve top level events. | |
| virtual void | RegisterChild (HWND *hwnd, MNComponent *com) |
| Allows this component to propagate an event to the given child. | |
| virtual void | AddCallBack (BOOL(*callback)(MNComponent *, UINT, WPARAM, LPARAM)) |
| Adds a callback function. | |
| virtual LRESULT | FireEvents (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) |
| Propagates events to all the callback functions. | |
| virtual LRESULT | FireChildEvents (UINT message, WPARAM wParam, LPARAM lParam) |
| Propagates the events to the appropriate child/children. | |
| virtual LRESULT | SendEventToParent (UINT message, WPARAM wParam, LPARAM lParam) |
| Transmits the given event to the parent. | |
| virtual LRESULT | SendEventToChild (HWND child, UINT message, WPARAM wParam, LPARAM lParam) |
| Transmits the given event to the child. | |
| virtual LRESULT | SendEventToChild (MNComponent *child, UINT message, WPARAM wParam, LPARAM lParam) |
| Transmits the given event to the child. | |
| LRESULT | SendMessage (UINT msg, WPARAM wParam, LPARAM lParam) |
| Sends a message to the underlying control. | |
| virtual BOOL | Show () |
| Shows the component. | |
| virtual BOOL | Hide () |
| Hides the component. | |
| virtual HWND | GetHwnd () |
| Returns the window handle. | |
| virtual HINSTANCE | GetInstance () |
| Returns the instance of the application. | |
| virtual void | SetSize (int width, int height) |
| Sets the size of the component. | |
| virtual void | SetWidth (int width) |
| Sets the width of the component. | |
| virtual void | SetHeight (int height) |
| Sets the height of the component. | |
| virtual int | GetWidth () |
| Gets the width of the component. | |
| virtual int | GetHeight () |
| Gets the height of the component. | |
| virtual void | SetText (LPSTR label) |
| Set the components text. | |
| virtual void | GetText (LPSTR buf, int buf_len) |
| Returns the component's text. | |
| virtual int | GetX () |
| Returns the component's horizontal position. | |
| virtual int | GetY () |
| Returns the component's vertical position. | |
| virtual void | SetX (int x) |
| Sets the component's horizontal position. | |
| virtual void | SetY (int y) |
| Sets the component's vertical position. | |
| virtual void | SetPosition (int x, int y) |
| Sets the component's position. | |
Protected Methods | |
| void | CreateControl (MNComponent *parent, LPSTR classname, LPSTR label, int width, int height, int x, int y, int style, int exstyle) |
| Method that does the actual button creation. | |
| void | GetCharSize () |
| Gets the average width of a character and the height of a character. | |
Protected Attributes | |
| MNComponent * | parent |
| The parent of the component. | |
| HWND | hwnd |
| The handle to the component. | |
| HINSTANCE | hInstance |
| The instance of this application. | |
| int | showstate |
| The state of the window when hidden. | |
| int | width |
| The width of the component in pixels. | |
| int | height |
| The height of the component in pixels. | |
| int | x |
| The horizontal position of the panel. | |
| int | y |
| The vertical position of the panel. | |
| vector< BOOL(*)(MNComponent *, UINT, WPARAM, LPARAM)> | listeners |
| Stores the callbacks for this component. Stores the functions given to AddCallBack(). It is used by FireEvents() to notify the callbacks. | |
| vector< CHILDCOMPONENT > | clisteners |
| A list of the child components that events are to be passed to. | |
Static Protected Attributes | |
| TEXTMETRIC | finfo |
| Information about the font used by the system. | |
Friends | |
| LRESULT CALLBACK | GlobalProc (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam) |
| Is used to process all the callback functions. | |
|
||||||||||||||||||||||||||||||||||||
|
Creates a new list box.
|
|
|
Adds a callback function.
|
|
||||||||||||
|
Adds a string to the list at the given index.
|
|
||||||||||||||||
|
Adds the ginven strings to the list at the given index.
|
|
||||||||||||||||||||||||||||||||||||||||
|
Method that does the actual button creation.
|
|
||||||||||||||||
|
Propagates the events to the appropriate child/children.
|
|
||||||||||||||||||||
|
Propagates events to all the callback functions.
|
|
|
Gets the height of the component.
Reimplemented in MNPanel. |
|
|
Returns the window handle.
|
|
|
Returns the instance of the application.
|
|
|
Returns the number of items in the list box.
|
|
|
Gets the index of the selected item.
|
|
|
Gets the selected string.
|
|
|
Gets the string at the given index.
|
|
||||||||||||
|
Returns the component's text.
|
|
|
Gets the width of the component.
Reimplemented in MNPanel. |
|
|
Returns the component's horizontal position.
|
|
|
Returns the component's vertical position.
|
|
|
Hides the component. It still may not be hidden if MNWindow::BeginMessageLoop() has not been called yet, or some callback negates this methods effect.
|
|
|
Gets the string at the given index.
|
|
||||||||||||
|
Allows this component to propagate an event to the given child.
|
|
||||||||||||
|
Allows this component to recieve top level events.
|
|
|
Removes the string at the given index.
|
|
||||||||||||||||||||
|
Transmits the given event to the child.
|
|
||||||||||||||||||||
|
Transmits the given event to the child.
|
|
||||||||||||||||
|
Transmits the given event to the parent.
|
|
||||||||||||||||
|
Sends a message to the underlying control. See the components docs. |
|
|
Sets the height of the component.
|
|
||||||||||||
|
Sets the component's position. This method is most often used by layout managers to set a control's position without affecting wether x or y's value is AUTOPOS.
Reimplemented in MNPanel. |
|
||||||||||||
|
Sets the size of the component.
|
|
|
Set the components text.
Reimplemented in MNAbstractButton. |
|
|
Sets the width of the component.
|
|
|
Sets the component's horizontal position.
|
|
|
Sets the component's vertical position.
|
|
|
Shows the component. It still may not be shown if MNWindow::BeginMessageLoop() has not been called yet, or some callback negates this methods effect.
|
|
||||||||||||||||||||
|
Is used to process all the callback functions.
|
|
|
A list of the child components that events are to be passed to. Stores the children who wish to recieve events.
|
|
|
Stores the callbacks for this component. Stores the functions given to AddCallBack(). It is used by FireEvents() to notify the callbacks.
|
1.2.18