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

views.h

Go to the documentation of this file.
00001 /*
00002  * views.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( __COMMAND_CODES )
00013 #define __COMMAND_CODES
00014 
00019 const ushort
00020 
00021 //  Standard command codes
00022 
00023     cmValid         = 0,
00024     cmQuit          = 1,
00025     cmError         = 2,
00026     cmMenu          = 3,
00027     cmClose         = 4,
00028     cmZoom          = 5,
00029     cmResize        = 6,
00030     cmNext          = 7,
00031     cmPrev          = 8,
00032     cmHelp          = 9,
00033 
00034 //  TDialog standard commands
00035 
00036     cmOK            = 10,
00037     cmCancel        = 11,
00038     cmYes           = 12,
00039     cmNo            = 13,
00040     cmDefault       = 14,
00041 
00042 // Standard application commands
00043 
00044     cmNew           = 30,
00045     cmOpen          = 31,
00046     cmSave          = 32,
00047     cmSaveAs        = 33,
00048     cmSaveAll       = 34,
00049     cmChDir         = 35,
00050     cmDosShell      = 36,
00051     cmCloseAll      = 37,
00052 
00053     // SS: some new internal commands.
00054 
00055     cmSysRepaint    = 38,
00056     cmSysResize     = 39,
00057     cmSysWakeup     = 40,
00058 
00059 //  TView State masks
00060 
00069     sfVisible       = 0x001,
00070 
00077     sfCursorVis     = 0x002,
00078 
00085     sfCursorIns     = 0x004,
00086 
00091     sfShadow        = 0x008,
00092 
00097     sfActive        = 0x010,
00098 
00107     sfSelected      = 0x020,
00108 
00115     sfFocused       = 0x040,
00116 
00121     sfDragging      = 0x080,
00122 
00128     sfDisabled      = 0x100,
00129 
00144     sfModal         = 0x200,
00145 
00151     sfDefault       = 0x400,
00152 
00161     sfExposed       = 0x800,
00162 
00163 // TView Option masks
00164 
00171     ofSelectable    = 0x001,
00172 
00182     ofTopSelect     = 0x002,
00183 
00192     ofFirstClick    = 0x004,
00193 
00201     ofFramed        = 0x008,
00202 
00209     ofPreProcess    = 0x010,
00210 
00217     ofPostProcess   = 0x020,
00218 
00229     ofBuffered      = 0x040,
00230 
00236     ofTileable      = 0x080,
00237 
00243     ofCenterX       = 0x100,
00244 
00250     ofCenterY       = 0x200,
00251 
00257     ofCentered      = 0x300,
00258 
00263     ofValidate      = 0x400,
00264 
00265 // TView GrowMode masks
00266 
00273     gfGrowLoX       = 0x01,
00274 
00280     gfGrowLoY       = 0x02,
00281 
00287     gfGrowHiX       = 0x04,
00288 
00294     gfGrowHiY       = 0x08,
00295 
00300     gfGrowAll       = 0x0f,
00301 
00308     gfGrowRel       = 0x10,
00309 
00314     gfFixed         = 0x20,
00315 
00316 // TView DragMode masks
00317 
00322     dmDragMove      = 0x01,
00323 
00328     dmDragGrow      = 0x02,
00329 
00334     dmLimitLoX      = 0x10,
00335 
00340     dmLimitLoY      = 0x20,
00341 
00346     dmLimitHiX      = 0x40,
00347 
00352     dmLimitHiY      = 0x80,
00353 
00358     dmLimitAll      = dmLimitLoX | dmLimitLoY | dmLimitHiX | dmLimitHiY,
00359 
00360 // TView Help context codes
00361 
00366     hcNoContext     = 0,
00367 
00372     hcDragging      = 1,
00373 
00374 // TScrollBar part codes
00375 
00380     sbLeftArrow     = 0,
00381 
00386     sbRightArrow    = 1,
00387 
00392     sbPageLeft      = 2,
00393 
00398     sbPageRight     = 3,
00399 
00404     sbUpArrow       = 4,
00405 
00410     sbDownArrow     = 5,
00411 
00416     sbPageUp        = 6,
00417 
00422     sbPageDown      = 7,
00423 
00428     sbIndicator     = 8,
00429 
00430 // TScrollBar options for TWindow.StandardScrollBar
00431 
00436     sbHorizontal    = 0x000,
00437 
00442     sbVertical      = 0x001,
00443 
00448     sbHandleKeyboard = 0x002,
00449 
00450 // TWindow Flags masks
00451 
00456     wfMove          = 0x01,
00457 
00462     wfGrow          = 0x02,
00463 
00469     wfClose         = 0x04,
00470 
00475     wfZoom          = 0x08,
00476 
00477 //  TView inhibit flags
00478 
00479     noMenuBar       = 0x0001,
00480     noDeskTop       = 0x0002,
00481     noStatusLine    = 0x0004,
00482     noBackground    = 0x0008,
00483     noFrame         = 0x0010,
00484     noViewer        = 0x0020,
00485     noHistory       = 0x0040,
00486 
00487 // TWindow number constants
00488 
00494     wnNoNumber      = 0,
00495 
00496 // TWindow palette entries
00497 
00502     wpBlueWindow    = 0,
00503 
00508     wpCyanWindow    = 1,
00509 
00514     wpGrayWindow    = 2,
00515 
00516 //  Application command codes
00517 
00518     cmCut           = 20,
00519     cmCopy          = 21,
00520     cmPaste         = 22,
00521     cmUndo          = 23,
00522     cmClear         = 24,
00523     cmTile          = 25,
00524     cmCascade       = 26,
00525 
00526 // Standard messages
00527 
00528     cmReceivedFocus     = 50,
00529     cmReleasedFocus     = 51,
00530     cmCommandSetChanged = 52,
00531 
00532 // TScrollBar messages
00533 
00534     cmScrollBarChanged  = 53,
00535     cmScrollBarClicked  = 54,
00536 
00537 // TWindow select messages
00538 
00539     cmSelectWindowNum   = 55,
00540 
00541 //  TListViewer messages
00542 
00543     cmListItemSelected  = 56,
00544 
00545 //  Event masks
00546 
00555     positionalEvents    = evMouse,
00556 
00565     focusedEvents       = evKeyboard | evCommand;
00566 
00567 #endif  // __COMMAND_CODES
00568 
00569 #if defined( Uses_TCommandSet ) && !defined( __TCommandSet )
00570 #define __TCommandSet
00571 
00584 class TCommandSet
00585 {
00586 public:
00592     TCommandSet();
00599     TCommandSet( const TCommandSet& tc );
00603     Boolean has( int cmd );
00607     void disableCmd( int cmd );
00611     void enableCmd( int cmd );
00615     void operator += ( int cmd );
00619     void operator -= ( int cmd );
00623     void disableCmd( const TCommandSet& tc );
00627     void enableCmd( const TCommandSet& tc );
00631     void operator += ( const TCommandSet& tc );
00635     void operator -= ( const TCommandSet& tc );
00639     Boolean isEmpty();
00646     TCommandSet& operator &= ( const TCommandSet& tc);
00653     TCommandSet& operator |= ( const TCommandSet& tc);
00660     friend TCommandSet operator & ( const TCommandSet&, const TCommandSet& );
00667     friend TCommandSet operator | ( const TCommandSet&, const TCommandSet& );
00673     friend int operator == ( const TCommandSet& tc1, const TCommandSet& tc2 );
00679     friend int operator != ( const TCommandSet& tc1, const TCommandSet& tc2 );
00680 private:
00684     int loc( int );
00688     int mask( int );
00692     static int masks[8];
00696     uchar cmds[32];
00697 };
00698 
00699 inline void TCommandSet::operator += ( int cmd )
00700 {
00701     enableCmd( cmd );
00702 }
00703 
00704 inline void TCommandSet::operator -= ( int cmd )
00705 {
00706     disableCmd( cmd );
00707 }
00708 
00709 inline void TCommandSet::operator += ( const TCommandSet& tc )
00710 {
00711     enableCmd( tc );
00712 }
00713 
00714 inline void TCommandSet::operator -= ( const TCommandSet& tc )
00715 {
00716     disableCmd( tc );
00717 }
00718 
00719 inline int operator != ( const TCommandSet& tc1, const TCommandSet& tc2 )
00720 {
00721     return !operator == ( tc1, tc2 );
00722 }
00723 
00724 inline int TCommandSet::loc( int cmd )
00725 {
00726     return cmd / 8;
00727 }
00728 
00729 inline int TCommandSet::mask( int cmd )
00730 {
00731     return masks[ cmd & 0x07 ];
00732 }
00733 
00734 #endif  // Uses_TCommandSet
00735 
00736 #if defined( Uses_TPalette ) && !defined( __TPalette )
00737 #define __TPalette
00738 
00752 class TPalette
00753 {
00754 public:
00760     TPalette( const char *d, ushort len );
00764     TPalette( const TPalette& tp );
00768     ~TPalette();
00772     TPalette& operator = ( const TPalette& tp );
00777     uchar& operator[]( int index ) const;
00781     uchar *data;
00782 };
00783 
00784 #endif  // Uses_TPalette
00785 
00786 #if defined( Uses_TView ) && !defined( __TView )
00787 #define __TView
00788 
00789 class TRect;
00790 class TEvent;
00791 class TGroup;
00792 
00807 class TView : public TObject, public TStreamable
00808 {
00809 public:
00814     enum phaseType { phFocused, phPreProcess, phPostProcess };
00818     enum selectMode{ normalSelect, enterSelect, leaveSelect };
00840     TView( const TRect& bounds );
00844     ~TView();
00853     virtual void sizeLimits( TPoint& min, TPoint& max );
00861     TRect getBounds();
00868     TRect getExtent();
00876     TRect getClipRect();
00882     Boolean mouseInView( TPoint mouse );
00892     Boolean containsMouse( TEvent& event );
00901     void locate( TRect& bounds );
00913     virtual void dragView( TEvent& event, uchar mode,  //  temporary fix
00914       TRect& limits, TPoint minSize, TPoint maxSize ); //  for Miller's stuff
00926     virtual void calcBounds( TRect& bounds, TPoint delta );
00938     virtual void changeBounds( const TRect& bounds );
00943     void growTo( short x, short y );
00948     void moveTo( short x, short y );
00959     void setBounds( const TRect& bounds );
00965     virtual ushort getHelpCtx();
00984     virtual Boolean valid( ushort command );
00989     void hide();
00995     void show();
01013     virtual void draw();
01024     void drawView();
01035     Boolean exposed();
01048     Boolean focus();
01053     void hideCursor();
01059     void drawHide( TView *lastView );
01065     void drawShow( TView *lastView );
01075     void drawUnderRect( TRect& r, TView *lastView );
01082     void drawUnderView( Boolean doShadow, TView *lastView );
01092     virtual ushort dataSize();
01101     virtual void getData( void *rec );
01110     virtual void setData( void *rec );
01121     virtual void awaken();
01127     void blockCursor();
01133     void normalCursor();
01137     virtual void resetCursor();
01142     void setCursor( int x, int y );
01147     void showCursor();
01153     void drawCursor();
01160     void clearEvent( TEvent& event );
01166     Boolean eventAvail();
01174     virtual void getEvent( TEvent& event );
01198     virtual void handleEvent( TEvent& event );
01218     virtual void putEvent( TEvent& event );
01227     static Boolean commandEnabled( ushort command );
01232     static void disableCommands( TCommandSet& commands );
01237     static void enableCommands( TCommandSet& commands );
01242     static void disableCommand( ushort command );
01247     static void enableCommand( ushort command );
01251     static void getCommands( TCommandSet& commands );
01255     static void setCommands( TCommandSet& commands );
01259     static void setCmdState( TCommandSet& commands, Boolean enable);
01269     virtual void endModal( ushort command );
01278     virtual ushort execute();
01284     ushort getColor( ushort color );
01296     virtual TPalette& getPalette() const;
01307     uchar mapColor( uchar );
01312     Boolean getState( ushort aState );
01322     void select();
01338     virtual void setState( ushort aState, Boolean enable );
01344     void keyEvent( TEvent& event );
01379     Boolean mouseEvent( TEvent& event, ushort mask );
01384     TPoint makeGlobal( TPoint source );
01397     TPoint makeLocal( TPoint source );
01403     TView *nextView();
01412     TView *prevView();
01421     TView *prev();
01426     TView *next;
01433     void makeFirst();
01453     void putInFrontOf( TView *Target );
01457     TView *TopView();
01464     void writeBuf(  short x, short y, short w, short h, const void* b );
01471     void writeBuf(  short x, short y, short w, short h, const TDrawBuffer& b );
01477     void writeChar( short x, short y, char c, uchar color, short count );
01485     void writeLine( short x, short y, short w, short h, const TDrawBuffer& b );
01493     void writeLine( short x, short y, short w, short h, const void *b );
01499     void writeStr( short x, short y, const char *str, uchar color );
01503     TPoint size;
01579     ushort options;
01589     ushort eventMask;
01665     ushort state;
01670     TPoint origin;
01680     TPoint cursor;
01718     uchar growMode;
01740     uchar dragMode;
01764     ushort helpCtx;
01774     static Boolean commandSetChanged;
01775 #ifndef GENINC
01776 
01792     static TCommandSet curCommandSet;
01793 #endif
01794 
01799     TGroup *owner;
01806     static Boolean showMarkers;
01815     static uchar errorAttr;
01822     virtual void shutDown();
01823 private:
01827     void moveGrow( TPoint p,
01828                    TPoint s,
01829                    TRect& limits,
01830                    TPoint minSize,
01831                    TPoint maxSize,
01832                    uchar mode
01833                  );
01837     void change( uchar, TPoint delta, TPoint& p, TPoint& s, ulong ctrlState );
01841     int exposedRec1(short int, short int, class TView *);
01845     int exposedRec2(short int, short int, class TView *);
01849     void writeView(short int, short int, short int, const void *);
01853     void writeViewRec1(short int, short int, class TView *, int);
01857     void writeViewRec2(short int, short int, class TView *, int);
01861     virtual const char *streamableName() const
01862         { return name; }
01863 protected:
01870     TView( StreamableInit );
01871 public:
01875     static const char * const name;
01879     static TStreamable *build();
01880 protected:
01884     virtual void write( opstream& os );
01888     virtual void *read( ipstream& is );
01889 };
01890 
01894 inline ipstream& operator >> ( ipstream& is, TView& cl )
01895     { return is >> (TStreamable&)cl; }
01899 inline ipstream& operator >> ( ipstream& is, TView*& cl )
01900     { return is >> (void *&)cl; }
01901 
01905 inline opstream& operator << ( opstream& os, TView& cl )
01906     { return os << (TStreamable&)cl; }
01910 inline opstream& operator << ( opstream& os, TView* cl )
01911     { return os << (TStreamable *)cl; }
01912 
01913 inline void TView::writeBuf( short x, short y, short w, short h,
01914                              const TDrawBuffer& b )
01915 {
01916     writeBuf( x, y, w, h, b.data );
01917 }
01918 
01919 inline void TView::writeLine( short x, short y, short w, short h,
01920                               const TDrawBuffer& b )
01921 {
01922     writeLine( x, y, w, h, b.data );
01923 }
01924 
01925 #endif  // Uses_TView
01926 
01927 /* ---------------------------------------------------------------------- */
01928 /*      class TFrame                                                      */
01929 /*                                                                        */
01930 /*      Palette layout                                                    */
01931 /*        1 = Passive frame                                               */
01932 /*        2 = Passive title                                               */
01933 /*        3 = Active frame                                                */
01934 /*        4 = Active title                                                */
01935 /*        5 = Icons                                                       */
01936 /* ---------------------------------------------------------------------- */
01937 
01938 #if defined( Uses_TFrame ) && !defined( __TFrame )
01939 #define __TFrame
01940 
01941 class TRect;
01942 class TEvent;
01943 class TDrawBuffer;
01944 
01951 class TFrame : public TView
01952 {
01953 public:
01961     TFrame( const TRect& bounds );
01972     virtual void draw();
01977     virtual TPalette& getPalette() const;
01989     virtual void handleEvent( TEvent& event );
01998     virtual void setState( ushort aState, Boolean enable );
02002     static char frameChars[33];
02006     static const char * closeIcon;
02010     static const char * dragIcon;
02011 private:
02015     void frameLine( TDrawBuffer& frameBuf, short y, short n, uchar color );
02019     void dragWindow( TEvent& event, uchar dragMode );
02023     friend class TDisplay;
02027     static const char initFrame[19];
02031     static const char * zoomIcon;
02035     static const char * unZoomIcon;
02039     virtual const char *streamableName() const
02040         { return name; }
02041 protected:
02049     TFrame( StreamableInit );
02050 public:
02054     static const char * const name;
02059     static TStreamable *build();
02060 };
02061 
02065 inline ipstream& operator >> ( ipstream& is, TFrame& cl )
02066     { return is >> (TStreamable&)cl; }
02070 inline ipstream& operator >> ( ipstream& is, TFrame*& cl )
02071     { return is >> (void *&)cl; }
02072 
02076 inline opstream& operator << ( opstream& os, TFrame& cl )
02077     { return os << (TStreamable&)cl; }
02081 inline opstream& operator << ( opstream& os, TFrame* cl )
02082     { return os << (TStreamable *)cl; }
02083 
02084 #endif  // Uses_TFrame
02085 
02086 /* ---------------------------------------------------------------------- */
02087 /*      class TScrollBar                                                  */
02088 /*                                                                        */
02089 /*      Palette layout                                                    */
02090 /*        1 = Page areas                                                  */
02091 /*        2 = Arrows                                                      */
02092 /*        3 = Indicator                                                   */
02093 /* ---------------------------------------------------------------------- */
02094 
02095 #if defined( Uses_TScrollBar ) && !defined( __TScrollBar )
02096 #define __TScrollBar
02097 
02098 class TRect;
02099 class TEvent;
02100 
02106 typedef char TScrollChars[5];
02107 
02111 class TScrollBar : public TView
02112 {
02113 public:
02128     TScrollBar( const TRect& bounds );
02133     virtual void draw();
02137     virtual TPalette& getPalette() const;
02148     virtual void handleEvent( TEvent& event );
02159     virtual void scrollDraw();
02186     virtual int scrollStep( int part );
02195     void setParams( int aValue, int aMin, int aMax,
02196                     int aPgStep, int aArStep );
02204     void setRange( int aMin, int aMax );
02211     void setStep( int aPgStep, int aArStep );
02218     void setValue( int aValue );
02222     void drawPos( int pos );
02226     int getPos();
02230     int getSize();
02239     int value;
02250     TScrollChars chars;
02255     int minVal;
02260     int maxVal;
02272     int pgStep;
02281     int arStep;
02285     static TScrollChars vChars;
02289     static TScrollChars hChars;
02290 private:
02294     int getPartCode(void);
02298     virtual const char *streamableName() const
02299         { return name; }
02300 protected:
02307     TScrollBar( StreamableInit );
02311     virtual void write( opstream& os );
02315     virtual void *read( ipstream& is );
02316 public:
02320     static const char * const name;
02324     static TStreamable *build();
02325 };
02326 
02330 inline ipstream& operator >> ( ipstream& is, TScrollBar& cl )
02331     { return is >> (TStreamable&)cl; }
02335 inline ipstream& operator >> ( ipstream& is, TScrollBar*& cl )
02336     { return is >> (void *&)cl; }
02337 
02341 inline opstream& operator << ( opstream& os, TScrollBar& cl )
02342     { return os << (TStreamable&)cl; }
02346 inline opstream& operator << ( opstream& os, TScrollBar* cl )
02347     { return os << (TStreamable *)cl; }
02348 
02349 #endif  // Uses_TScrollBar
02350 
02351 /* ---------------------------------------------------------------------- */
02352 /*      class TScroller                                                   */
02353 /*                                                                        */
02354 /*      Palette layout                                                    */
02355 /*      1 = Normal text                                                   */
02356 /*      2 = Selected text                                                 */
02357 /* ---------------------------------------------------------------------- */
02358 
02359 #if defined( Uses_TScroller ) && !defined( __TScroller )
02360 #define __TScroller
02361 
02362 class TRect;
02363 class TScrollBar;
02364 class TEvent;
02365 
02379 class TScroller : public TView
02380 {
02381 public:
02389     TScroller( const TRect& bounds,
02390                TScrollBar *aHScrollBar,
02391                TScrollBar *aVScrollBar
02392              );
02398     virtual void changeBounds( const TRect& bounds );
02402     virtual TPalette& getPalette() const;
02409     virtual void handleEvent( TEvent& event );
02415     virtual void scrollDraw();
02423     void scrollTo( int x, int y );
02428     void setLimit( int x, int y );
02436     virtual void setState( ushort aState, Boolean enable );
02446     void checkDraw();
02453     virtual void shutDown();
02466     TPoint delta;
02467 protected:
02471     uchar drawLock;
02475     Boolean drawFlag;
02480     TScrollBar *hScrollBar;
02485     TScrollBar *vScrollBar;
02491     TPoint limit;
02492 private:
02496     void showSBar( TScrollBar *sBar );
02500     virtual const char *streamableName() const
02501         { return name; }
02502 protected:
02509     TScroller( StreamableInit );
02513     virtual void write( opstream& os );
02517     virtual void *read( ipstream& is );
02518 public:
02522     static const char * const name;
02526     static TStreamable *build();
02527 };
02528 
02532 inline ipstream& operator >> ( ipstream& is, TScroller& cl )
02533     { return is >> (TStreamable&)cl; }
02537 inline ipstream& operator >> ( ipstream& is, TScroller*& cl )
02538     { return is >> (void *&)cl; }
02539 
02543 inline opstream& operator << ( opstream& os, TScroller& cl )
02544     { return os << (TStreamable&)cl; }
02548 inline opstream& operator << ( opstream& os, TScroller* cl )
02549     { return os << (TStreamable *)cl; }
02550 
02551 #endif  // Uses_TScroller
02552 
02553 #if defined( Uses_TListViewer ) && !defined( __TListViewer )
02554 #define __TListViewer
02555 
02556 class TRect;
02557 class TScrollBar;
02558 class TEvent;
02559 
02584 class TListViewer : public TView
02585 {
02586     static const char * emptyText;
02587 public:
02605     TListViewer( const TRect& bounds,
02606                  ushort aNumCols,
02607                  TScrollBar *aHScrollBar,
02608                  TScrollBar *aVScrollBar
02609                );
02617     virtual void changeBounds( const TRect& bounds );
02624     virtual void draw();
02630     virtual void focusItem( short item );
02634     virtual TPalette& getPalette() const;
02642     virtual void getText( char *dest, short item, short maxLen );
02647     virtual Boolean isSelected( short item );
02662     virtual void handleEvent( TEvent& event );
02672     virtual void selectItem( short item );
02683     void setRange( short aRange );
02695     virtual void setState( ushort aState, Boolean enable );
02700     virtual void focusItemNum( short item );
02707     virtual void shutDown();
02712     TScrollBar *hScrollBar;
02717     TScrollBar *vScrollBar;
02721     short numCols;
02728     short topItem;
02734     short focused;
02739     short range;
02743     static char separatorChar;
02744 private:
02745     virtual const char *streamableName() const
02746         { return name; }
02747 protected:
02754     TListViewer( StreamableInit );
02758     virtual void write( opstream& os );
02762     virtual void *read( ipstream& is );
02763 public:
02767     static const char * const name;
02771     static TStreamable *build();
02772 };
02773 
02777 inline ipstream& operator >> ( ipstream& is, TListViewer& cl )
02778     { return is >> (TStreamable&)cl; }
02782 inline ipstream& operator >> ( ipstream& is, TListViewer*& cl )
02783     { return is >> (void *&)cl; }
02784 
02788 inline opstream& operator << ( opstream& os, TListViewer& cl )
02789     { return os << (TStreamable&)cl; }
02793 inline opstream& operator << ( opstream& os, TListViewer* cl )
02794     { return os << (TStreamable *)cl; }
02795 
02796 #endif  // Uses_TListViewer
02797 
02798 #if defined( Uses_TGroup ) && !defined( __TGroup )
02799 #define __TGroup
02800 
02801 class TView;
02802 
02848 class TGroup : public TView
02849 {
02850 public:
02857     TGroup( const TRect& bounds );
02863     ~TGroup();
02871     virtual void shutDown();
02897     ushort execView( TView *p );
02907     virtual ushort execute();
02912     virtual void awaken();
02916     void insertView( TView *p, TView *Target );
02921     void remove( TView *p );
02926     void removeView( TView *p );
02942     void resetCurrent();
02954     void setCurrent( TView *p, selectMode mode );
02962     void selectNext( Boolean forwards );
02990     TView *firstThat( Boolean (*func)( TView *, void * ), void *args );
02994     Boolean focusNext(Boolean forwards);
03017     void forEach( void (*func)( TView *, void * ), void *args );
03031     void insert( TView *p );
03037     void insertBefore( TView *p, TView *Target );
03042     TView *current;
03046     TView *at( short index );
03051     TView *firstMatch( ushort aState, ushort aOptions );
03055     short indexOf( TView *p );
03060     Boolean matches( TView *p );
03065     TView *first();
03079     virtual void setState( ushort aState, Boolean enable );
03111     virtual void handleEvent( TEvent& event );
03116     void drawSubViews( TView *p, TView *bottom );
03122     virtual void changeBounds( const TRect& bounds );
03129     virtual ushort dataSize();
03137     virtual void getData( void *rec );
03145     virtual void setData( void *rec );
03154     virtual void draw();
03160     void redraw();
03181     void lock();
03188     void unlock();
03192     virtual void resetCursor();
03202     virtual void endModal( ushort command );
03213     virtual void eventError( TEvent& event );
03222     virtual ushort getHelpCtx();
03232     virtual Boolean valid( ushort command );
03237     void freeBuffer();
03245     void getBuffer();
03250     TView *last;
03257     TRect clip;
03272     phaseType phase;
03279     ushort *buffer;
03291     uchar lockFlag;
03295     ushort endState;
03296 private:
03300     Boolean invalid( TView *p, ushort command );
03304     void focusView( TView *p, Boolean enable );
03308     void selectView( TView *p, Boolean enable );
03312     TView* findNext(Boolean forwards);
03316     virtual const char *streamableName() const
03317         { return name; }
03318 protected:
03325     TGroup( StreamableInit );
03329     virtual void write( opstream& os );
03333     virtual void *read( ipstream& is );
03334 public:
03338     static const char * const name;
03342     static TStreamable *build();
03343 };
03344 
03348 inline ipstream& operator >> ( ipstream& is, TGroup& cl )
03349     { return is >> (TStreamable&)cl; }
03353 inline ipstream& operator >> ( ipstream& is, TGroup*& cl )
03354     { return is >> (void *&)cl; }
03355 
03359 inline opstream& operator << ( opstream& os, TGroup& cl )
03360     { return os << (TStreamable&)cl; }
03364 inline opstream& operator << ( opstream& os, TGroup* cl )
03365     { return os << (TStreamable *)cl; }
03366 
03367 #endif  // Uses_TGroup
03368 
03369 #if defined( Uses_TWindow ) && !defined( __TWindow )
03370 #define __TWindow
03371 
03372 #define cpBlueWindow "\x08\x09\x0A\x0B\x0C\x0D\x0E\x0F"
03373 #define cpCyanWindow "\x10\x11\x12\x13\x14\x15\x16\x17"
03374 #define cpGrayWindow "\x18\x19\x1A\x1B\x1C\x1D\x1E\x1F"
03375 
03376 class TFrame;
03377 class TRect;
03378 class TPoint;
03379 class TEvent;
03380 class TFrame;
03381 class TScrollBar;
03382 
03392 class TWindowInit
03393 {
03394 public:
03407     TWindowInit( TFrame *(*cFrame)( TRect bounds ) );
03408 protected:
03414     TFrame *(*createFrame)( TRect bounds );
03415 };
03416 
03417 /* ---------------------------------------------------------------------- */
03418 /*      class TWindow                                                     */
03419 /*                                                                        */
03420 /*      Palette layout                                                    */
03421 /*        1 = Frame passive                                               */
03422 /*        2 = Frame active                                                */
03423 /*        3 = Frame icon                                                  */
03424 /*        4 = ScrollBar page area                                         */
03425 /*        5 = ScrollBar controls                                          */
03426 /*        6 = Scroller normal text                                        */
03427 /*        7 = Scroller selected text                                      */
03428 /*        8 = Reserved                                                    */
03429 /* ---------------------------------------------------------------------- */
03430 
03441 class TWindow: public TGroup, public virtual TWindowInit
03442 {
03443 public:
03469     TWindow( const TRect& bounds,
03470              const char *aTitle,
03471              short aNumber
03472            );
03477     ~TWindow();
03483     virtual void close();
03488     virtual TPalette& getPalette() const;
03492     virtual const char *getTitle( short maxSize );
03510     virtual void handleEvent( TEvent& event );
03518     static TFrame *initFrame( TRect );
03528     virtual void setState( ushort aState, Boolean enable );
03539     virtual void sizeLimits( TPoint& min, TPoint& max );
03564     TScrollBar *standardScrollBar( ushort aOptions );
03571     virtual void zoom();
03578     virtual void shutDown();
03604     uchar flags;
03608     TRect zoomRect;
03614     short number;
03631     short palette;
03635     TFrame *frame;
03640     const char *title;
03641 private:
03642     virtual const char *streamableName() const
03643         { return name; }
03644 protected:
03651     TWindow( StreamableInit );
03655     virtual void write( opstream& os );
03659     virtual void *read( ipstream& is );
03660 public:
03664     static const char * const name;
03668     static TStreamable *build();
03669 };
03670 
03674 inline ipstream& operator >> ( ipstream& is, TWindow& cl )
03675     { return is >> (TStreamable&)cl; }
03679 inline ipstream& operator >> ( ipstream& is, TWindow*& cl )
03680     { return is >> (void *&)cl; }
03681 
03685 inline opstream& operator << ( opstream& os, TWindow& cl )
03686     { return os << (TStreamable&)cl; }
03690 inline opstream& operator << ( opstream& os, TWindow* cl )
03691     { return os << (TStreamable *)cl; }
03692 
03693 #endif  // Uses_TWindow

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