/* $XConsortium: Notebook4.c /main/5 1995/07/15 21:07:38 drk $ */ /* * @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 */ #include #define NUMARGS 12 #define NUM_PAGE 12 #define NUM_STATUS_AREA 12 #define NUM_MAJOR_TAB 3 #define NUM_MINOR_TAB 3 /* This test takes its XmNtranslations resource value from the defaults file ./tests/Toolkit/Notebook.defaults. */ void main (int argc, char **argv) { Widget Parent; Widget Notebook1; Widget Page[NUM_PAGE]; Widget DupPage; Widget StatusArea[NUM_STATUS_AREA]; Widget MajorTab[NUM_MINOR_TAB]; Widget MinorTab[NUM_MINOR_TAB]; Arg args[NUMARGS]; int n,i,page_no; char buf[32]; XmNotebookPageInfo page_info1, page_info2, page_info3, page_info4; XmNotebookPageStatus result1, result2, result3, result4; CommonTestInit(argc,argv); n=0; XtSetArg (args[n], XmNwidth, 300); n++; XtSetArg (args[n], XmNheight, 300); n++; Parent = XmCreateFrame(Shell1, "Parent", args, n); XtManageChild (Parent); n=0; XtSetArg (args[n], XmNfirstPageNumber, 1); n++; XtSetArg (args[n], XmNlastPageNumber, 5); n++; Notebook1 = XmCreateNotebook (Parent, "Notebook1", args, n); XtManageChild (Notebook1); for (i=0; i< NUM_PAGE; i++) { page_no = i+1; sprintf (buf, "Page%d", page_no); n=0; XtSetArg(args[n], XmNnotebookChildType, XmPAGE); n++; XtSetArg(args[n], XmNpageNumber, page_no); n++; /* empty page for page 4. This is to test the PAGE_EMPTY return value. */ if (page_no != 4) { Page[i] = XmCreatePushButton (Notebook1,buf, args, n); XtManageChild (Page[i]); } } /* duplicate page for page 5. This is to test PAGE_DUPLICATED. */ page_no = 5; n=0; XtSetArg(args[n], XmNnotebookChildType, XmPAGE); n++; XtSetArg(args[n], XmNpageNumber, page_no); n++; DupPage = XmCreatePushButton (Notebook1, "DupPage", args, n); XtManageChild (DupPage); for (i=0; i< NUM_STATUS_AREA; i++) { page_no = i+1; sprintf (buf, "StatusArea%d", page_no); n=0; XtSetArg(args[n], XmNnotebookChildType, XmSTATUS_AREA); n++; XtSetArg(args[n], XmNpageNumber, page_no); n++; StatusArea[i] = XmCreateLabel (Notebook1,buf, args, n); XtManageChild (StatusArea[i]); } for (i=0; i