home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
yacl-012.zip
/
ui
/
xrbtngrp.h
< prev
next >
Wrap
C/C++ Source or Header
|
1995-04-08
|
3KB
|
105 lines
#ifndef _xrbtngrp_h_ /* Tue Nov 22 09:36:40 1994 */
#define _xrbtngrp_h_
/*
*
* Copyright (C) 1994, M. A. Sridhar
*
*
* This software is Copyright M. A. Sridhar, 1994. You are free
* to copy, modify or distribute this software as you see fit,
* and to use it for any purpose, provided this copyright
* notice and the following disclaimer are included with all
* copies.
*
* DISCLAIMER
*
* The author makes no warranties, either expressed or implied,
* with respect to this software, its quality, performance,
* merchantability, or fitness for any particular purpose. This
* software is distributed AS IS. The user of this software
* assumes all risks as to its quality and performance. In no
* event shall the author be liable for any direct, indirect or
* consequential damages, even if the author has been advised
* as to the possibility of such damages.
*
*/
// An ExOrButtonGroup is a SimpleVObject that has an Integer as model. The
// visual representation of the ExOrButtonGroup is a group of toggle buttons
// (``radio buttons'' under MS-Windows), at most one of which may be
// selected at any given time. The Integer model contains the view id of the
// button currently selected, and the {\tt Selection} method returns this
// view id.
#if defined(__GNUC__)
#pragma interface
#endif
#include "base/integer.h"
#include "ui/composit.h"
#include "ui/btngroup.h"
class CL_EXPORT UI_ExOrButtonGroup: public UI_ButtonGroup {
public:
UI_ExOrButtonGroup (UI_VObjCollection* parent,
const UI_Rectangle& shape,
UI_ViewID id = -1, UI_ViewDescriptor* vd = NULL);
// Constructor: creates an empty ButtonGroup as a child of {\tt
// parent}, with the given shape and view ID.
virtual CL_Integer& Selection ();
// Return the view ID of the currently selected toggle button, as a {\tt
// CL_Integer}. The return value may be
// modified via the Integer methods, and this results in modification of
// the display.
CL_Object& Model () {return Selection();};
#if defined(__MS_WINDOWS__)
UI_ExOrButtonGroup (UI_CompositeVObject* parent, UI_ViewID id,
UI_ViewHandle h);
// Resource-based construction (only under MS-Windows). This assumes
// that (1) all (and only) the buttons in the group are geometrically
// contained within the button group box's rectangle, (2) the
// contained buttons occur immediately after the group box in the
// resource file ordering, and (3) the group box has a valid id.
// Therefore, this does not allow (in particular) for groups within groups.
#endif
protected:
bool _ModelChanged (CL_Object&, long);
bool HandleChildEvent (const UI_Event& e);
CL_Integer _selection;
private:
void _Init ();
void _UpdateSelection ();
};
#endif /* _xrbtngrp_h_ */