X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/82ab1215070a84414f4e6a8f8ebe9bdecdd176f5..362c669367af6c1b024d531c31a76692a6e9ad13:/user/wxLayout/wxllist.h diff --git a/user/wxLayout/wxllist.h b/user/wxLayout/wxllist.h index d4744a77ba..8959a80e10 100644 --- a/user/wxLayout/wxllist.h +++ b/user/wxLayout/wxllist.h @@ -14,13 +14,18 @@ #include "kbList.h" -#include +#include "wx/wx.h" // skip the following defines if embedded in M application -#ifndef MCONFIG_H -// for testing only: +#ifdef M_BASEDIR +# ifdef DEBUG +//# define WXLAYOUT_DEBUG +# endif +#else + // for testing only: # define WXLAYOUT_DEBUG -//# define USE_STD_STRING + // The wxLayout classes can be compiled with std::string instead of wxString + //# define USE_STD_STRING #endif #ifdef USE_STD_STRING @@ -42,8 +47,9 @@ typedef long CoordType; class wxLayoutList; class wxLayoutObjectBase; -/// Define a list type of wxLayoutObjectBase pointers. -KBLIST_DEFINE(wxLayoutObjectList, wxLayoutObjectBase); +class wxDC; +class wxColour; +class wxFont; /** The base class defining the interface to each object which can be part of the layout. Each object needs to draw itself and calculate @@ -94,6 +100,10 @@ private: void * m_UserData; }; +/// Define a list type of wxLayoutObjectBase pointers. +KBLIST_DEFINE(wxLayoutObjectList, wxLayoutObjectBase); + + /// object for text block class wxLayoutObjectText : public wxLayoutObjectBase { @@ -133,8 +143,9 @@ public: bool draw = true); virtual wxPoint GetSize(CoordType *baseLine) const; wxLayoutObjectIcon(wxIcon *icon); + private: - wxIcon * m_Icon; + wxIcon *m_Icon; }; /// for export to html: @@ -235,10 +246,13 @@ public: /**@name Functionality for editing */ //@{ /// set list editable or read only - void SetEditable(bool editable = true) { m_Editable = true; } + void SetEditable(bool editable = true) { m_Editable = editable; } + /// return true if list is editable + bool IsEditable(void) const { return m_Editable; } /// move cursor void MoveCursor(int dx = 0, int dy = 0); void SetCursor(wxPoint const &p) { m_CursorPosition = p; } + wxPoint GetCursor(void) const { return m_CursorPosition; } /// delete one or more cursor positions void Delete(CoordType count = 1); void Insert(String const &text); @@ -249,7 +263,10 @@ public: /// return a pointer to the default settings: wxLayoutObjectCmd const *GetDefaults(void) const { return m_DefaultSetting ; } - //@} + wxLayoutObjectList::iterator FindCurrentObject(CoordType *offset = NULL); + // get the length of the line with the object pointed to by i + CoordType GetLineLength(wxLayoutObjectList::iterator i); +//@} protected: /// font parameters: int m_FontFamily, m_FontStyle, m_FontWeight; @@ -283,10 +300,7 @@ protected: bool m_Editable; /// find the object to the cursor position and returns the offset /// in there - wxLayoutObjectList::iterator FindObjectCursor(wxPoint const &cpos, CoordType *offset = NULL); - wxLayoutObjectList::iterator FindCurrentObject(CoordType *offset = NULL); - // get the length of the line with the object pointed to by i - CoordType GetLineLength(wxLayoutObjectList::iterator i); + wxLayoutObjectList::iterator FindObjectCursor(wxPoint *cpos, CoordType *offset = NULL); };