windows_com 2.1.0 → 2.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9cd9c67d4242830c8724e54bbcb687ab72c9f156
4
- data.tar.gz: 9adf8c76beffe573a5787b49b8d81e2c801618b2
3
+ metadata.gz: 2cf9e8a660759ec930af827e7e189d0f2ca8cd96
4
+ data.tar.gz: 4d0195894da766f1ec56e1d66eb422c52e2ffe72
5
5
  SHA512:
6
- metadata.gz: 47aa923cfadab2b1573e2dfb038ed4a4852cebedbf54a916aadb5bdf5d98bb3ff61affe7c3acd2abd61bbc7140ba36791b0f2624d3570e7fe09f7e0492532e51
7
- data.tar.gz: 7e434696d7c42f29696e7cbf6668f1d46613caa70e2d96e99c6f1507f87f74aa05f2bcc9118104cf33cc8e68c89d4d2413f9fb960aab6d3544232d80686edb1f
6
+ metadata.gz: 6b6fa145975b6469efef29eee55bb70c6b734619492ffa98b1970748e13238a57bcff5726209055920d1d204112414490ba6ab5f8c59adb3bc986aa58991e440
7
+ data.tar.gz: d0ab45045ea7207551f392caf37d71ae148113f392c2c851c0962952e7d097ebdbde8cba9c40e26927d24070b7a7740f44c56b6a72ce18adef31f021e2eb91fc
data/RELNOTES.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Release Notes
2
2
 
3
+ ## 2.1.1
4
+
5
+ Sync important example with changes in related gem (windows_gui)
6
+
3
7
  ## 2.1.0
4
8
 
5
9
  `COMVtbl_` doesn't prepend `this` pointers to vtbl specs
@@ -14,7 +18,7 @@ Allow `COMInterface_` instances to be passed to code expecting pointers without
14
18
 
15
19
  ## 2.0.0
16
20
 
17
- - Add `COMCallback` module for __implementing__ COM objects in Ruby
21
+ - Add `COMCallback` module for __implementing__ COM interfaces in Ruby
18
22
  - enhance some bound FFI structs with useful methods
19
23
  - improve code
20
24
 
Binary file
@@ -28,3 +28,7 @@ CmdButton1_SmallImages_RESID = 60019
28
28
  CmdButton1_SmallImages_120__RESID = 60020
29
29
  CmdButton1_LargeImages_RESID = 60021
30
30
  CmdButton1_LargeImages_120__RESID = 60022
31
+ CmdAOT = 8
32
+ CmdAOT_LabelTitle_RESID = 60023
33
+ CmdAOT_LabelDescription_RESID = 60024
34
+ CmdAOT_TooltipDescription_RESID = 60025
@@ -26,6 +26,16 @@ class UICH < IUICommandHandlerImpl
26
26
 
27
27
  attr_reader :uif
28
28
 
29
+ def OnAOT(*args)
30
+ UsingFFIStructs(PROPVARIANT.new) { |v|
31
+ uif.GetUICommandProperty(CmdAOT, UI_PKEY_BooleanValue, v)
32
+
33
+ SetWindowPos(uif.hwnd,
34
+ (v[:boolVal] == -1) ? HWND_TOPMOST : HWND_NOTOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE
35
+ )
36
+ }
37
+ end
38
+
29
39
  def OnItem1(*args)
30
40
  MessageBox(uif.hwnd,
31
41
  L("#{self}.#{__method__}"),
@@ -50,6 +60,8 @@ class UICH < IUICommandHandlerImpl
50
60
 
51
61
  def Execute(*args)
52
62
  case args[0]
63
+ when CmdAOT
64
+ OnAOT(*args)
53
65
  when CmdItem1
54
66
  OnItem1(*args)
55
67
  when CmdButton1
@@ -87,12 +99,18 @@ def OnCreate(hwnd,
87
99
  )
88
100
  xtra = Id2Ref[GetWindowLong(hwnd, GWL_USERDATA)]
89
101
 
102
+ UIResources.Build(clean: true) if UIResources.BuildNeeded?()
103
+
90
104
  xtra[:uif] = UIF.new(hwnd)
91
105
  xtra[:uich] = UICH.new(xtra[:uif])
92
106
  xtra[:uia] = UIA.new(xtra[:uich])
93
107
 
94
108
  xtra[:uif].Initialize(hwnd, xtra[:uia])
95
- xtra[:uif].LoadUI(LoadUIDll(), L('APPLICATION_RIBBON'))
109
+ xtra[:uif].LoadUI(UIResources.Load(), L('APPLICATION_RIBBON'))
110
+
111
+ UsingFFIStructs(PROPVARIANT[VT_BOOL, :boolVal, -1]) { |v|
112
+ xtra[:uif].SetUICommandProperty(CmdAOT, UI_PKEY_BooleanValue, v)
113
+ }
96
114
 
97
115
  0
98
116
  end
@@ -179,6 +197,7 @@ def WinMain
179
197
  exit(0) if hwnd.null?
180
198
 
181
199
  ShowWindow(hwnd, SW_SHOWNORMAL)
200
+ SetWindowPos(hwnd, HWND_TOPMOST, 0, 0, 0, 0, SWP_NOMOVE | SWP_NOSIZE)
182
201
  UpdateWindow(hwnd)
183
202
 
184
203
  UsingFFIStructs(MSG.new) { |msg|
@@ -8,35 +8,38 @@
8
8
  <Command Name='cmdTab1' LabelTitle='Tab1' />
9
9
  <Command Name='cmdTab1Group1' LabelTitle='&amp;Group1' LabelDescription='LabelDescription...' TooltipDescription='TooltipDescription...'>
10
10
  <Command.SmallImages>
11
- <Image>../../res/go-next-small.bmp</Image>
12
- <Image MinDPI='120'>../../res/go-next.bmp</Image>
11
+ <Image>../res/go-next-small.bmp</Image>
12
+ <Image MinDPI='120'>../res/go-next.bmp</Image>
13
13
  </Command.SmallImages>
14
14
  <Command.LargeImages>
15
- <Image>../../res/go-next.bmp</Image>
16
- <Image MinDPI='120'>../../res/go-next-big.bmp</Image>
15
+ <Image>../res/go-next.bmp</Image>
16
+ <Image MinDPI='120'>../res/go-next-big.bmp</Image>
17
17
  </Command.LargeImages>
18
18
  </Command>
19
19
 
20
20
  <Command Name='cmdItem1' LabelTitle='&amp;Item1' LabelDescription='LabelDescription...' TooltipDescription='TooltipDescription...'>
21
21
  <Command.SmallImages>
22
- <Image>../../res/go-previous-small.bmp</Image>
23
- <Image MinDPI='120'>../../res/go-previous.bmp</Image>
22
+ <Image>../res/go-previous-small.bmp</Image>
23
+ <Image MinDPI='120'>../res/go-previous.bmp</Image>
24
24
  </Command.SmallImages>
25
25
  <Command.LargeImages>
26
- <Image>../../res/go-previous.bmp</Image>
27
- <Image MinDPI='120'>../../res/go-previous-big.bmp</Image>
26
+ <Image>../res/go-previous.bmp</Image>
27
+ <Image MinDPI='120'>../res/go-previous-big.bmp</Image>
28
28
  </Command.LargeImages>
29
29
  </Command>
30
30
 
31
31
  <Command Name='cmdButton1' LabelTitle='&amp;Button1' LabelDescription='LabelDescription...' TooltipDescription='TooltipDescription...'>
32
32
  <Command.SmallImages>
33
- <Image>../../res/go-next-small.bmp</Image>
34
- <Image MinDPI='120'>../../res/go-next.bmp</Image>
33
+ <Image>../res/go-next-small.bmp</Image>
34
+ <Image MinDPI='120'>../res/go-next.bmp</Image>
35
35
  </Command.SmallImages>
36
36
  <Command.LargeImages>
37
- <Image>../../res/go-next.bmp</Image>
38
- <Image MinDPI='120'>../../res/go-next-big.bmp</Image>
37
+ <Image>../res/go-next.bmp</Image>
38
+ <Image MinDPI='120'>../res/go-next-big.bmp</Image>
39
39
  </Command.LargeImages>
40
+ </Command>
41
+
42
+ <Command Name='cmdAOT' LabelTitle='&amp;Always On Top' LabelDescription='LabelDescription...' TooltipDescription='TooltipDescription...'>
40
43
  </Command>
41
44
  </Application.Commands>
42
45
 
@@ -53,6 +56,7 @@
53
56
  <Ribbon.QuickAccessToolbar>
54
57
  <QuickAccessToolbar CommandName='cmdQAT'>
55
58
  <QuickAccessToolbar.ApplicationDefaults>
59
+ <CheckBox CommandName='cmdAOT' />
56
60
  <Button CommandName='cmdItem1' />
57
61
  <Button CommandName='cmdButton1' />
58
62
  </QuickAccessToolbar.ApplicationDefaults>
Binary file
Binary file
Binary file
Binary file
Binary file
Binary file
@@ -1,6 +1,6 @@
1
1
  require 'ffi'
2
2
 
3
- WINDOWS_COM_VERSION = '2.1.0'
3
+ WINDOWS_COM_VERSION = '2.1.1'
4
4
 
5
5
  WINDOWS_COM_OLE_INIT = true unless defined?(WINDOWS_COM_OLE_INIT)
6
6
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: windows_com
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.0
4
+ version: 2.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Radoslav Peev
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-02-03 00:00:00.000000000 Z
11
+ date: 2017-02-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ffi
@@ -39,6 +39,12 @@ files:
39
39
  - examples/UIRibbon/Command.rb
40
40
  - examples/UIRibbon/Command.rbw
41
41
  - examples/UIRibbon/Command.xml
42
+ - examples/res/go-next-big.bmp
43
+ - examples/res/go-next-small.bmp
44
+ - examples/res/go-next.bmp
45
+ - examples/res/go-previous-big.bmp
46
+ - examples/res/go-previous-small.bmp
47
+ - examples/res/go-previous.bmp
42
48
  - lib/windows_com.rb
43
49
  - lib/windows_com/common.rb
44
50
  - lib/windows_com/libc.rb