From 19e769e697ef3cc16065a766fc037a26e525f839 Mon Sep 17 00:00:00 2001 From: Kohei Yoshida Date: Wed, 12 Jan 2011 14:04:03 -0500 Subject: [PATCH] Add bits to change appearance of the edit box upon invalid references. --- formula/inc/formula/funcutl.hxx | 13 ++++++++++--- 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 #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 );