func_maxgui_setgadgetpixmap.rst 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. .. _func_maxgui_setgadgetpixmap:
  2. ===============
  3. SetGadgetPixmap
  4. ===============
  5. SetGadgetPixmap -
  6. Description
  7. ===========
  8. .. code-block:: blitzmax
  9. SetGadgetPixmap( gadget:TGadget, pixmap:TPixmap, flags% = GADGETPIXMAP_ICON )
  10. Set a gadget's pixmap.
  11. This is a more generic form of old backwards-compatible #SetPanelPixmap function which now allows icons
  12. to be set for other gadgets as well as just backgrounds for panels.
  13. For setting background pixmaps on panels, @flags should still be one of the following:
  14. [ @Flag | @Meaning
  15. * PANELPIXMAP_TILE | The panel is filled with repeating tiles.
  16. * PANELPIXMAP_CENTER | The pixmap is positioned at the center of the panel.
  17. * PANELPIXMAP_FIT | The pixmap is scaled proportionally to best fit the panel size.
  18. * PANELPIXMAP_FIT2 | A variant of PANELPIXMAP_FIT where clipping can occur to achieve a better fit.
  19. * PANELPIXMAP_STRETCH | The pixmap is stretched to fit the entire panel.
  20. ]
  21. Alternatively, to set a push-button or menu's icon, use the following constants:
  22. [ @Flag | @Meaning
  23. * GADGETPIXMAP_ICON | Places an icon-sized pixmap onto a button/menu.
  24. * GADGETPIXMAP_NOTEXT | Removes text on buttons when used in conjunction with GADGETPIXMAP_ICON.
  25. ]
  26. Each platform allows slightly different maximum icon sizes for their menus. Therefore, the recommended
  27. size for menu icons is 12x12 pixels, which appears to work well on all supported platforms.
  28. Note: At present, OK buttons cannot have an icon set as a cross-platform solution is unavailable.
  29. The function can be passed #Null as the parameter for @pixmap, in which case the pixmap will be removed.
  30. Parameters
  31. ==========
  32. Return Values
  33. =============
  34. Nothing.
  35. Examples
  36. ========
  37. See Also
  38. ========