MathStudent::MathStudent()
{
	SetObjectCount(count);

	address    = new char[5];
	strcpy(address, "add");

	city       = new char[5];
	strcpy(city, "cit");

	state      = new char[5];
	strcpy(state, "sta");

	zipCode    = 0;

	SetName(" ");
	SetStanding(" ");
	SetNumber(" ");
	SetId(0);
	SetAge(0);
	SetGpa(0.0);
	SetGender('X');
	SetAllDate(0,0,0);

}
Пример #2
0
EXPORT_C void CLogEvent::CopyL(const CLogEvent& aEvent)
/** Makes a copy of the specified log event.

@param aEvent The log event to be copied. */
	{
	// Set data first as this is the only function that can leave
	// If this function fails nothing will be changed
	SetDataL(aEvent.Data());

	SetId(aEvent.Id());
	SetEventType(aEvent.EventType());
	SetTime(aEvent.Time());
	SetDurationType(aEvent.DurationType());
	SetDuration(aEvent.Duration());
	SetContact(aEvent.Contact());
	SetLink(aEvent.Link());
	SetDescription(aEvent.Description());
	SetRemoteParty(aEvent.RemoteParty());
	SetDirection(aEvent.Direction());
	SetStatus(aEvent.Status());
	SetSubject(aEvent.Subject());
	SetNumber(aEvent.Number());

	ClearFlags(KLogFlagsMask);
	SetFlags(aEvent.Flags());
#ifdef SYMBIAN_ENABLE_EVENTLOGGER_DUALSIM
	SetSimId(aEvent.SimId());
#endif
	}
MathStudent::MathStudent(const MathStudent& otherStudent)
{

	address = new char[strlen(otherStudent.GetAddress())+1];
	strcpy(address, otherStudent.GetAddress());

	city    = new char[strlen(otherStudent.GetCity())+1];
	strcpy(city, otherStudent.GetCity());

	state   = new char[strlen(otherStudent.GetState())+1];
	strcpy(state, otherStudent.GetState());

	zipCode = otherStudent.GetZipCode();

	SetName(otherStudent.GetName());
	SetStanding(otherStudent.GetStanding());
	SetNumber(otherStudent.GetNumber());
	SetId(otherStudent.GetId());
	SetAge(otherStudent.GetAge());
	SetGpa(otherStudent.GetGpa());
	SetGender(otherStudent.GetGender());
	SetAllDate(otherStudent.GetMonth(), otherStudent.GetDay(),otherStudent.GetYear());
	SetObjectCount(otherStudent.GetObjectCount());


	cout << "\nCopy constructor has been called.";
}
Пример #4
0
Counter::Counter(
	const Font& font,
	float textSize,
	GUISizeUnit sizeUnit,
	unsigned int maxDigits,
	unsigned int decimals,
	char fillChar)
	: m_dotChar(font, '.')
	, m_subChar(font, ',')
	, m_NPart(font, maxDigits - decimals, fillChar)
	, m_FPart(font, decimals, '0')
	, m_hasFPart(decimals > 0)
	, m_decPow(pow(10, decimals))
{
	float aspectRatio = m_NPart.GetAspectRatio()
		+ (m_hasFPart ? m_FPart.GetAspectRatio() : 0.0f)
		+ font.GetAspectRatio(',')
		+ font.GetAspectRatio('.');

	LayoutProperties layoutProperties;
	layoutProperties.m_desiredSize = Vec2f(aspectRatio * textSize, textSize);
	layoutProperties.m_desiredSizeUnit = sizeUnit;
	layoutProperties.m_aspectRatio = aspectRatio;
	SetLayoutProperties(layoutProperties);

	SetNumber(0);
}
Пример #5
0
	bool NumericUpDown::SetProperty(UIProperty::Enum prop, const char* val)
	{
		switch (prop)
		{
		case UIProperty::NUMERIC_UPDOWN_MINMAX:
		{
												  Vec2I minmax = StringMathConverter::ParseVec2I(val);
												  SetMinMax(minmax.x, minmax.y);
												  return true;
		}
		case UIProperty::NUMERIC_UPDOWN_NUMBER:
		{
			int num = StringConverter::ParseInt(val);
			SetNumber(num);
			return true;
		}

		case UIProperty::NUMERIC_UPDOWN_SHIFT_STEP:
		{
			mShiftStep = StringConverter::ParseInt(val);
			return true;
		}
		case UIProperty::NUMERIC_UPDOWN_STEP:
		{
			mStep = StringConverter::ParseInt(val);
			return true;
		}
		}

		return __super::SetProperty(prop, val);
	}
void MathStudent::SetAllMath(string 		newName,
							 string 		newStanding,
							 string 		newNumber,
							 long   		newId,
							 unsigned short newAge,
							 double 		newGpa,
							 char 		    newGender,
							 int			newMonth,
							 int 		    newDay,
							 int 		    newYear,
							 char *         newAddress,
							 char * 		newCity,
							 char *         newState,
							 long           newZipCode)
{
	SetName(newName);
	SetStanding(newStanding);
	SetNumber(newNumber);
	SetId(newId);
	SetAge(newAge);
	SetGpa(newGpa);
	SetGender(newGender);
	SetAllDate(newMonth, newDay, newYear);
	SetAddress(newAddress);
	SetCity(newCity);
	SetState(newState);
	SetZipCode(newZipCode);

}
Пример #7
0
DigitField::DigitField(const Font& font, unsigned int maxDigits, char fillChar)
{
	maxDigits = maxDigits == 0 ? 1 : maxDigits;

	m_number.resize(maxDigits);

	std::string digits("0123456789");
	digits.push_back(fillChar);

	float maxDigitAspectRatio = 0.0f;

	for (size_t i = 0; i < maxDigits; ++i)
	{
		std::vector<std::shared_ptr<StaticChar>> digitLookup;

		for (char digit : digits)
		{
			assert(font.HasGlyph(digit));
			digitLookup.push_back(std::make_shared<StaticChar>(font, digit));
			maxDigitAspectRatio =
				std::max(maxDigitAspectRatio, font.GetAspectRatio(digit));
		}

		m_digitLookups.push_back(digitLookup);
	}

	m_aspectRatio = maxDigits * maxDigitAspectRatio;

	SetNumber(0);
}
Пример #8
0
void 
CMSPeak::ReadAndProcess(const CMSSpectrum& Spectrum,
                        const CMSSearchSettings& Settings)
{
	if(Read(Spectrum, Settings) != 0) {
	    ERR_POST(Error << "omssa: unable to read spectrum into CMSPeak");
	    return;
	}
    SetName().clear();
	if(Spectrum.CanGetIds()) SetName() = Spectrum.GetIds();
	if(Spectrum.CanGetNumber())
	    SetNumber() = Spectrum.GetNumber();
		
	SetPeakLists()[eMSPeakListOriginal]->Sort(eMSPeakListSortMZ);
	SetComputedCharge(Settings.GetChargehandling(), Spectrum);
	InitHitList(Settings.GetMinhit());
	CullAll(Settings);

    // this used to look at the filtered list.  changed to look at original
    // to simplify the code.
	if(GetPeakLists()[eMSPeakListOriginal]->GetNum() < Settings.GetMinspectra())
	    {
	    ERR_POST(Info << "omssa: not enough peaks in spectra");
	    SetError(eMSHitError_notenuffpeaks);
	}

}
CXTPPropertyGridItemNumber::CXTPPropertyGridItemNumber(UINT nID, long nValue, long* pBindNumber)
	: CXTPPropertyGridItem(nID)
{
	m_pBindNumber = pBindNumber;
	SetNumber(nValue);
	m_strDefaultValue = m_strValue;
}
void CXTPPropertyGridItemNumber::OnBeforeInsert()
{
	if (m_pBindNumber && *m_pBindNumber != m_nValue)
	{
		SetNumber(*m_pBindNumber);
	}
}
CXTPPropertyGridItemNumber::CXTPPropertyGridItemNumber(LPCTSTR strCaption, long nValue, long* pBindNumber)
	: CXTPPropertyGridItem(strCaption)
{
	m_pBindNumber = pBindNumber;
	SetNumber(nValue);
	m_strDefaultValue = m_strValue;
}
void MathStudent::CopyFrom(MathStudent otherStudent)
{
	delete [] address;
	delete [] city;
	delete [] state;

	address = new char[strlen(otherStudent.GetAddress())+1];
	strcpy(address, otherStudent.GetAddress());

	city = new char[strlen(otherStudent.GetCity())+1];
	strcpy(city, otherStudent.GetCity());

	state = new char[strlen(otherStudent.GetState())+1];
	strcpy(state, otherStudent.GetState());

	zipCode = otherStudent.GetZipCode();

	SetName(otherStudent.GetName());
	SetStanding(otherStudent.GetStanding());
	SetNumber(otherStudent.GetNumber());
	SetId(otherStudent.GetId());
	SetAge(otherStudent.GetAge());
	SetGpa(otherStudent.GetGpa());
	SetGender(otherStudent.GetGender());
	SetAllDate(otherStudent.GetMonth(),
			   otherStudent.GetDay(),
			   otherStudent.GetYear());




}
/***************************************************************************
 * PromptUserForInput
 * -------------------------------------------------------------------------
 * This method will prompt the user for each input
 *
 * Returns:
 ***************************************************************************/
void Student::PropagateStudent()
{
	const int	   WIDTH = 21;
	string 		   newName;
	long   		   newId;
	string		   newNumber;
	unsigned short newAge;
	char           newGender;
	string         newStanding;
	double		   newGpa;
	int 		   month, day, year;

	cout << "\nEnter the proper information to continue.\n";


		cout << setw(WIDTH) << "Enter Name: " ;
		getline(cin, newName);
		SetName(newName);

		cout << setw(WIDTH) << "Enter ID: ";
		cin  >> newId;
		SetId(newId);
		cin.ignore(numeric_limits<streamsize>::max(), '\n');

		cout << setw(WIDTH) << "Enter phone number: ";
		getline(cin, newNumber);
		SetNumber(newNumber);

		cout << setw(WIDTH) << "Enter age: ";
		cin  >> newAge;
		cin.ignore(numeric_limits<streamsize>::max(), '\n');

		SetAge(newAge);

		cout << setw(WIDTH) << "Enter Gender: ";
		cin.get(newGender);
		cin.ignore(numeric_limits<streamsize>::max(), '\n');

		SetGender(newGender);

		cout << setw(WIDTH) << "Enter Class Standing: ";
		getline(cin, newStanding);

		SetStanding(newStanding);

		cout << setw(WIDTH) << "Enter GPA: ";
		cin  >> newGpa;
		cin.ignore(numeric_limits<streamsize>::max(), '\n');

		SetGpa(newGpa);

		cout << "Enter year of month, day, and year of graduation: ";
		cin  >> month >> day >> year;

		SetAllDate(month, day, year);

		cin.ignore(numeric_limits<streamsize>::max(), '\n');

}
Пример #14
0
 explicit Clue(int num_,
               const string_t & text_,
               Word word_)
     : word(word_)
 {
     SetNumber(num_);
     SetText(text_);
 }
Пример #15
0
static void DrawTime(Word x,Word y,Word time)
{
    Word minutes,seconds;
    Rect TimeRect;

    TimeRect.left = x;
    TimeRect.right = x+((12*4)+TIMEWIDTH);
    TimeRect.top = y;
    TimeRect.bottom = y+22;

    minutes = time/60;
    seconds = time%60;
    SetNumber(minutes,x,y,2);
    x+=TIMEWIDTH;
    SetNumber(seconds,x,y,2);
    BlastScreen2(&TimeRect);
}
Пример #16
0
	void NumericUpDown::OnUp(void* arg)
	{
		if (mValue < mMax)
		{
			auto injector = InputManager::GetInstance().GetInputInjector();
			if (injector->IsKeyDown(VK_SHIFT)){
				SetNumber(mValue + mShiftStep);
			}
			else if (injector->IsKeyDown(VK_CONTROL)) {
				SetNumber(mMax);
			}
			else{
				SetNumber(mValue + mStep);
			}
			InputManager::GetInstance().GetInputInjector()->InvalidateClickTime();
			OnEvent(UIEvents::EVENT_NUMERIC_UP);
		}
	}
Пример #17
0
//设置详细解释
VOID CObject_Item_Gem::SetExtraInfo(const _ITEM * pItemInfo)
{
	TDAssert(pItemInfo);

	//调用基类函数,保存_ITEM结构
	CObject_Item::SetExtraInfo(pItemInfo);

	SetNumber(pItemInfo->GetItemCount());
	SetManufacturer(pItemInfo);
}
Пример #18
0
static void DrawRatio(Word x,Word y,Word theRatio)
{
    Rect RatioRect;

    RatioRect.top = y;
    RatioRect.left = x;
    RatioRect.bottom = y+22;
    RatioRect.right = x+(3*12);
    SetNumber(theRatio,x,y,3);
    BlastScreen2(&RatioRect);
}
Пример #19
0
//设置详细解释
VOID CObject_Item_StoreMap::SetExtraInfo(const _ITEM * pItemInfo)
{
	TDAssert(pItemInfo);

	//调用基类函数,保存_ITEM结构
	CObject_Item::SetExtraInfo(pItemInfo);

	const STORE_MAP_INFO& infoStoreMap = pItemInfo->m_StoreMap;

	SetNumber(pItemInfo->GetItemCount());
	SetManufacturer(pItemInfo);
}
Пример #20
0
//设置详细解释
VOID CObject_Item_Task::SetExtraInfo(const _ITEM * pItemInfo)
{
    KLAssert(pItemInfo);

    const MEDIC_INFO& infoMedic = pItemInfo->m_Medic;

    SetNumber(pItemInfo->GetItemCount());
    for ( int i=0; i<MAX_ITEM_PARAM; ++i)
    {
        m_Param[i] = pItemInfo->m_Param[i];
    }
}
Пример #21
0
OutValue::OutValue(af::TElement& B)	
{
	Root = B.GetRoot();

	if(B.GetName() == "New")
	{
		QString s;
		SetObjectName("OutValue_" + s.sprintf("%d", Root.Tag()));
		SetOutValueType(4);
		SetNodeOfValue();
		SetModelOfValue();
		SetNumber(1);
	}
}
Пример #22
0
	void NumericUpDown::InitializeButtons()
	{
		//mDown = (Button*)AddChild(0.0, 0.0, 0.33333f, 1.0f, ComponentType::Button);
		assert(mDown.expired());
		auto down = std::static_pointer_cast<Button>(AddChild(ComponentType::Button));
		mDown = down;
		down->SetName("down");
		down->SetRuntimeChild(true);


		//mUp = (Button*)AddChild(1.0, 0.0, 0.33333f, 1.0f, ComponentType::Button);
		auto up = std::static_pointer_cast<Button>(AddChild(ComponentType::Button));
		mUp = up;
		up->SetName("up");
		up->SetRuntimeChild(true);

		down->ChangeSize(Vec2I(20, 20));
		down->ChangeNPos(Vec2(0, 0));
		down->SetUseAbsPos(false);

		down->SetProperty(UIProperty::REGION, "DownTriangle");
		down->SetProperty(UIProperty::IMAGE_COLOR_OVERLAY, "1, 1, 0, 1");
		down->SetProperty(UIProperty::NO_BACKGROUND, "true");
		down->RegisterEventFunc(UIEvents::EVENT_MOUSE_LEFT_CLICK,
				std::bind(&NumericUpDown::OnDown, this, std::placeholders::_1));
		down->SetEnable(mValue > mMin && mEnable);

		up->ChangeSize(Vec2I(20, 20));
		up->ChangeNPos(Vec2(1, 0));
		up->SetUseAbsPos(false);
		up->SetProperty(UIProperty::REGION, "UpTriangle");
		up->SetProperty(UIProperty::IMAGE_COLOR_OVERLAY, "1, 1, 0, 1");
		up->SetProperty(UIProperty::ALIGNH, "right");
		up->SetProperty(UIProperty::NO_BACKGROUND, "true");
		up->RegisterEventFunc(UIEvents::EVENT_MOUSE_LEFT_CLICK,
				std::bind(&NumericUpDown::OnUp, this, std::placeholders::_1));
		up->SetEnable(mValue < mMax && mEnable);

		SetProperty(UIProperty::TEXT_ALIGN, "center");

		WCHAR buffer[100];
		swprintf_s(buffer, L"%d", mValue);
		SetText(buffer);

		if (up && down){
			mValue = std::min(mValue, mMax);
			mValue = std::max(mValue, mMin);
			SetNumber(mValue);			
		}
	}
Пример #23
0
KVTelBlocking::KVTelBlocking(UInt_t n): KVTelescope()
{
   //Create blocking telescope number 'n'.
   //By default the BIC pressure is 30 (Torr)

   if (n) {                     //default ctor must not add detectors, or Clone() will give a telescope with 2 more detectors!!
      SetNumber(n);
      Add(new KVBIC(30.));
      Add(new KVSiB(500.));
      SetDepth(1, 0.);
      SetDepth(2, 119.);        //SIB is 119mm behind BIC
   }
   SetName(Form("TEL_BLOCK_%d", (Int_t)n));
}
Пример #24
0
void SCH_SHEET_PIN::SwapData( SCH_ITEM* aItem )
{
    wxCHECK_RET( aItem->Type() == SCH_SHEET_PIN_T,
                 wxString::Format( wxT( "SCH_SHEET_PIN object cannot swap data with %s object." ),
                                   GetChars( aItem->GetClass() ) ) );

    SCH_SHEET_PIN* pin = ( SCH_SHEET_PIN* ) aItem;
    SCH_TEXT::SwapData( (SCH_TEXT*) pin );
    int tmp = pin->GetNumber();
    pin->SetNumber( GetNumber() );
    SetNumber( tmp );
    SHEET_SIDE stmp = pin->GetEdge();
    pin->SetEdge( GetEdge() );
    SetEdge( stmp );
}
Пример #25
0
static void EditWarehouseReceipts(db::db_filler::FillDatabaseData const& db_fill_data)
{
	auto whr_list = db::warehouse_receipt::GetList();
	
	for (ref<CWarehouseReceipt> whr : whr_list)
	{
		auto w_whr = modify(whr);
		
		SwapEntities(w_whr);
		auto whr_number = w_whr->GetNumber();
		whr_number += L"_1";
		w_whr->SetNumber(whr_number.c_str());

		db::warehouse_receipt::Save(whr);
	}
}
Пример #26
0
//
// ObjectData::Static::GenerateSymbols
//
void Static::GenerateSymbols()
{
   ObjectExpression::Pointer obj;
   StaticIter itr, end = Table.end();

   for(itr = Table.begin(); itr != end; ++itr)
   {
      if(itr->second.number == -1)
         SetNumber(itr->second);
   }

   for(itr = Table.begin(); itr != end; ++itr)
   {
      obj = ObjectExpression::CreateValueUNS(itr->second.number, SourcePosition::none());

      ObjectExpression::add_symbol(itr->second.name, obj);
   }
}
Пример #27
0
//=============================================================================
// constructor
//=============================================================================
Flower::Flower(u32 in_number)
	:position_(0.0f,0.0f,0.0f)
	,is_show_(true)
	,type_(TYPE::SPROUT)
	,time_count_(0)
	,number_(0)
	,is_live_(false)
	,is_growth_(false)
	,tree_index_(-1)
{
	sprite_3d_ = std::make_shared<mesh::Sprite3D>(float2(0.5f,0.5f));
	mesh_object_ = std::make_shared<MeshObject>(sprite_3d_);
	sprite_3d_->SetAnchorPoint(float2(0.5f,0.5f));
	sprite_3d_->Apply();
	height_ = 0.25f;
	SetNumber(in_number);
	is_show_ = false;
	is_live_ = false;
	is_growing_ = false;
}
/***************************************************************************
 * SetAll
 * -------------------------------------------------------------------------
 * This method will set all private members
 *
 * Returns: All members will be assigned a value
 ***************************************************************************/
void Student::SetAll(string 		   newName,
					 string 		   newStanding,
					 string 		   newNumber,
					 long   		   newId,
					 unsigned short    newAge,
					 double 		   newGpa,
					 char 		       newGender,
					 int               month,
					 int               day,
					 int               year)
{
	//Calls all set methods to initialize all
	SetName    (newName);
	SetStanding(newStanding);
	SetNumber  (newNumber);
	SetId      (newId);
	SetAge     (newAge);
	SetGpa     (newGpa);
	SetGender  (newGender);
	SetAllDate(month, day, year);
}
Пример #29
0
void CValue::SetData(CValue &Val)
{
	if(this==&Val)
		return;

	switch(nType)
	{
	case TYPE_NUMBER:
		SetNumber(Val);
		return;
	case TYPE_STRING:
		SetString(Val);
		return;
	case TYPE_DATE:
		SetDate(Val);
		return;
	case TYPE_REFFER:
		if(pRef)
			pRef->SetData(Val);
		return;
	}

	SetValue(Val);
}
Пример #30
0
VOID	CObject_Item_Gem::Clone(const CObject_Item * pItemSource)
{
	SetNumber(((CObject_Item_Gem*)pItemSource)->GetNumber());
	CObject_Item::Clone(pItemSource);
}