home *** CD-ROM | disk | FTP | other *** search
/ Tools / WinSN5.0Ver.iso / NETSCAP.50 / WIN1998.ZIP / ns / cmd / xfe / src / RadioGroup.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-04-08  |  2.0 KB  |  72 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.    RadioGroup.h -- Radio groups that don't have to share the same row column parent.
  20.    Created: Chris Toshok <toshok@netscape.com>, 28-Sep-96.
  21.  */
  22.  
  23.  
  24.  
  25. #ifndef _xfe_radiogroup_h
  26. #define _xfe_radiogroup_h
  27.  
  28. #include "xp_core.h"
  29. #include "xp_list.h"
  30. #include <X11/Intrinsic.h>
  31. #include "Frame.h"
  32.  
  33. class XFE_RadioGroup {
  34. public:
  35.  
  36.   char *getName();
  37.   XFE_Frame *getFrame();
  38.  
  39.   void addChild(Widget w);
  40.   void removeChild(Widget w);
  41.  
  42.   //returns a named radio group, creating it if it doesn't already exist.
  43.   static XFE_RadioGroup *getByName(char *name, XFE_Frame *forFrame);
  44.  
  45. private:
  46.   char *m_name;
  47.   XFE_Frame *m_frame;
  48.  
  49.   Boolean m_incallback;
  50.   Widget m_callbackwidget;
  51.  
  52.   XP_List *m_children;
  53.  
  54.   static void registerGroup(XFE_RadioGroup *group);
  55.   static void unregisterGroup(XFE_RadioGroup *group);
  56.   static XP_List *groups;
  57.  
  58.   // keep these private.  Only use the getByName() method above to actually get at
  59.   // a XFE_RadioGroup.
  60.   XFE_RadioGroup(char *name, XFE_Frame *frame);
  61.   ~XFE_RadioGroup();
  62.  
  63.   void toggle(Widget w);
  64.   static void toggle_cb(Widget w, XtPointer clientData, XtPointer callData);
  65.  
  66. #ifdef DEBUG
  67.   char *getLabel(Widget w);
  68. #endif
  69. };
  70.  
  71. #endif /* _xfe_radiogroup_h */
  72.