Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

dialogs.h

Go to the documentation of this file.
00001 /*
00002  * dialogs.h
00003  *
00004  * Turbo Vision - Version 2.0
00005  *
00006  * Copyright (c) 1994 by Borland International
00007  * All Rights Reserved.
00008  *
00009  * Modified by Sergio Sigala <sergio@sigala.it>
00010  */
00011 
00012 #if !defined( __BUTTON_TYPE )
00013 #define __BUTTON_TYPE
00014 
00023 const int
00024     bfNormal    = 0x00,
00025 
00031     bfDefault   = 0x01,
00032 
00038     bfLeftJust  = 0x02,
00039 
00044     bfBroadcast = 0x04,
00045 
00050     bfGrabFocus = 0x08,
00051     cmRecordHistory = 60;
00052 
00053 #endif  // __BUTTON_TYPE
00054 
00055 /* ---------------------------------------------------------------------- */
00056 /*      class TDialog                                                     */
00057 /*                                                                        */
00058 /*      Palette layout                                                    */
00059 /*        1 = Frame passive                                               */
00060 /*        2 = Frame active                                                */
00061 /*        3 = Frame icon                                                  */
00062 /*        4 = ScrollBar page area                                         */
00063 /*        5 = ScrollBar controls                                          */
00064 /*        6 = StaticText                                                  */
00065 /*        7 = Label normal                                                */
00066 /*        8 = Label selected                                              */
00067 /*        9 = Label shortcut                                              */
00068 /*       10 = Button normal                                               */
00069 /*       11 = Button default                                              */
00070 /*       12 = Button selected                                             */
00071 /*       13 = Button disabled                                             */
00072 /*       14 = Button shortcut                                             */
00073 /*       15 = Button shadow                                               */
00074 /*       16 = Cluster normal                                              */
00075 /*       17 = Cluster selected                                            */
00076 /*       18 = Cluster shortcut                                            */
00077 /*       19 = InputLine normal text                                       */
00078 /*       20 = InputLine selected text                                     */
00079 /*       21 = InputLine arrows                                            */
00080 /*       22 = History arrow                                               */
00081 /*       23 = History sides                                               */
00082 /*       24 = HistoryWindow scrollbar page area                           */
00083 /*       25 = HistoryWindow scrollbar controls                            */
00084 /*       26 = ListViewer normal                                           */
00085 /*       27 = ListViewer focused                                          */
00086 /*       28 = ListViewer selected                                         */
00087 /*       29 = ListViewer divider                                          */
00088 /*       30 = InfoPane                                                    */
00089 /*       31 = Cluster Disabled                                            */
00090 /*       32 = Reserved                                                    */
00091 /* ---------------------------------------------------------------------- */
00092 
00093 #if defined( Uses_TDialog ) && !defined( __TDialog )
00094 #define __TDialog
00095 
00096 #define  cpGrayDialog \
00097     "\x20\x21\x22\x23\x24\x25\x26\x27\x28\x29\x2A\x2B\x2C\x2D\x2E\x2F"\
00098     "\x30\x31\x32\x33\x34\x35\x36\x37\x38\x39\x3A\x3B\x3C\x3D\x3E\x3F"
00099 
00100 #define  cpBlueDialog \
00101     "\x40\x41\x42\x43\x44\x45\x46\x47\x48\x49\x4a\x4b\x4c\x4d\x4e\x4f"\
00102     "\x50\x51\x52\x53\x54\x55\x56\x57\x58\x59\x5a\x5b\x5c\x5d\x5e\x5f"
00103 
00104 #define  cpCyanDialog \
00105     "\x60\x61\x62\x63\x64\x65\x66\x67\x68\x69\x6a\x6b\x6c\x6d\x6e\x6f"\
00106     "\x70\x71\x72\x73\x74\x75\x76\x77\x78\x79\x7a\x7b\x7c\x7d\x7e\x7f"
00107 
00108 #define cpDialog cpGrayDialog
00109 
00110 const int dpBlueDialog = 0,
00111       dpCyanDialog = 1,
00112       dpGrayDialog = 2;
00113 
00114 class TRect;
00115 class TEvent;
00116 class TValidator;
00117 
00136 class TDialog : public TWindow
00137 {
00138 public:
00157     TDialog( const TRect& bounds, const char *aTitle );
00161     virtual TPalette& getPalette() const;
00176     virtual void handleEvent( TEvent& event );
00193     virtual Boolean valid( ushort command );
00194 private:
00195     virtual const char *streamableName() const
00196         { return name; }
00197 protected:
00205     TDialog( StreamableInit );
00206 public:
00207     static const char * const name;
00211     static TStreamable *build();
00212 };
00213 
00217 inline ipstream& operator >> ( ipstream& is, TDialog& cl )
00218     { return is >> (TStreamable&)cl; }
00222 inline ipstream& operator >> ( ipstream& is, TDialog*& cl )
00223     { return is >> (void *&)cl; }
00224 
00228 inline opstream& operator << ( opstream& os, TDialog& cl )
00229     { return os << (TStreamable&)cl; }
00233 inline opstream& operator << ( opstream& os, TDialog* cl )
00234     { return os << (TStreamable *)cl; }
00235 
00236 #endif  // Uses_TDialog
00237 
00238 /* ---------------------------------------------------------------------- */
00239 /*      class TInputLine                                                  */
00240 /*                                                                        */
00241 /*      Palette layout                                                    */
00242 /*        1 = Passive                                                     */
00243 /*        2 = Active                                                      */
00244 /*        3 = Selected                                                    */
00245 /*        4 = Arrows                                                      */
00246 /* ---------------------------------------------------------------------- */
00247 
00248 #if defined( Uses_TInputLine ) && !defined( __TInputLine )
00249 #define __TInputLine
00250 
00251 class TRect;
00252 class TEvent;
00253 class TValidator;
00254 
00261 class TInputLine : public TView
00262 {
00263 public:
00282     TInputLine( const TRect& bounds, int aMaxLen, TValidator *aValid = 0 );
00288     ~TInputLine();
00297     virtual ushort dataSize();
00310     virtual void draw();
00321     virtual void getData( void *rec );
00325     virtual TPalette& getPalette() const;
00346     virtual void handleEvent( TEvent& event );
00357     void selectAll( Boolean enable );
00371     virtual void setData( void *rec );
00384     virtual void setState( ushort aState, Boolean enable );
00388     virtual Boolean valid( ushort cmd );
00392     void setValidator( TValidator* aValid );
00396     char* data;
00400     int maxLen;
00404     int curPos;
00408     int firstPos;
00413     int selStart;
00418     int selEnd;
00419 private:
00420     Boolean canScroll( int delta );
00421     int mouseDelta( TEvent& event );
00422     int mousePos( TEvent& event );
00423     void deleteSelect();
00424     void adjustSelectBlock();
00425     void saveState();
00426     void restoreState();
00427     Boolean checkValid(Boolean);
00428     static const char rightArrow;
00429     static const char leftArrow;
00430     virtual const char *streamableName() const
00431         { return name; }
00432     TValidator* validator;
00433     int anchor;
00434 #ifndef __UNPATCHED
00435     int oldAnchor; // New variable to save another bit of state info
00436 #endif
00437     char* oldData;
00438     int oldCurPos;
00439     int oldFirstPos;
00440     int oldSelStart;
00441     int oldSelEnd;
00442 protected:
00450     TInputLine( StreamableInit );
00454     virtual void write( opstream& os );
00458     virtual void *read( ipstream& is );
00459 public:
00463     static const char * const name;
00467     static TStreamable *build();
00468 };
00469 
00473 inline ipstream& operator >> ( ipstream& is, TInputLine& cl )
00474     { return is >> (TStreamable&)cl; }
00478 inline ipstream& operator >> ( ipstream& is, TInputLine*& cl )
00479     { return is >> (void *&)cl; }
00480 
00484 inline opstream& operator << ( opstream& os, TInputLine& cl )
00485     { return os << (TStreamable&)cl; }
00489 inline opstream& operator << ( opstream& os, TInputLine* cl )
00490     { return os << (TStreamable *)cl; }
00491 
00492 #endif  // Uses_TInputLine
00493 
00494 
00495 /* ---------------------------------------------------------------------- */
00496 /*      TButton object                                                    */
00497 /*                                                                        */
00498 /*      Palette layout                                                    */
00499 /*        1 = Normal text                                                 */
00500 /*        2 = Default text                                                */
00501 /*        3 = Selected text                                               */
00502 /*        4 = Disabled text                                               */
00503 /*        5 = Normal shortcut                                             */
00504 /*        6 = Default shortcut                                            */
00505 /*        7 = Selected shortcut                                           */
00506 /*        8 = Shadow                                                      */
00507 /* ---------------------------------------------------------------------- */
00508 
00509 #if defined( Uses_TButton ) && !defined( __TButton )
00510 #define __TButton
00511 
00512 class TRect;
00513 class TEvent;
00514 class TDrawBuffer;
00515 
00536 class TButton : public TView
00537 {
00538 public:
00585     TButton( const TRect& bounds,
00586              const char *aTitle,
00587              ushort aCommand,
00588              ushort aFlags
00589            );
00597     ~TButton();
00602     virtual void draw();
00613     void drawState( Boolean down );
00617     virtual TPalette& getPalette() const;
00634     virtual void handleEvent( TEvent& event );
00657     void makeDefault( Boolean enable );
00669     virtual void press();
00681     virtual void setState( ushort aState, Boolean enable );
00685     const char *title;
00691     static const char * shadows;
00692 protected:
00697     ushort command;
00705     uchar flags;
00712     Boolean amDefault;
00713 private:
00714     void drawTitle( TDrawBuffer&, int, int, ushort, Boolean );
00715     void pressButton( TEvent& );
00716     TRect getActiveRect();
00717     static const char * markers;
00718     virtual const char *streamableName() const
00719         { return name; }
00720 protected:
00731     TButton( StreamableInit ): TView( streamableInit ) {};
00737     virtual void write( opstream& os );
00743     virtual void *read( ipstream& is );
00744 public:
00748     static const char * const name;
00755     static TStreamable *build();
00756 };
00757 
00761 inline ipstream& operator >> ( ipstream& is, TButton& cl )
00762     { return is >> (TStreamable&)cl; }
00766 inline ipstream& operator >> ( ipstream& is, TButton*& cl )
00767     { return is >> (void *&)cl; }
00768 
00772 inline opstream& operator << ( opstream& os, TButton& cl )
00773     { return os << (TStreamable&)cl; }
00777 inline opstream& operator << ( opstream& os, TButton* cl )
00778     { return os << (TStreamable *)cl; }
00779 
00780 #endif  // Uses_TButton
00781 
00782 
00783 #if defined( Uses_TSItem ) && !defined( __TSItem )
00784 #define __TSItem
00785 
00793 class TSItem
00794 {
00795 public:
00799     TSItem( const char *aValue, TSItem *aNext )
00800         { value = newStr(aValue); next = aNext; }
00804     ~TSItem() { delete value; }
00808     const char *value;
00812     TSItem *next;
00813 };
00814 
00815 #endif  // Uses_TSItem
00816 
00817 /* ---------------------------------------------------------------------- */
00818 /*      class TCluster                                                    */
00819 /*                                                                        */
00820 /*      Palette layout                                                    */
00821 /*        1 = Normal text                                                 */
00822 /*        2 = Selected text                                               */
00823 /*        3 = Normal shortcut                                             */
00824 /*        4 = Selected shortcut                                           */
00825 /*        5 = Disabled text                                               */
00826 /* ---------------------------------------------------------------------- */
00827 
00828 #if defined( Uses_TCluster ) && !defined( __TCluster )
00829 #define __TCluster
00830 
00831 class TRect;
00832 class TSItem;
00833 class TEvent;
00834 class TPoint;
00835 class TStringCollection;
00836 
00856 class TCluster : public TView
00857 {
00858 public:
00872     TCluster( const TRect& bounds, TSItem *aStrings );
00878     ~TCluster();
00889     virtual ushort dataSize();
00908     void drawBox( const char *icon, char marker );
00928     void drawMultiBox(const char *icon, const char* marker);
00938     virtual void getData( void *rec );
00950     ushort getHelpCtx();
00954     virtual TPalette& getPalette() const;
00963     virtual void handleEvent( TEvent& event );
00977     virtual Boolean mark( int item );
00981     virtual uchar multiMark( int item );
00991     virtual void press( int item );
01000     virtual void movedTo( int item );
01009     virtual void setData( void *rec );
01017     virtual void setState( ushort aState, Boolean enable );
01024     virtual void setButtonState(unsigned long aMask, Boolean enable);
01025 protected:
01046     unsigned long value;
01054     unsigned long enableMask;
01061     int sel;
01065     TStringCollection *strings;
01066 private:
01067     int column( int item );
01068     int findSel( TPoint p );
01069     int row( int item );
01070     void moveSel(int, int);
01071     virtual const char *streamableName() const
01072         { return name; }
01073 protected:
01083     TCluster( StreamableInit );
01088     virtual void write( opstream& os );
01093     virtual void *read( ipstream& is );
01094 public:
01102     Boolean buttonState(int item);
01106     static const char * const name;
01112     static TStreamable *build();
01113 };
01114 
01118 inline ipstream& operator >> ( ipstream& is, TCluster& cl )
01119     { return is >> (TStreamable&)cl; }
01123 inline ipstream& operator >> ( ipstream& is, TCluster*& cl )
01124     { return is >> (void *&)cl; }
01125 
01129 inline opstream& operator << ( opstream& os, TCluster& cl )
01130     { return os << (TStreamable&)cl; }
01134 inline opstream& operator << ( opstream& os, TCluster* cl )
01135     { return os << (TStreamable *)cl; }
01136 
01137 #endif  // Uses_TCluster
01138 
01139 
01140 /* ---------------------------------------------------------------------- */
01141 /*      class TRadioButtons                                               */
01142 /*                                                                        */
01143 /*      Palette layout                                                    */
01144 /*        1 = Normal text                                                 */
01145 /*        2 = Selected text                                               */
01146 /*        3 = Normal shortcut                                             */
01147 /*        4 = Selected shortcut                                           */
01148 /* ---------------------------------------------------------------------- */
01149 
01150 
01151 #if defined( Uses_TRadioButtons ) && !defined( __TRadioButtons )
01152 #define __TRadioButtons
01153 
01154 class TRect;
01155 class TSItem;
01156 
01181 class TRadioButtons : public TCluster
01182 {
01183 public:
01198     TRadioButtons( const TRect& bounds, TSItem *aStrings );
01207     virtual void draw();
01215     virtual Boolean mark( int item );
01224     virtual void movedTo( int item );
01233     virtual void press( int item );
01241     virtual void setData( void *rec );
01242 private:
01243     static const char * button;
01244     virtual const char *streamableName() const
01245         { return name; }
01246 protected:
01256     TRadioButtons( StreamableInit );
01257 public:
01261     static const char * const name;
01267     static TStreamable *build();
01268 };
01269 
01273 inline ipstream& operator >> ( ipstream& is, TRadioButtons& cl )
01274     { return is >> (TStreamable&)cl; }
01278 inline ipstream& operator >> ( ipstream& is, TRadioButtons*& cl )
01279     { return is >> (void *&)cl; }
01280 
01284 inline opstream& operator << ( opstream& os, TRadioButtons& cl )
01285     { return os << (TStreamable&)cl; }
01289 inline opstream& operator << ( opstream& os, TRadioButtons* cl )
01290     { return os << (TStreamable *)cl; }
01291 
01292 inline TRadioButtons::TRadioButtons( const TRect& bounds, TSItem *aStrings ) :
01293     TCluster( bounds, aStrings )
01294 {
01295 }
01296 
01297 #endif  // Uses_TRadioButtons
01298 
01299 
01300 /* ---------------------------------------------------------------------- */
01301 /*      TCheckBoxes                                                       */
01302 /*                                                                        */
01303 /*      Palette layout                                                    */
01304 /*        1 = Normal text                                                 */
01305 /*        2 = Selected text                                               */
01306 /*        3 = Normal shortcut                                             */
01307 /*        4 = Selected shortcut                                           */
01308 /* ---------------------------------------------------------------------- */
01309 
01310 #if defined( Uses_TCheckBoxes ) && !defined( __TCheckBoxes )
01311 #define __TCheckBoxes
01312 
01313 class TRect;
01314 class TSItem;
01315 
01335 class TCheckBoxes : public TCluster
01336 {
01337 public:
01352     TCheckBoxes( const TRect& bounds, TSItem *aStrings);
01361     virtual void draw();
01373     virtual Boolean mark( int item );
01382     virtual void press( int item );
01383 private:
01384     static const char * button;
01385     virtual const char *streamableName() const
01386         { return name; }
01387 protected:
01397     TCheckBoxes( StreamableInit );
01398 public:
01402     static const char * const name;
01408     static TStreamable *build();
01409 };
01410 
01414 inline ipstream& operator >> ( ipstream& is, TCheckBoxes& cl )
01415     { return is >> (TStreamable&)cl; }
01419 inline ipstream& operator >> ( ipstream& is, TCheckBoxes*& cl )
01420     { return is >> (void *&)cl; }
01421 
01425 inline opstream& operator << ( opstream& os, TCheckBoxes& cl )
01426     { return os << (TStreamable&)cl; }
01430 inline opstream& operator << ( opstream& os, TCheckBoxes* cl )
01431     { return os << (TStreamable *)cl; }
01432 
01433 inline TCheckBoxes::TCheckBoxes( const TRect& bounds, TSItem *aStrings) :
01434     TCluster( bounds, aStrings )
01435 {
01436 }
01437 
01438 #endif  // Uses_TCheckBoxes
01439 
01440 
01441 #if defined( Uses_TMultiCheckBoxes ) && !defined( __TMultiCheckBoxes )
01442 #define __TMultiCheckBoxes
01443 
01444 const unsigned short cfOneBit       = 0x0101,
01445                      cfTwoBits      = 0x0203,
01446                      cfFourBits     = 0x040F,
01447                      cfEightBits    = 0x08FF;
01448 
01449 /* ---------------------------------------------------------------------- */
01450 /*      TMultiCheckBoxes                                                  */
01451 /*                                                                        */
01452 /*      Palette layout                                                    */
01453 /*        1 = Normal text                                                 */
01454 /*        2 = Selected text                                               */
01455 /*        3 = Normal shortcut                                             */
01456 /*        4 = Selected shortcut                                           */
01457 /* ---------------------------------------------------------------------- */
01458 
01459 class TRect;
01460 class TSItem;
01461 
01466 class TMultiCheckBoxes : public TCluster
01467 {
01468 public:
01476     TMultiCheckBoxes(TRect& bounds, TSItem *aStrings, uchar aSelRange,
01477         ushort aFlags, const char* aStates);
01484     ~TMultiCheckBoxes();
01489     virtual ushort dataSize();
01496     virtual void draw();
01504     virtual void getData(void *rec);
01508     virtual uchar multiMark(int item);
01514     virtual void press( int item );
01522     virtual void setData(void*);
01523 private:
01524     uchar selRange;
01549     ushort flags;
01550     char* states;
01551 #ifndef __UNPATCHED
01552     virtual const char *streamableName() const
01553         { return name; }
01554 #endif
01555 protected:
01562     TMultiCheckBoxes( StreamableInit );
01566     virtual void write( opstream& os );
01570     virtual void *read( ipstream& is );
01571 public:
01575     static const char * const name;
01579     static TStreamable *build();
01580 };
01581 
01585 inline ipstream& operator >> ( ipstream& is, TMultiCheckBoxes& cl )
01586     { return is >> (TStreamable&)cl; }
01590 inline ipstream& operator >> ( ipstream& is, TMultiCheckBoxes*& cl )
01591     { return is >> (void *&)cl; }
01592 
01596 inline opstream& operator << ( opstream& os, TMultiCheckBoxes& cl )
01597     { return os << (TStreamable&)cl; }
01601 inline opstream& operator << ( opstream& os, TMultiCheckBoxes* cl )
01602     { return os << (TStreamable *)cl; }
01603 
01604 #endif
01605 
01606 
01607 #if defined( Uses_TListBox ) && !defined( __TListBox )
01608 #define __TListBox
01609 
01610 class TRect;
01611 class TScrollBar;
01612 class TCollection;
01613 
01621 struct TListBoxRec
01622 {
01626     TCollection *items;
01630     ushort selection;
01631 };
01632 
01643 class TListBox : public TListViewer
01644 {
01645 public:
01661     TListBox( const TRect& bounds, ushort aNumCols, TScrollBar *aScrollBar );
01665     ~TListBox();
01677     virtual ushort dataSize();
01685     virtual void getData( void *rec );
01697     virtual void getText( char *dest, short item, short maxLen );
01702     virtual void newList( TCollection *aList );
01710     virtual void setData( void *rec );
01714     TCollection *list();
01715 private:
01716     virtual const char *streamableName() const
01717         { return name; }
01718 protected:
01726     TCollection *items;
01733     TListBox( StreamableInit );
01737     virtual void write( opstream& os );
01741     virtual void *read( ipstream& is );
01742 public:
01746     static const char * const name;
01750     static TStreamable *build();
01751 };
01752 
01756 inline ipstream& operator >> ( ipstream& is, TListBox& cl )
01757     { return is >> (TStreamable&)cl; }
01761 inline ipstream& operator >> ( ipstream& is, TListBox*& cl )
01762     { return is >> (void *&)cl; }
01763 
01767 inline opstream& operator << ( opstream& os, TListBox& cl )
01768     { return os << (TStreamable&)cl; }
01772 inline opstream& operator << ( opstream& os, TListBox* cl )
01773     { return os << (TStreamable *)cl; }
01774 
01775 inline TCollection *TListBox::list()
01776 {
01777     return items;
01778 }
01779 
01780 #endif  // Uses_TListBox
01781 
01782 
01783 /* ---------------------------------------------------------------------- */
01784 /*      class TStaticText                                                 */
01785 /*                                                                        */
01786 /*      Palette layout                                                    */
01787 /*        1 = Text                                                        */
01788 /* ---------------------------------------------------------------------- */
01789 
01790 #if defined( Uses_TStaticText ) && !defined( __TStaticText )
01791 #define __TStaticText
01792 
01793 class TRect;
01794 
01808 class TStaticText : public TView
01809 {
01810 public:
01821     TStaticText( const TRect& bounds, const char *aText );
01827     ~TStaticText();
01833     virtual void draw();
01837     virtual TPalette& getPalette() const;
01841     virtual void getText( char *s );
01842 protected:
01846     const char *text;
01847 private:
01848     virtual const char *streamableName() const
01849         { return name; }
01850 protected:
01857     TStaticText( StreamableInit );
01861     virtual void write( opstream& os );
01865     virtual void *read( ipstream& is );
01866 public:
01870     static const char * const name;
01876     static TStreamable *build();
01877 };
01878 
01882 inline ipstream& operator >> ( ipstream& is, TStaticText& cl )
01883     { return is >> (TStreamable&)cl; }
01887 inline ipstream& operator >> ( ipstream& is, TStaticText*& cl )
01888     { return is >> (void *&)cl; }
01889 
01893 inline opstream& operator << ( opstream& os, TStaticText& cl )
01894     { return os << (TStreamable&)cl; }
01898 inline opstream& operator << ( opstream& os, TStaticText* cl )
01899     { return os << (TStreamable *)cl; }
01900 
01901 #endif  // Uses_TStaticText
01902 
01903 
01904 /* ---------------------------------------------------------------------- */
01905 /*      class TParamText                                                  */
01906 /*                                                                        */
01907 /*      Palette layout                                                    */
01908 /*        1 = Text                                                        */
01909 /* ---------------------------------------------------------------------- */
01910 
01911 #if defined( Uses_TParamText ) && !defined( __TParamText )
01912 #define __TParamText
01913 
01914 class TRect;
01915 
01924 class TParamText : public TStaticText
01925 {
01926 public:
01935     TParamText( const TRect& bounds );
01939     ~TParamText();
01944     virtual void getText( char *s );
01951     virtual void setText( char *fmt, ... );
01955     virtual int getTextLen();
01956 protected:
01960     char *str;
01961 private:
01962     virtual const char *streamableName() const
01963         { return name; }
01964 protected:
01971     TParamText( StreamableInit );
01972 #ifndef __UNPATCHED
01973 
01976     virtual void write( opstream& os );
01980     virtual void *read( ipstream& is );
01981 #endif
01982 public:
01986     static const char * const name;
01992     static TStreamable *build();
01993 };
01994 
01998 inline ipstream& operator >> ( ipstream& is, TParamText& cl )
01999     { return is >> (TStreamable&)cl; }
02003 inline ipstream& operator >> ( ipstream& is, TParamText*& cl )
02004     { return is >> (void *&)cl; }
02005 
02009 inline opstream& operator << ( opstream& os, TParamText& cl )
02010     { return os << (TStreamable&)cl; }
02014 inline opstream& operator << ( opstream& os, TParamText* cl )
02015     { return os << (TStreamable *)cl; }
02016 
02017 #endif  // Uses_TParamText
02018 
02019 
02020 /* ---------------------------------------------------------------------- */
02021 /*      class TLabel                                                      */
02022 /*                                                                        */
02023 /*      Palette layout                                                    */
02024 /*        1 = Normal text                                                 */
02025 /*        2 = Selected text                                               */
02026 /*        3 = Normal shortcut                                             */
02027 /*        4 = Selected shortcut                                           */
02028 /* ---------------------------------------------------------------------- */
02029 
02030 #if defined( Uses_TLabel ) && !defined( __TLabel )
02031 #define __TLabel
02032 
02033 class TRect;
02034 class TEvent;
02035 class TView;
02036 
02056 class TLabel : public TStaticText
02057 {
02058 public:
02077     TLabel( const TRect& bounds, const char *aText, TView *aLink );
02081     virtual void draw();
02085     virtual TPalette& getPalette() const;
02098     virtual void handleEvent( TEvent& event );
02112     virtual void shutDown();
02113 protected:
02118     TView *link;
02123     Boolean light;
02124 private:
02125     virtual const char *streamableName() const
02126         { return name; }
02127     void focusLink(TEvent&);
02128 protected:
02135     TLabel( StreamableInit );
02140     virtual void write( opstream& os );
02145     virtual void *read( ipstream& is );
02146 public:
02150     static const char * const name;
02156     static TStreamable *build();
02157 };
02158 
02162 inline ipstream& operator >> ( ipstream& is, TLabel& cl )
02163     { return is >> (TStreamable&)cl; }
02167 inline ipstream& operator >> ( ipstream& is, TLabel*& cl )
02168     { return is >> (void *&)cl; }
02169 
02173 inline opstream& operator << ( opstream& os, TLabel& cl )
02174     { return os << (TStreamable&)cl; }
02178 inline opstream& operator << ( opstream& os, TLabel* cl )
02179     { return os << (TStreamable *)cl; }
02180 
02181 #endif  // Uses_TLabel
02182 
02183 
02184 /* ---------------------------------------------------------------------- */
02185 /*      class THistoryViewer                                              */
02186 /*                                                                        */
02187 /*      Palette layout                                                    */
02188 /*        1 = Active                                                      */
02189 /*        2 = Inactive                                                    */
02190 /*        3 = Focused                                                     */
02191 /*        4 = Selected                                                    */
02192 /*        5 = Divider                                                     */
02193 /* ---------------------------------------------------------------------- */
02194 
02195 #if defined( Uses_THistoryViewer ) && !defined( __THistoryViewer )
02196 #define __THistoryViewer
02197 
02198 class TRect;
02199 class TScrollBar;
02200 
02207 class THistoryViewer : public TListViewer
02208 {
02209 public:
02224     THistoryViewer( const TRect& bounds,
02225                     TScrollBar *aHScrollBar,
02226                     TScrollBar *aVScrollBar,
02227                     ushort aHistoryId
02228                   );
02232     virtual TPalette& getPalette() const;
02238     virtual void getText( char *dest, short item, short maxLen );
02248     virtual void handleEvent( TEvent& event );
02253     int historyWidth();
02254 protected:
02259     ushort historyId;
02260 };
02261 
02262 #endif  // Uses_THistoryViewer
02263 
02264 #if defined( Uses_THistoryWindow ) && !defined( __THistoryWindow )
02265 #define __THistoryWindow
02266 
02267 class TListViewer;
02268 class TRect;
02269 class TWindow;
02270 class TInputLine;
02271 
02282 class THistInit
02283 {
02284 public:
02293     THistInit( TListViewer *(*cListViewer)( TRect r, TWindow *w,
02294         ushort histID ));
02295 protected:
02302     TListViewer *(*createListViewer)( TRect r, TWindow *w, ushort histId );
02303 };
02304 
02305 /* ---------------------------------------------------------------------- */
02306 /*      THistoryWindow                                                    */
02307 /*                                                                        */
02308 /*      Palette layout                                                    */
02309 /*        1 = Frame passive                                               */
02310 /*        2 = Frame active                                                */
02311 /*        3 = Frame icon                                                  */
02312 /*        4 = ScrollBar page area                                         */
02313 /*        5 = ScrollBar controls                                          */
02314 /*        6 = HistoryViewer normal text                                   */
02315 /*        7 = HistoryViewer selected text                                 */
02316 /* ---------------------------------------------------------------------- */
02317 
02328 class THistoryWindow : public TWindow, public virtual THistInit
02329 {
02330 public:
02352     THistoryWindow( const TRect& bounds, ushort historyId );
02356     virtual TPalette& getPalette() const;
02361     virtual void getSelection( char *dest );
02370     static TListViewer *initViewer( TRect bounds, TWindow *w, ushort
02371         aHistoryId );
02372 protected:
02376     TListViewer *viewer;
02377 };
02378 
02379 #endif  // Uses_THistoryWindow
02380 
02381 #if defined( Uses_THistory ) && !defined( __THistory )
02382 #define __THistory
02383 
02384 class TRect;
02385 class TInputLine;
02386 class TEvent;
02387 class THistoryWindow;
02388 
02404 class THistory : public TView
02405 {
02406 public:
02418     THistory( const TRect& bounds, TInputLine *aLink, ushort aHistoryId );
02422     virtual void draw();
02426     virtual TPalette& getPalette() const;
02432     virtual void handleEvent( TEvent& event );
02443     virtual THistoryWindow *initHistoryWindow( const TRect& bounds );
02447     virtual void recordHistory(const char *s);
02455     virtual void shutDown();
02459     static const char * icon;
02460 protected:
02464     TInputLine *link;
02471     ushort historyId;
02472 private:
02473     virtual const char *streamableName() const
02474         { return name; }
02475 protected:
02482     THistory( StreamableInit );
02486     virtual void write( opstream& os );
02490     virtual void *read( ipstream& is );
02491 public:
02495     static const char * const name;
02499     static TStreamable *build();
02500 };
02501 
02505 inline ipstream& operator >> ( ipstream& is, THistory& cl )
02506     { return is >> (TStreamable&)cl; }
02510 inline ipstream& operator >> ( ipstream& is, THistory*& cl )
02511     { return is >> (void *&)cl; }
02512 
02516 inline opstream& operator << ( opstream& os, THistory& cl )
02517     { return os << (TStreamable&)cl; }
02521 inline opstream& operator << ( opstream& os, THistory* cl )
02522     { return os << (TStreamable *)cl; }
02523 
02524 #endif  // Uses_THistory

Generated at Sat Sep 22 20:19:08 2001 for TVision by doxygen1.2.8.1 written by Dimitri van Heesch, © 1997-2001