!
!
! demo.uil - Xmp widget demo application UIL file.
!
!

module demo

objects = { XmPushButton = gadget; }

include file ("Xmp.uil");	! Xmp widget definitions

procedure
	ManageCb(string);
	ExitCb();

object appMain : XmMainWindow {
    arguments {
	XmNmenuBar = XmMenuBar menuBar;
	XmNworkWindow = XmFrame workArea;
    };
    controls {
	XmMenuBar menuBar;
	XmFrame workArea;
	unmanaged XmInformationDialog helpDialog;
    };
    callbacks {
	XmNhelpCallback = procedure ManageCb("*helpDialog");
    };
};


!***********************************************************************
object menuBar : XmMenuBar {
    arguments { XmNmenuHelpWidget = XmCascadeButton helpCascade; };
    controls {
        XmCascadeButton fileCascade;
        XmCascadeButton helpCascade;
    };
};
object fileCascade : XmCascadeButton {
    arguments { XmNlabelString ="File"; XmNmnemonic = keysym("F"); };
    controls { XmPulldownMenu { controls {
	XmPushButton exitButton;
    }; }; };
};
object exitButton : XmPushButton {
    arguments { XmNlabelString = "Exit"; XmNmnemonic = keysym("E"); };
    callbacks { XmNactivateCallback = procedure ExitCb(); };
};
object helpCascade : XmCascadeButton {
    arguments { XmNlabelString ="Help"; XmNmnemonic = keysym("H"); };
    controls { XmPulldownMenu { controls { XmPushButton overviewButton; }; }; };
};
object overviewButton : XmPushButton {
    arguments { XmNlabelString = "Overview"; XmNmnemonic = keysym("O"); };
    callbacks { XmNactivateCallback = procedure ManageCb("*helpDialog"); };
};

!***********************************************************************
object helpDialog : XmInformationDialog {
    arguments {
	XmNdefaultButtonType = XmDIALOG_CANCEL_BUTTON;
	XmNcancelLabelString = "Dismiss";
	XmNdialogTitle = "Help";
	XmNmessageString =
	compound_string ("Xmp widgets", separate = true) &
	compound_string (" ", separate = true) &
	compound_string (" ", separate = true) &
	compound_string ("XmpBlob - A simple control.", separate = true) &
	compound_string (" ", separate = true) &
	compound_string ("XmpString - A compound string label.", separate = true) &
	compound_string (" ", separate = true) &
	compound_string ("XmpGrid - A 2D layout manager.");
    };
    controls {
	Xm_OK unmanaged { };
	Xm_Help unmanaged { };
    };
};

!***********************************************************************
object workArea : XmFrame {
    arguments {
	XmNmarginWidth = 40;
	XmNmarginHeight = 40;
	XmNshadowThickness = 0;
    };
    controls { XmFrame gridFrame; };
};

object gridFrame : XmFrame {
    arguments { };
    controls {
	user_defined titleString;
	user_defined grid;
    };
};

object titleString : user_defined procedure XmpCreateString {
    arguments {
	XmNchildType = XmFRAME_TITLE_CHILD;
	XmNchildHorizontalAlignment = XmALIGNMENT_END;
	XmNtext = "Xmp Widget Demo";
    };
};

!***********************************************************************
object grid : user_defined procedure XmpCreateGrid {
    arguments {
	XmNrows = 3;
	XmNcolumns = 3;
    };
    controls {
	user_defined A1;
	XmPushButton A2;
	user_defined A3;
	XmPushButton B1;
	user_defined B2;
	XmPushButton B3;
	XmPushButton C1;
	XmPushButton C2;
	user_defined C3;
    };
};
object A1 : user_defined procedure XmpCreateBlob { arguments {
		XmNunitType = Xm100TH_MILLIMETERS;
		XmNmarginWidth = 300;
		XmNmarginHeight = 300;
		XmNblobShape = XmBLOB_RECTANGLE;
	}; };
object A2 : XmPushButton { arguments { }; }; 
object A3 : user_defined procedure XmpCreateString { arguments {
        	XmNtext = "XmpString";
		XmNshadowThickness = 2;
	};};
object B1 : XmPushButton { arguments { }; };
object B2 : user_defined procedure XmpCreateBlob { arguments {
		XmNgridMarginWidth = 10;
		XmNgridMarginHeight = 10;
	}; };
object B3 : XmPushButton { arguments { }; };
object C1 : XmPushButton { arguments { XmNlabelString = "Motif"; }; };
object C2 : XmPushButton { arguments { }; };
object C3 : user_defined procedure XmpCreateBlob { arguments {
		XmNblobShape = XmBLOB_RECTANGLE;
	}; };
end module;

