Module: WindowsGUI::UIRibbon
- Includes:
- WindowsCOM
- Defined in:
- lib/windows_gui/uiribbon.rb
Defined Under Namespace
Modules: UIResources
Constant Summary collapse
- UI_PKEY_Enabled =
- UI_PKEY_LabelDescription =
- UI_PKEY_Keytip =
- UI_PKEY_Label =
- UI_PKEY_TooltipDescription =
- UI_PKEY_TooltipTitle =
- UI_PKEY_LargeImage =
- UI_PKEY_LargeHighContrastImage =
- UI_PKEY_SmallImage =
- UI_PKEY_SmallHighContrastImage =
- UI_PKEY_CommandId =
- UI_PKEY_ItemsSource =
- UI_PKEY_Categories =
- UI_PKEY_CategoryId =
- UI_PKEY_SelectedItem =
- UI_PKEY_CommandType =
- UI_PKEY_ItemImage =
- UI_PKEY_BooleanValue =
- UI_PKEY_DecimalValue =
- UI_PKEY_StringValue =
- UI_PKEY_MaxValue =
- UI_PKEY_MinValue =
- UI_PKEY_Increment =
- UI_PKEY_DecimalPlaces =
- UI_PKEY_FormatString =
- UI_PKEY_RepresentativeString =
- UI_PKEY_FontProperties =
- UI_PKEY_FontProperties_Family =
- UI_PKEY_FontProperties_Size =
- UI_PKEY_FontProperties_Bold =
- UI_PKEY_FontProperties_Italic =
- UI_PKEY_FontProperties_Underline =
- UI_PKEY_FontProperties_Strikethrough =
- UI_PKEY_FontProperties_VerticalPositioning =
- UI_PKEY_FontProperties_ForegroundColor =
- UI_PKEY_FontProperties_BackgroundColor =
- UI_PKEY_FontProperties_ForegroundColorType =
- UI_PKEY_FontProperties_BackgroundColorType =
- UI_PKEY_FontProperties_ChangedProperties =
- UI_PKEY_FontProperties_DeltaSize =
- UI_PKEY_RecentItems =
- UI_PKEY_Pinned =
- UI_PKEY_Color =
- UI_PKEY_ColorType =
- UI_PKEY_ColorMode =
- UI_PKEY_ThemeColorsCategoryLabel =
- UI_PKEY_StandardColorsCategoryLabel =
- UI_PKEY_RecentColorsCategoryLabel =
- UI_PKEY_AutomaticColorLabel =
- UI_PKEY_NoColorLabel =
- UI_PKEY_MoreColorsLabel =
- UI_PKEY_ThemeColors =
- UI_PKEY_StandardColors =
- UI_PKEY_ThemeColorsTooltips =
- UI_PKEY_StandardColorsTooltips =
- UI_PKEY_Viewable =
- UI_PKEY_Minimized =
- UI_PKEY_QuickAccessToolbarDock =
- UI_PKEY_ContextAvailable =
- UI_PKEY_GlobalBackgroundColor =
- UI_PKEY_GlobalHighlightColor =
- UI_PKEY_GlobalTextColor =
- UI_CONTEXTAVAILABILITY_NOTAVAILABLE =
0- UI_CONTEXTAVAILABILITY_AVAILABLE =
1- UI_CONTEXTAVAILABILITY_ACTIVE =
2- UI_FONTPROPERTIES_NOTAVAILABLE =
0- UI_FONTPROPERTIES_NOTSET =
1- UI_FONTPROPERTIES_SET =
2- UI_FONTVERTICALPOSITION_NOTAVAILABLE =
0- UI_FONTVERTICALPOSITION_NOTSET =
1- UI_FONTVERTICALPOSITION_SUPERSCRIPT =
2- UI_FONTVERTICALPOSITION_SUBSCRIPT =
3- UI_FONTUNDERLINE_NOTAVAILABLE =
0- UI_FONTUNDERLINE_NOTSET =
1- UI_FONTUNDERLINE_SET =
2- UI_FONTDELTASIZE_GROW =
0- UI_FONTDELTASIZE_SHRINK =
1- UI_CONTROLDOCK_TOP =
1- UI_CONTROLDOCK_BOTTOM =
3- UI_SWATCHCOLORTYPE_NOCOLOR =
0- UI_SWATCHCOLORTYPE_AUTOMATIC =
1- UI_SWATCHCOLORTYPE_RGB =
2- UI_SWATCHCOLORMODE_NORMAL =
0- UI_SWATCHCOLORMODE_MONOCHROME =
1- IUISimplePropertySet =
- IUISimplePropertySetImpl =
- IUIRibbon =
- UI_INVALIDATIONS_STATE =
0x00000001- UI_INVALIDATIONS_VALUE =
0x00000002- UI_INVALIDATIONS_PROPERTY =
0x00000004- UI_INVALIDATIONS_ALLPROPERTIES =
0x00000008- UI_ALL_COMMANDS =
0- IUIFramework =
- UIFramework =
- IUIContextualUI =
- IUICollection =
- UI_COLLECTIONCHANGE_INSERT =
0- UI_COLLECTIONCHANGE_REMOVE =
1- UI_COLLECTIONCHANGE_REPLACE =
2- UI_COLLECTIONCHANGE_RESET =
3- UI_COLLECTION_INVALIDINDEX =
0xffffffff- IUICollectionChangedEvent =
- IUICollectionChangedEventImpl =
- UI_EXECUTIONVERB_EXECUTE =
0- UI_EXECUTIONVERB_PREVIEW =
1- UI_EXECUTIONVERB_CANCELPREVIEW =
2- IUICommandHandler =
- IUICommandHandlerImpl =
- UI_COMMANDTYPE_UNKNOWN =
0- UI_COMMANDTYPE_GROUP =
1- UI_COMMANDTYPE_ACTION =
2- UI_COMMANDTYPE_ANCHOR =
3- UI_COMMANDTYPE_CONTEXT =
4- UI_COMMANDTYPE_COLLECTION =
5- UI_COMMANDTYPE_COMMANDCOLLECTION =
6- UI_COMMANDTYPE_DECIMAL =
7- UI_COMMANDTYPE_BOOLEAN =
8- UI_COMMANDTYPE_FONT =
9- UI_COMMANDTYPE_RECENTITEMS =
10- UI_COMMANDTYPE_COLORANCHOR =
11- UI_COMMANDTYPE_COLORCOLLECTION =
12- UI_VIEWTYPE_RIBBON =
1- UI_VIEWVERB_CREATE =
0- UI_VIEWVERB_DESTROY =
1- UI_VIEWVERB_SIZE =
2- UI_VIEWVERB_ERROR =
3- IUIApplication =
- IUIApplicationImpl =
- IUIImage =
- UI_OWNERSHIP_TRANSFER =
0- UI_OWNERSHIP_COPY =
1- IUIImageFromBitmap =
- UIImageFromBitmap =
Class Method Summary collapse
- .UI_GetBValue(hsb) ⇒ Object
- .UI_GetHValue(hsb) ⇒ Object
- .UI_GetSValue(hsb) ⇒ Object
- .UI_HSB(h, s, b) ⇒ Object
- .UI_MAKEAPPMODE(x) ⇒ Object
- .UI_RGB2HSB(r, g, b) ⇒ Object
Class Method Details
.UI_GetBValue(hsb) ⇒ Object
200 201 202 |
# File 'lib/windows_gui/uiribbon.rb', line 200 def UI_GetBValue(hsb) LOBYTE(hsb >> 16) end |
.UI_GetHValue(hsb) ⇒ Object
192 193 194 |
# File 'lib/windows_gui/uiribbon.rb', line 192 def UI_GetHValue(hsb) LOBYTE(hsb) end |
.UI_GetSValue(hsb) ⇒ Object
196 197 198 |
# File 'lib/windows_gui/uiribbon.rb', line 196 def UI_GetSValue(hsb) LOBYTE(hsb >> 8) end |
.UI_HSB(h, s, b) ⇒ Object
204 205 206 |
# File 'lib/windows_gui/uiribbon.rb', line 204 def UI_HSB(h, s, b) h | (s << 8) | (b << 16) end |
.UI_MAKEAPPMODE(x) ⇒ Object
415 416 417 |
# File 'lib/windows_gui/uiribbon.rb', line 415 def UI_MAKEAPPMODE(x) 1 << x end |
.UI_RGB2HSB(r, g, b) ⇒ Object
208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 |
# File 'lib/windows_gui/uiribbon.rb', line 208 def UI_RGB2HSB(r, g, b) r, g, b = r.to_f / 255, g.to_f / 255, b.to_f / 255 max, min = [r, g, b].max, [r, g, b].min l = (max + min) / 2 s = if max == min 0 elsif l < 0.5 (max - min) / (max + min) else (max - min) / (2 - (max + min)) end h = if max == min 0 elsif r == max (g - b) / (max - min) elsif g == max 2 + (b - r) / (max - min) else 4 + (r - g) / (max - min) end * 60 h += 360 if h < 0 h = h / 360 [ (255 * h).round, # hue (255 * s).round, # saturation (l < 0.1793) ? # brightness 0 : (l > 0.9821) ? 255 : (257.7 + 149.9 * Math.log(l)).round ] end |