コード例 #1
0
ファイル: Widget.cpp プロジェクト: BackupTheBerlios/utgs-svn
/*! Hide widget, which is not allready hidden.
 *  If widget is hidden, function does nothing.
 */
void Widget::Hide()
{ 
    if (IsVisible())
    {
        SetDirty(GetBoundingRect());
        _is_visible=false;
        Accept( InputReset(this) );
        NotifyAncestors(false);
        OnVisible.Send_1(false); 
    }
}
コード例 #2
0
 void ActiveWidget::Init()
 {
     _handlers = new MethodPool<ActiveWidget, const Widget::Request >;
     _handlers->Add( &ActiveWidget::AcceptInputCursor,    InputCursor()  );
     _handlers->Add( &ActiveWidget::AcceptInputButton,    InputButton()  );
     _handlers->Add( &ActiveWidget::AcceptDoubleClick,    DoubleClick()  );
     _handlers->Add( &ActiveWidget::AcceptInputWheel ,    InputWheel()   );
     _handlers->Add( &ActiveWidget::AcceptInputReset ,    InputReset()   );
     _handlers->Add( &ActiveWidget::AcceptInputKeyboard , InputKeyboard());
     _handlers->Add( &ActiveWidget::AcceptInputChar ,     InputChar()    );
     _handlers->Add( &ActiveWidget::AcceptInputFocus,     InputFocus()   );
     _handlers->Add( &ActiveWidget::AcceptInputAccel,     InputAccel()   );
 }
コード例 #3
0
    void ActiveWidget::AcceptInputReset( const InputReset &request)
    {
        Widget *sender = request.Sender();
        _cursor = Pos(-1,-1);
        int i;

        for (i=0; i!=NUM_BUTTONS; ++i)
        {
            if ( _was_touched[i] ) 
            { 
                if (_was_over) OnMoveOut[i].Schedule_1( _cursor );
                OnRelease[i].Schedule_1( _cursor ); 
            }
            _was_touched[i] = false;
            _is_dragging[i] = false;
            _mb_down[i] = false;
        }

        for (i=0; i!=_pressed_keys.Size(); ++i)
        {
            bool likes_this_key = false;
            likes_this_key |= _on_path_key_mask.GetBit( _pressed_keys[i] );
            likes_this_key |= HasFocus() && _key_mask.GetBit( _pressed_keys[i] );
            if ( likes_this_key )
            {
                OnKeyRelease.Schedule_1( _pressed_keys[i]);
            }
        }
        _pressed_keys.Clear();

        if (_was_over || _unsent_outside)
        {
            OnMoveOutside.Schedule_1( _cursor ); HideHint();
        }

        _was_over = false;
        _unsent_outside = false;
        _result = false;
        Widget::Accept( InputReset(this) );
    }
コード例 #4
0
ファイル: FirstAI.cpp プロジェクト: ArachnidJapan/ThreadWar
void FirstAI::OnUpdate(float frameTime){
	//AIのレベル
	levelTimer += frameTime;
	if (levelTimer >= 5.0f){
		if (levelChangeNum == playerNum % 4)
			AILevelSetting();
		levelChangeNum++;
		levelTimer = 0.0f;
		if (levelChangeNum > 3)
			levelChangeNum = 0;
	}

	//入力状態リセット
	InputReset();

	//パラメータ等、AI実行前に必要な計算
	ParamCalc();

	//AIを実行
	AIRun(frameTime);

	//最終的な入力
	FinalInput();
}
コード例 #5
0
 void ActiveWidget::Deactivate() 
 {
     _is_active=false;
     Accept( InputReset() );
     OnActivate.Send_1(_is_active); 
 }
コード例 #6
0
ファイル: Widget.cpp プロジェクト: BackupTheBerlios/utgs-svn
void Widget::Cleanup()
{
    DBG_Text("Cleanup");
    Accept( InputReset() );
    NotifyAncestors(false);
}