void BookCtrlBaseTestCase::ChangeEvents()
{
    wxBookCtrlBase * const base = GetBase();

    base->SetSelection(0);

    EventCounter changing(base, GetChangingEvent());
    EventCounter changed(base, GetChangedEvent());

    base->SetSelection(1);

    CPPUNIT_ASSERT_EQUAL(1, changing.GetCount());
    CPPUNIT_ASSERT_EQUAL(1, changed.GetCount());

    changed.Clear();
    changing.Clear();
    base->ChangeSelection(2);

    CPPUNIT_ASSERT_EQUAL(0, changing.GetCount());
    CPPUNIT_ASSERT_EQUAL(0, changed.GetCount());

    base->AdvanceSelection();

    CPPUNIT_ASSERT_EQUAL(1, changing.GetCount());
    CPPUNIT_ASSERT_EQUAL(1, changed.GetCount());

    changed.Clear();
    changing.Clear();
    base->AdvanceSelection(false);

    CPPUNIT_ASSERT_EQUAL(1, changing.GetCount());
    CPPUNIT_ASSERT_EQUAL(1, changed.GetCount());
}
Beispiel #2
0
bool wxNotebook::OSXHandleClicked( double WXUNUSED(timestampsec) )
{
    bool status = false ;

    SInt32 newSel = GetPeer()->GetValue() - 1 ;
    if ( newSel != m_selection )
    {
        wxBookCtrlEvent changing(
            wxEVT_NOTEBOOK_PAGE_CHANGING, m_windowId,
            newSel , m_selection );
        changing.SetEventObject( this );
        HandleWindowEvent( changing );

        if ( changing.IsAllowed() )
        {
            wxBookCtrlEvent event(
                wxEVT_NOTEBOOK_PAGE_CHANGED, m_windowId,
                newSel, m_selection );
            event.SetEventObject( this );
            HandleWindowEvent( event );

            m_selection = newSel;
        }
        else
        {
            GetPeer()->SetValue( m_selection + 1 ) ;
        }

        status = true ;
    }

    return status ;
}
void GridTestCase::CellEdit()
{
    // TODO on OSX when running the grid test suite solo this works
    // but not when running it together with other tests
#if wxUSE_UIACTIONSIMULATOR && !defined(__WXOSX__)
    EventCounter changing(m_grid, wxEVT_GRID_CELL_CHANGING);
    EventCounter changed(m_grid, wxEVT_GRID_CELL_CHANGED);
    EventCounter created(m_grid, wxEVT_GRID_EDITOR_CREATED);

    wxUIActionSimulator sim;

    m_grid->SetFocus();
    m_grid->SetGridCursor(1, 1);
    m_grid->ShowCellEditControl();

    sim.Text("abab");
    sim.Char(WXK_RETURN);

    wxYield();

    CPPUNIT_ASSERT_EQUAL(1, created.GetCount());
    CPPUNIT_ASSERT_EQUAL(1, changing.GetCount());
    CPPUNIT_ASSERT_EQUAL(1, changed.GetCount());
#endif
}
Beispiel #4
0
wxInt32 wxNotebook::MacControlHit(WXEVENTHANDLERREF WXUNUSED(handler) , WXEVENTREF WXUNUSED(event) )
{
    OSStatus status = eventNotHandledErr ;

    SInt32 newSel = m_peer->GetValue() - 1 ;
    if ( newSel != m_nSelection )
    {
        wxNotebookEvent changing(
            wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGING, m_windowId,
            newSel , m_nSelection );
        changing.SetEventObject( this );
        GetEventHandler()->ProcessEvent( changing );

        if ( changing.IsAllowed() )
        {
            wxNotebookEvent event(
                wxEVT_COMMAND_NOTEBOOK_PAGE_CHANGED, m_windowId,
                newSel, m_nSelection );
            event.SetEventObject( this );
            GetEventHandler()->ProcessEvent( event );
        }
        else
        {
            m_peer->SetValue( m_nSelection + 1 ) ;
        }

        status = noErr ;
    }

    return (wxInt32)status ;
}
void TreeCtrlTestCase::SelectionChange()
{
    m_tree->ExpandAll();
    m_tree->UnselectAll();

    EventCounter changed(m_tree, wxEVT_TREE_SEL_CHANGED);
    EventCounter changing(m_tree, wxEVT_TREE_SEL_CHANGING);

    wxUIActionSimulator sim;

    wxRect poschild1, poschild2;
    m_tree->GetBoundingRect(m_child1, poschild1, true);
    m_tree->GetBoundingRect(m_child2, poschild2, true);

    // We move in slightly so we are not on the edge
    wxPoint point1 = m_tree->ClientToScreen(poschild1.GetPosition()) + wxPoint(4, 4);
    wxPoint point2 = m_tree->ClientToScreen(poschild2.GetPosition()) + wxPoint(4, 4);

    sim.MouseMove(point1);
    wxYield();

    sim.MouseClick();
    wxYield();

    sim.MouseMove(point2);
    wxYield();

    sim.MouseClick();
    wxYield();

    CPPUNIT_ASSERT_EQUAL(2, changed.GetCount());
    CPPUNIT_ASSERT_EQUAL(2, changing.GetCount());
}
Beispiel #6
0
void Codri::Controller::_onInitializationSuccess() {
    mLogger->info() << "Initialisation completed successfully, all functionality should be operational";

    // STATE EVENTS //

    // Kiosk
    connect(MainApplication::instance()->kiosk(), SIGNAL(onPowerChanged(Kiosk::Power)), mPlatformInterface, SLOT(setPower(Kiosk::Power)));

    // Configuration
    connect(MainApplication::instance()->configuration(), SIGNAL(onVolumeChanged(uint8_t)), mPlatformInterface, SLOT(setVolume(uint8_t)));

    // Presentation
    connect(MainApplication::instance()->presentation(), SIGNAL(onPathChanged(const QString&)), mRepositoryInterface, SLOT(check(const QString&)));


    // SUBSYSTEM EVENTS //

    // Repository interface
    connect(mRepositoryInterface, SIGNAL(changing()), mUserInterface, SLOT(showInit()));
    connect(mRepositoryInterface, SIGNAL(ready(QDir)), mUserInterface, SLOT(showPresentation(QDir)));
    connect(mRepositoryInterface, SIGNAL(runtimeFailure()), mUserInterface, SLOT(showError()));

    // User interface
    // connect(mRepositoryInterface, SIGNAL(runtimeFailure()), ..., SLOT(...));


    // SUBSYSTEM START //

    mUserInterface->start();
    mPlatformInterface->start();
    mRepositoryInterface->start();
    mNetworkInterface->start();
}
Beispiel #7
0
int main(){
	int i=0;
	printf("-+-+-+-+-+-+-+-+-+-+-+-+-+\n");
	printf(" ポーカー(ジョーカー入り) \n");
	printf("+-+-+-+-+-+-+-+-+-+-+-+-+-\n\n");
	for(i=0; i<5; i++){//初期手札
		changecard(i);
	}
	turn();
	changing();
	printf("\n");
	turn();
	changing();
	printf("\n");
	turn();
	ppoint = point;
	printf("\n");
	vscpu();
	return 0;
}