Class: Fzeet::UIRibbon::GalleryItem
- Inherits:
-
Windows::UISimplePropertySetCallback
- Object
- Fzeet::UIRibbon::GalleryItem
- Defined in:
- lib/fzeet/windows/uiribbon.rb
Instance Attribute Summary collapse
-
#categoryId ⇒ Object
readonly
Returns the value of attribute categoryId.
-
#image ⇒ Object
readonly
Returns the value of attribute image.
-
#label ⇒ Object
readonly
Returns the value of attribute label.
Instance Method Summary collapse
- #GetValue(pkey, pvalue) ⇒ Object
-
#initialize(label, categoryId = 0, image = nil) ⇒ GalleryItem
constructor
A new instance of GalleryItem.
Constructor Details
#initialize(label, categoryId = 0, image = nil) ⇒ GalleryItem
Returns a new instance of GalleryItem.
544 545 546 547 548 |
# File 'lib/fzeet/windows/uiribbon.rb', line 544 def initialize(label, categoryId = 0, image = nil) @label, @categoryId, @image = label, categoryId, image super() end |
Instance Attribute Details
#categoryId ⇒ Object (readonly)
Returns the value of attribute categoryId.
550 551 552 |
# File 'lib/fzeet/windows/uiribbon.rb', line 550 def categoryId @categoryId end |
#image ⇒ Object (readonly)
Returns the value of attribute image.
550 551 552 |
# File 'lib/fzeet/windows/uiribbon.rb', line 550 def image @image end |
#label ⇒ Object (readonly)
Returns the value of attribute label.
550 551 552 |
# File 'lib/fzeet/windows/uiribbon.rb', line 550 def label @label end |
Instance Method Details
#GetValue(pkey, pvalue) ⇒ Object
552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 |
# 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 |