00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00024 #ifndef __vtkKWText_h
00025 #define __vtkKWText_h
00026
00027 #include "vtkKWCoreWidget.h"
00028
00029 class vtkKWTextInternals;
00030
00031 class KWWidgets_EXPORT vtkKWText : public vtkKWCoreWidget
00032 {
00033
00034 public:
00035 static vtkKWText* New();
00036 vtkTypeRevisionMacro(vtkKWText,vtkKWCoreWidget);
00037 void PrintSelf(ostream& os, vtkIndent indent);
00038
00040
00043 virtual char *GetText();
00044 virtual void SetText(const char *);
00045 virtual void SetText(const char *, const char *tag);
00046 virtual void AppendText(const char *);
00047 virtual void AppendText(const char *, const char *tag);
00049
00051
00052 virtual void SetReadOnly(int val);
00053 vtkGetMacro(ReadOnly, int);
00054 vtkBooleanMacro(ReadOnly, int);
00056
00058
00062 virtual void SetQuickFormatting(int);
00063 vtkGetMacro(QuickFormatting, int);
00064 vtkBooleanMacro(QuickFormatting, int);
00066
00068
00069 virtual void SetWidth(int);
00070 virtual int GetWidth();
00071 virtual void SetHeight(int);
00072 virtual int GetHeight();
00074
00076
00077 virtual void GetBackgroundColor(double *r, double *g, double *b);
00078 virtual double* GetBackgroundColor();
00079 virtual void SetBackgroundColor(double r, double g, double b);
00080 virtual void SetBackgroundColor(double rgb[3])
00081 { this->SetBackgroundColor(rgb[0], rgb[1], rgb[2]); };
00083
00085
00086 virtual void GetForegroundColor(double *r, double *g, double *b);
00087 virtual double* GetForegroundColor();
00088 virtual void SetForegroundColor(double r, double g, double b);
00089 virtual void SetForegroundColor(double rgb[3])
00090 { this->SetForegroundColor(rgb[0], rgb[1], rgb[2]); };
00092
00094
00097 virtual void SetHighlightThickness(int);
00098 virtual int GetHighlightThickness();
00100
00102
00105 virtual void SetBorderWidth(int);
00106 virtual int GetBorderWidth();
00108
00110
00113 virtual void SetRelief(int);
00114 virtual int GetRelief();
00115 virtual void SetReliefToRaised();
00116 virtual void SetReliefToSunken();
00117 virtual void SetReliefToFlat();
00118 virtual void SetReliefToRidge();
00119 virtual void SetReliefToSolid();
00120 virtual void SetReliefToGroove();
00122
00124
00135 virtual void SetFont(const char *font);
00136 virtual const char* GetFont();
00138
00140
00148 virtual void SetPadX(int);
00149 virtual int GetPadX();
00150 virtual void SetPadY(int);
00151 virtual int GetPadY();
00153
00155
00156 virtual void SetWrapToNone();
00157 virtual void SetWrapToWord();
00158 virtual void SetWrapToChar();
00160
00163 virtual void AddTagMatcher(const char *regexp, const char *tag);
00164
00166
00178 vtkBooleanMacro(ResizeToGrid, int);
00179 virtual void SetResizeToGrid(int);
00180 virtual int GetResizeToGrid();
00182
00185 virtual void SeeEnd();
00186
00188
00196 virtual void SetCommand(vtkObject *object, const char *method);
00197 virtual void InvokeCommand(const char *value);
00199
00201
00203 enum
00204 {
00205 TriggerOnFocusOut = 1,
00206 TriggerOnReturnKey = 2,
00207 TriggerOnAnyChange = 4
00208 };
00209
00210 vtkGetMacro(CommandTrigger, int);
00211 virtual void SetCommandTrigger(int);
00212 virtual void SetCommandTriggerToReturnKeyAndFocusOut();
00213 virtual void SetCommandTriggerToAnyChange();
00215
00217
00221 virtual int GetModifiedFlag();
00222 virtual void SetModifiedFlag(int);
00224
00231 virtual void UpdateEnableState();
00232
00234
00235 static const char *MarkerBold;
00236 static const char *MarkerItalic;
00237 static const char *MarkerUnderline;
00238 static const char *TagBold;
00239 static const char *TagItalic;
00240 static const char *TagUnderline;
00241 static const char *TagFgNavy;
00242 static const char *TagFgRed;
00243 static const char *TagFgBlue;
00244 static const char *TagFgDarkGreen;
00245
00247
00249 virtual void ValueCallback();
00250
00251
00252
00253 protected:
00254 vtkKWText();
00255 ~vtkKWText();
00256
00258 virtual void CreateWidget();
00259
00261 virtual void Configure(int disable = 0);
00262
00263 int ReadOnly;
00264 int QuickFormatting;
00265 int CommandTrigger;
00266
00267 char *Command;
00268
00269
00270
00271 vtkKWTextInternals *Internals;
00272
00273
00274 virtual void AppendTextInternalTagging(const char *, const char *tag);
00275 virtual void AppendTextInternal(const char *, const char *tag);
00276
00277
00278
00279 private:
00280
00281 char *InternalTextString;
00282 vtkGetStringMacro(InternalTextString);
00283 vtkSetStringMacro(InternalTextString);
00284
00285 vtkKWText(const vtkKWText&);
00286 void operator=(const vtkKWText&);
00287 };
00288
00289 #endif
00290