home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: SysTools / SysTools.zip / sysba021.zip / SRC.ZIP / sysbar2 / sysbar2.h < prev    next >
C/C++ Source or Header  |  2003-01-03  |  5KB  |  157 lines

  1. /*
  2.  
  3.   SysBar/2 Utility Set  version 0.21
  4.  
  5.   SYSBAR2.DLL public library definitions
  6.  
  7.   ..................................................................
  8.  
  9.   Copyright (c) 1995-1999  Dmitry I. Platonoff
  10.                            All rights reserved
  11.  
  12.                          dplatonoff@canada.com
  13.  
  14.   ..................................................................
  15.  
  16.   LICENSE
  17.   ~~~~~~~
  18.   Redistribution and use in source and binary forms, with or without
  19.   modification, are permitted provided that the following conditions
  20.   are met:
  21.  
  22.   1. Redistributions of source code must retain the above copyright
  23.      notice, this list of conditions and the following disclaimer.
  24.  
  25.   2. Redistributions in binary form must reproduce the above
  26.      copyright notice, this list of conditions and the following
  27.      disclaimer in the documentation and/or other materials provided
  28.      with the distribution.
  29.  
  30.   3. Redistributions of any form whatsoever, as well as all
  31.      advertising materials mentioning features or use of this
  32.      software (if any), must include the following acknowledgment:
  33.      "This product includes software developed by Dmitry I. Platonoff".
  34.  
  35.   4. The names "SysBar/2" and "Dmitry I. Platonoff" must not be
  36.      used to endorse or promote products derived from this software
  37.      without prior written permission. For such permission, please
  38.      contact dplatonoff@canada.com.
  39.  
  40.   5. Products derived from this software may not be called
  41.      "SysBar/2" nor may "Dmitry I. Platonoff" appear in their
  42.      contributor lists without prior written permission.
  43.  
  44.   ..................................................................
  45.  
  46.   DISCLAIMER
  47.   ~~~~~~~~~~
  48.   THIS SOFTWARE IS PROVIDED BY THE AUTHOR OR CONTRIBUTORS "AS IS"
  49.   AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
  50.   LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
  51.   FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
  52.   AUTHOR OR THE CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
  53.   INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
  54.   (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
  55.   SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
  56.   HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT,
  57.   STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
  58.   ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
  59.   ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  60.  
  61. */
  62.  
  63. #include "ffile.h"
  64.  
  65.  
  66. #define SB2c_Filler   CLR_DARKGRAY
  67. #define SB2c_Brighter CLR_PALEGRAY
  68. #define SB2c_Darker   CLR_BLACK
  69. //#define SB2c_Filler   CLR_PALEGRAY
  70. //#define SB2c_Brighter CLR_WHITE
  71. //#define SB2c_Darker   CLR_DARKGRAY
  72. #define DLG_PROPERTIES       2100
  73. #define D_Prop_Notebook      2101
  74.  
  75.  
  76. extern HMODULE SB2_Init( void );
  77. extern void SB2_Over( void );
  78.  
  79. extern char* SB2_Strings( int iIndex );
  80. const int iSB2S_Version = 0;
  81. const int iSB2S_Copyright = 1;
  82. const int iSB2S_Email = 2;
  83.  
  84.  
  85. extern ULONG SB2_AddDlgPage( HWND hwnd, ULONG ulNotebookID,
  86.   char *pszTabText, char *pszComment );
  87.  
  88. extern char *SB2_CfgFilename( char *pszCfg, char *pszExe );
  89.  
  90. extern void SB2_LargeDigits( HPS hps, int x, int y, char *pszString,
  91.   short int bMonochrome, short int bLarge, int iCount = 0 );
  92. extern void SB2_SmallDigits( HPS hps, int x, int y, char *pszString, 
  93.   short int bMonochrome, short int bLarge, int iCount = 0 );
  94.  
  95. extern void SB2_Border( HPS hps, int iLeft, int iBottom, int iRight, int iTop,
  96.   short int iRaised = 1, int iFiller = SB2c_Filler, int bOutlined = 0 );
  97.  
  98. extern void SB2_Button( HPS hps, int iLeft, int iBottom, int iRight, int iTop,
  99.   short int iRaised, HBITMAP hBitmap, int iBitmapWidth, int iBitmapHeight );
  100.  
  101.  
  102.  
  103. // INI-style file reader
  104. class IniFile : public ffile
  105. {
  106. public:
  107.   IniFile( char* pszFilename, const char* pszMode = "rt" ) :  //Constructor
  108.     ffile( pszFilename, pszMode ) {}                 //to open a file
  109.  
  110.   char* Read( void );  //Method to read a line from the file and strip
  111.                //extra spaces & comments
  112.  
  113.            //Method to get the first value of entry from specified section
  114.   char* Get( char* pszSection, char* pszEntry, char* pszDefault = NULL );
  115.  
  116.   char* GetNext( char* pszEntry );  //Get the next value of the same entry
  117.  
  118. };
  119.  
  120. extern void SB2_LoadFontCfg( char *pszSection, FATTRS *pF, IniFile *pCfg );
  121. extern void SB2_SaveFontCfg( char *pszSection, FATTRS *pF, FILE *f );
  122.  
  123. extern void SB2_FillColorList( HWND hwnd, ULONG ulID, int iSelected = 0 );
  124. extern char* SB2_ColorName( int iIndex );
  125. extern int SB2_ColorValue( int iIndex );
  126. extern int SB2_ColorA2I( char *pszName );
  127. extern int SB2_ColorCount( void );
  128.  
  129. extern char* SB2_ParseValue( char *s, int& i );
  130. extern char* SB2_ParseValue( char *s, char *d );
  131.  
  132.  
  133. class DescWindow
  134. {
  135.   char *pszText;
  136. public:
  137.  
  138.   HWND hwDescFrame;
  139.   HWND hwDescClient;
  140.   int iDescX;
  141.   int iDescY;
  142.   int iDescWidth;
  143.   int iDescHeight;
  144.  
  145.   DescWindow( void );
  146.   ~DescWindow( void );
  147.   HWND CreateWindow( char *pszClassName );
  148.   void SetText( char *pszText );
  149.   void Hide( void );
  150.   void AdjustSize( FATTRS *pF, HWND hwnd );
  151.   void AdjustPos( int x, int y, int dx, int dy, int bVertical );
  152.   void MoveTo( int x, int y );
  153.   void Paint( FATTRS *pF, HWND hwnd );
  154. };
  155.  
  156.  
  157.