! 
! @OPENGROUP_COPYRIGHT@
! COPYRIGHT NOTICE
! Copyright (c) 1990, 1991, 1992, 1993 Open Software Foundation, Inc.
! Copyright (c) 1996, 1997, 1998, 1999, 2000 The Open Group
! ALL RIGHTS RESERVED (MOTIF). See the file named COPYRIGHT.MOTIF for
! the full copyright text.
! 
! This software is subject to an open license. It may only be
! used on, with or for operating systems which are themselves open
! source systems. You must contact The Open Group for a license
! allowing distribution and sublicensing of this software on, with,
! or for operating systems which are not Open Source programs.
! 
! See http://www.opengroup.org/openmotif/license for full
! details of the license agreement. Any use, reproduction, or
! distribution of the program constitutes recipient's acceptance of
! this agreement.
! 
! EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, THE PROGRAM IS
! PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
! KIND, EITHER EXPRESS OR IMPLIED INCLUDING, WITHOUT LIMITATION, ANY
! WARRANTIES OR CONDITIONS OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY
! OR FITNESS FOR A PARTICULAR PURPOSE
! 
! EXCEPT AS EXPRESSLY SET FORTH IN THIS AGREEMENT, NEITHER RECIPIENT
! NOR ANY CONTRIBUTORS SHALL HAVE ANY LIABILITY FOR ANY DIRECT,
! INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
! DAMAGES (INCLUDING WITHOUT LIMITATION LOST PROFITS), HOWEVER CAUSED
! AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
! LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
! ANY WAY OUT OF THE USE OR DISTRIBUTION OF THE PROGRAM OR THE
! EXERCISE OF ANY RIGHTS GRANTED HEREUNDER, EVEN IF ADVISED OF THE
! POSSIBILITY OF SUCH DAMAGES.
! 
! 
! HISTORY
! 
!   $XConsortium: textedit.uil /main/5 1995/07/14 09:44:46 drk $
!******************************************************************************

!************************************************************
!     textedit.uil -- description of interface
!
!  Describes widget hierarchy of main window & dialogues
!
!************************************************************

module textedit

names = case_sensitive

include file 'strings.uil';

list
	changeView_controls : controls { };

include file 'menus.uih';

!  Define callback procedures

procedure
    ToggleOpCB();
    ToggleKeepFileDialogueCB();
    ToggleRevertToOpenCB();
    TextChangedCB();
    TextGainFocusCB();
    TextLoseFocusCB();
    TextGainPrimaryCB();
    TextLosePrimaryCB();
    SplitCB();
    RemovePaneCB();
    OnePaneCB();
    OkFileCB();
    CancelFileCB();
    SaveYesCB();
    SaveNoCB();
    SaveCancelCB();
    WarnCancelCB();
    QuestionYesCB();
    DefaultFontCB();
    SetFontCB(string);
    AddFontCB(string);
    DefaultColorCB();
    SetColorCB(string);
    AddColorCB(string);
    RemoveLinesCB();
    StrikethruCB(integer);
    UnderlineCB(any);

!identifiers for application values
!identifier
value
	textOnlyFormat : 1;
	byteStreamFormat : 2;
	helpMarkupFormat : 3;

!-----------------------------------------------------------------
!   The Main Window Hierarchy
!-----------------------------------------------------------------

object mainWindow:  XmMainWindow {
    arguments {
        XmNmenuBar = XmMenuBar menuBar;
    };
    controls {
        XmPanedWindow panedWindow;
        XmMenuBar menuBar;
    };
};

object panedWindow: XmPanedWindow{
    controls {
        XmScrolledCSText textFirst;
    };
};

object textFirst: XmScrolledCSText {
    callbacks {
	XmNvalueChangedCallback = procedure TextChangedCB();
	XmNfocusCallback = procedure TextGainFocusCB();
	XmNlosingFocusCallback = procedure TextLoseFocusCB();
	XmNgainPrimaryCallback = procedure TextGainPrimaryCB();
	XmNlosePrimaryCallback = procedure TextLosePrimaryCB();
    };
    arguments {
     XmNeditMode = XmMULTI_LINE_EDIT;
	XmNallowResize = true;
	XmNrows = 24;
	XmNcolumns = 80;
        XmNpaneMinimum = 20;
    };
};

object menuBar: XmMenuBar {
    arguments {
	XmNmenuHelpWidget = XmCascadeButton helpButton;
    };
    controls {
     XmCascadeButton fileButton;
	XmCascadeButton editButton;
	XmCascadeButton viewButton;
	XmCascadeButton optionsButton;
	XmCascadeButton renditionsButton;
	XmCascadeButton helpButton;
    };
};


object optionsButton: XmCascadeButton {
    arguments {
        XmNlabelString = optionsString;
        XmNmnemonic = optionsMnemonic; 
    };
    controls {
        XmPulldownMenu optionsMenu;
    };
};

object renditionsButton: XmCascadeButton {
    arguments {
        XmNlabelString = renditionsString;
        XmNmnemonic = renditionsMnemonic; 
    };
    controls {
	   XmPulldownMenu renditionsMenu;
    };
};

object optionsMenu: XmPulldownMenu {
    controls {
	XmToggleButton keepToggle;
	XmToggleButton revertToggle;
    };
};

object removeButton: XmPushButton {
    arguments {
        XmNlabelString = removeString;
        XmNmnemonic = removeMnemonic; 
    };
    callbacks {
        XmNactivateCallback = procedure RemoveCB();
    };
};

object splitButton: XmPushButton {
    arguments {
        XmNlabelString = splitString;
        XmNmnemonic = splitMnemonic;
    };
    callbacks {
        XmNactivateCallback = procedure SplitCB();
    };
};

object removePaneButton: XmPushButton {
    arguments {
        XmNlabelString = removePaneString;
        XmNmnemonic = removePaneMnemonic;
    };
    callbacks {
        XmNactivateCallback = procedure RemovePaneCB();
    };
};

object onePaneButton: XmPushButton {
    arguments {
        XmNlabelString = onePaneString;
        XmNmnemonic = onePaneMnemonic;
    };
    callbacks {
        XmNactivateCallback = procedure OnePaneCB();
    };
};

object keepToggle: XmToggleButton {
    arguments {
        XmNlabelString = keepToggleString;
	XmNset = false;
    };
    callbacks {
        XmNvalueChangedCallback = procedure ToggleKeepFileDialogueCB();
    };
};

object revertToggle: XmToggleButton {
    arguments {
        XmNlabelString = revertToggleString;
	XmNset = true;
    };
    callbacks {
        XmNvalueChangedCallback = procedure ToggleRevertToOpenCB();
    };
};

object renditionsMenu : XmPulldownMenu {
    controls {
        XmCascadeButton fontsButton;
        XmCascadeButton colorsButton;
        XmCascadeButton linesButton;
    };
};

object fontsButton: XmCascadeButton {
    arguments {
        XmNlabelString = fontsString;
!        XmNmnemonic = fontsMnemonic; 
    };
    controls {
        XmPulldownMenu fontsMenu;
    };
};

object colorsButton: XmCascadeButton {
    arguments {
        XmNlabelString = colorsString;
!        XmNmnemonic = colorsMnemonic; 
    };
    controls {
        XmPulldownMenu colorsMenu;
    };
};

object linesButton: XmCascadeButton {
    arguments {
        XmNlabelString = linesString;
!        XmNmnemonic = linesMnemonic; 
    };
    controls {
        XmPulldownMenu linesMenu;
    };
};

object fontsMenu: XmPulldownMenu {
    controls {
        XmPushButton defaultFontButton;
        XmPushButton font1Button;
        XmPushButton font2Button;
        XmPushButton font3Button;
    };
};

object defaultFontButton: XmPushButton {
    arguments {
        XmNlabelString = defaultFontString;
!        XmNmnemonic = Mnemonic;
    };
    callbacks {
        XmNactivateCallback = procedure DefaultFontCB();
    };
};

object font1Button: XmPushButton {
    arguments {
        XmNlabelString = font1String;
!        XmNmnemonic = Mnemonic;
    };
    callbacks {
        XmNactivateCallback = procedure SetFontCB(font1String);
	   MrmNcreateCallback = procedure AddFontCB(font1String);
    };
};

object font2Button: XmPushButton {
    arguments {
        XmNlabelString = font2String;
!        XmNmnemonic = Mnemonic;
    };
    callbacks {
        XmNactivateCallback = procedure SetFontCB(font2String);
	   MrmNcreateCallback = procedure AddFontCB(font2String);
    };
};

object font3Button: XmPushButton {
    arguments {
        XmNlabelString = font3String;
!        XmNmnemonic = Mnemonic;
    };
    callbacks {
        XmNactivateCallback = procedure SetFontCB(font3String);
	   MrmNcreateCallback = procedure AddFontCB(font3String);
    };
};


object colorsMenu: XmPulldownMenu {
    controls {
        XmPushButton defaultColorButton;
        XmPushButton color1Button;
        XmPushButton color2Button;
        XmPushButton color3Button;
    };
};

object defaultColorButton: XmPushButton {
    arguments {
        XmNlabelString = defaultColorString;
!        XmNmnemonic = Mnemonic;
    };
    callbacks {
        XmNactivateCallback = procedure DefaultColorCB();
    };
};

object color1Button: XmPushButton {
    arguments {
        XmNlabelString = color1String;
!        XmNmnemonic = Mnemonic;
    };
    callbacks {
        XmNactivateCallback = procedure SetColorCB(color1String);
	   MrmNcreateCallback = procedure AddColorCB(color1String);
    };
};

object color2Button: XmPushButton {
    arguments {
        XmNlabelString = color2String;
!        XmNmnemonic = Mnemonic;
    };
    callbacks {
        XmNactivateCallback = procedure SetColorCB(color2String);
	   MrmNcreateCallback = procedure AddColorCB(color2String);
    };
};

object color3Button: XmPushButton {
    arguments {
        XmNlabelString = color3String;
!        XmNmnemonic = Mnemonic;
    };
    callbacks {
        XmNactivateCallback = procedure SetColorCB(color3String);
	   MrmNcreateCallback = procedure AddColorCB(color3String);
    };
};

object linesMenu: XmPulldownMenu {
    controls {
        XmPushButton noLineButton;
        XmPushButton strikethruButton;
        XmPushButton underlineButton;
    };
};

object noLineButton: XmPushButton {
    arguments {
        XmNlabelString = noLineString;
!        XmNmnemonic = Mnemonic;
    };
    callbacks {
        XmNactivateCallback = procedure RemoveLinesCB();
    };
};

object strikethruButton: XmPushButton {
    arguments {
        XmNlabelString = strikethruString;
!        XmNmnemonic = Mnemonic;
    };
    callbacks {
        XmNactivateCallback = procedure StrikethruCB(XmSINGLE_LINE);
    };
};

object underlineButton: XmPushButton {
    arguments {
        XmNlabelString = underlineString;
!        XmNmnemonic = Mnemonic;
    };
    callbacks {
!        XmNactivateCallback = procedure UnderlineCB(1);
        XmNactivateCallback = procedure UnderlineCB(XmSINGLE_LINE);
    };
};

!-----------------------------------------------------------------

!  Provides a template for subsequently created text panes

object textPane: XmScrolledCSText {
    callbacks {
	XmNvalueChangedCallback = procedure TextChangedCB();
	XmNfocusCallback = procedure TextGainFocusCB();
	XmNgainPrimaryCallback = procedure TextGainPrimaryCB();
	XmNlosePrimaryCallback = procedure TextLosePrimaryCB();
	XmNlosingFocusCallback = procedure TextLoseFocusCB();
    };
    arguments {
        XmNeditMode = XmMULTI_LINE_EDIT;
	XmNallowResize = true;
    };
};

!  A text widget to hold onto the shared source for all the text panes

object textStore: XmCSText {
    arguments {
        XmNeditMode = XmMULTI_LINE_EDIT;
    };
};

!-----------------------------------------------------------------
!   The File Selection Box Hierarchy
!-----------------------------------------------------------------

object fileDialog: XmFileSelectionDialog {
    callbacks {
        XmNokCallback = procedure OkFileCB();
        XmNcancelCallback = procedure CancelFileCB();
    };
    controls {
        XmRowColumn extraBox;
    };
};

object extraBox: XmRowColumn {
    arguments {
	XmNorientation = XmVERTICAL;
    };
    controls {
!	XmFrame statusFrame;
	XmOptionMenu formatMenu;
	XmFrame opFrame;
    };
};

object statusFrame: XmFrame {
    controls {
        XmRowColumn statusCheckPanel;
    };
};

object formatMenu: XmOptionMenu {
    arguments {
		XmNlabelString = formatMenuString;
    };
    controls {
	XmPulldownMenu {
	    controls {
		XmPushButton { arguments {
		    XmNlabelString = textOnlyString;
		    XmNuserData = textOnlyFormat;
		}; };
		XmPushButton { arguments {
		    XmNlabelString = byteStreamString;
		    XmNuserData = byteStreamFormat;
		}; };
		XmPushButton { arguments {
		    XmNlabelString = helpMarkupString;
		    XmNuserData = helpMarkupFormat;
		}; };
	   };
	};
   };
};

object opFrame: XmFrame {
    controls {
        XmRadioBox opRadioBox;
    };
};

object statusCheckPanel: XmRowColumn {
    arguments {
	XmNorientation = XmVERTICAL;
    };
    controls {
	XmToggleButton keepToggle;
	XmToggleButton revertToggle;
    };
};

object opRadioBox: XmRadioBox {
    arguments {
	XmNorientation = XmHORIZONTAL;
	XmNpacking = XmPACK_COLUMN;
    };
    callbacks {
        XmNentryCallback = procedure ToggleOpCB();
    };
    controls {
	XmToggleButton openToggle;
	XmToggleButton saveToggle;
	XmToggleButton copyToggle;
	XmToggleButton moveToggle;
    };
};

object openToggle: XmToggleButton {
    arguments {
        XmNlabelString = openToggleString;
    };
};

object saveToggle: XmToggleButton {
    arguments {
        XmNlabelString = saveString;
    };
};

object copyToggle: XmToggleButton {
    arguments {
        XmNlabelString = copyString;
    };
};

object moveToggle: XmToggleButton {
    arguments {
        XmNlabelString = moveToggleString;
    };
};

!-----------------------------------------------------------------
!  The Save Dialog Hierarchy
!-----------------------------------------------------------------

object saveDialog: XmFormDialog {
    arguments {
 	XmNcancelButton = cancelButton;
 	XmNdefaultButton = yesButton;
 	XmNdialogStyle = XmDIALOG_FULL_APPLICATION_MODAL;
        XmNdialogTitle = editSaveString;
 	XmNnoResize = false;
    };
    controls {
        XmLabel warnpixLabel;
	XmLabel questionLabel;
	XmPushButton yesButton;
	XmPushButton noButton;
	XmPushButton cancelButton;
	};
};

object warnpixLabel: XmLabel {
    arguments {
        XmNlabelType = XmPIXMAP;
	XmNlabelPixmap = xbitmapfile( 'xm_warning' );
	XmNleftAttachment = XmATTACH_FORM;
	XmNleftOffset = 10;
	XmNtopAttachment = XmATTACH_FORM;
	XmNtopOffset = 10;
    };
};

object questionLabel: XmLabel {
    arguments {
	XmNlabelString = editSaveString;
	XmNleftAttachment = XmATTACH_WIDGET;
        XmNleftWidget = warnpixLabel;
	XmNleftOffset = 10;
	XmNrightAttachment = XmATTACH_FORM;
	XmNrightOffset = 8;
	XmNbottomAttachment = XmATTACH_OPPOSITE_WIDGET;
	XmNbottomWidget = warnpixLabel;
    };
};

object yesButton: XmPushButton {
    arguments {
	XmNlabelString = yesString;
	XmNleftAttachment = XmATTACH_OPPOSITE_WIDGET;
        XmNleftWidget = questionLabel;
	XmNleftOffset = -20;
	XmNtopAttachment = XmATTACH_WIDGET;
	XmNtopWidget = questionLabel;
	XmNtopOffset = 10;
	XmNbottomAttachment = XmATTACH_FORM;
	XmNbottomOffset = 8;
    };
    callbacks {
        XmNactivateCallback = procedure SaveYesCB();
    };
};

object noButton: XmPushButton {
    arguments {
	XmNlabelString = noString;
	XmNleftAttachment = XmATTACH_WIDGET;
        XmNleftWidget = yesButton;
	XmNleftOffset = 10;
	XmNbottomAttachment = XmATTACH_OPPOSITE_WIDGET;
	XmNbottomWidget = yesButton;
	XmNtopAttachment = XmATTACH_NONE;
    };
    callbacks {
        XmNactivateCallback = procedure SaveNoCB();
    };
};

object cancelButton: XmPushButton {
    arguments {
	XmNlabelString = cancelString;
	XmNleftAttachment = XmATTACH_WIDGET;
        XmNleftWidget = noButton;
	XmNleftOffset = 10;
	XmNrightAttachment = XmATTACH_FORM;
	XmNrightOffset = 8;
	XmNbottomAttachment = XmATTACH_OPPOSITE_WIDGET;
	XmNbottomWidget = yesButton;
	XmNtopAttachment = XmATTACH_NONE;
    };
    callbacks {
        XmNactivateCallback = procedure SaveCancelCB();
    };
};

!-----------------------------------------------------------------
!  The Warning Dialog Hierarchy
!-----------------------------------------------------------------

object warnDialog: XmWarningDialog {
    arguments {
        XmNdialogTitle = warnString;
    };
    callbacks {
        XmNcancelCallback = procedure WarnCancelCB();
    };
};

!-----------------------------------------------------------------
!  The Question Dialog Hierarchy
!-----------------------------------------------------------------

object questionDialog: XmQuestionDialog {
    arguments {
        XmNdialogTitle = questionString;
        XmNmessageString = questionDeleteString;
        XmNokLabelString = yesString;
        XmNcancelLabelString = noString;
    };
    callbacks {
        XmNokCallback = procedure QuestionYesCB();
    };
};

end module;
