00001
00002
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
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
00024 HelpNr = helpNr;
00025 X = x;
00026 Y = y;
00027
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
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089 bool TGrayDialog::DialogFunction(UINT uMsg, WPARAM wParam, LPARAM lParam)
00090 {
00091
00092
00093
00094 const DWORD aHelpIDs[]=
00095 {
00096 CM_ROUTELOAD, IDH_106_115,
00097 CM_ROUTESAVE, IDH_107_116,
00098 CM_INDEVPAUSE, IDH_104_120,
00099 121, IDH_104_121,
00100 122, IDH_105_122,
00101 CM_HELPINDEX, IDH_105_123,
00102 IDM_EDITFILE_DOC, IDH_105_100,
00103 CM_HELPONHELP, IDH_106_124,
00104
00105 IDR_EDIT31, IDH_107_125,
00106 IDR_EDIT32, IDH_107_126,
00107 CM_EXECUTE, IDH_105_102,
00108 IDA_ROUTE, IDH_105_103,
00109 150, IDH_104_150,
00110 CM_COMPILE, IDH_106_104,
00111 151, IDH_105_151,
00112 CM_ACTIVATE, IDH_106_105,
00113 152, IDH_104_152,
00114 CM_STOP, IDH_106_106,
00115 CM_HELPCONTEXT, IDH_104_130,
00116 CM_PANIC, IDH_106_107,
00117 CM_OWM, IDH_106_108,
00118 155, IDH_101_155,
00119 IDSD_RADIOTS1, IDH_101_156,
00120 CM_TOGGLETS, IDH_104_110,
00121 IDSD_RADIOTS2, IDH_101_157,
00122 CM_TOGGLEACT, IDH_104_111,
00123 IDSD_CHECKSE, IDH_101_158,
00124 CM_CAW, IDH_105_112,
00125 159, IDH_101_159,
00126 CM_SETUP, IDH_105_113,
00127 IDSD_CHECKCB, IDH_101_160,
00128 114, IDH_106_114,
00129
00130
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 }