Gray.cpp
gehe zur Dokumentation dieser Datei
00001 // TGrayDialog ------------------------------------------------------
00002 // auf dem Bildschirm zentrierter Dialog mit grauem Hintergrund
00003 
00004 #include "Gray.h"
00005 #include "Mutabor.rh"
00006 #include "diahlp.h"
00007 
00008 #define H_TASKBAR 35
00009 
00010 const char HlpFile[] = "MUTABOR.HLP";
00011 
00012 DEFINE_RESPONSE_TABLE1(TGrayDialog, TDialog)
00013   EV_COMMAND(CM_HELPCOMMON, CmHelpCommon),
00014   EV_COMMAND(IDHELP_, CmHelpCommon),
00015   EV_COMMAND(IDR_ERASE01, CmErase),
00016   EV_COMMAND(IDR_ERASE02, CmErase),
00017 //  EV_WM_CTLCOLOR,
00018 END_RESPONSE_TABLE;
00019 
00020 TGrayDialog::TGrayDialog(TWindow* parent, TResId resId, int helpNr, int x, int y, TModule* module)
00021  : TDialog(parent, resId, module)
00022 {
00023 //  SetBkgndColor(RGB(196, 196, 196));
00024   HelpNr = helpNr;
00025   X = x;
00026   Y = y;
00027 //TW  Attr.AccelTable = IDA_GRAYDIALOG;
00028 }
00029 
00030 void TGrayDialog::SetupWindow()
00031 {
00032   TDialog::SetupWindow();
00033 
00034   HWND desk = GetDesktopWindow();
00035   if ( desk )
00036   {
00037            TRect R;
00038            ::GetClientRect(desk, &R);
00039     if ( Y == -1 )
00040     {
00041       TWindow::Attr.X = (R.right - TWindow::Attr.W) / 2;
00042              TWindow::Attr.Y = (R.bottom - TWindow::Attr.H) / 2;
00043     }
00044     else
00045     {
00046       TPoint p = TPoint(X,Y);
00047       Parent->ClientToScreen(p);
00048       TWindow::Attr.X = p.x +10;
00049              TWindow::Attr.Y = p.y + 10;
00050     }
00051     if ( TWindow::Attr.X+TWindow::Attr.W > R.right )
00052       TWindow::Attr.X = R.right-TWindow::Attr.W;
00053     if ( TWindow::Attr.Y+TWindow::Attr.H+H_TASKBAR > R.bottom )
00054       TWindow::Attr.Y = R.bottom-TWindow::Attr.H-H_TASKBAR;
00055     if ( TWindow::Attr.X < 0 )
00056       TWindow::Attr.X = 0;
00057     if ( TWindow::Attr.Y < 0 )
00058       TWindow::Attr.Y = 0;
00059   }
00060   MoveWindow(TWindow::Attr.X, TWindow::Attr.Y,
00061          TWindow::Attr.W, TWindow::Attr.H, false);
00062 }
00063 
00064 void TGrayDialog::CmHelpCommon()
00065 {
00066   WinHelp(HlpFile, HELP_CONTEXT, HelpNr);
00067 }
00068 
00069 void TGrayDialog::CmErase()
00070 {
00071   CloseWindow(IDR_ERASE01);
00072 }
00073 /*
00074 HBRUSH TGrayDialog::EvCtlColor(HDC hDC, HWND hWndChild, UINT ctlType)
00075 {
00076   switch (ctlType)
00077   {
00078            case CTLCOLOR_STATIC:
00079                     SetBkColor(hDC, RGB(196, 196, 196));
00080                     return (HBRUSH)GetStockObject(NULL_BRUSH);
00081            case CTLCOLOR_BTN:
00082                     SetBkMode(hDC, TRANSPARENT);
00083                 return (HBRUSH)GetStockObject(NULL_BRUSH);
00084            default:
00085                     return TDialog::EvCtlColor(hDC, hWndChild, ctlType);
00086   }
00087 }
00088 */
00089 bool TGrayDialog::DialogFunction(UINT uMsg, WPARAM wParam,  LPARAM lParam)
00090 {
00091 
00092         // Create an array of control identifiers and context identifiers.
00093 
00094 const DWORD aHelpIDs[]=
00095 {
00096         CM_ROUTELOAD,   IDH_106_115,    // Mutabor-Box: "Mode" (Button)
00097         CM_ROUTESAVE,   IDH_107_116,    // Output filter: "Channel" (Button)
00098         CM_INDEVPAUSE,  IDH_104_120,    // Input device: "" (Edit)
00099         121,    IDH_104_121,    // Input device: "" (Edit)
00100         122,    IDH_105_122,    // Input filter: "" (Edit)
00101         CM_HELPINDEX,   IDH_105_123,    // Input filter: "" (Edit)
00102         IDM_EDITFILE_DOC,       IDH_105_100,    // Input filter: "all" (Button)
00103         CM_HELPONHELP,  IDH_106_124,    // Mutabor-Box: "" (Edit)
00104 //9     IDC_STATICBITMAP1,      IDH_105_101,    // Input filter: "else" (Button)
00105         IDR_EDIT31,     IDH_107_125,    // Output filter: "" (Edit)
00106         IDR_EDIT32,     IDH_107_126,    // Output filter: "" (Edit)
00107         CM_EXECUTE,     IDH_105_102,    // Input filter: "channel" (Button)
00108         IDA_ROUTE,      IDH_105_103,    // Input filter: "staff" (Button)
00109         150,    IDH_104_150,    // Input device: "Löschen" (Button)
00110         CM_COMPILE,     IDH_106_104,    // Mutabor-Box: "box number" (Button)
00111         151,    IDH_105_151,    // Input filter: "Löschen" (Button)
00112         CM_ACTIVATE,    IDH_106_105,    // Mutabor-Box: "GUIDO-File" (Button)
00113         152,    IDH_104_152,    // Input device: "Durchsuchen" (Button)
00114         CM_STOP,        IDH_106_106,    // Mutabor-Box: "no Box / thru-mode" (Button)
00115         CM_HELPCONTEXT, IDH_104_130,    // Input device: "" (ComboBox)
00116         CM_PANIC,       IDH_106_107,    // Mutabor-Box: "active" (Button)
00117         CM_OWM, IDH_106_108,    // Mutabor-Box: "passive" (Button)
00118         155,    IDH_101_155,    // Setup: "Windows" (Button)
00119         IDSD_RADIOTS1,  IDH_101_156,    // Setup: "  as &tone system " (Button)
00120         CM_TOGGLETS,    IDH_104_110,    // Input device: "Type" (Button)
00121         IDSD_RADIOTS2,  IDH_101_157,    // Setup: "  as &relations  " (Button)
00122         CM_TOGGLEACT,   IDH_104_111,    // Input device: "I" (Button)
00123         IDSD_CHECKSE,   IDH_101_158,    // Setup: " save &editorfiles " (Button)
00124         CM_CAW, IDH_105_112,    // Input filter: "Type" (Button)
00125         159,    IDH_101_159,    // Setup: "Tone system" (Button)
00126         CM_SETUP,       IDH_105_113,    // Input filter: "Range" (Button)
00127         IDSD_CHECKCB,   IDH_101_160,    // Setup: " use color bars" (Button)
00128         114,    IDH_106_114,    // Mutabor-Box: "Box" (Button)
00129 //  IDR_EDIT31, IDR_EDIT31_H,
00130 //  IDR_EDIT32, IDR_EDIT32_H,
00131   IDR_CHECKBOX31, IDR_CHECKBOX31_H,
00132         0, 0
00133 };
00134 
00135         switch (uMsg) {
00136     case WM_HELP:
00137         ::WinHelp((HWND)(((LPHELPINFO) lParam)->hItemHandle), HlpFile,
00138             HELP_WM_HELP, (DWORD) (LPSTR) aHelpIDs);
00139 
00140         break;
00141             case WM_CONTEXTMENU:
00142                 ::WinHelp((HWND) wParam, HlpFile, HELP_CONTEXTMENU,
00143                     (DWORD) (LPVOID) aHelpIDs);
00144                 break;
00145       default:
00146          return TDialog::DialogFunction(uMsg, wParam, lParam);
00147         }
00148 
00149         return FALSE;
00150 }

Erzeugt am Sun Aug 21 2011 10:51:51 für Mutabor von doxygen 1.7.4