CFileInfoList Class Reference

#include <fileinfolist.h>

List of all members.

Public Member Functions

 CFileInfoList ()
virtual ~CFileInfoList ()
BOOL Init (CWindowID ParentDlg, CGadgetID GadgetID)
void AddColumn (String_64 strHeader, INT32 iWidth=-1, INT32 iFormat=wxLIST_FORMAT_LEFT)
CListRow AddRow ()
void Clear ()

Protected Member Functions

void SetRowBitmap (INT32 iRow, UINT32 uiBitmapID)
void SetRowText (INT32 iRow, INT32 iColumn, String_256 strText)
wxListCtrl * GetListCtrl ()
wxImageList * GetImageList ()

Protected Attributes

CWindowID m_widParentDlg
CGadgetID m_gdgidGadget

Static Protected Attributes

static const INT32 m_ciImageListType = wxIMAGE_LIST_SMALL

Friends

class CListRow

Classes

class  CListRow


Detailed Description

Definition at line 104 of file fileinfolist.h.


Constructor & Destructor Documentation

CFileInfoList::CFileInfoList  ) 
 

Definition at line 186 of file fileinfolist.cpp.

00187 {
00188     m_widParentDlg = 0;
00189     m_gdgidGadget  = 0;
00190 }

CFileInfoList::~CFileInfoList  )  [virtual]
 

Definition at line 193 of file fileinfolist.cpp.

00194 {
00195 }


Member Function Documentation

void CFileInfoList::AddColumn String_64  strHeader,
INT32  iWidth = -1,
INT32  iFormat = wxLIST_FORMAT_LEFT
 

Function : CFileInfoList::AddColumn Author : Mikhail Tatarnikov Purpose : Add a new column Returns : void Exceptions: Parameters: [in] String_64 strHeader - column label; [in] INT32 iWidth - column width; [in] INT32 iFormat - column format (see wxListCtrl::InsertColumn). Notes :

Definition at line 271 of file fileinfolist.cpp.

00272 {
00273     wxListCtrl* plstList = GetListCtrl();
00274     INT32 iColNum = plstList->GetColumnCount();
00275     plstList->InsertColumn(iColNum, strHeader, iFormat, iWidth);
00276 }

CFileInfoList::CListRow CFileInfoList::AddRow  ) 
 

Function : CFileInfoList::AddRow Author : Mikhail Tatarnikov Purpose : Adds a new row Returns : CFileInfoList::CListRow - an object to represet the new created row. Exceptions: Parameters: None Notes :

Definition at line 288 of file fileinfolist.cpp.

00289 {
00290     wxListCtrl* plstList = GetListCtrl();
00291     
00292     INT32 iRowsCount = plstList->GetItemCount();
00293     plstList->InsertItem(iRowsCount, _T(""));
00294     
00295     return CListRow(this, iRowsCount);
00296 }

void CFileInfoList::Clear  ) 
 

Function : CFileInfoList::Clear Author : Mikhail Tatarnikov Purpose : Removes all elements from the list Returns : void Exceptions: Parameters: None Notes :

Definition at line 307 of file fileinfolist.cpp.

00308 {
00309     wxListCtrl* plstList = GetListCtrl();
00310     plstList->DeleteAllItems();
00311 
00312     
00313     plstList->AssignImageList(NULL, m_ciImageListType);
00314 }

wxImageList * CFileInfoList::GetImageList  )  [protected]
 

Definition at line 222 of file fileinfolist.cpp.

00223 {
00224     wxListCtrl* pListCtrl = GetListCtrl();
00225     wxImageList* pilImageList = pListCtrl->GetImageList(m_ciImageListType);
00226     
00227     return pilImageList;
00228 }

wxListCtrl * CFileInfoList::GetListCtrl  )  [protected]
 

Function : CFileInfoList::GetListCtrl Author : Mikhail Tatarnikov Purpose : Helper function to retrieve the actual list control Returns : wxListCtrl* - the list control associated with this object. Exceptions: Parameters: None Notes :

Definition at line 207 of file fileinfolist.cpp.

00208 {
00209     wxWindow* pwndGadget = DialogManager::GetGadget(m_widParentDlg, m_gdgidGadget);
00210     if (!pwndGadget)
00211         return NULL;
00212     
00213     if (!pwndGadget->IsKindOf(CLASSINFO(wxListCtrl)))
00214         return NULL;
00215     
00216     wxListCtrl* plstList = (wxListCtrl*)pwndGadget;
00217     
00218     return plstList;
00219 }

BOOL CFileInfoList::Init CWindowID  widParentDlg,
CGadgetID  gdgidGadget
 

Function : CBitmapDropDown::Init Author : Mikhail Tatarnikov Purpose : Initialize the control Returns : BOOL - TRUE if success, FALSE otherwise. Exceptions: Parameters: [in] CWindowID Window - the parent window, NULL to deinitialize; [in] CGadgetID Gadget - the control ID. Notes :

Definition at line 243 of file fileinfolist.cpp.

00244 {
00245     // Obtain the gadget and check if it has an appropriate class (we can
00246     // be attached to a wxListCtrl only).
00247     wxWindow* pwndGadget = DialogManager::GetGadget(widParentDlg, gdgidGadget);
00248     if (pwndGadget && pwndGadget->IsKindOf(CLASSINFO(wxListCtrl)))
00249     {
00250         m_widParentDlg = widParentDlg;
00251         m_gdgidGadget  = gdgidGadget;
00252         
00253         return(TRUE);
00254     }
00255     
00256     ERROR3("CBitmapDropDown::Init failed - illegal Gadget");
00257     return(FALSE);
00258 }

void CFileInfoList::SetRowBitmap INT32  iRow,
UINT32  uiBitmapID
[protected]
 

Function : CFileInfoList::SetRowBitmap Author : Mikhail Tatarnikov Purpose : Set a bitmap to the row. Returns : void Exceptions: Parameters: [in] INT32 iRow - row to set the bitmap to; [in] UINT32 uiBitmapID - new bitmap ID. Notes :

Definition at line 327 of file fileinfolist.cpp.

00328 {
00329     wxListCtrl* plstList = GetListCtrl();
00330     if (plstList == NULL)
00331         return;
00332     
00333     // Load the bitmap
00334     wxBitmap* pBitmap = CamArtProvider::Get()->FindBitmap(uiBitmapID, CAF_DEFAULT);
00335     if (pBitmap == NULL)
00336         return;
00337     
00338     // Obtain the control's image list and add the new bitmap into it.
00339     wxImageList* pilImageList = GetImageList();
00340     
00341     // Check if we have to create an image list ourselves.
00342     if (pilImageList == NULL)
00343     {
00344         pilImageList = new wxImageList(pBitmap->GetWidth(), pBitmap->GetHeight(), true, 0);
00345         plstList->AssignImageList(pilImageList, m_ciImageListType);
00346     }
00347     
00348     INT32 iBitmapIndex = pilImageList->Add(*pBitmap);
00349     
00350     // Finally set the item information.
00351     plstList->SetItem(iRow, 0, _T(""), iBitmapIndex);
00352 }

void CFileInfoList::SetRowText INT32  iRow,
INT32  iColumn,
String_256  strText
[protected]
 

Function : CFileInfoList::SetRowText Author : Mikhail Tatarnikov Purpose : Set new text to a row Returns : void Exceptions: Parameters: [in] INT32 iRow - row to set the text to; [in] INT32 iColumn - column to set the text to; [in] String_256 strText - new text. Notes :

Definition at line 365 of file fileinfolist.cpp.

00366 {
00367     wxListCtrl* plstList = GetListCtrl();
00368     plstList->SetItem(iRow, iColumn, strText);
00369 }


Friends And Related Function Documentation

friend class CListRow [friend]
 

Definition at line 148 of file fileinfolist.h.


Member Data Documentation

const INT32 CFileInfoList::m_ciImageListType = wxIMAGE_LIST_SMALL [static, protected]
 

Definition at line 159 of file fileinfolist.h.

CGadgetID CFileInfoList::m_gdgidGadget [protected]
 

Definition at line 157 of file fileinfolist.h.

CWindowID CFileInfoList::m_widParentDlg [protected]
 

Definition at line 156 of file fileinfolist.h.


The documentation for this class was generated from the following files:
Generated on Sat Nov 10 03:52:22 2007 for Camelot by  doxygen 1.4.4