guiMenuBarCtrl_ScriptBinding.h 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125
  1. //-----------------------------------------------------------------------------
  2. // Copyright (c) 2013 GarageGames, LLC
  3. //
  4. // Permission is hereby granted, free of charge, to any person obtaining a copy
  5. // of this software and associated documentation files (the "Software"), to
  6. // deal in the Software without restriction, including without limitation the
  7. // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
  8. // sell copies of the Software, and to permit persons to whom the Software is
  9. // furnished to do so, subject to the following conditions:
  10. //
  11. // The above copyright notice and this permission notice shall be included in
  12. // all copies or substantial portions of the Software.
  13. //
  14. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  15. // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  16. // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  17. // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  18. // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  19. // FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
  20. // IN THE SOFTWARE.
  21. //-----------------------------------------------------------------------------
  22. ConsoleMethodGroupBeginWithDocs(GuiMenuBarCtrl, GuiControl)
  23. /*! Sets the currently used BackgroundProfile for the GuiControl
  24. @param p The BackgroundProfile applies to the the entire screen behind the open menu.
  25. @return No return value
  26. */
  27. ConsoleMethodWithDocs(GuiMenuBarCtrl, setBackgroundProfile, ConsoleVoid, 3, 3, (GuiControlProfile p))
  28. {
  29. GuiControlProfile* profile;
  30. if (Sim::findObject(argv[2], profile))
  31. object->setControlBackgroundProfile(profile);
  32. }
  33. /*! Sets the currently used MenuProfile for the GuiControl
  34. @param p The MenuProfile is applied to each top level menu item.
  35. @return No return value
  36. */
  37. ConsoleMethodWithDocs(GuiMenuBarCtrl, setMenuProfile, ConsoleVoid, 3, 3, (GuiControlProfile p))
  38. {
  39. GuiControlProfile* profile;
  40. if (Sim::findObject(argv[2], profile))
  41. object->setControlMenuProfile(profile);
  42. }
  43. /*! Sets the currently used MenuItemProfile for the GuiControl
  44. @param p The MenuItemProfile is applied to each menu item.
  45. @return No return value
  46. */
  47. ConsoleMethodWithDocs(GuiMenuBarCtrl, setMenuItemProfile, ConsoleVoid, 3, 3, (GuiControlProfile p))
  48. {
  49. GuiControlProfile* profile;
  50. if (Sim::findObject(argv[2], profile))
  51. object->setControlMenuItemProfile(profile);
  52. }
  53. /*! Sets the currently used MenuContentProfile for the GuiControl
  54. @param p The MenuContentProfile is applied the menu box that opens.
  55. @return No return value
  56. */
  57. ConsoleMethodWithDocs(GuiMenuBarCtrl, setMenuContentProfile, ConsoleVoid, 3, 3, (GuiControlProfile p))
  58. {
  59. GuiControlProfile* profile;
  60. if (Sim::findObject(argv[2], profile))
  61. object->setControlMenuContentProfile(profile);
  62. }
  63. /*! Sets the currently used ThumbProfile for the GuiControl
  64. @param p The ThumbProfile is applied to the thumb of the scrollbar.
  65. @return No return value
  66. */
  67. ConsoleMethodWithDocs(GuiMenuBarCtrl, setThumbProfile, ConsoleVoid, 3, 3, (GuiControlProfile p))
  68. {
  69. GuiControlProfile* profile;
  70. if (Sim::findObject(argv[2], profile))
  71. object->setControlThumbProfile(profile);
  72. }
  73. /*! Sets the currently used TrackProfile for the GuiControl
  74. @param p The TrackProfile is applied to the track area used by the scroll thumb.
  75. @return No return value
  76. */
  77. ConsoleMethodWithDocs(GuiMenuBarCtrl, setTrackProfile, ConsoleVoid, 3, 3, (GuiControlProfile p))
  78. {
  79. GuiControlProfile* profile;
  80. if (Sim::findObject(argv[2], profile))
  81. object->setControlTrackProfile(profile);
  82. }
  83. /*! Sets the currently used ArrowProfile for the GuiControl
  84. @param p The ArrowProfile is applied to the arrow buttons of the scrollbar if you turn them on.
  85. @return No return value
  86. */
  87. ConsoleMethodWithDocs(GuiMenuBarCtrl, setArrowProfile, ConsoleVoid, 3, 3, (GuiControlProfile p))
  88. {
  89. GuiControlProfile* profile;
  90. if (Sim::findObject(argv[2], profile))
  91. object->setControlArrowProfile(profile);
  92. }
  93. /*! Sets a menu item to active or inactive based on a name.
  94. @param menuName The name of the menu that should be enabled or disabled. If multiple menu items have the same name they will all be enabled or disabled. Case sensative.
  95. @param isActive True if the menu should be enabled. False if it is disabled.
  96. @return No return value.
  97. */
  98. ConsoleMethodWithDocs(GuiMenuBarCtrl, setMenuActive, ConsoleVoid, 4, 4, ("string menuName, bool isActive"))
  99. {
  100. if (argc != 4)
  101. {
  102. Con::warnf("GuiMenuBarCtrl::setMenuActive() - Invalid number of parameters! Should be (string menuName, bool isActive).");
  103. return;
  104. }
  105. object->setMenuActive(argv[2], dAtob(argv[3]));
  106. }
  107. ConsoleMethodGroupEndWithDocs(GuiMenuBarCtrl)