Add bits to change appearance of the edit box upon invalid references.

This commit is contained in:
Kohei Yoshida 2011-01-12 14:04:03 -05:00
parent 81d22042d2
commit 19e769e697
2 changed files with 24 additions and 3 deletions

View File

@ -34,10 +34,9 @@
#include <vcl/edit.hxx>
#include "formula/formuladllapi.h"
namespace formula {
namespace formula
{
class IControlReferenceHandler;
class IControlReferenceHandler;
class FORMULA_DLLPUBLIC RefEdit : public Edit
{
@ -59,6 +58,13 @@ public:
virtual ~RefEdit();
void SetRefString( const XubString& rStr );
/**
* Flag reference valid or invalid, which in turn changes the visual
* appearance of the control accordingly.
*/
void SetRefValid(bool bValid);
using Edit::SetText;
virtual void SetText( const XubString& rStr );
virtual void Modify();
@ -100,6 +106,7 @@ public:
};
} // formula
#endif // FORMULA_FUNCUTL_HXX
/* vim:set shiftwidth=4 softtabstop=4 expandtab: */

View File

@ -954,6 +954,20 @@ void RefEdit::SetRefString( const XubString& rStr )
Edit::SetText( rStr );
}
void RefEdit::SetRefValid(bool bValid)
{
if (bValid)
{
SetControlForeground();
SetControlBackground();
}
else
{
SetControlForeground(COL_WHITE);
SetControlBackground(0xff6563);
}
}
void RefEdit::SetText( const XubString& rStr )
{
Edit::SetText( rStr );