summaryrefslogtreecommitdiff
path: root/formula
diff options
context:
space:
mode:
authorKohei Yoshida <kyoshida@novell.com>2011-01-12 14:04:03 -0500
committerKohei Yoshida <kyoshida@novell.com>2011-01-12 14:04:58 -0500
commit02a39a3d6c147aa135f05f5024d39e61c7b48aab (patch)
tree2a6ff1bddd1fdb322f856aab35b29af229b1fe81 /formula
parent0d209ac289dd5c79da6950b4c01b0cec9b7fbe6d (diff)
Add bits to change appearance of the edit box upon invalid references.
Diffstat (limited to 'formula')
-rw-r--r--formula/inc/formula/funcutl.hxx13
-rw-r--r--formula/source/ui/dlg/funcutl.cxx14
2 files changed, 24 insertions, 3 deletions
diff --git a/formula/inc/formula/funcutl.hxx b/formula/inc/formula/funcutl.hxx
index 110084dd64..6f7d23d3d3 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 6213b198fb..79b7ea0277 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 );