class Fzeet::Windows::PropertyStore

Public Instance Methods

commit() click to toggle source
# File lib/fzeet/windows/propsys.rb, line 41
def commit; Commit(); self end
count() click to toggle source
# File lib/fzeet/windows/propsys.rb, line 23
def count; FFI::MemoryPointer.new(:ulong) { |pc| GetCount(pc); return pc.get_ulong(0) } end
Also aliased as: size, length
each() { |k, v| ... } click to toggle source
# File lib/fzeet/windows/propsys.rb, line 43
def each; length.times { |i| v = get(k = key(i)); yield k, v }; self end
get(k) click to toggle source

superclass.superclass is FFI::Struct, so do NOT touch [] and []=

# File lib/fzeet/windows/propsys.rb, line 30
def get(k) PROPVARIANT.new.tap { |v| GetValue(k, v) } end
key(i) click to toggle source
# File lib/fzeet/windows/propsys.rb, line 27
def key(i) PROPERTYKEY.new.tap { |k| GetAt(i, k) } end
length()
Alias for: count
prop(*args) click to toggle source
# File lib/fzeet/windows/propsys.rb, line 33
def prop(*args)
        case args.length
        when 1; get(*args)
        when 2; set(*args)
        else raise ArgumentError
        end
end
set(k, v) click to toggle source
# File lib/fzeet/windows/propsys.rb, line 31
def set(k, v) SetValue(k, v); self end
size()
Alias for: count
uiprop(*args) click to toggle source
# File lib/fzeet/windows/uiribbon.rb, line 411
def uiprop(*args)
        args[0] = Windows.const_get("UI_PKEY_#{args[0]}")

        prop(*args)
end
update(from) click to toggle source
# File lib/fzeet/windows/uiribbon.rb, line 417
def update(from)
        case from
        when Windows::LOGFONT
                uiprop(:FontProperties_Family, Windows::PROPVARIANT[:wstring, from.face])
                uiprop(:FontProperties_Size, Windows::PROPVARIANT[:decimal, from.size.round])
                uiprop(:FontProperties_Bold, Windows::PROPVARIANT[:uint, (from.bold?) ? 2 : 1])
                uiprop(:FontProperties_Italic, Windows::PROPVARIANT[:uint, (from.italic?) ? 2 : 1])
                uiprop(:FontProperties_Underline, Windows::PROPVARIANT[:uint, (from.underline?) ? 2 : 1])
                uiprop(:FontProperties_Strikethrough, Windows::PROPVARIANT[:uint, (from.strikeout?) ? 2 : 1])
        else raise ArgumentError
        end

        self
end