class Fzeet::UIRibbon::GalleryItem

Attributes

categoryId[R]
image[R]
label[R]

Public Class Methods

new(label, categoryId = 0, image = nil) click to toggle source
Calls superclass method
# File lib/fzeet/windows/uiribbon.rb, line 544
def initialize(label, categoryId = 0, image = nil)
        @label, @categoryId, @image = label, categoryId, image

        super()
end

Public Instance Methods

GetValue(pkey, pvalue) click to toggle source
# File lib/fzeet/windows/uiribbon.rb, line 552
def GetValue(pkey, pvalue)
        key, value = Windows::PROPERTYKEY.new(pkey), Windows::PROPVARIANT.new(pvalue)

        case key
        when Windows::UI_PKEY_CategoryId
                value.uint = @categoryId; Windows::S_OK
        when Windows::UI_PKEY_Label
                value.wstring = @label; Windows::S_OK
        when Windows::UI_PKEY_ItemImage
                FFI::MemoryPointer.new(:pointer) { |punk|
                        Windows::UIImageFromBitmap.new.CreateImage(PARGB32.new(@image).handle, Windows::UI_OWNERSHIP_TRANSFER, punk)

                        unk = Windows::Unknown.new(punk.read_pointer)
                        value.unknown = unk
                        unk.Release
                }

                Windows::S_OK
        else
                Windows::E_NOTIMPL
        end
end