Board game like Abalone for AmigaOS
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

About.cpp 4.5KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145
  1. /*
  2. * This file is part of Abacus.
  3. * Copyright (C) 1997 Kai Nickel
  4. *
  5. * Abacus is free software: you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License as published by
  7. * the Free Software Foundation, either version 3 of the License, or
  8. * (at your option) any later version.
  9. *
  10. * Abacus is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License
  16. * along with Abacus. If not, see <http://www.gnu.org/licenses/>.
  17. *
  18. */
  19. /****************************************************************************************
  20. About.cpp
  21. -----------------------------------------------------------------------------------------
  22. CL_About (Window)
  23. -----------------------------------------------------------------------------------------
  24. 01.01.1996
  25. ****************************************************************************************/
  26. #include "About.hpp"
  27. #include "Tools.hpp"
  28. #include "Images.hpp"
  29. #include <stdio.h> // für sprintf
  30. MUI_CustomClass *CL_About;
  31. /****************************************************************************************
  32. AboutMUI
  33. ****************************************************************************************/
  34. ULONG About_AboutMUI(struct IClass* cl, Object* obj, Msg msg)
  35. {
  36. struct About_Data* data = (About_Data*)INST_DATA(cl, obj);
  37. Object* app = (Object*)xget(obj, MUIA_ApplicationObject);
  38. Object* aboutwin = AboutmuiObject,
  39. MUIA_Window_RefWindow , obj,
  40. MUIA_Aboutmui_Application, app,
  41. End;
  42. if (aboutwin) setatt(aboutwin, MUIA_Window_Open, TRUE);
  43. return 0;
  44. }
  45. /****************************************************************************************
  46. New
  47. ****************************************************************************************/
  48. ULONG About_New(struct IClass* cl, Object* obj, struct opSet* msg)
  49. {
  50. Object *BT_Ok, *BT_MUI;
  51. About_Data tmp;
  52. static char version_text[50];
  53. sprintf(version_text, GetStr(MSG_ABOUT_VERSION), version_number, version_date);
  54. obj = (Object*)DoSuperNew(cl, obj,
  55. MUIA_HelpNode , "COPYRIGHT",
  56. MUIA_Window_LeftEdge , MUIV_Window_LeftEdge_Centered,
  57. MUIA_Window_TopEdge , MUIV_Window_TopEdge_Centered,
  58. MUIA_Window_CloseGadget, FALSE,
  59. MUIA_Window_DepthGadget, FALSE,
  60. MUIA_Window_SizeGadget , FALSE,
  61. MUIA_Window_DragBar , FALSE,
  62. MUIA_Window_Borderless , TRUE,
  63. WindowContents, VGroup, ButtonFrame,
  64. Child, HGroup,
  65. Child, HVSpace,
  66. Child, MakeImage(IMG_Logo_body, IMG_LOGO_WIDTH, IMG_LOGO_HEIGHT,
  67. IMG_LOGO_DEPTH, IMG_LOGO_COMPRESSION, IMG_LOGO_MASKING,
  68. IMG_Abacus_colors),
  69. Child, VGroup,
  70. Child, MakeImage(IMG_Abacus_body, IMG_ABACUS_WIDTH, IMG_ABACUS_HEIGHT,
  71. IMG_ABACUS_DEPTH, IMG_ABACUS_COMPRESSION,
  72. IMG_ABACUS_MASKING, IMG_Abacus_colors),
  73. Child, TextObject,
  74. MUIA_Text_Contents, version_text,
  75. MUIA_Font , MUIV_Font_Tiny,
  76. End,
  77. End,
  78. Child, HVSpace,
  79. End,
  80. Child, HBar(),
  81. Child, HGroup,
  82. Child, HVSpace,
  83. Child, TextObject,
  84. MUIA_Text_Contents, GetStr(MSG_ABOUT_TEXT),
  85. End,
  86. Child, HVSpace,
  87. End,
  88. Child, HBar(),
  89. Child, HGroup,
  90. Child, BT_Ok = MakeButton(MSG_ABOUT_OK , MSG_ABOUT_OK_HELP ),
  91. Child, BT_MUI = MakeButton(MSG_ABOUT_MUI, MSG_ABOUT_MUI_HELP),
  92. End,
  93. End,
  94. TAG_MORE, msg->ops_AttrList);
  95. if (obj)
  96. {
  97. DoMethod(obj , MUIM_Notify, MUIA_Window_CloseRequest, TRUE , obj, 3, MUIM_Set, MUIA_Window_Open, FALSE);
  98. DoMethod(BT_Ok , MUIM_Notify, MUIA_Pressed , FALSE, obj, 3, MUIM_Set, MUIA_Window_Open, FALSE);
  99. DoMethod(BT_MUI, MUIM_Notify, MUIA_Pressed , FALSE, obj, 1, MUIM_About_AboutMUI);
  100. struct About_Data* data = (About_Data*)INST_DATA(cl, obj);
  101. *data = tmp;
  102. return (ULONG)obj;
  103. }
  104. return 0;
  105. }
  106. /****************************************************************************************
  107. Dispatcher
  108. ****************************************************************************************/
  109. SAVEDS ASM ULONG About_Dispatcher(REG(a0) struct IClass* cl,
  110. REG(a2) Object* obj,
  111. REG(a1) Msg msg)
  112. {
  113. switch(msg->MethodID)
  114. {
  115. case OM_NEW : return(About_New (cl, obj, (opSet*)msg));
  116. case MUIM_About_AboutMUI: return(About_AboutMUI(cl, obj, msg));
  117. }
  118. return DoSuperMethodA(cl, obj, msg);
  119. }