home *** CD-ROM | disk | FTP | other *** search
/ PC Administrator / spravce.iso / RunModule / src / RunModuleData.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  2001-10-12  |  3.7 KB  |  112 lines

  1. // RunModuleData.cpp: implementation of the CRunModuleData class.
  2. //
  3. /*
  4. Copyright 2001 Anish Mistry. All rights reserved.
  5.  
  6. Redistribution and use in source and binary forms, with or without modification,
  7. are permitted provided that the following conditions are met:
  8.  
  9.    1. Redistributions of source code must retain the above copyright notice, 
  10.    this list of conditions and the following disclaimer.
  11.    2. Redistributions in binary form must reproduce the above copyright notice,
  12.    this list of conditions and the following disclaimer in the documentation 
  13.    and/or other materials provided with the distribution.
  14.  
  15. THIS SOFTWARE IS PROVIDED BY ANISH MISTRY ``AS IS'' AND ANY EXPRESS OR IMPLIED 
  16. WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY 
  17. AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS 
  18. OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
  19. OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
  20. GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
  21. CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR
  22. TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
  23. SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  24.  
  25. The views and conclusions contained in the software and documentation are those
  26. of the authors and should not be interpreted as representing official policies,
  27. either expressed or implied, of Anish Mistry or AM Productions.
  28.  
  29. * Variation of the FreeBSD License. http://www.freebsd.org/copyright/freebsd-license.html
  30. */
  31. //////////////////////////////////////////////////////////////////////
  32.  
  33. #include "stdafx.h"
  34. #include "RunModuleData.h"
  35.  
  36. //////////////////////////////////////////////////////////////////////
  37. // Construction/Destruction
  38. //////////////////////////////////////////////////////////////////////
  39.  
  40. CRunModuleData::CRunModuleData()
  41. {
  42.     SetFile("runmodule.ini");
  43. }
  44.  
  45. CRunModuleData::~CRunModuleData()
  46. {
  47.  
  48. }
  49.  
  50. void CRunModuleData::SetWndPos(POINT pt)
  51. {// begin SetWndPos
  52.     WriteKey("layout","wnd-x",pt.x);
  53.     WriteKey("layout","wnd-y",pt.y);
  54. }// end SetWndPos
  55.  
  56. POINT CRunModuleData::GetPos(const char *pItem)
  57. {// begin GetPos
  58.     char pTemp[MAX_PATH] = {NULL};
  59.     wsprintf(pTemp,"%hs-x",pItem);
  60.     POINT pt = {NULL};
  61.     pt.x = ReadKey("layout",pTemp,-1);
  62.     wsprintf(pTemp,"%hs-y",pItem);
  63.     pt.y = ReadKey("layout",pTemp,-1);
  64.     return pt;
  65. }// end GetPos
  66.  
  67. SIZE CRunModuleData::GetSize(const char *pItem)
  68. {// begin GetSize
  69.     char pTemp[MAX_PATH] = {NULL};
  70.     wsprintf(pTemp,"%hs-cx",pItem);
  71.     SIZE sz = {NULL};
  72.     sz.cx = ReadKey("layout",pTemp,0);
  73.     wsprintf(pTemp,"%hs-cy",pItem);
  74.     sz.cy = ReadKey("layout",pTemp,0);
  75.     return sz;
  76. }// end GetSize
  77.  
  78. bool CRunModuleData::HideDescriptions()
  79. {// begin HideDescriptions
  80.     return (bool)ReadKey("settings","hide-descriptions",0);
  81. }// end HideDescriptions
  82.  
  83. bool CRunModuleData::GetStayOpen()
  84. {// begin GetStayOpen
  85.     return (bool)ReadKey("settings","stay-open",1);
  86. }// end GetStayOpen
  87.  
  88. void CRunModuleData::SetStayOpen(bool bStayOpen)
  89. {// begin SetStayOpen
  90.     WriteKey("settings","stay-open",bStayOpen);
  91. }// end SetStayOpen
  92.  
  93. bool CRunModuleData::MakeToolWindow()
  94. {// begin MakeToolWindow
  95.     return (bool)ReadKey("settings","toolwindow",0);
  96. }// end MakeToolWindow
  97.  
  98. bool CRunModuleData::MakeTopMost()
  99. {// begin MakeTopMost
  100.     return (bool)ReadKey("settings","topmost",0);
  101. }// end MakeTopMost
  102.  
  103. bool CRunModuleData::NoCaption()
  104. {// begin NoCaption
  105.     return (bool)ReadKey("settings","no-caption",0);
  106. }// end NoCaption
  107.  
  108. bool CRunModuleData::MakeShellSafe()
  109. {// begin MakeShellSafe
  110.     return (bool)ReadKey("settings","shell-safeties",0);
  111. }// end MakeShellSafe
  112.