ListControl Class Reference

Represents a List in a DialogOp. More...

#include <gadget.h>

Inheritance diagram for ListControl:

DialogMgrGadget NotifyingGadget Gadget CCCoreUI List of all members.

Public Member Functions

 ListControl (DialogOp *const pDialog, CGadgetID ControlID, Notifiable *pNotify=&Nobody)
virtual ~ListControl ()
BOOL AddItem (const StringBase &ItemText)
BOOL InsertItem (const StringBase &ItemText, UINT32 AtIndex)
BOOL DeleteItemAtIndex (UINT32 AtIndex)
BOOL DeleteAllItems ()
UINT32 GetNumberOfSelectedItems () const
BOOL GetFirstSelectedIndex (INT32 *pIndex) const
BOOL GetSelectedIndexes (INT32 **pIndexes) const
BOOL DeselectAll ()
BOOL SetItem (const StringBase &ItemText, UINT32 AtIndex)
virtual void OnSelect ()
virtual void OnDoubleClicked ()

Private Member Functions

 CC_DECLARE_MEMDUMP (ListControl)

Private Attributes

Notifiablem_pNotifyOnSelectionChange

Detailed Description

Represents a List in a DialogOp.

Author:
Colin_Barfoot (Xara Group Ltd) <camelotdev@xara.com>
Date:
15/10/96

Definition at line 374 of file gadget.h.


Constructor & Destructor Documentation

ListControl::ListControl DialogOp *const   pDialog,
CGadgetID  ControlID,
Notifiable pNotify = &Nobody
[inline]
 

Definition at line 380 of file gadget.h.

00381                                                : 
00382         DialogMgrGadget(pDialog, ControlID),
00383         m_pNotifyOnSelectionChange(pNotify) {}

virtual ListControl::~ListControl  )  [inline, virtual]
 

Definition at line 385 of file gadget.h.

00385 {};


Member Function Documentation

BOOL ListControl::AddItem const StringBase ItemText  )  [inline]
 

Definition at line 407 of file gadget.h.

00408 {
00409     ENSURE( 0 != m_ControlID, "Control ID is invalide" );
00410     ENSURE_NOT_NULL(m_pDialog);
00411     
00412     return m_pDialog->SetStringGadgetValue(m_ControlID, ItemText, TRUE);
00413 }

ListControl::CC_DECLARE_MEMDUMP ListControl   )  [private]
 

BOOL ListControl::DeleteAllItems  )  [inline]
 

Definition at line 430 of file gadget.h.

00431 {
00432     ENSURE( 0 != m_ControlID, "Control ID is invalide" );
00433     ENSURE_NOT_NULL(m_pDialog);
00434     return m_pDialog->DeleteAllValues(m_ControlID);
00435 }

BOOL ListControl::DeleteItemAtIndex UINT32  AtIndex  )  [inline]
 

Definition at line 423 of file gadget.h.

00424 {
00425     ENSURE( 0 != m_ControlID, "Control ID is invalide" );
00426     ENSURE_NOT_NULL(m_pDialog);
00427     return m_pDialog->DeleteValue(m_ControlID, FALSE, INT32(AtIndex));
00428 }

BOOL ListControl::DeselectAll  )  [inline]
 

Definition at line 462 of file gadget.h.

00463 {
00464     ENSURE( 0 != m_ControlID, "Control ID is invalide" );
00465     ENSURE_NOT_NULL(m_pDialog);
00466     return m_pDialog->SetBoolGadgetSelected(m_ControlID, FALSE, -1);
00467 }

BOOL ListControl::GetFirstSelectedIndex INT32 *  pIndex  )  const [inline]
 

Definition at line 444 of file gadget.h.

00445 {
00446     ENSURE( 0 != m_ControlID, "Control ID is invalide" );
00447     ENSURE_NOT_NULL(m_pDialog);
00448     *pIndex = m_pDialog->GetFirstSelectedItem(m_ControlID);
00449     return (*pIndex != -1);
00450 }

UINT32 ListControl::GetNumberOfSelectedItems  )  const [inline]
 

Definition at line 437 of file gadget.h.

00438 {
00439     ENSURE( 0 != m_ControlID, "Control ID is invalide" );
00440     ENSURE_NOT_NULL(m_pDialog);
00441     return UINT32(m_pDialog->GetSelectedCount(m_ControlID));
00442 }

BOOL ListControl::GetSelectedIndexes INT32 **  pIndexes  )  const [inline]
 

Definition at line 452 of file gadget.h.

00453 {
00454     ENSURE( 0 != m_ControlID, "Control ID is invalide" );
00455     ENSURE_NOT_NULL(m_pDialog);
00456     ENSURE_NOT_NULL(pIndexes);
00457     *pIndexes = m_pDialog->GetSelectedItems(m_ControlID);
00458     return (*pIndexes != NULL);
00459 }

BOOL ListControl::InsertItem const StringBase ItemText,
UINT32  AtIndex
[inline]
 

Definition at line 415 of file gadget.h.

00416 {
00417     ENSURE( 0 != m_ControlID, "Control ID is invalide" );
00418     ENSURE_NOT_NULL(m_pDialog);
00419     
00420     return m_pDialog->SetStringGadgetValue(m_ControlID, ItemText, FALSE, AtIndex);
00421 }

void ListControl::OnDoubleClicked  )  [inline, virtual]
 

Definition at line 474 of file gadget.h.

00475 {
00476     Notify(m_pNotifyOnSelectionChange);
00477 }

void ListControl::OnSelect  )  [inline, virtual]
 

Definition at line 470 of file gadget.h.

00471 {
00472     Notify(m_pNotifyOnSelectionChange);
00473 }

BOOL ListControl::SetItem const StringBase ItemText,
UINT32  AtIndex
 


Member Data Documentation

Notifiable* ListControl::m_pNotifyOnSelectionChange [private]
 

Definition at line 402 of file gadget.h.


The documentation for this class was generated from the following file:
Generated on Sat Nov 10 03:56:00 2007 for Camelot by  doxygen 1.4.4