os::IconView Class Reference
[The Syllable Graphical User Interface API]

Icon view with different views. More...

Inheritance diagram for os::IconView:

os::Control os::View os::Invoker os::Handler os::IconDirectoryView List of all members.

Public Types

enum  scroll_direction {
  SCROLL_UP,
  SCROLL_DOWN,
  SCROLL_LEFT,
  SCROLL_RIGHT
}
enum  view_type {
  VIEW_ICONS,
  VIEW_LIST,
  VIEW_DETAILS,
  VIEW_ICONS_DESKTOP
}
 The different view types. More...

Public Member Functions

 IconView (const Rect &cFrame, os::String zName, uint32 nResizeMask)
 Constructor.
 ~IconView ()
virtual void EnableStatusChanged (bool bIsEnabled)
virtual void Invoked (uint nIcon, os::IconData *pcData)
 Called when an icon is invoked.
virtual void SelectionChanged ()
 Called when the selection changes.
virtual void DragSelection (os::Point cStartPoint)
 Called when an icon should be dragged.
virtual void OpenContextMenu (os::Point cPosition, bool bMouseOverIcon)
 Called when the context menu of one icon should be opened.
view_type GetView () const
 Returns the curent view type.
void SetView (view_type eType)
 Sets a new view type.
void SetTextColor (os::Color32_s sColor)
 Sets a new text color.
void SetTextShadowColor (os::Color32_s sColor)
 Sets a new color for the shadows of the text.
void SetSelectionColor (os::Color32_s sColor)
 Sets a new color for the selection.
void SetBackgroundColor (os::Color32_s sColor)
 Sets a new background color.
void SetBackground (os::Image *pcImage)
 Sets a new background image.
void SetSingleClick (bool bSingle)
 Enables/Disables single click mode.
bool IsSingleClick () const
 Returns whether single click mode is enabled.
void SetAutoSort (bool bAutoSort)
 Enables/Disables sorting.
bool IsAutoSort () const
 Returns whether sorting is enabled.
void SetMultiSelect (bool bMultiSelect)
 Enables/Disables multiselect.
bool IsMultiSelect () const
 Returns whether multiselect is enabled.
void Clear ()
 Clears the iconview.
uint AddIcon (os::Image *pcIcon, os::IconData *pcData)
 Adds a new icon to the iconview.
void RemoveIcon (uint nIcon)
 Removes an icon.
uint GetIconCount ()
 Returns the number of icons.
os::String GetIconString (uint nIcon, uint nString)
 Returns a string of an icon.
os::ImageGetIconImage (uint nIcon)
 Returns the image of an icon.
os::IconDataGetIconData (uint nIcon)
 Returns the private data of an icon.
bool GetIconSelected (uint nIcon)
 Returns whether one icon is selected.
os::Point GetIconPosition (uint nIcon)
 Returns the current position of an icon.
void AddIconString (uint nIcon, os::String zName)
 Adds a string of an icon.
void SetIconString (uint nIcon, uint nString, os::String zString)
 Sets a string of an icon.
void SetIconImage (uint nIcon, os::Image *pcImage)
 Sets the image of an icon.
void SetIconSelected (uint nIcon, bool bSelected, bool bDeselectAll=true)
 Sets the selection status of an icon.
void SetIconPosition (uint nIcon, os::Point cPosition)
 Sets the position of an icon.
os::Point GetIconSize ()
 Returns the current icon size that is assumed by the iconview.
void RenderIcon (uint nIcon, os::View *pcView, os::Point cPosition)
 Renders an icon in a view.
void RenderIcon (os::String zName, os::Image *pcImage, os::View *pcView, os::Point cPosition)
 Renders an icon in a view.
void Layout ()
 Relayouts the view.
os::Point ConvertToView (os::Point cPoint)
void StartScroll (scroll_direction eDirection)
 Start scrolling.
void StopScroll ()
 Stops scrolling.
void ScrollToIcon (uint nIcon)
 Scrolls to an icon.
void SetSelChangeMsg (os::Message *pcMessage)
 Sets the selection change message.
void SetInvokeMsg (os::Message *pcMessage)
 Sets the invoke message.
virtual os::MessageGetSelChangeMsg ()
 Returns the selection change message.
virtual os::MessageGetInvokeMsg ()
 Returns the invoke message.
virtual void MakeFocus (bool bFocus=true)
 Change focus of the IconView.
virtual void SetTabOrder (int nOrder=NEXT_TAB_ORDER)
 Set the keyboard manouvering sorting order.
virtual int GetTabOrder ()

Classes

class  MainView
class  Private

Detailed Description

Description:
The iconview can display icons + descriptions in different ways, e.g. it is used by the os::IconDirectoryView class to display the contents of folders.
See also:
os::IconDirectoryView
Author:
Arno Klenke ([email protected])


Member Enumeration Documentation

enum os::IconView::scroll_direction

Enumerator:
SCROLL_UP 
SCROLL_DOWN 
SCROLL_LEFT 
SCROLL_RIGHT 

enum os::IconView::view_type

Description:
VIEW_ICONS - Displays icons which are freely moveable.
VIEW_LIST - Displays the icons in a multi-column list.
VIEW_DETAILS - Displays the icons in a single-column list with the
icon strings in the other columns.
Author:
Arno Klenke ([email protected])
Enumerator:
VIEW_ICONS 
VIEW_LIST 
VIEW_DETAILS 
VIEW_ICONS_DESKTOP 


Constructor & Destructor Documentation

IconView::IconView ( const Rect cFrame,
os::String  zName,
uint32  nResizeMask 
)

Description:
IconView constructor.
Parameters:
cFrame - Frame of the iconview.
zName - Name of the iconview.
nResizeMask - resize mask.
Author:
Arno Klenke ([email protected])

IconView::~IconView (  ) 


Member Function Documentation

void IconView::EnableStatusChanged ( bool  bIsEnabled  )  [virtual]

Implements os::Control.

void IconView::Invoked ( uint  nIcon,
os::IconData pcData 
) [virtual]

Description:
Called when an icon is invoked. The default action is to send the message set by SetInvokeMsg()
Parameters:
nIcon - Index of the invoked icon.
pcData - Data of the invoked icon.
Author:
Arno Klenke ([email protected])

Reimplemented in os::IconDirectoryView.

void IconView::SelectionChanged (  )  [virtual]

Description:
Called when an icon is selected. The default action is to send the message set by SetSelChangeMsg()
Parameters:
nIcon - Index of the invoked icon.
pcData - Data of the invoked icon.
Author:
Arno Klenke ([email protected])

void IconView::DragSelection ( os::Point  cStartPoint  )  [virtual]

Description:
Called when an icon should be dragged.
Parameters:
cStartPoint - Start position of the drag.
Author:
Arno Klenke ([email protected])

Reimplemented in os::IconDirectoryView.

void IconView::OpenContextMenu ( os::Point  cPosition,
bool  bMouseOverIcon 
) [virtual]

Description:
Called when the context menu of one icon should be opened.
Parameters:
cPosition - Position.
bMouseOverIcon - Whether the contextmenu of an icon should be opened.
Author:
Arno Klenke ([email protected])

Reimplemented in os::IconDirectoryView.

IconView::view_type IconView::GetView (  )  const

Description:
Returns:
The current view type as VIEW_* enums.
Author:
Arno Klenke ([email protected])

void IconView::SetView ( view_type  eType  ) 

Description:
Sets a new view type and updates the view.
Parameters:
eType - View type.
Author:
Arno Klenke ([email protected])

void IconView::SetTextColor ( os::Color32_s  sColor  ) 

Description:
Sets a new text color and updates the view.
Note: SetTextColor overwrites SetTextShadowColor to disable shadows
Please make sure that the background color/image doesn’t make the text invisible.
Parameters:
sColor - The new color.
Author:
Arno Klenke ([email protected]) Andreas Benzler ([email protected])

void IconView::SetTextShadowColor ( os::Color32_s  sColor  ) 

Description:
Sets a new color for the shadows of the text.
Note: SetTextColor overwrites SetTextShadowColor to disable shadows.
Parameters:
sColor - The new color.
Author:
Arno Klenke ([email protected]) Andreas Benzler ([email protected])

void IconView::SetSelectionColor ( os::Color32_s  sColor  ) 

Description:
Sets a new color for the selection rectangle.
Note:
Please make sure that the color doesn’t make the text invisible.
Parameters:
sColor - The new color.
Author:
Arno Klenke ([email protected])

void IconView::SetBackgroundColor ( os::Color32_s  sColor  ) 

Description:
Sets a new background color and updates the view.
Note:
Not used if a background image is set.
Parameters:
sColor - The new color.
Author:
Arno Klenke ([email protected])

void IconView::SetBackground ( os::Image pcImage  ) 

Description:
Sets a new background image and updates the view.
Note:
The previous image will be deleted.
Parameters:
pcImage - The new image.
Author:
Arno Klenke ([email protected])

void IconView::SetSingleClick ( bool  bSingleClick  ) 

Description:
Enables/Disables single click mode. In single click mode the icons will already be invoked with a single click.
Parameters:
bSingleClick - Whether single click mode is enabled.
Author:
Arno Klenke ([email protected])

bool IconView::IsSingleClick (  )  const

Description:
Returns whether single click mode is enabled.
Author:
Arno Klenke ([email protected])

void IconView::SetAutoSort ( bool  bAutoSort  ) 

Description:
Enables/Disables the sorting of the icons.
Parameters:
bAutoSort - Whether sorting is enabled.
Author:
Arno Klenke ([email protected])

bool IconView::IsAutoSort (  )  const

Description:
Returns whether sorting is enabled.
Author:
Arno Klenke ([email protected])

void IconView::SetMultiSelect ( bool  bMultiSelect  ) 

Description:
Enables/Disables whether the selection of multiple icons is allowed.
Author:
Arno Klenke ([email protected])

bool IconView::IsMultiSelect (  )  const

Description:
Returns whether multiselect is enabled.
Author:
Arno Klenke ([email protected])

void IconView::Clear (  ) 

Description:
Clears the iconview and deletes all icons.
Author:
Arno Klenke ([email protected])

uint IconView::AddIcon ( os::Image pcImage,
os::IconData pcData 
)

Description:
Adds a new icon to the iconview.
Note:
You need to call Layout() to make the new icons visible!
Parameters:
pcImage - The icon.
pcData - Private data of the icon. A subclass of os::IconData can be used.
Author:
Arno Klenke ([email protected])

void IconView::RemoveIcon ( uint  nIcon  ) 

Description:
Removes an icon from the iconview.
Note:
You need to call Layout() to make the changes visible!
Parameters:
nIcon - Index of the icon.
Author:
Arno Klenke ([email protected])

uint IconView::GetIconCount (  ) 

Description:
Returns the number of icons of the iconview.
Author:
Arno Klenke ([email protected])

os::String IconView::GetIconString ( uint  nIcon,
uint  nString 
)

Description:
Returns a string of an icon of the iconview.
Parameters:
nIcon - Index of the icon.
nString - Index of the string.
Returns:
The string or "" if one of the index is invalid.
Author:
Arno Klenke ([email protected])

os::Image * IconView::GetIconImage ( uint  nIcon  ) 

Description:
Returns the image of an icon of the iconview.
Parameters:
nIcon - Index of the icon.
Returns:
The image or NULL.
Author:
Arno Klenke ([email protected])

os::IconData * IconView::GetIconData ( uint  nIcon  ) 

Description:
Returns the private data of an icon of the iconview.
Parameters:
nIcon - Index of the icon.
Returns:
The data or NULL.
Author:
Arno Klenke ([email protected])

bool IconView::GetIconSelected ( uint  nIcon  ) 

Description:
Returns whether one icon of the iconview is selected.
Parameters:
nIcon - Index of the icon.
Author:
Arno Klenke ([email protected])

os::Point IconView::GetIconPosition ( uint  nIcon  ) 

Description:
RReturns the current position of an icon of the iconview.
Parameters:
nIcon - Index of the icon.
Returns:
The position.
Author:
Arno Klenke ([email protected])

void IconView::AddIconString ( uint  nIcon,
os::String  zString 
)

Description:
Add a a string of an icon.
Note:
Only the first string will be displayed in all view types. The additional ones only in VIEW_DETAILS.
Parameters:
nIcon - Index of the icon.
zString - String.
Author:
Arno Klenke ([email protected])

void IconView::SetIconString ( uint  nIcon,
uint  nString,
os::String  zString 
)

Description:
Sets a a string of an icon.
Note:
You have to add new strings using the AddIconString() method.
Parameters:
nIcon - Index of the icon.
nString - Index of the string.
zString - String.
Author:
Arno Klenke ([email protected])

void IconView::SetIconImage ( uint  nIcon,
os::Image pcImage 
)

Description:
Sets the image of an icon.
Parameters:
nIcon - Index of the icon.
pcImage - New image. The old one will be deleted.
Author:
Arno Klenke ([email protected])

void IconView::SetIconSelected ( uint  nIcon,
bool  bSelected,
bool  bDeselectAll = true 
)

Description:
Sets the selection status of an icon and updates the view.
Parameters:
nIcon - Index of the icon.
bSelected - New select status.
bDeselectAll - Whether all icons should be deslected first.
Author:
Arno Klenke ([email protected])

void IconView::SetIconPosition ( uint  nIcon,
os::Point  cPosition 
)

Description:
Sets the position of an icon.
Parameters:
nIcon - Index of the icon.
cPosition - the new position.
Author:
Arno Klenke ([email protected])

os::Point IconView::GetIconSize (  ) 

Description:
Returns the current icon size that is assumed by the iconview.
Author:
Arno Klenke ([email protected])

void IconView::RenderIcon ( uint  nIcon,
os::View pcView,
os::Point  cPosition 
)

Description:
Renders an icon in a view. Should only be used in special cases.
Author:
Arno Klenke ([email protected])

void IconView::RenderIcon ( os::String  zName,
os::Image pcImage,
os::View pcView,
os::Point  cPosition 
)

Description:
Renders an icon in a view. Should only be used in special cases.
Author:
Arno Klenke ([email protected])

void IconView::Layout (  ) 

Description:
Relayouts and updates the view. Necessary after calls like AddIcon() or RemoveIcon().
Author:
Arno Klenke ([email protected])

os::Point IconView::ConvertToView ( os::Point  cPoint  ) 

void IconView::StartScroll ( scroll_direction  eDirection  ) 

Description:
Start scrolling.
Author:
Arno Klenke ([email protected])

void IconView::StopScroll (  ) 

Description:
Stops scrolling.
Author:
Arno Klenke ([email protected])

void IconView::ScrollToIcon ( uint  nIcon  ) 

Description:
Scrolls the view to make one icon visible.
Parameters:
nIcon - Icon
Author:
Arno Klenke ([email protected])

void IconView::SetSelChangeMsg ( os::Message pcMessage  ) 

Description:
Sets the message that is sent when the selection changes.
Parameters:
pcMessage - New message.
Author:
Arno Klenke ([email protected])

void IconView::SetInvokeMsg ( os::Message pcMessage  ) 

Description:
Sets the message that is sent when an icon is invoked.
Parameters:
pcMessage - New message.
Author:
Arno Klenke ([email protected])

os::Message * IconView::GetSelChangeMsg (  )  [virtual]

Description:
Returns the message that is sent when the selection changes.
Author:
Arno Klenke ([email protected])

os::Message * IconView::GetInvokeMsg (  )  [virtual]

Description:
Returns the message that is sent when an icon is invoked.
Author:
Arno Klenke ([email protected])

void IconView::MakeFocus ( bool  bFocus = true  )  [virtual]

Description:
Change focus of the IconView
Parameters:
bFocus - if true set focus else unfocus the IconView
Author:
Jonas Jarvoll ([email protected])

Reimplemented from os::View.

void IconView::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 ([email protected])

Reimplemented from os::View.

int IconView::GetTabOrder (  )  [virtual]


Generated on Sat May 9 22:51:29 2009 for Syllable higlevel API by  doxygen 1.5.1