Pyro higlevel API
Classes | Public Member Functions | Friends | List of all members
os::DropdownMenu Class Reference

Edit box with an asociated item-menu. More...

Inheritance diagram for os::DropdownMenu:
os::View os::Invoker os::Handler

Classes

class  DropdownTextView
 
class  DropdownView
 

Public Member Functions

 DropdownMenu (const Rect &cFrame, const String &cName, uint32 nResizeMask=CF_FOLLOW_LEFT|CF_FOLLOW_TOP, uint32 nFlags=WID_WILL_DRAW|WID_FULL_UPDATE_ON_RESIZE)
 DropdownMenu constructor. More...
 
 ~DropdownMenu ()
 
void SetEnable (bool bEnable=true)
 
bool IsEnabled () const
 
void SetReadOnly (bool bFlag=true)
 Change the "read-only" status. More...
 
bool GetReadOnly () const
 Returns the read-only status. More...
 
void AppendItem (const String &cString)
 Add a item to the end of the drop down list. More...
 
void InsertItem (int nPosition, const String &cString)
 Insert and item at a given position. More...
 
bool DeleteItem (int nPosition)
 Delete a item. More...
 
int GetItemCount () const
 Get the item count. More...
 
void Clear ()
 Delete all items. More...
 
const StringGetItem (int nItem) const
 Get one of the item strings. More...
 
int GetSelection () const
 Get the current selection. More...
 
void SetSelection (int nItem, bool bNotify=true)
 Set current selection. More...
 
const StringGetCurrentString () const
 
void SetCurrentString (const String &cString)
 
void SetMinPreferredSize (int nWidthChars)
 
int GetMinPreferredSize () const
 
void SetMaxPreferredSize (int nWidthChars)
 
int GetMaxPreferredSize () const
 
void SetSelectionMessage (Message *pcMsg)
 Set the message that will be sendt when the selection changes. More...
 
MessageGetSelectionMessage () const
 Get a pointer to the current "SelectionChanged" message. More...
 
void SetSendIntermediateMsg (bool bFlag)
 
bool GetSendIntermediateMsg () const
 
void SetEditMessage (Message *pcMsg)
 Set the message sendt when the user changes the content of the edit box. More...
 
MessageGetEditMessage () const
 Get a pointer to the current "SelectionChanged" message. More...
 
virtual void HandleMessage (Message *pcMessage)
 Handle events from sub components. More...
 
virtual void Paint (const Rect &cUpdateRect)
 Called by the system update "damaged" areas of the view. More...
 
virtual Point GetPreferredSize (bool bLargest) const
 
virtual void FrameSized (const Point &cDelta)
 Virtual hook called by the system when the view is resized. More...
 
virtual void MouseDown (const Point &cPosition, uint32 nButtons)
 Hook called by the system when a mouse button is pressed. More...
 
virtual void KeyDown (const char *pzString, const char *pzRawString, uint32 nQualifiers)
 Hook called by the system when a key is pressed while the view has focus. More...
 
virtual void AllAttached ()
 
virtual void Activated (bool bIsActive)
 Hook called when the view gain or loose focus. More...
 
virtual void SetTabOrder (int nOrder=NEXT_TAB_ORDER)
 Set the keyboard manouvering sorting order. More...
 
virtual int GetTabOrder () const
 Get the keybord manouvering order. More...
 
virtual void WheelMoved (const Point &cDelta)
 Hook called by the system when the scroll-wheel is rotated. More...
 
virtual void FontChanged (Font *pcNewFont)
 Called to notify the view that the font has changed. More...
 
- Public Member Functions inherited from os::View
 View (const Rect &cFrame, const String &cTitle, uint32 nResizeMask=CF_FOLLOW_LEFT|CF_FOLLOW_TOP, uint32 nFlags=WID_WILL_DRAW|WID_CLEAR_BACKGROUND)
 View constructor. More...
 
virtual ~View ()
 View destructor. More...
 
virtual void AttachedToWindow ()
 
virtual void DetachedFromWindow ()
 
virtual void AllDetached ()
 
virtual void WindowActivated (bool bIsActive)
 Hook called when the window hosting this view gain or loose focus. More...
 
virtual void MouseMove (const Point &cNewPos, int nCode, uint32 nButtons, Message *pcData)
 Hook called by the system when the mouse is moved. More...
 
virtual void MouseUp (const Point &cPosition, uint32 nButtons, Message *pcData)
 Hook called by the system when a mouse button is release. More...
 
virtual void KeyUp (const char *pzString, const char *pzRawString, uint32 nQualifiers)
 Hook called by the system when a key is released while the view has focus. More...
 
virtual void FrameMoved (const Point &cDelta)
 Virtual hook called by the system when the view is moved within it's parent. More...
 
virtual void ViewScrolled (const Point &cDelta)
 Virtual hook called by the system when the view content is scrolled. More...
 
virtual Point GetContentSize () const
 
virtual void AddChild (View *pcView, bool bAssignTabOrder=false)
 
void RemoveChild (View *pcChild)
 
void RemoveThis ()
 
ViewGetChildAt (const Point &cPos) const
 
ViewGetChildAt (int nIndex) const
 
ViewGetParent () const
 
ScrollBarGetVScrollBar () const
 
ScrollBarGetHScrollBar () const
 
WindowGetWindow () const
 
String GetTitle () const
 
virtual const ShortcutKeyGetShortcut () const
 
virtual void SetShortcut (const ShortcutKey &cShortcut)
 Set keyboard shortcut. More...
 
virtual void SetShortcutFromLabel (const String &cLabel)
 Set keyboard shortcut from Label. More...
 
void SetContextMenu (Menu *pcMenu)
 Set popup menu for a View. More...
 
MenuGetContextMenu () const
 Get popup menu. More...
 
uint32 GetQualifiers () const
 
void GetMouse (Point *pcPosition, uint32 *pnButtons) const
 
void SetMousePos (const Point &cPosition)
 
void BeginDrag (Message *pcData, const Point &cOffset, const Bitmap *pcBitmap, Handler *pcReplyTarget=NULL)
 Start a drag and drop operation. More...
 
void BeginDrag (Message *pcData, const Point &cOffset, const Rect &cBounds, Handler *pcReplyTarget=NULL)
 Start a drag and drop operation. More...
 
void SetFlags (uint32 nFlags)
 
uint32 GetFlags (uint32 nMask=~0L) const
 
void SetResizeMask (uint32 nFlags)
 
uint32 GetResizeMask () const
 
void Show (bool bVisible=true)
 Show/hide a view and all it's children. More...
 
void Hide ()
 
bool IsVisible () const
 
virtual void MakeFocus (bool bFocus=true)
 
virtual bool HasFocus () const
 
Rect GetFrame () const
 
Rect GetBounds () const
 
Rect GetNormalizedBounds () const
 
float Width () const
 
float Height () const
 
Point GetLeftTop () const
 
virtual void SetFrame (const Rect &cRect, bool bNotifyServer=true)
 Set the size and position relative to the parent view. More...
 
virtual void MoveBy (const Point &cDelta)
 Move the view within the parent coordinate system. More...
 
virtual void MoveBy (float vDeltaX, float vDeltaY)
 
virtual void MoveTo (const Point &cPos)
 Set the views position within the parent coordinate system. More...
 
virtual void MoveTo (float x, float y)
 
virtual void ResizeBy (const Point &cDelta)
 
virtual void ResizeBy (float vDeltaW, float vDeltaH)
 
virtual void ResizeTo (const Point &cSize)
 Set a new absolute size for the view. More...
 
virtual void ResizeTo (float W, float H)
 Set a new absolute size for the view. More...
 
void SetDrawingRegion (const Region &cReg)
 Restrict rendering using a clipping region. More...
 
void ClearDrawingRegion ()
 Remove any previously assigned drawing region. More...
 
void SetShapeRegion (const Region &cReg)
 Define a non-square shape for the view. More...
 
void ClearShapeRegion ()
 Remove any previously assigned shape region. More...
 
virtual int ToggleDepth ()
 
Point ConvertFromParent (const Point &cPoint) const
 
void ConvertFromParent (Point *cPoint) const
 
Rect ConvertFromParent (const Rect &cRect) const
 
void ConvertFromParent (Rect *cRect) const
 
Point ConvertToWindow (const Point &cPoint) const
 
void ConvertToWindow (Point *cPoint) const
 
Rect ConvertToWindow (const Rect &cRect) const
 
void ConvertToWindow (Rect *cRect) const
 
Point ConvertFromWindow (const Point &cPoint) const
 
void ConvertFromWindow (Point *cPoint) const
 
Rect ConvertFromWindow (const Rect &cRect) const
 
void ConvertFromWindow (Rect *cRect) const
 
Point ConvertToScreen (const Point &cPoint) const
 
void ConvertToScreen (Point *cPoint) const
 
Rect ConvertToScreen (const Rect &cRect) const
 
void ConvertToScreen (Rect *cRect) const
 
Point ConvertFromScreen (const Point &cPoint) const
 
void ConvertFromScreen (Point *cPoint) const
 
Rect ConvertFromScreen (const Rect &cRect) const
 
void ConvertFromScreen (Rect *cRect) const
 
void Invalidate (const Rect &cRect, bool bRecurse=false)
 Add a rectangle to the damage list. More...
 
void Invalidate (bool bRecurse=false)
 Invalidate the whole view. More...
 
void Flush ()
 Flush the render queue. More...
 
void Sync ()
 Flush the render queue. More...
 
void SetDrawingMode (drawing_mode nMode)
 
drawing_mode GetDrawingMode () const
 
void SetFont (Font *pcFont)
 Change the views text font. More...
 
FontGetFont () const
 
void SetFgColor (int nRed, int nGreen, int nBlue, int nAlpha=255)
 
void SetFgColor (Color32_s sColor)
 
Color32_s GetFgColor () const
 
void SetBgColor (int nRed, int nGreen, int nBlue, int nAlpha=255)
 
void SetBgColor (Color32_s sColor)
 
Color32_s GetBgColor () const
 
void SetEraseColor (int nRed, int nGreen, int nBlue, int nAlpha=255)
 
void SetEraseColor (Color32_s sColor)
 
Color32_s GetEraseColor () const
 
void MovePenTo (const Point &cPos)
 
void MovePenTo (float x, float y)
 
void MovePenBy (const Point &cPos)
 
void MovePenBy (float x, float y)
 
Point GetPenPosition () const
 Get the current pen position. More...
 
void DrawLine (const Point &cToPoint)
 
void DrawLine (const Point &cFromPnt, const Point &cToPnt)
 
virtual void ScrollBy (const Point &cDelta)
 
virtual void ScrollBy (float vDeltaX, float vDeltaY)
 
virtual void ScrollTo (Point cTopLeft)
 
virtual void ScrollTo (float x, float y)
 
Point GetScrollOffset () const
 
void ScrollRect (const Rect &cSrcRect, const Rect &cDstRect)
 Copy a rectangle from one location to another within the view. More...
 
void FillRect (const Rect &cRect)
 
void FillRect (const Rect &cRect, Color32_s sColor)
 
void DrawBitmap (const Bitmap *pcBitmap, const Rect &cSrcRect, const Rect &cDstRect)
 Render a bitmap into the view. More...
 
void EraseRect (const Rect &cRect)
 
void DrawFrame (const Rect &cRect, uint32 nFlags)
 
void DrawRoundedFrame (const os::Rect &cReizeFrame=os::Rect(1, 4,-1,-4), const os::Color32_s &cColor=get_default_color(COL_SHADOW))
 
void DrawRoundedFrame (const os::Rect &cFrame, const os::Rect &cReizeFrame=os::Rect(1, 4,-1,-4), const os::Color32_s &cColor=get_default_color(COL_SHADOW))
 
void DrawString (const Point &cPos, const String &cString)
 
void DrawString (const String &cString)
 Render a text-string at the current pen position. More...
 
void DrawString (const char *pzStr, int Len=-1)
 
void DrawText (const Rect &cPos, const String &cString, uint32 nFlags=0)
 Render a text-string in a specified rectangle. More...
 
void DrawSelectedText (const Rect &cPos, const String &cString, const IPoint &cSel1, const IPoint &cSel2, uint32 nMode=SEL_CHAR, uint32 nFlags=0)
 
void GetSelection (const String &cClipboard="__system_clipboard__")
 
void GetTruncatedStrings (const char **pazStringArray, int nStringCount, uint32 nMode, float nWidth, char **pazResultArray) const
 
float GetStringWidth (const String &cString) const
 
float GetStringWidth (const char *pzString, int nLen=-1) const
 
void GetStringWidths (const char **apzStringArray, const int *anLengthArray, int nStringCount, float *avWidthArray) const
 
Point GetTextExtent (const String &cString, uint32 nFlags=0, int nTargetWidth=-1) const
 
int GetStringLength (const String &cString, float vWidth, bool bIncludeLast=false) const
 
int GetStringLength (const char *pzString, int nLen, float vWidth, bool bIncludeLast=false) const
 
void GetStringLengths (const char **apzStringArray, const int *anLengthArray, int nStringCount, float vWidth, int *anMaxLengthArray, bool bIncludeLast=false) const
 
void GetFontHeight (font_height *psHeight) const
 
void Ping (int nSize=0) const
 
void SetToolTip (const os::String &t)
 
os::String GetToolTip () const
 
Point ConvertToParent (const Point &cPoint) const
 Translate a os::Point into our parents coordinate system. More...
 
void ConvertToParent (Point *cPoint) const
 Translate a os::Point into our parents coordinate system. More...
 
Rect ConvertToParent (const Rect &cRect) const
 
void ConvertToParent (Rect *cRect) const
 
- Public Member Functions inherited from os::Handler
 Handler (const String &cName)
 Construct a handler. More...
 
virtual ~Handler ()
 Destructor. More...
 
virtual void TimerTick (int nID)
 Timer dispatch member. More...
 
String GetName () const
 Get the handlers name. More...
 
void SetName (const String &cName)
 Rename the handler. More...
 
LooperGetLooper () const
 Get a pointer to the looper this handler belongs to. More...
 
void SetNextHandler (Handler *pcNextHandler)
 Set a handler that should handle messages this handler is not interrested in. More...
 
HandlerGetNextHandler () const
 Get the next handler in a handler chain. More...
 
void AddFilter (MessageFilter *pcFilter)
 
void RemoveFilter (MessageFilter *pcFilter)
 
const MsgFilterListGetFilterList () const
 
const uint32 GetToken ()
 Get the handlers token. More...
 
- Public Member Functions inherited from os::Invoker
 Invoker ()
 Default constructor. More...
 
 Invoker (Message *pcMessage)
 Constructor. More...
 
 Invoker (Message *pcMessage, const Handler *pcHandler, const Looper *pcLooper=NULL)
 Constructor. More...
 
 Invoker (Message *pcMessage, const Messenger &cTarget)
 Constructor. More...
 
virtual ~Invoker ()
 Destructor. More...
 
virtual status_t SetMessage (Message *pcMessage)
 Assign a new message to the invoker. More...
 
MessageGetMessage () const
 Get the message currently assigned to the invoker. More...
 
uint32 GetCode () const
 Get the code field from the currently assigned message. More...
 
virtual bool Invoked (Message *pcMessage)
 Intercept outgoing messages. More...
 
virtual void TargetChanged (const Messenger &cOldTarget)
 Virtual hook called by the system after the target has been changed. More...
 
virtual void MessageChanged (const Message &cOldMsg)
 Virtual hook called by the system after the message has been changed. More...
 
virtual status_t SetTarget (const Handler *pcHandler, const Looper *pcLooper=NULL)
 Set a new message target. More...
 
virtual status_t SetTarget (const Messenger &cMessenger)
 Set a new message target. More...
 
bool IsTargetLocal () const
 Check if the target lives in our process. More...
 
HandlerGetTarget (Looper **ppcLooper=NULL) const
 Get the current target. More...
 
Messenger GetMessenger () const
 Get the messenger used to target messages sendt by the invoker. More...
 
virtual status_t SetHandlerForReply (Handler *pcHandler)
 Set a reply target for messages sendt by this messenger. More...
 
HandlerGetHandlerForReply () const
 Get the current reply target for replies on messages sendt by the invoker. More...
 
virtual status_t Invoke (Message *pcMessage=NULL)
 Send the current message to the current target. More...
 

Friends

class DropdownView
 
class DropdownTextView
 

Detailed Description

Description:
See Also
TextView, Invoker
Author
Kurt Skauen (kurt@.nosp@m.athe.nosp@m.os.cx)

Constructor & Destructor Documentation

DropdownMenu::DropdownMenu ( const Rect cFrame,
const String cName,
uint32  nResizeMask = CF_FOLLOW_LEFT | CF_FOLLOW_TOP,
uint32  nFlags = WID_WILL_DRAW | WID_FULL_UPDATE_ON_RESIZE 
)
Parameters
cFrame- The size and position of the edit box and it's associated button.
pzName- The identifier passed down to the Handler class (Never rendered)
nResizeMask- Flags deskribing which edge follows edges of the parent when the parent is resized (Se View::View())
nFlags- Various flags passed to the View::View() constructor.
See Also
os::View, os::Invoker
Author
Kurt Skauen (kurt@.nosp@m.athe.nosp@m.os.cx)

References os::View::AddChild(), ARROW_HEIGHT, ARROW_WIDTH, CS_CMAP8, DropdownTextView, FrameSized(), os::Bitmap::GetBytesPerRow(), os::Bitmap::LockRaster(), os::Handler::Message, os::Invoker::SetMessage(), and os::Bitmap::SHARE_FRAMEBUFFER.

DropdownMenu::~DropdownMenu ( )

Member Function Documentation

void DropdownMenu::Activated ( bool  bIsActive)
virtual
Description:
This is a callback member that can be overloaded by derived classes to learn when the view is activated and when it is deactivated. The bIsActive parameter tell whether the focus was lost or gained.
The view has focus when it is the active view in the active window.
Note:
This is a hook function that is called by the system to notify about an event. You should never call this member yourself.

The window is locked when this member is called.

Parameters
bIsActive- true if the view gain and false if it loose focus.
See Also
MakeFocus(), WindowActivated()
Author
Kurt Skauen (kurt@.nosp@m.athe.nosp@m.os.cx)

Reimplemented from os::View.

References os::View::Flush(), and os::View::Invalidate().

void DropdownMenu::AllAttached ( void  )
virtual
void DropdownMenu::AppendItem ( const String cString)
Parameters
cString- The string to be appended
See Also
InsertItem(), DeleteItem(), GetItemCount(), GetItem()
Author
Kurt Skauen (kurt@.nosp@m.athe.nosp@m.os.cx)

Referenced by os::FileRequester::FileRequester().

void DropdownMenu::Clear ( )
Description:
Delete all the items in the menu
Parameters
nPosition- The zero based index of the item to delete.
Returns
true if an item was deleted, false if the index was out of range.
See Also
AppendItem(), InsertItem(), GetItemCount(), GetItem()
Author
Kurt Skauen (kurt@.nosp@m.athe.nosp@m.os.cx)
bool DropdownMenu::DeleteItem ( int  nPosition)
Description:
Delete the item at the given position
Parameters
nPosition- The zero based index of the item to delete.
Returns
true if an item was deleted, false if the index was out of range.
See Also
AppendItem(), InsertItem(), GetItemCount(), GetItem()
Author
Kurt Skauen (kurt@.nosp@m.athe.nosp@m.os.cx)

Referenced by os::FileRequester::Private::PathChanged().

void DropdownMenu::FontChanged ( Font pcNewFont)
virtual
Description:
FontChanged() is a virtual hook function that can be overloaded by inheriting classes to track changes to the view's font.
This hook function is called whenver the font is replaced through the View::SetFont() member or if the currently assigned font is modified in a way that whould alter the graphical appearance of the font.
Note:
View::SetFont() will call FontChanged() syncronously and will cause FontChanged() to be called even if the view is not yet added to a window. Changes done to the font-object cause a message to be sendt to the window thread and FontChanged() will then be called asyncronously from the window thread when the message arrive. For this reason it is only possible to track changes done to the font object itself when the view is added to a window.
Parameters
pcNewFontPointer to the affected font (same as returned by GetFont()).
See Also
SetFont(), os::Font
Author
Kurt Skauen (kurt@.nosp@m.athe.nosp@m.os.cx)

Reimplemented from os::View.

References os::Window::FindView(), and os::View::SetFont().

void DropdownMenu::FrameSized ( const Point cDelta)
virtual
Description:
Overload this member if you need to know when the view is resized.
Note:
This member is called after the view is resized. If you need the old size you can subtract the cDelta calue from the current size.
Parameters
cDeltaThe distance the bottom/right corner was moved relative to the upper/left corner.
See Also
FrameMoved(), SetFrame, ResizeBy(), ResizeTo()
Author
Kurt Skauen (kurt@.nosp@m.athe.nosp@m.os.cx)

Reimplemented from os::View.

References os::Rect::bottom, os::View::GetBounds(), os::Rect::Height(), os::Rect::left, os::Rect::right, and os::View::SetFrame().

Referenced by DropdownMenu().

const String & DropdownMenu::GetCurrentString ( ) const
Message * DropdownMenu::GetEditMessage ( ) const
Description:
Return the pointer last set by SetEditMessage() or NULL if no message is assigned. If you change the message the changes will be reflected in the following events sendt when the edit box is changed.
Note:
The message is still owned by the DropdownMenu. You should not delete is
Returns
Pointer to the internel "string-changed" message.
See Also
SetSelectionMessage(), Invoker::SetTarget()
Author
Kurt Skauen (kurt@.nosp@m.athe.nosp@m.os.cx)
const String & DropdownMenu::GetItem ( int  nItem) const
Description:
Returns one of the items encapsulated in a stl string.
Parameters
nItem- Zero based index of the item to return.
Returns
const reference to an stl string containing the item string
See Also
GetItemCount(), AppendItem(), InsertItem(), DeleteItem()
Author
Kurt Skauen (kurt@.nosp@m.athe.nosp@m.os.cx)

Referenced by os::FileRequester::HandleMessage().

int DropdownMenu::GetItemCount ( ) const
Returns
The number of items in the menu
See Also
GetItem(), AppendItem(), InsertItem(), DeleteItem()
Author
Kurt Skauen (kurt@.nosp@m.athe.nosp@m.os.cx)

Referenced by os::FileRequester::Private::PathChanged().

int DropdownMenu::GetMaxPreferredSize ( ) const
int DropdownMenu::GetMinPreferredSize ( ) const
Point DropdownMenu::GetPreferredSize ( bool  bLargest) const
virtual
bool DropdownMenu::GetReadOnly ( ) const
Returns
true if read only, false if read/write.
See Also
SetReadOnly()
Author
Kurt Skauen (kurt@.nosp@m.athe.nosp@m.os.cx)

References os::TextView::GetReadOnly().

int DropdownMenu::GetSelection ( ) const
Returns
The index of the selected item, or -1 if no item is selected.
See Also
SetSelection(), SetSelectionMessage()
Author
Kurt Skauen (kurt@.nosp@m.athe.nosp@m.os.cx)

Referenced by os::FileRequester::HandleMessage().

Message * DropdownMenu::GetSelectionMessage ( ) const
Description:
Return the pointer last set by SetSelectionMessage() or NULL if no message is assigned. If you change the message the changes will be reflected in the following "SelectionChanged" events.
Note:
The message is still owned by the DropdownMenu. You should not delete it.
Returns
Pointer to the internel "SelectionChanged" message.
See Also
SetSelectionMessage(), Invoker::SetTarget()
Author
Kurt Skauen (kurt@.nosp@m.athe.nosp@m.os.cx)
bool DropdownMenu::GetSendIntermediateMsg ( ) const
int DropdownMenu::GetTabOrder ( ) const
virtual
Description:
This member is called by the system to decide which view to select next when the <TAB> key is pressed. The focus is given to the next view with higher or equal tab-order as the current. You can overload this member to decide the order whenever it is called, or rely on the default implementation that will return whatever was set by SetTabOrder(). A negative return value means that the view should not be skipped when searching for the next view to activate.
Returns
The views sorting order for keyboard manouvering.
See Also
SetTabOrder()
Author
Kurt Skauen (kurt@.nosp@m.athe.nosp@m.os.cx)

Reimplemented from os::View.

References os::View::GetTabOrder().

void DropdownMenu::HandleMessage ( Message pcMessage)
virtual
void DropdownMenu::InsertItem ( int  nPosition,
const String cString 
)

: The new item is inserted before the nPosition'th item.

Parameters
nPosition- Zero based index of the item to insert the string in front of
pzString- The string to be insert
See Also
AppendItem(), DeleteItem(), GetItemCount(), GetItem()
Author
Kurt Skauen (kurt@.nosp@m.athe.nosp@m.os.cx)

Referenced by os::FileRequester::FileRequester(), and os::FileRequester::Private::PathChanged().

bool DropdownMenu::IsEnabled ( void  ) const

Referenced by KeyDown(), and Paint().

void DropdownMenu::KeyDown ( const char *  pzString,
const char *  pzRawString,
uint32  nQualifiers 
)
virtual
Description:
Overload this member if your view need to handle keyboard input. This member is called to allow the view to handle M_KEY_DOWN messages. The most common members are exctracted from the message and passed as parameters but you might need to obtain the raw message with os::Looper::GetCurrentMessage() and find some members yourself if you the data you needed are not passed in.
For example if you need the raw key-code for the pressed key you will have to lookup the "_raw_key" member from the message.
Parameters
pzStringString containing a single UTF-8 encoded character. This is the character generated by the pressed key according to the current keymap accounting for any qualifiers that might be pressed.
pzRawStringSame as pzString except that the key is converted without accounting for qualifiers. Ie. if 'A' is pressed while pressing <SHIFT> pzString will contain 'A' and pzRawString will contain 'a'.
nQualifiersBitmask describing which qualifiers that was active when the key was pressed.
See Also
KeyUp(), os::Looper::GetCurrentMessage()
Author
Kurt Skauen (kurt@.nosp@m.athe.nosp@m.os.cx)

Reimplemented from os::View.

References os::View::Flush(), os::View::GetBounds(), os::View::GetShortcut(), os::View::Invalidate(), IsEnabled(), os::View::KeyDown(), os::View::MakeFocus(), and VK_ENTER.

void DropdownMenu::MouseDown ( const Point cPosition,
uint32  nButtons 
)
virtual
Description:
This member is called from the window thread whenever a mouse button is clicked above the view. You can overload this member if your view need to know about mouse-down events.
A view will not automatically take focus when clicked so if you want that behaviour you must call MakeFocus() from an overloaded version of this member.
The default implementation of this member will call MouseDown() on it's parent view if one exists.
Parameters
cPositionMouse position in the views coordinate system at the time the mouse was pressed.
nButtonsIndex of the pressed button. Buttons start at 1 for the left button, 2 for the right button, 3 for the middle button. Additional buttons might be supported by the mouse driver and will then be assigned numbers from 4 and up.
See Also
MouseUp(), MouseMove(), WheelMoved()
Author
Kurt Skauen (kurt@.nosp@m.athe.nosp@m.os.cx)

Reimplemented from os::View.

References os::View::Flush(), os::View::GetBounds(), os::View::Invalidate(), os::Control::IsEnabled(), and os::View::MouseDown().

void DropdownMenu::Paint ( const Rect cUpdateRect)
virtual
Description:
Note:
Warning:
Parameters
cUpdateRectA rectangle enclosing all damaged areas. This is just a rough "worst-case", further fine-grained clipping will be performed by the Application Server to avoid updating non-damaged pixels and make the update as fast and flicker-free as possible.
See Also
Invalidate(), Flush()
Author
Kurt Skauen (kurt@.nosp@m.athe.nosp@m.os.cx)

Reimplemented from os::View.

References ARROW_HEIGHT, ARROW_WIDTH, os::Rect::bottom, os::COL_FOCUS, os::COL_NORMAL, DM_COPY, DM_OVER, os::View::DrawBitmap(), os::View::DrawFrame(), os::View::DrawLine(), os::FRAME_RAISED, os::FRAME_RECESSED, os::get_default_color(), os::View::GetBounds(), os::View::HasFocus(), os::Rect::Height(), IsEnabled(), os::Control::IsEnabled(), os::Rect::left, os::Rect::Resize(), os::Rect::right, os::View::SetDrawingMode(), os::View::SetEraseColor(), os::View::SetFgColor(), os::Rect::top, os::Rect::Width(), and os::Point::y.

void DropdownMenu::SetCurrentString ( const String cString)
void DropdownMenu::SetEditMessage ( Message pcMsg)
Description:
The message is sendt everytime the user changes the content of the edit box. Before the message is sendt a boolean member called "final" is added. This member is false when the user is typing into the edit box, and true for the last message sendt when the user hits <ENTER>.

The content of the edit box is not automatically copyed into the item-list. If you f.eks. want to add a new entry to the item list each time the user change the string and hits <ENTER>, you must listen to this message and read out the string with GetCurrentString() and add it to the list with AppendItem() or InsertItem() each time you receive a message with the "final" member equal "true".

Note:
The DropdownMenu overtake the ownership of the message. You should not delete or reference the message after SetSelectionMessage() returns.
Parameters
pcMsg- The message to be sendt when the edit box changes.
See Also
GetEditMessage(), SetSelectionMessage(), Invoker::SetTarget(), Invoker::Invoke()
Author
Kurt Skauen (kurt@.nosp@m.athe.nosp@m.os.cx)
void DropdownMenu::SetEnable ( bool  bEnable = true)
void DropdownMenu::SetMaxPreferredSize ( int  nWidthChars)
void DropdownMenu::SetMinPreferredSize ( int  nWidthChars)
void DropdownMenu::SetReadOnly ( bool  bFlag = true)
Description:
When the DropdownMenu is set in read-only mode the user will not be able to edit the contents of the edit box. It will also make the menu open when the user click inside the edit box.
Parameters
bFlag- Is true the menu will be read-only, if false it will be read/write.
See Also
GetReadOnly()
Author
Kurt Skauen (kurt@.nosp@m.athe.nosp@m.os.cx)

References os::TextView::SetReadOnly().

Referenced by os::FileRequester::FileRequester().

void DropdownMenu::SetSelection ( int  nItem,
bool  bNotify = true 
)
Description:
The given item will be highlighted when the menu is opened and the item will be copyed into the edit box. If the bNotify parameter is true and the selection differs from the currend the "SelectionMessage" (see SetSelectionMessage()) will be sendt to the target set by SetTarget().
Parameters
nItem- The new selection
bNotify- If true a notification will be sendt if the new selection differ from the current.
See Also
GetSelection(), SetSelectionMessage(), GetSelectionMessage(), Invoker::SetTarget()
Author
Kurt Skauen (kurt@.nosp@m.athe.nosp@m.os.cx)

References os::Message::AddBool(), os::Message::AddInt32(), os::Invoker::Invoke(), and os::TextView::Set().

Referenced by os::FileRequester::FileRequester(), and os::FileRequester::Private::PathChanged().

void DropdownMenu::SetSelectionMessage ( Message pcMsg)
Description:
When the selection is changed eighter by the user or by calling SetSelection() with bNotify = true, the DropdownMenu() will clone off the message set with SetSelectionMessage() and send it to it's target by calling Invoker::Invoke().

Before sending the message the two fields "final" and "selection" are added. "final" is a boolean that is true when the user select (click's on) an item from the menu, or if the event was triggered by SetSelection(). "final" is false when the event was triggered by the user moving the mouse over the menu. "selection" is an int32 that contain the new selection.

In addition to those fields comes the fields added by Invoker::Invoke().

If pcMsg is NULL no event will be triggered by changing the selection.

Note:
The DropdownMenu overtake the ownership of the message. You should not delete or reference the message after SetSelectionMessage() returns.
Parameters
pcMsg- The message to be sendt when selection changes.
See Also
GetSelectionMessage(), SetEditMessage(), Invoker::SetTarget()
Author
Kurt Skauen (kurt@.nosp@m.athe.nosp@m.os.cx)

Referenced by os::FileRequester::FileRequester().

void DropdownMenu::SetSendIntermediateMsg ( bool  bFlag)
void DropdownMenu::SetTabOrder ( int  nOrder = NEXT_TAB_ORDER)
virtual
Description:
Set the value that will be returned by GetTabOrder().
Parameters
nOrder- The sorting order.
See Also
GetTabOrder()
Author
Kurt Skauen (kurt@.nosp@m.athe.nosp@m.os.cx)

Reimplemented from os::View.

References os::TextView::SetTabOrder(), and os::View::SetTabOrder().

void DropdownMenu::WheelMoved ( const Point cDelta)
virtual
Description:
This member is called from the window thread whenever the user rotates the scroll wheel with the mouse pointer above this view.
The default implementation of this member will call WheelMoved() on it's parent view if one exists.
Since
V0.3.7
Parameters
cDeltaDelta movement. Normally only the y value is used but it is possible for the mouse driver to also support horizontal scroll wheel functionality. The delta value is normally +/- 1.0 for each "click" on the wheel.
See Also
MouseMove(), MouseDown(), MouseUp()
Author
Kurt Skauen (kurt@.nosp@m.athe.nosp@m.os.cx)

Reimplemented from os::View.

References os::Message::AddPoint(), os::Message::AddPointer(), os::Window::FindView(), os::View::Flush(), os::View::GetBounds(), os::View::Invalidate(), os::M_WHEEL_MOVED, os::View::MakeFocus(), os::Handler::Message, and os::Looper::PostMessage().

Friends And Related Function Documentation

friend class DropdownTextView
friend

Referenced by DropdownMenu().

friend class DropdownView
friend