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.

MsgWin.cpp 3.1KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108
  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. MsgWin.cpp
  21. -----------------------------------------------------------------------------------------
  22. -----------------------------------------------------------------------------------------
  23. 01.01.1997
  24. ****************************************************************************************/
  25. #include "MsgWin.hpp"
  26. #include "Tools.hpp"
  27. #include "MCC.hpp"
  28. #include "Images.hpp"
  29. struct MUI_CustomClass *CL_MsgWin;
  30. /****************************************************************************************
  31. New
  32. ****************************************************************************************/
  33. ULONG MsgWin_New(struct IClass* cl, Object* obj, struct opSet* msg)
  34. {
  35. MsgWin_Data tmp;
  36. Object* BT_Ok;
  37. char* txtbig = (char*)GetTagData(MUIA_MsgWin_MsgBig , 0, msg->ops_AttrList);
  38. char* txtsmall = (char*)GetTagData(MUIA_MsgWin_MsgSmall, 0, msg->ops_AttrList);
  39. obj = (Object*)DoSuperNew(cl, obj,
  40. MUIA_Window_LeftEdge , MUIV_Window_LeftEdge_Centered,
  41. MUIA_Window_TopEdge , MUIV_Window_TopEdge_Centered,
  42. //MUIA_Window_Width , MUIV_Window_Width_Visible(30),
  43. MUIA_Window_CloseGadget, FALSE,
  44. MUIA_Window_DepthGadget, FALSE,
  45. MUIA_Window_SizeGadget , FALSE,
  46. MUIA_Window_DragBar , FALSE,
  47. MUIA_Window_Borderless , TRUE,
  48. WindowContents, VGroup, ButtonFrame,
  49. Child, TextObject,
  50. MUIA_Font , MUIV_Font_Big,
  51. MUIA_Text_Contents, txtbig,
  52. End,
  53. Child, TextObject,
  54. MUIA_Text_Contents, txtsmall,
  55. End,
  56. Child, HBar(),
  57. Child, HGroup,
  58. Child, HVSpace,
  59. Child, BT_Ok = MUI_MakeObject(MUIO_Button, GetStr(MSG_WINNER_OK)),
  60. Child, HVSpace,
  61. End,
  62. End,
  63. TAG_MORE, msg->ops_AttrList);
  64. if (obj)
  65. {
  66. DoMethod(BT_Ok, MUIM_Notify, MUIA_Pressed, FALSE,
  67. MUIV_Notify_Application, 2, MUIM_Application_ReturnID, MUIV_MsgWin_Close);
  68. struct MsgWin_Data* data = (MsgWin_Data*)INST_DATA(cl, obj);
  69. *data = tmp;
  70. return (ULONG)obj;
  71. }
  72. return 0;
  73. }
  74. /****************************************************************************************
  75. Dispatcher
  76. ****************************************************************************************/
  77. SAVEDS ASM ULONG MsgWin_Dispatcher(REG(a0) struct IClass* cl,
  78. REG(a2) Object* obj,
  79. REG(a1) Msg msg)
  80. {
  81. switch(msg->MethodID)
  82. {
  83. case OM_NEW: return(MsgWin_New (cl, obj, (opSet*)msg));
  84. }
  85. return DoSuperMethodA(cl, obj, msg);
  86. }