diff options
Diffstat (limited to 'rhtvision/classes/thistwin.cc')
-rw-r--r-- | rhtvision/classes/thistwin.cc | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/rhtvision/classes/thistwin.cc b/rhtvision/classes/thistwin.cc new file mode 100644 index 0000000..7329726 --- /dev/null +++ b/rhtvision/classes/thistwin.cc @@ -0,0 +1,56 @@ +/* + * Turbo Vision - Version 2.0 + * + * Copyright (c) 1994 by Borland International + * All Rights Reserved. + * + +Modified by Robert H”hne to be used for RHIDE. + + * + * + */ + +#define Uses_THistoryWindow +#define Uses_THistoryViewer +#define Uses_TPalette +#include <tv.h> + +THistInit::THistInit( TListViewer *(*cListViewer)( TRect, TWindow *, ushort ) ) : + createListViewer( cListViewer ) +{ +} + +#define cpHistoryWindow "\x13\x13\x15\x18\x17\x13\x14" + +THistoryWindow::THistoryWindow( const TRect& bounds, + ushort historyId ) : + TWindowInit( &THistoryWindow::initFrame ) + , THistInit( &THistoryWindow::initViewer ) + , TWindow( bounds, 0, wnNoNumber) +{ + flags = wfClose; + if( createListViewer != 0 && + (viewer = createListViewer( getExtent(), this, historyId )) != 0 ) + insert( viewer ); +} + +TPalette& THistoryWindow::getPalette() const +{ + static TPalette palette( cpHistoryWindow, sizeof( cpHistoryWindow )-1 ); + return palette; +} + +void THistoryWindow::getSelection( char *dest ) +{ + viewer->getText( dest, viewer->focused, 255 ); +} + +TListViewer *THistoryWindow::initViewer( TRect r, TWindow * win, ushort historyId ) +{ + r.grow( -1, -1 ); + return new THistoryViewer( r, + win->standardScrollBar( sbHorizontal | sbHandleKeyboard ), + win->standardScrollBar( sbVertical | sbHandleKeyboard ), + historyId); +} |