From 0fa141944eff9fa6c6e1c321e9b2119f2793de1f Mon Sep 17 00:00:00 2001 From: akshay-c Date: Thu, 17 Jan 2019 12:22:27 +0530 Subject: Mapped esc to cancel during exit --- ldmicro/CMakeLists.txt | 2 +- ldmicro/ldmicro.cpp | 23 +---------------------- ldmicro/simpledialog.cpp | 4 +++- 3 files changed, 5 insertions(+), 24 deletions(-) diff --git a/ldmicro/CMakeLists.txt b/ldmicro/CMakeLists.txt index c5b73cd..023d17a 100644 --- a/ldmicro/CMakeLists.txt +++ b/ldmicro/CMakeLists.txt @@ -158,7 +158,7 @@ IF(UNIX) set(CPACK_GENERATOR "DEB") set(CPACK_PACKAGE_VERSION_MAJOR "2") set(CPACK_PACKAGE_VERSION_MINOR "2") - set(CPACK_PACKAGE_VERSION_PATCH "3") + set(CPACK_PACKAGE_VERSION_PATCH "4") set(CPACK_DEBIAN_PACKAGE_SHLIBDEPS ON) set(CPACK_PACKAGE_DESCRIPTION "Ladder Logic editor, simulator and compiler for 8 bit microcontrollers") diff --git a/ldmicro/ldmicro.cpp b/ldmicro/ldmicro.cpp index 85ae7c5..f42defe 100644 --- a/ldmicro/ldmicro.cpp +++ b/ldmicro/ldmicro.cpp @@ -234,6 +234,7 @@ BOOL CheckSaveUserCancels(void) return FALSE; case IDCANCEL: + case GTK_RESPONSE_DELETE_EVENT: return TRUE; default: @@ -1326,28 +1327,6 @@ int main(int argc, char** argv) GenerateIoListDontLoseSelection(); RefreshScrollbars(); UpdateMainWindowTitleBar(); - - // MSG msg; - // DWORD ret; - // while(ret = GetMessage(&msg, NULL, 0, 0)) { - // if(msg.hwnd == IoList && msg.message == WM_KEYDOWN) { - // if(msg.wParam == VK_TAB) { - // SetFocus(MainWindow); - // continue; - // } - // } - // if(msg.message == WM_KEYDOWN && msg.wParam != VK_UP && - // msg.wParam != VK_DOWN && msg.wParam != VK_RETURN && msg.wParam - // != VK_SHIFT) - // { - // if(msg.hwnd == IoList) { - // msg.hwnd = MainWindow; - // SetFocus(MainWindow); - // } - // } - // TranslateMessage(&msg); - // DispatchMessage(&msg); - // } gtk_main(); return EXIT_SUCCESS; diff --git a/ldmicro/simpledialog.cpp b/ldmicro/simpledialog.cpp index 3fe5e1f..864189b 100644 --- a/ldmicro/simpledialog.cpp +++ b/ldmicro/simpledialog.cpp @@ -305,6 +305,7 @@ void SimpleDialogWrapUp() DestroyWindow(SimpleDialog); ProgramChanged(); SIMPLE_DIALOG_ACTIVE = FALSE; + gtk_widget_set_sensitive (MainWindow, TRUE); } void SimpleDialogCancelProc() @@ -312,6 +313,7 @@ void SimpleDialogCancelProc() DestroyWindow(SimpleDialog); ProgramChanged(); SIMPLE_DIALOG_ACTIVE = FALSE; + gtk_widget_set_sensitive (MainWindow, TRUE); } static gboolean SimpleDialogKeyPressProc(HWID widget, GdkEventKey* event, gpointer data) @@ -371,6 +373,7 @@ void ShowSimpleDialog(char *title, int boxes, char **labels, DWORD numOnlyMask, // (LONG_PTR)MyAlnumOnlyProc); } } + gtk_widget_show_all(SimpleDialog); g_signal_connect (CancelButton, "clicked", G_CALLBACK (SimpleDialogCancelProc), NULL); g_signal_connect (OkButton, "clicked", G_CALLBACK (SimpleDialogWrapUp), NULL); @@ -378,7 +381,6 @@ void ShowSimpleDialog(char *title, int boxes, char **labels, DWORD numOnlyMask, // EnableWindow(MainWindow, FALSE); // ShowWindow(SimpleDialog, TRUE); - gtk_widget_show_all(SimpleDialog); // SetFocus(Textboxes[0]); // SendMessage(Textboxes[0], EM_SETSEL, 0, -1); -- cgit