From bf7c1067974668610114f7da9be6ac16763137fd Mon Sep 17 00:00:00 2001 From: nyamatongwe Date: Sat, 4 Feb 2006 00:02:08 +0000 Subject: Modification from Greg Smith to allow setting text style attributes for calltips as STYLE_CALLTIP and display calltips with tabs to align text. --- src/CallTip.h | 26 ++++++++++++++++++++------ 1 file changed, 20 insertions(+), 6 deletions(-) (limited to 'src/CallTip.h') diff --git a/src/CallTip.h b/src/CallTip.h index 53eec832a..9848a10af 100644 --- a/src/CallTip.h +++ b/src/CallTip.h @@ -11,14 +11,17 @@ /** */ class CallTip { - int startHighlight; - int endHighlight; + int startHighlight; // character offset to start and... + int endHighlight; // ...end of highlighted text char *val; Font font; - PRectangle rectUp; - PRectangle rectDown; - int lineHeight; - int offsetMain; + PRectangle rectUp; // rectangle of last up angle in the tip + PRectangle rectDown; // rectangle of last down arrow in the tip + int lineHeight; // vertical line spacing + int offsetMain; // The alignment point of the call tip + int tabSize; // Tab size in pixels, <=0 no TAB expand + bool useStyleCallTip; // if true, STYLE_CALLTIP should be used + // Private so CallTip objects can not be copied CallTip(const CallTip &) {} CallTip &operator=(const CallTip &) { return *this; } @@ -26,6 +29,8 @@ class CallTip { int posStart, int posEnd, int ytext, PRectangle rcClient, bool highlight, bool draw); int PaintContents(Surface *surfaceWindow, bool draw); + bool IsTabCharacter(char c); + int NextTabPos(int x); public: Window wCallTip; @@ -60,6 +65,15 @@ public: /// Set a range of characters to be displayed in a highlight style. /// Commonly used to highlight the current parameter. void SetHighlight(int start, int end); + + /// Set the tab size in pixels for the call tip. 0 or -ve means no tab expand. + void SetTabSize(int tabSz); + + /// Used to determine which STYLE_xxxx to use for call tip information + bool UseStyleCallTip() const { return useStyleCallTip;} + + // Modify foreground and background colours + void SetForeBack(const ColourPair &fore, const ColourPair &back); }; #endif -- cgit v1.2.3