Thread Rating:
  • 434 Vote(s) - 2.86 Average
  • 1
  • 2
  • 3
  • 4
  • 5
標準の右クリックメニューから一部機能を削除
05-10-2012, 06:29 PM,
#3
RE: 標準の右クリックメニューから一部機能を削除
たとえば以下のようにすると、
テキストフィールドの右クリックメニューから「削除」を取り除くことができます。

Code:
{curl 7.0 applet}
{curl-file-attributes character-encoding = "shift-jis"}

{define-class public MyTextFieldUI {inherits StandardTextFieldUI}
  {constructor {default ...}
    {construct-super {splice ...}}
  }
  {method private {make-menu-pane-for-text-field view:View}:MenuPane
    let fm:FocusManager = {non-null view.focus-manager}
    {return
        {MenuPane
            {MenuAction
                label = {host-localize "Cut"},
                bound-command = {fm.get-command "cut"} ||""
            },
            {MenuAction
                label = {host-localize "Copy"},
                bound-command = {fm.get-command "copy"} ||""
            },
            {MenuAction
                label = {Label
                            {host-localize "Paste"}
                        },
                bound-command = {fm.get-command "paste"} ||""
            }
        }
    }
  }
  {method open public {on-context-menu-event e:ContextMenuEvent}:void
    {if not e.consumed? then
        {if-non-null v = {self.get-view} then
            {if-non-null
                menu-pane = {self.make-menu-pane-for-text-field v}
             then
                {e.consume}
                {menu-pane.popup self, e.x, e.y}
            }
        }
    }
  }
}
{View
    {TextField ui-object = {MyTextFieldUI}},
    visibility = "normal",
    {on WindowClose do
        {exit}
    }
}


Messages In This Thread
RE: 標準の右クリックメニューから一部機能を削除 - by ashimo - 05-10-2012, 06:29 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('493')