home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
OS/2 Shareware BBS: 10 Tools
/
10-Tools.zip
/
yacl-012.zip
/
ui
/
orbtngrp.h
< prev
next >
Wrap
C/C++ Source or Header
|
1995-04-08
|
3KB
|
106 lines
#ifndef _orbtngrp_h_ /* Tue Nov 22 09:04:24 1994 */
#define _orbtngrp_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 OrButtonGroup is a SimpleVObject that has an IntegerSet as model. The
// set contains the ViewID's of those buttons in the group that are chosen
// (or checked). If the contained buttons are ToggleButtons, the model
// may possibly contain more than one id; if they are ExOrToggleButtons,
// the model will contain at most one id (it may contain none, if no
// button in the group is checked).
#if defined(__GNUC__)
#pragma interface
#endif
#include "ui/btngroup.h"
#include "ui/composit.h"
class CL_EXPORT UI_OrButtonGroup: public UI_ButtonGroup {
public:
UI_OrButtonGroup (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_IntegerSet& Selection ();
// Return the current state of the selections, as a set of integers
// containing the id's of the selected buttons. The return value may be
// modified via the Set methods, and this results in modification of the
// display.
CL_Object& Model () {return Selection();};
#if defined(__MS_WINDOWS__)
UI_OrButtonGroup (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:
CL_IntegerSet _selection;
bool _ModelChanged (CL_Object&, long);
bool Select ();
private:
void _Init ();
void _UpdateSelection ();
};
#endif /* _orbtngrp_h_ */