home *** CD-ROM | disk | FTP | other *** search
- /*
- * $Id: edit_test.java,v 1.10 1996/10/03 19:46:51 hudson Exp $
- * $Author: hudson $
- */
-
- package sub_arctic.test;
-
- import sub_arctic.input.callback_object;
- import sub_arctic.input.event;
- import sub_arctic.lib.interactor_applet;
- import sub_arctic.lib.manager;
- import sub_arctic.lib.interactor;
- import sub_arctic.lib.button;
- import sub_arctic.lib.interactor_consts;
- import sub_arctic.lib.top_level;
- import sub_arctic.lib.oneline_text_edit;
- import sub_arctic.lib.text_edit;
- import sub_arctic.lib.base_parent_interactor;
- import sub_arctic.lib.scale;
- import sub_arctic.constraints.std_function;
-
- public class edit_test extends interactor_applet implements interactor_consts, callback_object {
-
- oneline_text_edit oneline;
-
- public void callback(
- interactor from_obj,
- event evt,
- int callback_num,
- Object callback_info) {
- if (from_obj instanceof button)
- oneline.set_text(null);
- }
-
- public void build_ui(base_parent_interactor top)
- {
- button clear;
- text_edit txt = new text_edit(100,10, 600,400,
- "this is a test, line 1\n" +
- "this is a test, line 2\n" +
- "this is a test, longer line 3\n" +
- "this is a test, longer line 4\n" +
- "this is a test, longer line 5\n"+
- "\n\n"+
- "a final line.", null, false);
- txt.set_selection(0,2, text_edit.SELECT_END,10);
- txt.set_h_spacing(10);
- txt.set_v_spacing(20);
- txt.size_by_content();
- txt.set_part_a_constraint(std_function.eq(NEXT_SIBLING.PART_A()));
-
- scale s1 = new scale(150, 0, 30, 0, 10, this);
- s1.set_x_constraint(std_function.eq(PREV_SIBLING.X()));
- s1.set_y_constraint(std_function.offset(PREV_SIBLING.Y2(),5));
-
- oneline=new oneline_text_edit(10,320,"Testing this interactor",
- null,false);
-
- top.add_child(txt);
- top.add_child(s1);
- top.add_child(oneline);
- clear=new button(180,320,"Clear Text Field", this);
- top.add_child(clear);
- }
- }
-
- /*=========================== COPYRIGHT NOTICE ===========================
-
- This file is part of the subArctic user interface toolkit.
-
- Copyright (c) 1996 Scott Hudson and Ian Smith
- All rights reserved.
-
- The subArctic system is freely available for most uses under the terms
- and conditions described in
- http://www.cc.gatech.edu/gvu/ui/sub_arctic/sub_arctic/doc/usage.html
- and appearing in full in the lib/interactor.java source file.
-
- The current release and additional information about this software can be
- found starting at: http://www.cc.gatech.edu/gvu/ui/sub_arctic/
-
- ========================================================================*/
-