home *** CD-ROM | disk | FTP | other *** search
/ Nebula 2 / Nebula Two.iso / SourceCode / MiscKit1.7.1 / MiscKit / Palettes / MiscTableScroll / MiscTableUtil.h < prev    next >
Encoding:
C/C++ Source or Header  |  1996-02-11  |  2.3 KB  |  62 lines

  1. #ifndef __MiscTableUtil_h
  2. #define __MiscTableUtil_h
  3. //=============================================================================
  4. //
  5. //        Copyright (C) 1995 by Paul S. McCarthy and Eric Sunshine.
  6. //                Written by Paul S. McCarthy and Eric Sunshine.
  7. //                            All Rights Reserved.
  8. //
  9. //        This notice may not be removed from this source code.
  10. //
  11. //        This object is included in the MiscKit by permission from the authors
  12. //        and its use is governed by the MiscKit license, found in the file
  13. //        "License.rtf" in the MiscKit distribution.    Please refer to that file
  14. //        for a list of all applicable permissions and restrictions.
  15. //        
  16. //=============================================================================
  17. //-----------------------------------------------------------------------------
  18. // MiscTableTypes.h
  19. //
  20. //        Common inline functions used by the MiscTableScroll object.
  21. //
  22. //-----------------------------------------------------------------------------
  23. //-----------------------------------------------------------------------------
  24. // $Id: MiscTableUtil.h,v 1.1 95/09/27 12:21:21 zarnuk Exp $
  25. // $Log:        MiscTableUtil.h,v $
  26. //    Revision 1.1  95/09/27    12:21:21  zarnuk
  27. //    Initial revision
  28. //    
  29. //-----------------------------------------------------------------------------
  30.  
  31. #include <misckit/MiscTableTypes.h>
  32. #include "bool.h"
  33.  
  34. inline MiscBorderType otherBorder( MiscBorderType t )
  35.     { return (t == MISC_COL_BORDER) ? MISC_ROW_BORDER : MISC_COL_BORDER; }
  36.  
  37. inline bool isFixed( MiscTableSizing x )
  38.         { return x == MISC_NUSER_NDATA_NSPRINGY_SIZING; }
  39.  
  40. inline bool isSpringy( MiscTableSizing x )
  41.         { return (((int)x) & MISC_SIZING_SPRINGY_BIT) != 0; }
  42.  
  43. inline bool isSizeable( MiscTableSizing x )
  44.         { return (((int)x) & MISC_SIZING_USER_BIT) != 0; }
  45.  
  46. inline bool isData( MiscTableSizing x )
  47.         { return (((int)x) & MISC_SIZING_DATA_BIT) != 0; }
  48.  
  49. inline MiscTableSizing setAttribute( MiscTableSizing x, int bit, bool b )
  50.         { return (MiscTableSizing) (b ? ((int)x | bit) : ((int)x & ~bit)); }
  51.  
  52. inline MiscTableSizing setSpringy( MiscTableSizing x, bool b )
  53.         { return setAttribute( x, MISC_SIZING_SPRINGY_BIT, b ); }
  54.  
  55. inline MiscTableSizing setSizeable( MiscTableSizing x, bool b )
  56.         { return setAttribute( x, MISC_SIZING_USER_BIT, b ); }
  57.  
  58. inline MiscTableSizing setData( MiscTableSizing x, bool b )
  59.         { return setAttribute( x, MISC_SIZING_DATA_BIT, b ); }
  60.  
  61. #endif    // __MiscTableUtil_h
  62.