home *** CD-ROM | disk | FTP | other *** search
/ Tools / WinSN5.0Ver.iso / NETSCAP.50 / WIN1998.ZIP / ns / cmd / winfe / tclist.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-04-08  |  2.2 KB  |  75 lines

  1. /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*-
  2.  *
  3.  * The contents of this file are subject to the Netscape Public License
  4.  * Version 1.0 (the "NPL"); you may not use this file except in
  5.  * compliance with the NPL.  You may obtain a copy of the NPL at
  6.  * http://www.mozilla.org/NPL/
  7.  *
  8.  * Software distributed under the NPL is distributed on an "AS IS" basis,
  9.  * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the NPL
  10.  * for the specific language governing rights and limitations under the
  11.  * NPL.
  12.  *
  13.  * The Initial Developer of this code under the NPL is Netscape
  14.  * Communications Corporation.  Portions created by Netscape are
  15.  * Copyright (C) 1998 Netscape Communications Corporation.  All Rights
  16.  * Reserved.
  17.  */
  18.  
  19. // TabList.h : header file
  20. //
  21.  
  22. /////////////////////////////////////////////////////////////////////////////
  23. // CTCList window
  24. #define MIN_TAB_SIZE        4    // minimum number of tab settings
  25.  
  26. class CTCList : public CListBox
  27. {
  28. // Construction
  29. public:
  30.     CTCList();
  31.  
  32. // Attributes
  33. public:
  34.     void    SetColumnSpace(int nSpacing);
  35.  
  36. // Overrides
  37.     // ClassWizard generated virtual function overrides
  38.     //{{AFX_VIRTUAL(CTCList)
  39.     //}}AFX_VIRTUAL
  40.  
  41. // Implementation
  42. public:
  43.     virtual ~CTCList();
  44.  
  45.     // Generated message map functions
  46. protected:
  47.     //{{AFX_MSG(CTCList)
  48.     afx_msg LRESULT OnAddString(WPARAM wParam, LPARAM lParam);
  49.     afx_msg LRESULT OnInsertString(WPARAM wParam, LPARAM lParam);
  50.     afx_msg LRESULT OnDeleteString(WPARAM wParam, LPARAM lParam);
  51.     //}}AFX_MSG
  52.  
  53.     DECLARE_MESSAGE_MAP()
  54.  
  55.     // Helper methods
  56.     void    CalculateAvgCharWidth(CDC* pDC);
  57.     void    CalculateTabs();
  58.     BOOL    CalculateColWidths(LPCSTR pString, BOOL bSetWidths = TRUE);
  59.     void    InitColWidth();
  60.     void    Recalc();  
  61.  
  62.  
  63.     int            m_nAvgCharWidth;    // avg character width
  64.     int            m_nSpacing;            // number of column spaces
  65.     CUIntArray    m_aTabs;            // array of tab settings
  66.     CUIntArray    m_aColWidth;        // array of maximum column widths
  67.     UINT        m_nTabs;            // number of tabs
  68.     
  69.     // character set used to calculate average character width,
  70.     // only allocate one character set for all instances of classes
  71.     static CString m_strCharSet;
  72. };
  73.  
  74. /////////////////////////////////////////////////////////////////////////////
  75.