T.R | Title | User | Personal Name | Date | Lines |
---|
209.1 | | ULTRA::WRAY | John Wray | Wed Feb 15 1989 12:38 | 6 |
|
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.2 | no buttons | MTA::GREENZANG | A mind is a terrible thing! | Wed Feb 15 1989 13:22 | 11 |
|
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.3 | Explanation, example | CALL::SWEENEY | Roads? Where we're going we don't need..roads | Wed Feb 15 1989 21:31 | 59 |
| 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.4 | any other way? | MTA::GREENZANG | A mind is a terrible thing! | Thu Feb 16 1989 10:46 | 19 |
|
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.5 | Explanation continues | SDSVAX::SWEENEY | Roads? Where we're going we don't need..roads | Thu Feb 16 1989 12:42 | 18 |
| 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.6 | what about more than one line? | LENSMN::bonini | I was grepped by a zombie with a pipe!!! | Wed Jul 05 1989 15:53 | 11 |
|
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.7 | | SELECT::COPPOLA | | Mon Jul 17 1989 11:53 | 6 |
| 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.8 | What does Style Guide say ? | EWBV37::HIME | | Wed Aug 09 1989 01:04 | 15 |
|
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.
|