home *** CD-ROM | disk | FTP | other *** search
/ Tools / WinSN5.0Ver.iso / NETSCAP.50 / WIN1998.ZIP / ns / lib / mac / UserInterface / CPaneEnabler.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-04-08  |  2.4 KB  |  68 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. // CPaneEnabler is a more general form of CButtonEnabler, originally written by John R. McMullen.
  20. // The generalization was done by Mark Young.
  21.  
  22. // CSlaveEnabler was written by John R. McMullen
  23.  
  24. #pragma once
  25.  
  26. #include "LAttachment.h"
  27.  
  28. class LPane;
  29.  
  30. //======================================
  31. class CPaneEnabler : public LAttachment
  32. // This enables a pane based on FindCommandStatus (or another policy if the pane
  33. // inherits from MPaneEnablerPolicy
  34. //======================================
  35. {
  36. public:
  37.     enum { class_ID = 'BtEn' }; // It used to be CButtonEnabler (thus the class_ID 'BtEn')
  38.                     CPaneEnabler(LStream* inStream);
  39.     virtual            ~CPaneEnabler();
  40.     virtual    void    ExecuteSelf(MessageT inMessage, void *ioParam);
  41.     static void        UpdatePanes();
  42. protected:
  43.     LPane*            mPane;
  44. }; // class CPaneEnabler
  45.  
  46. //======================================
  47. class CSlaveEnabler
  48. // This enables a pane based on another control with the same superview.  When the
  49. // controlling control is on, this pane enables.  When the controlling control is off,
  50. // this pane disables.  The controlling control is typically a checkbox or radio button.
  51. //======================================
  52. :    public LAttachment
  53. ,    public LListener
  54. {
  55. public:
  56.     enum { class_ID = 'Slav' };
  57.                     CSlaveEnabler(LStream* inStream);
  58.     virtual    void    ExecuteSelf(MessageT inMessage, void *ioParam);
  59.     virtual    void    ListenToMessage(MessageT inMessage, void *ioParam);
  60. protected:
  61.     void            Update(SInt32 inValue);
  62. protected:
  63.     PaneIDT            mControllingID; // read from stream
  64.     LPane*             mPane;
  65.     LControl*        mControllingControl;
  66. }; // class CPaneEnabler
  67.  
  68.