//============================================================================== PagePickerComponent::PagePickerComponent (int page_) : page (page_) { for (int n=0 ; n < 24 ; n++) { TextButton* button = new TextButton(); addAndMakeVisible (button); button->setButtonText (String (n + 1)); button->setWantsKeyboardFocus (false); if (n == page) { button->setColour (TextButton::buttonColourId, Colours::lightblue); } else { button->setColour (TextButton::buttonColourId, Colours::blue); button->setColour (TextButton::textColourOffId, Colours::white); } button->addListener (this); buttons.add(button); } }
//============================================================================== Copier::Copier( ChaseManager* chaseManager ) : chaseManager( chaseManager ) { //create 4 buttons for x1, x2, x4 and x8 for ( int i = 0; i < 4; i++ ) { TextButton* b = new TextButton( String( i ) ); b->setButtonText( "x" + String( pow( 2, i ) ) ); ColourLookAndFeel claf; b->setColour( TextButton::buttonColourId, claf.backgroundColour ); b->addListener( this ); addAndMakeVisible( b ); buttons.add( b ); } }