Thanks Mark, but unfortunately that doesn't affect anything. The reason I separated the ifs is so that I can check for right click and mouse wheel later using else statements rather than having to check for mouse event multiple times (the event is in scope the entire time so the event information will be stored in event.mouseButton).
the rect and text in question are created during the construction of the editor in the Game class (assignment in a constructor is bad, yes I know, but I'm only creating like 5 rectangleShapes and 5 texts at the beginning of the game so this is tolerable for my purposes). During the construction I simply write:
editorItem_t button;
button.rect = sf::RectangleShape( sf::Vector2f( editor.shell.getLocalBounds( ).width, EDITOR_BUTTON_HEIGHT ) );
button.rect.setOutlineColor( sf::Color::White );
button.rect.setOutlineThickness( EDITOR_OUTLINE_THICKNESS );
button.rect.setFillColor( sf::Color( ) ); //black
button.rect.setPosition( sf::Vector2f( 100, 100 ) ); //dummy location
//center the text
button.text = sf::Text( buttonText, editorFont, 20 ); //white text by default
sf::FloatRect textRect = button.text.getLocalBounds( );
button.text.setOrigin( textRect.left + textRect.width / 2.0f, textRect.top + textRect.height / 2.0f );
and this works fine. In particular, I really don't understand how the button.rect.setFillColor() function works during construction of the editor but is unresponsive during the EditorMode setFillColor() statement. Even writing a function in the Editor class called, say, ChangeColor, and calling it instead doesn't work for me:
void Editor::ChangeColor( sf::RectangleShape& rectangle ) {
rectangle.setFillColor( sf::Color:Blue );
}