home *** CD-ROM | disk | FTP | other *** search
- /*
- * Copyright (C) 1994, Silicon Graphics, Inc.
- * All Rights Reserved.
- *
- * This is UNPUBLISHED PROPRIETARY SOURCE CODE of Silicon Graphics, Inc.;
- * the contents of this file may not be disclosed to third parties, copied or
- * duplicated in any form, in whole or in part, without the prior written
- * permission of Silicon Graphics, Inc.
- *
- * RESTRICTED RIGHTS LEGEND:
- * Use, duplication or disclosure by the Government is subject to restrictions
- * as set forth in subdivision (c)(1)(ii) of the Rights in Technical Data
- * and Computer Software clause at DFARS 252.227-7013, and/or in similar or
- * successor clauses in the FAR, DOD or NASA FAR Supplement. Unpublished -
- * rights reserved under the Copyright Laws of the United States.
- */
- #ifndef VKGROUPBOX_H
- #define VKGROUPBOX_H
- ///////////////////////////////////////////////////////////////////////////////
- // THIS SUCKER IS OBSOLETE. IN MOTIF 1.2 JUST USE PLAIN OLD FRAME WIDGET!!!!
- // DON'T USE THIS CLASS ANYMORE.
- // I MODIFY IT TO USE FRAME WIDGET, AND PUT EVERYTHING IN THIS .h FILE.
- // (Ivan 1/5/94)
- ///////////////////////////////////////////////////////////////////////////////
-
-
- //////////////////////////////////////////////////////////////////////////
- // VkGroupBox.h - Logically group children inside a labeled frame.
- //
- // author -- hajadi@csd
- // notes: This is probably better implemented as variation of
- // frame widget.
- //////////////////////////////////////////////////////////////////////////
-
-
- enum Attachment { LEFT, CENTER, RIGHT };
-
- #include "OkArgs.h"
-
- #include <Vk/VkComponent.h>
-
- #include <Xm/LabelG.h>
- #include <Xm/Frame.h>
-
- class VkGroupBox : public VkComponent {
-
- private:
- Boolean _built;
- Widget _title;
-
-
- protected:
- virtual Widget setUpInterface( Widget parent ) = 0;
-
- public:
- VkGroupBox( Widget parent, const char* name, Attachment attach = CENTER ) :
- VkComponent( name )
- {
- _baseWidget = XmCreateFrame( parent, _name, NULL, 0 );
- installDestroyHandler();
-
- unsigned char alignment = XmALIGNMENT_CENTER;
- if ( attach==LEFT )
- alignment = XmALIGNMENT_BEGINNING;
- else if ( attach==RIGHT )
- alignment = XmALIGNMENT_END;
-
- OkArgs args( 2 );
- args.set( XmNchildType, XmFRAME_TITLE_CHILD );
- args.set( XmNchildHorizontalAlignment, alignment );
- _title = XmCreateLabelGadget( _baseWidget, "title",
- args.list(), args.count() );
- XtManageChild( _title );
- _built = False;
- }
-
- ~VkGroupBox() {};
- virtual const char *className() { return "VkGroupBox"; }
-
- void show()
- {
- if ( !_built )
- XtManageChild( setUpInterface( _baseWidget ) );
- VkComponent::show();
- }
-
- Widget view() const { return frame(); }
- Widget title() const { return _title; }
- Widget frame() const { return _baseWidget; }
-
-
- };
-
-
-
- #endif // VKGROUPBOX_H
-