diff options
author | akshay-c | 2019-01-17 12:22:27 +0530 |
---|---|---|
committer | akshay-c | 2019-01-17 12:22:27 +0530 |
commit | 0fa141944eff9fa6c6e1c321e9b2119f2793de1f (patch) | |
tree | 2931f75a1f478b0c8d9c9d842216d569012b4279 | |
parent | 12a67b195387a18844e7f5d2c672f25f76d93684 (diff) | |
download | LDMicroGtk-0fa141944eff9fa6c6e1c321e9b2119f2793de1f.tar.gz LDMicroGtk-0fa141944eff9fa6c6e1c321e9b2119f2793de1f.tar.bz2 LDMicroGtk-0fa141944eff9fa6c6e1c321e9b2119f2793de1f.zip |
Mapped esc to cancel during exit
-rw-r--r-- | ldmicro/CMakeLists.txt | 2 | ||||
-rw-r--r-- | ldmicro/ldmicro.cpp | 23 | ||||
-rw-r--r-- | 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); |