[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference bulova::decw_jan-89_to_nov-90

Title:DECWINDOWS 26-JAN-89 to 29-NOV-90
Notice:See 1639.0 for VMS V5.3 kit; 2043.0 for 5.4 IFT kit
Moderator:STAR::VATNE
Created:Mon Oct 30 1989
Last Modified:Mon Dec 31 1990
Last Successful Update:Fri Jun 06 1997
Number of topics:3726
Total number of notes:19516

209.0. "Stext Continues to Next Line" by IRT::WATSON () Wed Feb 15 1989 11:40

    How do you keep stext from continuing on to the next line?
    
    I would like to prompt for 20 characters.  Each time I type 
    return before filling the space up the prompt falls down to
    the next line.
    
    I tried setting rows, resize hight and width, max length, etc.
    
    Thanks.
    
    Jim Watson

T.RTitleUserPersonal
Name
DateLines
209.1ULTRA::WRAYJohn WrayWed Feb 15 1989 12:386
    The way I do this is to set the return key to be an accelerator
    for a "Finished typing" button attached to the stext's parent.
    If the stext sees the return itself, then it'll store it - after
    all "return" is a character...

209.2no buttonsMTA::GREENZANGA mind is a terrible thing!Wed Feb 15 1989 13:2211
    
    does it have to be connected to a sibling button?  currently i have
    a window with a dialog box.  the dialog box has children of stext
    and labels no buttons.  is there another way without associating
    the "return key" with a button?
    
    thanks!
    
    josephine
    

209.3Explanation, exampleCALL::SWEENEYRoads? Where we're going we don't need..roadsWed Feb 15 1989 21:3159
A UIL fragment follows <FF>.  I really don't know why but most applications
have text fields and separate OK buttons that when activated indicate that
input is complete. The login window of the session manager is the obvious
example. This perhaps is an XUI style issue.

The default button resource of a dialog box makes it simple to have a callback
which tells the application to read the text of a text widget.

/*
 *  Text entry widget for keyboard entry
 */

object text_entry : popup_attached_db {
	arguments {
	    default_button = push_button text_ok_button;
	    style = style_modal;
            };
	controls {
	    simple_text text_box;
	    push_button text_ok_button;
	    };
	callbacks {
	    create = procedure create_proc (text_popup);
	    };
	};

object text_box : simple_text widget {
	arguments {
	    width = 260;
	    max_length = 20;
	    rows = 1;
	    font_argument = Push_button_font;
	    adb_top_attachment = DwtAttachAdb;
	    adb_left_attachment = DwtAttachAdb;
	    border_width = 5;
	    };
	callbacks {
	    create = procedure create_proc (text_box);
	    };
	};


object text_ok_button : push_button widget {
	arguments {
	    label_label = 'OK';
	    font_argument = Push_button_font;
	    adb_top_attachment = DwtAttachWidget;
	    adb_top_widget = simple_text text_box;
	    adb_left_attachment = DwtAttachPosition;
	    adb_left_position = 50;
	    border_width = 5;
	    };

	callbacks {
	    activate = procedure get_text (text_popup);
	    };
	
	};

209.4any other way?MTA::GREENZANGA mind is a terrible thing!Thu Feb 16 1989 10:4619
    
    i have modified my window and added a button just for the purpose
    of signaling the end of an input.  i hid the button so it's not
    part of the display and it works fine.  i used the default_button
    association as described in 209.3.  i just want to know if there
    is another way of doing this without associating a button for this
    purpose.  i did notice that all of the examples that i have seen
    using the simple_text widget that accepts 1 line input has a button
    associated with them.
    
    josephine
    
    p.s.
    	is the default_button an accelerator?  if not, what does it
    mean to be a default_button and to be an accelerator?  is an
    accelerator called an accelerator because it does something faster?
    
    

209.5Explanation continuesSDSVAX::SWEENEYRoads? Where we&#039;re going we don&#039;t need..roadsThu Feb 16 1989 12:4218
    The default_button is a resource of the dialog box widget class.  Not all
    widget classes have default buttons.  Not all instances of dialog box
    widget class have default buttons.
    
    The fixed meaning of a default_button is that associated push button's
    activate callback is called when "Return" or "Enter" is pressed.  The
    default is null.
    
    Accelerators are a bit more complex.  Accelerators to a programmer are
    translation tables that specify what events which happen in one
    widget become events in another.  This is a very general technique.
    
    Accelerators to a user are keys which have the behavior of mouse and
    button events, at least in the typical case.
    
    To understand a bit more, you'll need to understand the X toolkit and X
    concepts of focus, grab, event translation.

209.6what about more than one line?LENSMN::boniniI was grepped by a zombie with a pipe!!!Wed Jul 05 1989 15:5311
	I know this is a little late but since the topic is identical, well
almost, I couldn't see starting a new topic.

	Suppose I wanted to limit the text widget to accepting THREE lines of
input.  Now I can't use an accelerator for the return key since I need that key
to get from line to line.  If I input text on the third line and hit return,
the widget kindly expands to allow more input.  Anyway around this?

Thanks

209.7SELECT::COPPOLAMon Jul 17 1989 11:536
    If you are using UIL us MAX_LENGTH to set how many chars you will allow
    or set it using set values routine.
    
    	vic...
    

209.8What does Style Guide say ?EWBV37::HIMEWed Aug 09 1989 01:0415
  The XUI Style Guide page 7-6 says as follows.

Some dialog boxes with multiple text entry fields require the user to enter
values in all the fields before the dialog box is considered valid. Pressing 
the Return key in these boxes can give different results. A dialog box that has
multiple text entry fields has no default button;pressing the Return key moves
the input focus to the next field. When the final field is reached, the dialog
box can then enable the default button.

  What does it mean ?

				Toru.