Module: Fzeet::Windows::MenuMethods

Included in:
Menu, PopupMenu
Defined in:
lib/fzeet/windows/user/Menu.rb

Defined Under Namespace

Classes: Item

Instance Method Summary collapse

Instance Method Details

#[](id) ⇒ Object



192
# File 'lib/fzeet/windows/user/Menu.rb', line 192

def [](id) Item.new(self, id) end

#append(flags, item = nil, id = 0) ⇒ Object



194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
# File 'lib/fzeet/windows/user/Menu.rb', line 194

def append(flags, item = nil, id = 0)
  Windows.DetonateLastError(0, :AppendMenu,
    @handle,
    Fzeet.flags(flags, :mf_, :mft_, :mfs_),
    case id
    when Integer; id
    when Symbol; Command[id]
    when Windows::MenuMethods; submenus << id; id.handle.to_i
    else raise ArgumentError
    end,
    item
  )

  self
end

#images=(images) ⇒ Object



210
# File 'lib/fzeet/windows/user/Menu.rb', line 210

def images=(images) images.each { |id, image| self[id].image = image } end

#rdetachObject



116
# File 'lib/fzeet/windows/user/Menu.rb', line 116

def rdetach; submenus.each(&:rdetach); detach end