aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authornyamatongwe <unknown>2003-01-10 11:20:08 +0000
committernyamatongwe <unknown>2003-01-10 11:20:08 +0000
commit296254f682f7c45e573a8e4586eed1b629f33fb1 (patch)
tree514c7b6532d9af0943a49750ced71bafdacf7462
parentdd670596af16c82cc3ae5433994067f05608cb77 (diff)
downloadscintilla-mirror-296254f682f7c45e573a8e4586eed1b629f33fb1.tar.gz
Added method to copy desired colour to allocated colour in ColourPair for
situations where doing palette management is too complex. Changed ListBox class to an interface to allow use of a platform-specific subclass to hide implementation details.
-rw-r--r--include/Platform.h53
1 files changed, 22 insertions, 31 deletions
diff --git a/include/Platform.h b/include/Platform.h
index d65710e3e..ee31063e3 100644
--- a/include/Platform.h
+++ b/include/Platform.h
@@ -216,6 +216,9 @@ struct ColourPair {
desired = desired_;
allocated.Set(desired.AsLong());
}
+ void Copy() {
+ allocated.Set(desired.AsLong());
+ }
};
class Window; // Forward declaration for Palette
@@ -372,40 +375,28 @@ private:
*/
class ListBox : public Window {
-private:
-#if PLAT_GTK
- WindowID list;
- WindowID scroller;
- int current;
- void *pixhash;
-#endif
- int desiredVisibleRows;
- unsigned int maxItemCharacters;
- unsigned int aveCharWidth;
-public:
- CallBackAction doubleClickAction;
- void *doubleClickActionData;
public:
ListBox();
virtual ~ListBox();
- void Create(Window &parent, int ctrlID);
- virtual void SetFont(Font &font);
- void SetAverageCharWidth(int width);
- void SetVisibleRows(int rows);
- PRectangle GetDesiredRect();
- void Clear();
- void Append(char *s, int type = -1);
- int Length();
- void Select(int n);
- int GetSelection();
- int Find(const char *prefix);
- void GetValue(int n, char *value, int len);
- void Sort();
- void SetTypeXpm(int type, const char *xpm_data);
- void SetDoubleClickAction(CallBackAction action, void *data) {
- doubleClickAction = action;
- doubleClickActionData = data;
- }
+ static ListBox *Allocate();
+
+ virtual void SetFont(Font &font)=0;
+ virtual void Create(Window &parent, int ctrlID, int lineHeight_, bool unicodeMode_)=0;
+ virtual void SetAverageCharWidth(int width)=0;
+ virtual void SetVisibleRows(int rows)=0;
+ virtual PRectangle GetDesiredRect()=0;
+ virtual int CaretFromEdge()=0;
+ virtual void Clear()=0;
+ virtual void Append(char *s, int type = -1)=0;
+ virtual int Length()=0;
+ virtual void Select(int n)=0;
+ virtual int GetSelection()=0;
+ virtual int Find(const char *prefix)=0;
+ virtual void GetValue(int n, char *value, int len)=0;
+ virtual void Sort()=0;
+ virtual void RegisterImage(int type, const char *xpm_data)=0;
+ virtual void ClearRegisteredImages()=0;
+ virtual void SetDoubleClickAction(CallBackAction, void *)=0;
};
/**