Beispiel #1
0
BOOL CComboBox::OnChildNotify(UINT message, WPARAM wParam, LPARAM lParam,
	LRESULT* pResult)
{
	switch (message)
	{
	case WM_DRAWITEM:
		ASSERT(pResult == NULL);       // no return value expected
		DrawItem((LPDRAWITEMSTRUCT)lParam);
		break;
	case WM_MEASUREITEM:
		ASSERT(pResult == NULL);       // no return value expected
		MeasureItem((LPMEASUREITEMSTRUCT)lParam);
		break;
	case WM_COMPAREITEM:
		ASSERT(pResult != NULL);       // return value expected
		*pResult = CompareItem((LPCOMPAREITEMSTRUCT)lParam);
		break;
	case WM_DELETEITEM:
		ASSERT(pResult == NULL);       // no return value expected
		DeleteItem((LPDELETEITEMSTRUCT)lParam);
		break;
	default:
		return CWnd::OnChildNotify(message, wParam, lParam, pResult);
	}
	return TRUE;
}
Beispiel #2
0
BOOL CListBox::OnChildNotify( UINT message, WPARAM wParam, LPARAM lParam,
                              LRESULT *pResult )
/**********************************************/
{
    switch( message ) {
    case WM_CHARTOITEM:
        *pResult = CharToItem( LOWORD( wParam ), HIWORD( wParam ) );
        return( TRUE );
    case WM_COMPAREITEM:
        *pResult = CompareItem( (LPCOMPAREITEMSTRUCT)lParam );
        return( TRUE );
    case WM_DELETEITEM:
        DeleteItem( (LPDELETEITEMSTRUCT)lParam );
        return( TRUE );
    case WM_DRAWITEM:
        DrawItem( (LPDRAWITEMSTRUCT)lParam );
        return( TRUE );
    case WM_MEASUREITEM:
        MeasureItem( (LPMEASUREITEMSTRUCT)lParam );
        return( TRUE );
    case WM_VKEYTOITEM:
        *pResult = VKeyToItem( LOWORD( wParam ), HIWORD( wParam ) );
        return( TRUE );
    }
    return( FALSE );
}
Beispiel #3
0
int CRecentImp<T, S>::FindItem( ReceiveType pItemData ) const
{
	if( !IsAvailable() ) return -1;
	if( !pItemData ) return -1;

	for( int i = 0; i < *m_pnUserItemCount; i++ )
	{
		if( CompareItem(GetItemPointer(i), pItemData) == 0 )return i;
	}

	return -1;
}
Beispiel #4
0
void GOSoundScheduler::SortList(std::vector<GOSoundWorkItem*>& list)
{
	for(unsigned i = 0; i + 1 < list.size(); i++)
	{
		for(unsigned j = i; j > 0 && CompareItem(list[j], list[j + 1]); j--)
		{
			GOSoundWorkItem* tmp = list[j];
			list[j] = list[j + 1];
			list[j + 1] = tmp;
		}
	}
}
Beispiel #5
0
bool TCopyParamList::operator==(const TCopyParamList & rhl) const
{
  bool Result = (GetCount() == rhl.GetCount());
  if (Result)
  {
    intptr_t Index = 0;
    while ((Index < GetCount()) && Result)
    {
      Result = (GetName(Index) == rhl.GetName(Index)) &&
        CompareItem(Index, rhl.GetCopyParam(Index), rhl.GetRule(Index));
      ++Index;
    }
  }
  return Result;
}
//---------------------------------------------------------------------------
bool TCopyParamList::operator==(const TCopyParamList & rhl) const
{
  bool Result = (GetCount() == rhl.GetCount());
  if (Result)
  {
    intptr_t I = 0;
    while ((I < GetCount()) && Result)
    {
      Result = (GetName(I) == rhl.GetName(I)) &&
        CompareItem(I, rhl.GetCopyParam(I), rhl.GetRule(I));
      I++;
    }
  }
  return Result;
}
Beispiel #7
0
//---------------------------------------------------------------------------
bool __fastcall TCopyParamList::operator==(const TCopyParamList & rhl) const
{
  bool Result = (Count == rhl.Count);
  if (Result)
  {
    int i = 0;
    while ((i < Count) && Result)
    {
      Result =
        (Names[i] == rhl.Names[i]) &&
        CompareItem(i, rhl.CopyParams[i], rhl.Rules[i]);
      i++;
    }
  }
  return Result;
}
Beispiel #8
0
int CCheckListBox::PreCompareItem(LPCOMPAREITEMSTRUCT lpCompareItemStruct)
{
	COMPAREITEMSTRUCT compareItem;
	memcpy(&compareItem, lpCompareItemStruct, sizeof(COMPAREITEMSTRUCT));

	if (compareItem.itemData1 != 0)
	{
		AFX_CHECK_DATA* pState = (AFX_CHECK_DATA*)compareItem.itemData1;
		compareItem.itemData1 = pState->m_dwUserData;
	}
	if (compareItem.itemData2 != 0)
	{
		AFX_CHECK_DATA* pState = (AFX_CHECK_DATA*)compareItem.itemData2;
		compareItem.itemData2 = pState->m_dwUserData;
	}
	return CompareItem(&compareItem);
}
Beispiel #9
0
void TCopyParamList::Change(intptr_t Index, const UnicodeString & Name,
  TCopyParamType * CopyParam, TCopyParamRule * Rule)
{
  if ((Name != GetName(Index)) || !CompareItem(Index, CopyParam, Rule))
  {
    FNames->SetString(Index, Name);
    delete GetCopyParam(Index);
    FCopyParams->SetItem(Index, CopyParam);
    delete GetRule(Index);
    FRules->SetItem(Index, Rule);
    Modify();
  }
  else
  {
    SAFE_DESTROY(CopyParam);
    SAFE_DESTROY(Rule);
  }
}
Beispiel #10
0
//---------------------------------------------------------------------------
void __fastcall TCopyParamList::Change(int Index, const UnicodeString Name,
  TCopyParamType * CopyParam, TCopyParamRule * Rule)
{
  if ((Name != Names[Index]) || !CompareItem(Index, CopyParam, Rule))
  {
    FNames->Strings[Index] = Name;
    delete CopyParams[Index];
    FCopyParams->Items[Index] = (reinterpret_cast<TObject *>(CopyParam));
    delete Rules[Index];
    FRules->Items[Index] = (reinterpret_cast<TObject *>(Rule));
    Modify();
  }
  else
  {
    delete CopyParam;
    delete Rule;
  }
}
//---------------------------------------------------------------------------
void TCopyParamList::Change(intptr_t Index, const UnicodeString & Name,
  TCopyParamType * CopyParam, TCopyParamRule * Rule)
{
  if ((Name != GetName(Index)) || !CompareItem(Index, CopyParam, Rule))
  {
    FNames->SetString(Index, Name);
    delete GetCopyParam(Index);
    FCopyParams->SetItem(Index, reinterpret_cast<TObject *>(CopyParam));
    delete GetRule(Index);
    FRules->SetItem(Index, reinterpret_cast<TObject *>(Rule));
    Modify();
  }
  else
  {
    delete CopyParam;
    delete Rule;
  }
}
Beispiel #12
0
BOOL CComboBox::OnChildNotify( UINT message, WPARAM wParam, LPARAM lParam,
                               LRESULT *pResult )
/***********************************************/
{
    UNUSED_ALWAYS( wParam );
    
    switch( message ) {
    case WM_COMPAREITEM:
        *pResult = CompareItem( (LPCOMPAREITEMSTRUCT)lParam );
        return( TRUE );
    case WM_DELETEITEM:
        DeleteItem( (LPDELETEITEMSTRUCT)lParam );
        return( TRUE );
    case WM_DRAWITEM:
        DrawItem( (LPDRAWITEMSTRUCT)lParam );
        return( TRUE );
    case WM_MEASUREITEM:
        MeasureItem( (LPMEASUREITEMSTRUCT)lParam );
        return( TRUE );
    }
    return( FALSE );
}