Setting dialog title to selected text