home *** CD-ROM | disk | FTP | other *** search
/ Tools / WinSN5.0Ver.iso / NETSCAP.50 / WIN1998.ZIP / ns / lib / mac / UserInterface / CToolbarButton.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-04-08  |  1.8 KB  |  62 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. // This is a subclass of CButton that can draw itself in three states:
  20. // text and icon, text only, or icon only.
  21.  
  22. // ******** NOTE! ********
  23. // So that we don't disturb any PPob's, this class assumes that the size of
  24. // the button in the PPob is the size to use for the text and icon mode.
  25. // For the other modes, there are "magic" constants (in CToolbarButton.cp)
  26. // that define the frame dimensions of the button.
  27.  
  28. #pragma once
  29.  
  30. #include "CButton.h"
  31.  
  32. class CToolbarButton
  33.     :    public CButton
  34. {
  35.     public:
  36.         enum {
  37.             eMode_IconsOnly = 0,
  38.             eMode_TextOnly,
  39.             eMode_IconsAndText
  40.         };
  41.  
  42.         enum {    defaultMode = eMode_IconsAndText    };
  43.  
  44.         enum {    class_ID = 'TbBt' };
  45.         
  46.                             CToolbarButton(LStream* inStream);
  47.         virtual                ~CToolbarButton();
  48.  
  49.         virtual Boolean        ChangeMode(Int8 newMode, SDimension16& outDimensionDeltas);
  50.  
  51.     protected:
  52.         virtual    void        DrawSelf();
  53.         virtual void        FinishCreateSelf();
  54.  
  55.         virtual    void        DrawButtonTitle(void);
  56.  
  57.         virtual    void        CalcTitleFrame(void);
  58.  
  59.         Int8        mCurrentMode;
  60.         Int16        mOriginalWidth;
  61.         Int16        mOriginalHeight;
  62. };