Ejemplo n.º 1
0
  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);
    //		    }
    //		}
  }
Ejemplo n.º 2
0
 public void Margins_set(int left, int top, int right, int bot) {
   if (left == 0 && right == 0) {
     txt_box.setBorder(BorderFactory.createLineBorder(Color.BLACK));
     txt_box.setMargin(new Insets(0, 0, 0, 0));
   } else {
     //			txt_box.setBorder(BasicBorders.getTextFieldBorder());
     //			txt_box.setMargin(new Insets(0, l, 0, r));
     txt_box.setFont(new Font("Courier New", FontStyleAdp_.Plain.Val(), 12));
     txt_box.setBorder(
         BorderFactory.createCompoundBorder(
             BorderFactory.createLineBorder(Color.BLACK),
             BorderFactory.createEmptyBorder(top, left, bot, right)));
   }
 }