diff options
author | Kohei Yoshida <kyoshida@novell.com> | 2011-01-12 14:04:03 -0500 |
---|---|---|
committer | Kohei Yoshida <kyoshida@novell.com> | 2011-01-12 14:04:58 -0500 |
commit | 19e769e697ef3cc16065a766fc037a26e525f839 (patch) | |
tree | 45ee5271a4f42787d9a4980243f168e7354d34a1 /formula | |
parent | 81d22042d20aa479df9bc97566b7f3477de41d17 (diff) |
Add bits to change appearance of the edit box upon invalid references.
Diffstat (limited to 'formula')
-rw-r--r-- | formula/inc/formula/funcutl.hxx | 13 | ||||
-rw-r--r-- | formula/source/ui/dlg/funcutl.cxx | 14 |
2 files changed, 24 insertions, 3 deletions
diff --git a/formula/inc/formula/funcutl.hxx b/formula/inc/formula/funcutl.hxx index 110084dd6419..6f7d23d3d3f7 100644 --- a/formula/inc/formula/funcutl.hxx +++ b/formula/inc/formula/funcutl.hxx @@ -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: */ diff --git a/formula/source/ui/dlg/funcutl.cxx b/formula/source/ui/dlg/funcutl.cxx index 527f9f4d9ef1..52c8d59c894b 100644 --- a/formula/source/ui/dlg/funcutl.cxx +++ b/formula/source/ui/dlg/funcutl.cxx @@ -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 ); |