Thread Rating:
  • 234 Vote(s) - 2.62 Average
  • 1
  • 2
  • 3
  • 4
  • 5
画面の操作を無効にするには?
02-26-2014, 06:35 PM,
#2
RE: 画面の操作を無効にするには?
画面にバリアを張って、バリア解除時にイベントを破棄すれば出来そう・・・。

Code:
{import * from COM.CURL.LIB.UI}
{define-class public BarrierFrame {inherits OverlayBox}
  {constructor public {default ...}
    {construct-super {splice ...}}
    set self.barrier-screen-frame =
        {Fill background =  "transparent"}
  }

  ||処理中に画面をロックするためのバリア
  field barrier-screen-frame:Graphic

  field private _barrier?:bool = false
  {getter public {barrier?}:bool
    {return self._barrier?}
  }
  {setter public {barrier? val:bool}:void
    set self._barrier? = val
    {if self._barrier?  then
        ||バリアーを張る
        {self.add self.barrier-screen-frame}
    else
        ||バリア解除時に、それまでのイベントを破棄する
        {dispatch-events false}
        {self.barrier-screen-frame.detach}
    }
  }
}
{def v:View = {View}}
{def bf = {BarrierFrame}}
{def ta = {TextArea
              width = {make-elastic},
              height= {make-elastic}
          }
}
{def cb =
    {CommandButton
        label= "with-busy-view",
        {on Action do
            {with bf.barrier? = true do
                {with-busy-view v do
                    ||時間をかけるためのダミー処理
                    def (buf:StringBuf, n:int, encoding:CharEncoding) =
                        {read-from {url "http://www.yahoo.com"}}
                }
            }
        }
    }
}
{do
    {v.add bf}
    {bf.add {VBox hstretch? = true, ta, cb}}
    {v.show}
}
Reply


Messages In This Thread
RE: 画面の操作を無効にするには? - by umemura - 02-26-2014, 06:35 PM
Forum Jump:


Users browsing this thread:
1 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('1043')