Ejemplo n.º 1
0
void TVideoEditorText::KeyDown(const char *bytes, int32 numBytes)
{
	char theChar = *bytes;
			
	// Increment our counter
	m_KeyCount++;
	if (m_KeyCount > 2)
		m_KeyCount = 1;
		
	//	Check for a return or enter 
	if (theChar == B_ENTER || theChar == B_RETURN || theChar == 'r')
	{
		MakeFocus(false);
	}		
	// We have a number.  Update the cell...
	else if ( isdigit(theChar) )
	{
		UpdateCurrentCell(theChar);	
	}
	// Reset selected cell to zero
	else if ( IsDelete(theChar) || IsBackspace(theChar) )
	{
		//ClearCell();
	}
	// Tab key or period '.' moves us through the time elements
	else if( IsTab(theChar) || theChar == '.' )
	{	
		// Check for shift key.  This move us back through the elements
		if ( IsShiftKeyDown() )		
			DecrementCell();
		else
			IncrementCell();
	}
	else if ( IsArrows(theChar) )
	{
		switch(theChar)
		{
			// Increment value
			case B_UP_ARROW:
				break;
				
			// Decrement value
			case B_DOWN_ARROW:
				break;
				
			// Select next cell
			case B_LEFT_ARROW:
				DecrementCell();
				break;
				
			// Select previous cell
			case B_RIGHT_ARROW:
				IncrementCell();
				break;
		}
	}
	// Illegal character
	else
		;//beep();
}
Ejemplo n.º 2
0
void CUser::AddSetTarget( OBJID idTarget )
{
	if( IsDelete() )	return;
	
	m_Snapshot.cb++;
	m_Snapshot.ar << NULL_ID;
	m_Snapshot.ar << SNAPSHOTTYPE_SETTARGET;
	m_Snapshot.ar << idTarget;
}
Ejemplo n.º 3
0
// 액션포인트 갱신.
void CUser::AddSetActionPoint( int nAP )
{
	if( IsDelete() )	return;
	
	m_Snapshot.cb++;
	m_Snapshot.ar << NULL_ID;
	m_Snapshot.ar << SNAPSHOTTYPE_SETACTIONPOINT;
	m_Snapshot.ar << nAP;
}
Ejemplo n.º 4
0
// tmMaxEscape : 탈출의 쿨타임
void CUser::AddEscape( DWORD tmMaxEscape )
{
	if( IsDelete() )	return;
	
	m_Snapshot.cb++;
	m_Snapshot.ar << NULL_ID;
	m_Snapshot.ar << SNAPSHOTTYPE_DO_ESCAPE;
	m_Snapshot.ar << tmMaxEscape;
}
Ejemplo n.º 5
0
void SCA_KeyboardSensor::AddToTargetProp(int keyIndex)
{
	if (IsPrintable(keyIndex)) {
		CValue* tprop = GetParent()->GetProperty(m_targetprop);
		
		if (tprop) {
			/* overwrite the old property */
			if (IsDelete(keyIndex)) {
				/* strip one char, if possible */
				STR_String newprop = tprop->GetText();
				int oldlength = newprop.Length();
				if (oldlength >= 1 ) {
					int newlength=oldlength;

					BLI_str_cursor_step_prev_utf8(newprop, newprop.Length(), &newlength);
					newprop.SetLength(newlength);

					CStringValue * newstringprop = new CStringValue(newprop, m_targetprop);
					GetParent()->SetProperty(m_targetprop, newstringprop);
					newstringprop->Release();
				}				
			} else {
				/* append */
				char pchar = ToCharacter(keyIndex, IsShifted());
				STR_String newprop = tprop->GetText() + pchar;
				CStringValue * newstringprop = new CStringValue(newprop, m_targetprop);			
				GetParent()->SetProperty(m_targetprop, newstringprop);
				newstringprop->Release();
			}
		} else {
			if (!IsDelete(keyIndex)) {
				/* Make a new property. Deletes can be ignored. */
				char pchar = ToCharacter(keyIndex, IsShifted());
				STR_String newprop = pchar;
				CStringValue * newstringprop = new CStringValue(newprop, m_targetprop);			
				GetParent()->SetProperty(m_targetprop, newstringprop);
				newstringprop->Release();
			}
		}
	}
	
}
Ejemplo n.º 6
0
void TNumberTextView::KeyDown(const char *bytes, int32 numBytes)
{
	char theChar = *bytes;
		
	// Accept numbers, delete and arrows
	if( isdigit(theChar) || IsBackspace(theChar) || IsArrows(theChar) || IsDelete(theChar) )
	{
		BTextView::KeyDown(bytes, numBytes);
	}
	// Illegal character
	else
		beep();
}
void SCA_KeyboardSensor::AddToTargetProp(int keyIndex, int unicode)
{
	if (IsPrintable(keyIndex)) {
		CValue* tprop = GetParent()->GetProperty(m_targetprop);

		if (IsDelete(keyIndex)) {
			/* Make a new property. Deletes can be ignored. */
			if (tprop) {
				/* overwrite the old property */
				/* strip one char, if possible */
				STR_String newprop = tprop->GetText();
				int oldlength = newprop.Length();
				if (oldlength >= 1 ) {
					int newlength=oldlength;

					BLI_str_cursor_step_prev_utf8(newprop, newprop.Length(), &newlength);
					newprop.SetLength(newlength);

					CStringValue * newstringprop = new CStringValue(newprop, m_targetprop);
					GetParent()->SetProperty(m_targetprop, newstringprop);
					newstringprop->Release();
				}
			}
		}
		else {
			char utf8_buf[7];
			size_t utf8_len;

			utf8_len = BLI_str_utf8_from_unicode(unicode, utf8_buf);
			utf8_buf[utf8_len] = '\0';

			STR_String newprop = tprop ? (tprop->GetText() + utf8_buf) : utf8_buf;

			CStringValue * newstringprop = new CStringValue(newprop, m_targetprop);
			GetParent()->SetProperty(m_targetprop, newstringprop);
			newstringprop->Release();
		}
	}
}
Ejemplo n.º 8
0
bool CSimultaneousOfAction::OnLoop()
{
    if (_actionList.size() < 1)
        return true;

    size_t __count = 0;
    for (list<pair<CActionBaseClass*, bool> >::iterator it = _actionList.begin(); it != _actionList.end();){
        if (!(*it).second){
            if (_skip || _allSkip)
                (*it).first->SetSkip();

            if ((*it).first->OnLoop()){
                if (_actionList.size() < 1){// if run to load script command
                    _skip = false;
                    return true;
                }

                (*it).second = true;
                __count++;
            }
        }
        else
            __count++;
            
        ++it;
    }
    _skip = false;

    if (_actionList.size() == __count){
        if (IsDelete())
            OnCleanup();

        return true;
    }

    return false;
}