I have been trying to make my tab names editable by following the advice given in this old thread:
It posts some code reposted here:
mEditLabel = new CTabLabelTextEditor(T("Tab Label")); mTabLabelBeingEdited = tabIndex; mEditLabel->setText(tabName); addAndMakeVisible(mEditLabel); mEditLabel->setBounds(theLabelXPos, Ypos, w, h); mEditLabel->setSelectAllWhenFocused(true); mEditLabel->grabKeyboardFocus(); mEditLabel->enterModalState(); //make the editor modal, so clicks outside the box will delete it mEditLabel->addActionListener(this); //listen to messages from the text editor
When mEditLabel becomes modal, it does not allow any other components on the screen to take mouse messages. I am not sure how his comment "//make the editor modal, so clicks outside the box will delete it" works with this bit of code. Can anyone give advice to allow clicks outside of the modal textbox to end the modal state, and remove mEditLabel from the display?