public void ctor_MsTextBoxMultiline_() {
    txt_box = new GxwTextBox_lang();
    txt_box.ctor_MsTextBox_();
    core = new GxwCore_host(GxwCore_lang.new_(this), txt_box.ctrlMgr);
    this.setViewportView(txt_box);
    txt_box.setLineWrap(true);
    txt_box.setWrapStyleWord(true); // else text will wrap in middle of words
    this.setVerticalScrollBarPolicy(ScrollPaneConstants.VERTICAL_SCROLLBAR_NEVER);
    this.setBorder(null);
    txt_box.setBorder(BorderFactory.createLineBorder(Color.BLACK));
    txt_box.setCaretColor(Color.BLACK);
    txt_box.getCaret().setBlinkRate(0);
    txt_box.setMargin(new Insets(0, 200, 200, 0));
    OverrideKeyBindings();
    InitUndoMgr();
    txt_box.setCaret(
        new javax.swing.text.DefaultCaret() {
          public void setSelectionVisible(boolean vis) {
            super.setSelectionVisible(true);
          }
        }); // else highlighted selection will not be visible when text box loses focus
    //		this.setLayout(null);

    //		Object fontDefinition = new UIDefaults.ProxyLazyValue("javax.swing.plaf.FontUIResource",
    // null, new Object[] { "dialog", new Integer(Font.PLAIN), new Integer(12) });
    //		java.util.Enumeration keys = UIManager.getDefaults().keys();
    //		while (keys.hasMoreElements()) {
    //		    Object key = keys.nextElement();
    //		    Object value = UIManager.get(key);
    //		    if (value instanceof javax.swing.plaf.FontUIResource) {
    //		        UIManager.put(key, fontDefinition);
    //		    }
    //		}
  }
Exemple #2
0
 // todo: call Dispose when ownerForm is disposed
 //	@Override protected void Dispose(boolean disposing)					{if (host.DisposeCbk())
 // super.Dispose(disposing);}
 public void ctor_GxwElem() {
   ctrlMgr = GxwCore_lang.new_(this);
   GxwBoxListener lnr = new GxwBoxListener(this);
   // this.setFocusTraversalKeysEnabled(false);
   this.addComponentListener(lnr);
   this.addFocusListener(lnr);
   this.enableEvents(
       AWTEvent.MOUSE_EVENT_MASK
           | AWTEvent.MOUSE_MOTION_EVENT_MASK
           | AWTEvent.MOUSE_WHEEL_EVENT_MASK);
 }