1998-06-29 08:44:36 -04:00
|
|
|
|
/*-*- c++ -*-********************************************************
|
|
|
|
|
* wxLwindow.h : a scrolled Window for displaying/entering rich text*
|
|
|
|
|
* *
|
|
|
|
|
* (C) 1998 by Karsten Ball<EFBFBD>der (Ballueder@usa.net) *
|
|
|
|
|
* *
|
|
|
|
|
* $Id$
|
|
|
|
|
*******************************************************************/
|
|
|
|
|
#ifndef WXLWINDOW_H
|
|
|
|
|
#define WXLWINDOW_H
|
|
|
|
|
|
|
|
|
|
#ifdef __GNUG__
|
|
|
|
|
# pragma interface "wxlwindow.h"
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#include <wx/wx.h>
|
|
|
|
|
|
|
|
|
|
#include "wxllist.h"
|
|
|
|
|
|
1998-07-29 09:57:51 -04:00
|
|
|
|
#ifdef BROKEN_COMPILER
|
|
|
|
|
# define virtual
|
|
|
|
|
#endif
|
|
|
|
|
|
1998-06-29 08:44:36 -04:00
|
|
|
|
class wxLayoutWindow : public wxScrolledWindow
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
wxLayoutWindow(wxWindow *parent);
|
|
|
|
|
|
|
|
|
|
wxLayoutList & GetLayoutList(void) { return m_llist; }
|
|
|
|
|
|
1998-07-29 09:57:51 -04:00
|
|
|
|
// clears the window and sets default parameters:
|
|
|
|
|
void Clear(int family = wxROMAN, int size=12, int style=wxNORMAL, int weight=wxNORMAL,
|
|
|
|
|
int underline=0, char const *fg="black", char const
|
|
|
|
|
*bg="white")
|
|
|
|
|
{
|
|
|
|
|
GetLayoutList().Clear(family,size,style,weight,underline,fg,bg);
|
|
|
|
|
SetBackgroundColour( *GetLayoutList().GetDefaults()->GetBGColour());
|
|
|
|
|
}
|
|
|
|
|
|
1998-06-29 08:44:36 -04:00
|
|
|
|
//virtual void OnDraw(wxDC &dc);
|
|
|
|
|
void OnPaint(wxPaintEvent &WXUNUSED(event));
|
1998-07-29 09:57:51 -04:00
|
|
|
|
virtual void OnMouse(wxMouseEvent& event);
|
|
|
|
|
virtual void OnChar(wxKeyEvent& event);
|
1998-06-29 08:44:36 -04:00
|
|
|
|
void UpdateScrollbars(void);
|
|
|
|
|
void Print(void);
|
|
|
|
|
void Erase(void)
|
|
|
|
|
{ m_llist.Clear(); Clear(); }
|
|
|
|
|
void SetEventId(int id) { m_EventId = id; }
|
1998-07-12 11:02:44 -04:00
|
|
|
|
wxPoint const &GetClickPosition(void) const { return
|
|
|
|
|
m_ClickPosition; }
|
1998-07-29 09:57:51 -04:00
|
|
|
|
virtual ~wxLayoutList() {} ;
|
1998-06-29 08:44:36 -04:00
|
|
|
|
private:
|
1998-07-12 11:02:44 -04:00
|
|
|
|
/// for sending events
|
|
|
|
|
wxWindow *m_Parent;
|
1998-06-29 08:44:36 -04:00
|
|
|
|
int m_EventId;
|
|
|
|
|
/// the layout list to be displayed
|
|
|
|
|
wxLayoutList m_llist;
|
|
|
|
|
/// have we already set the scrollbars?
|
|
|
|
|
bool m_ScrollbarsSet;
|
|
|
|
|
/// if we want to find an object:
|
|
|
|
|
wxPoint m_FindPos;
|
|
|
|
|
wxLayoutObjectBase *m_FoundObject;
|
1998-07-12 11:02:44 -04:00
|
|
|
|
wxPoint m_ClickPosition;
|
1998-06-29 08:44:36 -04:00
|
|
|
|
DECLARE_EVENT_TABLE()
|
|
|
|
|
};
|
|
|
|
|
|
1998-07-29 09:57:51 -04:00
|
|
|
|
#ifdef BROKEN_COMPILER
|
|
|
|
|
#undef virtual
|
|
|
|
|
#endif
|
|
|
|
|
|
1998-06-29 08:44:36 -04:00
|
|
|
|
#endif
|