stockitem.h 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. /////////////////////////////////////////////////////////////////////////////
  2. // Name: stockitem.h
  3. // Purpose: interface of global functions
  4. // Author: wxWidgets team
  5. // Licence: wxWindows licence
  6. /////////////////////////////////////////////////////////////////////////////
  7. /**
  8. Possible values for flags parameter of wxGetStockLabel().
  9. The elements of this enum are bit masks and may be combined with each other
  10. (except when specified otherwise).
  11. */
  12. enum wxStockLabelQueryFlag
  13. {
  14. /**
  15. Indicates absence of wxSTOCK_WITH_MNEMONIC and wxSTOCK_WITH_ACCELERATOR.
  16. Requests just the label (e.g. "Print...").
  17. */
  18. wxSTOCK_NOFLAGS = 0,
  19. /**
  20. Request the label with mnemonics character.
  21. E.g. "&Print...".
  22. */
  23. wxSTOCK_WITH_MNEMONIC = 1,
  24. /**
  25. Return the label with accelerator following it after TAB.
  26. E.g. "Print...\tCtrl-P". This can be combined with
  27. wxSTOCK_WITH_MNEMONIC to get "&Print...\tCtrl-P".
  28. */
  29. wxSTOCK_WITH_ACCELERATOR = 2,
  30. /**
  31. Return the label without any ellipsis at the end.
  32. By default, stock items text is returned with ellipsis, if appropriate,
  33. this flag allows to avoid having it. So using the same example as
  34. above, the returned string would be "Print" or "&Print" if
  35. wxSTOCK_WITH_MNEMONIC were also used.
  36. This flag can't be combined with wxSTOCK_WITH_ACCELERATOR.
  37. @since 2.9.1
  38. */
  39. wxSTOCK_WITHOUT_ELLIPSIS = 4,
  40. /**
  41. Return the label appropriate for a button and not a menu item.
  42. Currently the main difference is that the trailing ellipsis used in
  43. some stock labels is never included in the returned label. Also, the
  44. mnemonics is included if this flag is used. So the returned value for
  45. wxID_PRINT when this flag is used is "&Print".
  46. This flag can't be combined with wxSTOCK_WITH_ACCELERATOR.
  47. @since 2.9.1
  48. */
  49. wxSTOCK_FOR_BUTTON = wxSTOCK_WITHOUT_ELLIPSIS | wxSTOCK_WITH_MNEMONIC
  50. };
  51. /** @addtogroup group_funcmacro_misc */
  52. //@{
  53. /**
  54. Returns label that should be used for given @a id element.
  55. @param id
  56. Given id of the wxMenuItem, wxButton, wxToolBar tool, etc.
  57. @param flags
  58. Combination of the elements of wxStockLabelQueryFlag.
  59. @header{wx/stockitem.h}
  60. */
  61. wxString wxGetStockLabel(wxWindowID id, long flags = wxSTOCK_WITH_MNEMONIC);
  62. //@}