#include "kbList.h"
-#include <wx/wx.h>
+#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
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
void * m_UserData;
};
+/// Define a list type of wxLayoutObjectBase pointers.
+KBLIST_DEFINE(wxLayoutObjectList, wxLayoutObjectBase);
+
+
/// object for text block
class wxLayoutObjectText : public wxLayoutObjectBase
{
bool draw = true);
virtual wxPoint GetSize(CoordType *baseLine) const;
wxLayoutObjectIcon(wxIcon *icon);
+
private:
- wxIcon * m_Icon;
+ wxIcon *m_Icon;
};
/// for export to html:
/**@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);
/// 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;
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);
};