Esempio n. 1
0
//-----------------------------------------------------------------------------
//
//-----------------------------------------------------------------------------
tCZoneModesModel::tCZoneModesModel( 
    QObject* pParent,
    CZone::tCZoneLibrary* cZoneLibrary)
: QStandardItemModel( pParent )
, m_isPopulated( false )
, m_CZoneLibrary(cZoneLibrary)
{
    Connect( m_CZoneLibrary, SIGNAL( CommanderDataChanged() ), this, SLOT( OnDataChanged() ) ); 
}
Esempio n. 2
0
/*****************************************************
**
**   EphemView   ---   OnToolbarCommand
**
******************************************************/
void EphemView::OnToolbarCommand()
{
	if ( toolbar )
	{
		wxChoice *choice_mode = (wxChoice*)toolbar->FindControl( TBS_EPHEMMODE );
		if ( choice_mode )
		{
			if ( mode != choice_mode->GetSelection() )
			{
				mode = choice_mode->GetSelection();
				config->viewprefs->ephemMode = mode;
				initClientView();
			}
		}

		wxSpinCtrl *spin_year = (wxSpinCtrl*)toolbar->FindControl( TBS_YEAR );
		if ( spin_year ) year = spin_year->GetValue();

		wxSpinCtrl *spin_month = (wxSpinCtrl*)toolbar->FindControl( TBS_MONTH );
		if ( spin_year && spin_month )
		{
			if ( lastmonth == 12 && spin_month->GetValue() == 1 )
				spin_year->SetValue( spin_year->GetValue() + 1 );
			if ( lastmonth == 1 && spin_month->GetValue() == 12 )
				spin_year->SetValue( spin_year->GetValue() - 1 );

			lastmonth = spin_month->GetValue();
			year = spin_year->GetValue();
			month = spin_month->GetValue();
		}

		wxChoice *choice_ephemtz = (wxChoice*)toolbar->FindControl( TBS_TZ );
		if ( choice_ephemtz )
		{
			isLocaltime = choice_ephemtz->GetSelection();
			config->viewprefs->ephemTimezone = isLocaltime;
		}

		wxChoice *choice_ephemdeg = (wxChoice*)toolbar->FindControl( TBS_EPHEMDEG );
		if ( choice_ephemdeg )
		{
			circleType = choice_ephemdeg->GetSelection();
			config->viewprefs->ephemCircleType = circleType;
			setMaxDeg( circleType );
			choice_ephemdeg->Enable( mode == 1 );
		}

		wxChoice *choice_dasa = (wxChoice*)toolbar->FindControl( TBS_DASA );
		if ( choice_dasa )
		{
			dasaId = (DasaId)choice_dasa->GetSelection();
			choice_dasa->Enable(  mode == 5 );
		}
	}
	OnDataChanged();
}
Esempio n. 3
0
	void Vector3EditCtrlImp::_SetImpYValue(float y)
	{
		if (m_pCtrlData && GetImpYValue() != y)
		{
			if (m_pCtrlData->m_eDataType == E_VECTOR )
				(*((CVector3f*)(m_pCtrlData->m_pData))).y = y;
			else
				(*((CVector2f*)(m_pCtrlData->m_pData))).y = y;
			OnDataChanged();
		}
	}
Esempio n. 4
0
BOOL CStockContainer::ReloadBase( CStDatabase * pDB )
{
	CSPMutex::Scoped	l(m_mutex);

	SP_ASSERT( pDB );
	if( GetSize() <= 0 || NULL == pDB )
		return Load( NULL, NULL );
	pDB->LoadBasetable( *this );

	OnDataChanged();
	return TRUE;
}
Esempio n. 5
0
	void Vector3EditCtrlImp::_SetImpZValue(float z)
	{
		if (m_pCtrlData&& GetImpZValue() != z)
		{
			if (m_pCtrlData->m_eDataType == E_VECTOR )
				(*((CVector3f*)(m_pCtrlData->m_pData))).z = z;
			else
				m_fz = z;

			OnDataChanged();
		}
	}
Esempio n. 6
0
void IListDataSource::FireDataChangedEvent()
{
	if (mIsChanging)
	{
		mDirtyRange.Min=0;
		mDirtyRange.Max=Count()-1;
	}
	else
	{
		OnDataChanged(*this);
	}

}
Esempio n. 7
0
void IListDataSource::Commit()
{
	RETURN_IF_EMPTY(mDirtyRange);
	size_t count=mDirtyRange.Count();
	if (count>=Count())
	{
		OnDataChanged(*this);
	}
	else
	{
		OnItemUpdated(mDirtyRange.Min,count);
	}

	mDirtyRange.Reset();
	mIsChanging=false;
}
Esempio n. 8
0
BOOL CStockContainer::Load( CStDatabase * pDB, PROGRESS_CALLBACK fnCallback, void *cookie, int nProgStart, int nProgEnd )
{
	CSPMutex::Scoped	l(m_mutex);

	SP_ASSERT( nProgStart <= nProgEnd );
	SP_ASSERT( pDB );
	if( nProgStart > nProgEnd || NULL == pDB )
		return FALSE;

	Clear( );

	int	nLen	=	pDB->LoadCodetable( *this );
	SetMap( );

	pDB->LoadBasetable( *this );
	// pDB->LoadKDataCache( *this, fnCallback, cookie, nProgStart, nProgEnd );

	m_nType		=	typeAll;
	m_dwDate	=	-1;

	OnDataChanged( );
	return TRUE;
}
// public void Update(byte[] newBytes) [instance] :124
void ByteFileSource::Update(uArray* newBytes)
{
    _bytes = newBytes;
    OnDataChanged();
}
Esempio n. 10
0
/*****************************************************
**
**   BasicView   ---   OnCommand
**
******************************************************/
void BasicView::OnCommand( wxCommandEvent &event )
{
	//printf( "BasicView::OnCommand\n" );
	if ( dispatchCommand( event.GetId())) OnDataChanged();
	else event.Skip();
}
Esempio n. 11
0
BOOL CStockContainer::RetrieveFromStatic( int nType, LPCTSTR lpszDomain, CStrategy * pStrategy, DWORD dwDate )
{
	CSPMutex::Scoped	l(m_mutex);

	Clear( );

	if( nType == typeNone )
	{
		m_nType	=	typeNone;
		return TRUE;
	}

	if( nType < typeMin || nType > typeMax )
		return FALSE;
	m_nType		=	nType;

	m_dwDate	=	dwDate;
	
	CSPStringArray	astrSpecify;

	switch( nType )
	{
	case typeAll:
		CopyData( AfxGetStockContainer() );
		break;
	case typeIndex:
	case typeA:
	case typeBond:
	case typeFund:
	case typeClassShaa:
	case typeClassShab:
	case typeClassSzna:
	case typeClassSznb:
	case typeClassShabond:
	case typeClassSznbond:
		{
			int	nCount	=	0;
			SetSize( 0, AfxGetStockContainer().GetSize() );
			for( int i=0; i<AfxGetStockContainer().GetSize(); i++ )
			{
				CStockInfo	& info = AfxGetStockContainer().ElementAt(i);
				LONG	stocktype	=	info.GetType();
				if( ( typeIndex == nType && CStock::typeshIndex == stocktype )
					|| ( typeIndex == nType && CStock::typeszIndex == stocktype )
					|| ( typeA == nType && (CStock::typeshA == stocktype || CStock::typeszA == stocktype) && !info.IsFund() )
					|| ( typeBond == nType && (CStock::typeshBond == stocktype || CStock::typeszBond == stocktype) )
					|| ( typeFund == nType && info.IsFund() )
					|| ( typeClassShaa == nType && CStock::typeshA == stocktype )
					|| ( typeClassShab == nType && CStock::typeshB == stocktype )
					|| ( typeClassSzna == nType && CStock::typeszA == stocktype )
					|| ( typeClassSznb == nType && CStock::typeszB == stocktype )
					|| ( typeClassShabond == nType && CStock::typeshBond == stocktype )
					|| ( typeClassSznbond == nType && CStock::typeszBond == stocktype ) )
				{
					Add( info );
					nCount	++;
				}
			}
			SetSize( nCount );
		}
		break;
	case typeStrategy:
		{
			if( pStrategy )
				RetrieveSpecify( pStrategy->GetStocks() );
		}
		break;
	case typeGroup:
		{
			if( lpszDomain && strlen(lpszDomain) > 0 )
			{
				AfxGetGroupContainer().GetDomainStocks( lpszDomain, astrSpecify );
				RetrieveSpecify( astrSpecify );
				m_strDomain	=	lpszDomain;
			}
			else
				return AfxGetGroupContainer().GetAllDomainInfo( this, m_dwDate );
		}
		break;
	case typeDomain:
		{
			if( lpszDomain && strlen(lpszDomain) > 0 )
			{
				AfxGetDomainContainer().GetDomainStocks( lpszDomain, astrSpecify );
				RetrieveSpecify( astrSpecify );
				m_strDomain	=	lpszDomain;
			}
			else
				return AfxGetDomainContainer().GetAllDomainInfo( this, m_dwDate );
		}
		break;
	default:
		SP_ASSERT( FALSE );
		SetMap( );
		SetAverage( );
		return FALSE;
	}

	SetMap( );

	DWORD	dwMainDate = -1;
	AfxGetStockContainer().GetCurrentType( NULL, NULL, &dwMainDate );
	if( m_dwDate != dwMainDate )
		OnDataChanged();
	else
		SetAverage( );
	return TRUE;
}
//-----------------------------------------------------------------------------
// Inherited from INotifyUI
//-----------------------------------------------------------------------------
void CVcdBlockDoc::NotifyDataChanged( const char *pReason, int nNotifySource, int nNotifyFlags )
{
	OnDataChanged( pReason, nNotifySource, nNotifyFlags );
}
// public void Update(byte[] newBytes) [instance] :125
void ByteFileSource::Update(uArray* newBytes)
{
    uStackFrame __("Outracks.Simulator.ByteFileSource", "Update(byte[])");
    _bytes = newBytes;
    OnDataChanged();
}
Esempio n. 14
0
	void	EStrMapEditCtrlImp::_DelEStrNode(float idx)
	{
		if (m_pCtrlData)
			((CEStrMapData*)(m_pCtrlData->m_pData))->EraseMapNode(idx);
		OnDataChanged();
	}
Esempio n. 15
0
	void	EStrMapEditCtrlImp::_SetNodeEStr(float idx, const char* str)
	{
		if (m_pCtrlData)
			((CEStrMapData*)(m_pCtrlData->m_pData))->SetNodeEStr(idx, str);
		OnDataChanged();
	}
Esempio n. 16
0
	void	EStrMapEditCtrlImp::_InsertNewNode(float idx, const char* str)
	{
		if (m_pCtrlData )
			((CEStrMapData*)(m_pCtrlData->m_pData))->InsertMapNode(idx, str);
		OnDataChanged();
	}