Thread Rating:
  • 698 Vote(s) - 2.8 Average
  • 1
  • 2
  • 3
  • 4
  • 5
文字入力の抑止について
09-16-2011, 11:54 AM,
#2
RE: 文字入力の抑止について
若干乱暴ですがTextFieldを継承したクラスで
UIのKeyPressイベントを止めつつ、
set-value-with-eventsを抑止すれば
ほぼ入力できなくなると思います。
Code:
{define-class public NumericTextField {inherits TextField}

  {constructor public {default ...}

    {construct-super {splice ...}}
    {self.ui-object.add-event-handler
{on e:KeyPress do
{switch e.value
case '1','2','3','4','5','6','7','8','9','0','-',',' do
else                {e.consume}
}
}
}

    set self.halign = "right"
}

  {method public {set-value-with-events val:String}:void
{for c:char in val do
{switch c
case '1','2','3','4','5','6','7','8','9','0','-',',' do
else            {return}
}

    }

    {super.set-value-with-events val}  }

}

{NumericTextField value = "150"}


Messages In This Thread
文字入力の抑止について - by usami - 09-16-2011, 10:10 AM
RE: 文字入力の抑止について - by nmyzk - 09-16-2011, 11:54 AM
RE: 文字入力の抑止について - by usami - 09-21-2011, 12:02 PM
RE: 文字入力の抑止について - by usami - 09-22-2011, 09:23 AM
RE: 文字入力の抑止について - by Yuhki - 09-22-2011, 09:50 AM
RE: 文字入力の抑止について - by nmyzk - 09-22-2011, 09:56 AM
RE: 文字入力の抑止について - by usami - 09-22-2011, 01:14 PM
RE: 文字入力の抑止について - by usami - 09-22-2011, 04:00 PM
RE: 文字入力の抑止について - by usami - 09-26-2011, 05:42 PM
RE: 文字入力の抑止について - by fukuta - 09-29-2011, 08:56 AM
RE: 文字入力の抑止について - by onyo - 09-26-2011, 12:55 PM
RE: 文字入力の抑止について - by usami - 09-26-2011, 05:50 PM
RE: 文字入力の抑止について - by fukuta - 09-29-2011, 09:28 AM
RE: 文字入力の抑止について - by usami - 09-29-2011, 02:54 PM
Forum Jump:


Users browsing this thread:
4 Guest(s)

MyBB SQL Error

MyBB has experienced an internal SQL error and cannot continue.

SQL Error:
1017 - Can't find file: 'mybb_threadviews' (errno: 2)
Query:
INSERT INTO mybb_threadviews (tid) VALUES('279')