thePrs->SetLabelColor(aLblColor.red()/255.,
aLblColor.green()/255.,
aLblColor.blue()/255.);
+ myIsStoreTextProp = false;
}
return 1;
void VisuGUI_ScalarBarPane::onTextPref()
{
- myIsStoreTextProp = myTextDlg->exec();
+ myTextDlg->storeBeginValues();
+ myIsStoreTextProp = myTextDlg->exec() || myIsStoreTextProp;
updatePreview();
}
connect(buttonOk, SIGNAL(clicked()), this, SLOT(accept()));
connect(buttonCancel, SIGNAL(clicked()), this, SLOT(reject()));
}
+
+void VisuGUI_TextPrefDlg::storeBeginValues()
+{
+ myTitle = myTitleEdt->text();
+ myTitleFont->GetData(myColors[0], myComboVals[0], myCheckVals[0], myCheckVals[1], myCheckVals[2]);
+ myLabelFont->GetData(myColors[1], myComboVals[1], myCheckVals[3], myCheckVals[4], myCheckVals[5]);
+}
+
+/*!
+ Called when <Cancel> button is clicked, restore begin values
+*/
+void VisuGUI_TextPrefDlg::reject()
+{
+ myTitleEdt->setText(myTitle);
+ myTitleFont->SetData(myColors[0], myComboVals[0], myCheckVals[0], myCheckVals[1], myCheckVals[2]);
+ myLabelFont->SetData(myColors[1], myComboVals[1], myCheckVals[3], myCheckVals[4], myCheckVals[5]);
+
+ QDialog::reject();
+}
+/*!
+ Called when <Ok> button is clicked, store begin values
+*/
+void VisuGUI_TextPrefDlg::accept()
+{
+ storeBeginValues();
+
+ QDialog::accept();
+}