From 4f49fbcdbcd9145cd4895d13d1e9da1a2d6f2ce8 Mon Sep 17 00:00:00 2001 From: Mark Tempel Date: Thu, 15 Jan 2004 05:27:18 +0000 Subject: [PATCH] Update to remove a bit of MFC style preprocessor abuse to get this application to compile. svn path=/trunk/; revision=7639 --- rosapps/calc/main.c | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/rosapps/calc/main.c b/rosapps/calc/main.c index 276ce7b8fa2..4b1175b35a7 100644 --- a/rosapps/calc/main.c +++ b/rosapps/calc/main.c @@ -38,7 +38,9 @@ HACCEL hAccel; BOOL bDigitGrouping = FALSE; - +/*TODO: Figure out why we are copying MFC map style programming. +** This pattern is difficult to maintain. +*/ #define BEGIN_CMD_MAP(a) switch(##a) { #define CMD_MAP_ENTRY(a, b) case a: b(); break; #define END_CMD_MAP(a) } @@ -133,7 +135,9 @@ void OnHelpTopics(void) void OnHelpAbout(void) { } - +void OnButtonClick(int ButtonID) +{ +} // Message handler for dialog box. LRESULT CALLBACK CalcWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lParam) { @@ -154,14 +158,17 @@ LRESULT CALLBACK CalcWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lPar } if (HIWORD(wParam) == BN_CLICKED) { - switch (LOWORD(wParam)) { -// case IDC_OWNERDRAW: + switch (LOWORD(wParam)) { + OnButtonClick(LOWORD(wParam)); + //case IDC_OWNERDRAW: // // application-defined processing // break; } } - BEGIN_CMD_MAP(LOWORD(wParam)) + //BEGIN_CMD_MAP( LOWORD(wParam) ) + switch (LOWORD(wParam)) + { CMD_MAP_ENTRY(ID_EDIT_COPY, OnEditCopy) CMD_MAP_ENTRY(ID_EDIT_PASTE, OnEditPaste) CMD_MAP_ENTRY(ID_VIEW_STANDARD, OnViewStandard) @@ -176,7 +183,8 @@ LRESULT CALLBACK CalcWndProc(HWND hDlg, UINT message, WPARAM wParam, LPARAM lPar CMD_MAP_ENTRY(ID_VIEW_GRADS, OnViewGrads) CMD_MAP_ENTRY(ID_HELP_TOPICS, OnHelpTopics) CMD_MAP_ENTRY(ID_HELP_ABOUT, OnHelpAbout) - END_CMD_MAP(0) + } + //END_CMD_MAP(0) break; /* case WM_KEYUP: