/* * @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 */ /* static char rcsid[] = "$XConsortium: Text3.dat /main/5 1995/07/13 19:28:27 drk $" */ @) A client with a list of functions, a control panel and a Text widget to be acted upon should appear. #) Select the XmTextGetEditable() function from the Functions List by clicking MB1 on it. Click on the Call Function PushButton. The current editing status of the Action Text widget will be shown in the Status/Input widget. The status will be True. Confirm this by clicking MB1 in the Action text and deleting a few characters. #) Select the XmTextSetEditable() function. Set the True/False Arg ToggleButton to False. Click on the Call Function PushButton. The Action Text widget's editable property will be toggled to False. Select XmTextGetEditable() function and click the Call Function PushButton again. It should now show a value of False in the Status/Input widget. Also, now try deleting some characters from the Action Text widget. #) Make the Action Text widget editable again by selecting XmTextSetEditable, setting the True/False Arg to True and clicking on Call Function. C) #) Select the XmTextGetMaxLength() function and call it. The value 27 will be reported in the Status widget. #) Select the XmTextSetMaxLength() function from the list. Set the Numerical Arg 1 Scale to 30. Click the Call Function PushButton. Now select the XmTextGetMaxLength() function. The Status widget should read 30. You should be able to add text to the Action Text widget until its length is 30. #) Select the XmTextGetLastPosition() function and call it. It should read 30. Now delete a few characters from the Action Text and click Call Function again. It will now read a few less than 30. C) #) Select XmTextSetInsertionPosition() from the Functions List. Set the Numerical Arg 1 Scale to 3. Click the Call Function PushButton. The insertion cursor in the Action Text should move between the 'i' and 's' in 'This' (assuming that part of the text is still intact). C) #) Select and call the XmTextGetBaseline() function. It should read something near 20 depending on the metrics of the 'variable' font in use. #) Select the XmTextXYToPos() function. Set the Num Arg 1 Scale to 14 and the Num Arg 2 Scale to 18. Click the Call Function PushButton. The Status/Input widget should read "Position = 1". (The Num Arg 1 corresponds to the x argument and Num Arg 2 to the y argument.) #) Set the Num Arg 2 Scale to a number about 4 larger than the value returned by the earlier call to XmTextGetBaseline() (i.e. 24-26). Click Call Function. The Status widget should read the last position in the string. Verify this by scrolling up the Functions List and calling XmTextGetLastPosition() again. #) Select the XmTextPosToXY() function and set the Num Arg 1 Scale to 2. Click the Call Function PushButton. The Status widget should read something like "x = 24, y = 20" (this will vary depending on the font metrics and what the second character in the Action Text widget is). C) #) Select and call the XmTextGetTopCharacter() function. The value returned in the Status widget should be 0. #) Select the XmTextSetTopCharacter() function. Set the Num Arg 1 Scale to 6. Click the Call Function PushButton. The text in the Action Text widget should shift such that the first visible character on the left is the seventh character in the string (origin of 0). #) Set the Num Arg 1 Scale back to 0 and click Call Function again. The Action Text widget should return to its original appearance. E)