home *** CD-ROM | disk | FTP | other *** search
/ Point Programming 1 / PPROG1.ISO / c / fli106c / dlgshow.cpp < prev    next >
Encoding:
C/C++ Source or Header  |  1992-03-11  |  3.2 KB  |  140 lines

  1. //
  2. // The Fusion Library Interface for DOS
  3. // Version 1.06c
  4. // Copyright (C) 1990, 1991, 1992
  5. // Software Dimensions
  6. //
  7. // DialogClass
  8. //
  9.  
  10. #include "fli.h"
  11. #include "colors.h"
  12.  
  13. #ifdef __BCPLUSPLUS__
  14. #pragma hdrstop
  15. #endif
  16.  
  17. #include <string.h>
  18.  
  19. //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  20. //
  21. // ShowElements()
  22. //
  23. // Show the elements
  24. //
  25. //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  26.  
  27. void DialogClass::ShowElements(int Here)
  28. {
  29.   Blaze.InvisibleCursor();
  30.  
  31.   DialogElement *Redraw=First;
  32.  
  33.   do
  34.   {
  35.     if (!Here || (Here && Redraw!=Present))
  36.     {
  37.       Redraw->Show();
  38.       MouseHide();
  39.       if (Redraw->LocatorText && !AlreadyShown)
  40.         Blaze.QuickDisplay(Redraw->LocX,Redraw->LocY,
  41.           (Redraw->Available()!=FailedEvent)?
  42.             Colors.DiaQuickKey:Colors.DiaDeadLocator,
  43.           (Redraw->Available()!=FailedEvent)?
  44.             Colors.DiaLocator:Colors.DiaDeadLocator,Redraw->LocatorText);
  45.       MouseShow();
  46.     }
  47.     Redraw=Redraw->Next;
  48.   }
  49.   while (Redraw);
  50.  
  51.   AlreadyShown=1;
  52.  
  53.   Blaze.VisibleCursor();
  54. }
  55.  
  56. //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  57. //
  58. // ShowDialogBox()
  59. //
  60. // Show the dialog box
  61. //
  62. //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  63.  
  64. void DialogClass::ShowDialogBox()
  65. {
  66.    BlazeClass Blaze;
  67.  
  68.    MouseHide();
  69.    Blaze.Window(X,Y,Width,Height);
  70.  
  71.    Blaze.Box(0,0,Width,Height,Colors.DiaBorder);
  72.  
  73.    if (CloseIcon)
  74.      Blaze (1,0) << Colors.DiaBorder << '['
  75.        << Colors.DiaCloseIcon << '\x7'
  76.        << Colors.DiaBorder << ']';
  77.  
  78.    int Icon=(CloseIcon)?0:4;
  79.  
  80.    if (TopTitle && strlen(TopTitle)<=((Width-6)+Icon))
  81.      Blaze (5-Icon,0) << Colors.DiaTitle << TopTitle;
  82.  
  83.    MouseShow();
  84. }
  85.  
  86. //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  87. //
  88. // ShowLocator()
  89. //
  90. // Show the locator
  91. //
  92. //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  93.  
  94. void DialogClass::ShowLocator(int Visible)
  95. {
  96.   MouseHide();
  97.   if (Present->LocatorText)
  98.     Blaze.QuickDisplay(Present->LocX,Present->LocY,
  99.       (Visible)?Colors.DiaHiLiteLocator:
  100.         ((Present->Available()!=FailedEvent)?Colors.DiaQuickKey:Colors.DiaDeadLocator),
  101.       (Visible)?Colors.DiaHiLiteLocator:
  102.         ((Present->Available()!=FailedEvent)?Colors.DiaLocator:Colors.DiaDeadLocator),
  103.       Present->LocatorText);
  104.  
  105.   if (Visible)
  106.     Blaze.HelpLine(Present->FusionHelp,Present->Help);
  107.   MouseShow();
  108. }
  109.  
  110. //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  111. //
  112. // ShowHeading()
  113. //
  114. // Show the heading locator
  115. //
  116. //-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
  117.  
  118. void DialogClass::ShowHeading(int Visible)
  119. {
  120.   if (!HeadingCount)
  121.     return;
  122.  
  123.   MouseHide();
  124.  
  125.   for (int i=0;i<HeadingCount;i++)
  126.   {
  127.     _GroupHeadings &Head=*(HeadingStorage+i);
  128.  
  129.     if (!Visible)
  130.       Blaze.QuickDisplay(Head.X,Head.Y,Colors.DiaHeadingQuickKey,
  131.         Colors.DiaHeading,Head.Heading);
  132.     else if (Head.GroupCode==Visible)
  133.       Blaze.QuickDisplay(Head.X,Head.Y,Colors.DiaHiLiteHeading,
  134.         Colors.DiaHiLiteHeading,Head.Heading);
  135.   }
  136.  
  137.   MouseShow();
  138. }
  139.  
  140.