00001 #ifndef SCROLLEDWINDOWS_H
00002 #define SCROLLEDWINDOWS_H
00003
00004 #include "mainApplicationWindow.h"
00005
00006
00007 class MyScrolledWindowBase : public wxScrolled<wxWindow>
00008 {
00009 public:
00010 MyScrolledWindowBase(wxWindow *parent)
00011 : wxScrolled<wxWindow>(parent, wxID_ANY,
00012 wxDefaultPosition, wxDefaultSize,
00013 wxBORDER_SUNKEN)
00014 {
00015 m_nLines = 50;
00016
00017 wxClientDC dc(this);
00018
00019
00020 dc.GetTextExtent("Line 17", NULL, &m_hLine);
00021 }
00022
00023 virtual void ScrollWindow(int dx, int dy, const wxRect *rect = NULL)
00024 {
00025 wxScrolled<wxWindow>::ScrollWindow(dx, dy, rect);
00026
00027 }
00028
00029 protected:
00030
00031 int m_hLine;
00032
00033
00034 size_t m_nLines;
00035 };
00036
00037
00038
00039
00040 class MyScrolledWindowSmart : public MyScrolledWindowBase
00041 {
00042 public:
00043 MyScrolledWindowSmart(wxWindow *parent) : MyScrolledWindowBase(parent)
00044 {
00045
00046 SetScrollRate( 0, m_hLine );
00047 SetVirtualSize( wxDefaultCoord, ( m_nLines + 1 ) * m_hLine );
00048 }
00049
00050 };
00051
00052 #endif