summaryrefslogtreecommitdiff
path: root/ldmicro
diff options
context:
space:
mode:
Diffstat (limited to 'ldmicro')
-rw-r--r--ldmicro/coildialog.cpp3
-rw-r--r--ldmicro/commentdialog.cpp3
-rw-r--r--ldmicro/confdialog.cpp3
-rw-r--r--ldmicro/contactsdialog.cpp3
-rw-r--r--ldmicro/iolist.cpp5
-rw-r--r--ldmicro/ldmicro.cpp9
-rw-r--r--ldmicro/lutdialog.cpp12
-rw-r--r--ldmicro/resetdialog.cpp3
-rw-r--r--ldmicro/simpledialog.cpp2
-rw-r--r--ldmicro/simulate.cpp1
10 files changed, 40 insertions, 4 deletions
diff --git a/ldmicro/coildialog.cpp b/ldmicro/coildialog.cpp
index 1d36f98..48630d4 100644
--- a/ldmicro/coildialog.cpp
+++ b/ldmicro/coildialog.cpp
@@ -144,6 +144,7 @@ void CoilDialogGetData (char* name){
gtk_widget_set_sensitive (MainWindow, TRUE);
DestroyWindow (CoilDialog);
+ ProgramChanged();
}
// Mouse click callback
@@ -158,6 +159,7 @@ gboolean CoilDialogKeyPress (HWID widget, GdkEventKey* event, gpointer data){
}
else if (event -> keyval == GDK_KEY_Escape){
DestroyWindow (CoilDialog);
+ ProgramChanged();
gtk_widget_set_sensitive (MainWindow, TRUE);
}
return FALSE;
@@ -166,6 +168,7 @@ gboolean CoilDialogKeyPress (HWID widget, GdkEventKey* event, gpointer data){
// Calls DestroyWindow
void CoilCallDestroyWindow (HWID widget, gpointer data){
DestroyWindow (CoilDialog);
+ ProgramChanged();
gtk_widget_set_sensitive (MainWindow, TRUE);
}
diff --git a/ldmicro/commentdialog.cpp b/ldmicro/commentdialog.cpp
index e6743b4..4ceb107 100644
--- a/ldmicro/commentdialog.cpp
+++ b/ldmicro/commentdialog.cpp
@@ -59,6 +59,7 @@ void CommentDialogGetData (char* comment){
MAX_COMMENT_LEN-1);
gtk_widget_set_sensitive (MainWindow, TRUE);
DestroyWindow (CommentDialog);
+ ProgramChanged();
}
// Mouse click callback
@@ -74,12 +75,14 @@ gboolean CommentDialogKeyPress (HWID widget, GdkEventKey* event, gpointer data){
else if (event -> keyval == GDK_KEY_Escape){
DestroyWindow (CommentDialog);
gtk_widget_set_sensitive (MainWindow, TRUE);
+ ProgramChanged();
}
return FALSE;
}
void CommentCallDestroyWindow (HWID widget, gpointer data){
DestroyWindow (CommentDialog);
+ ProgramChanged();
gtk_widget_set_sensitive (MainWindow, TRUE);
}
diff --git a/ldmicro/confdialog.cpp b/ldmicro/confdialog.cpp
index 2fd8dd7..c162ac4 100644
--- a/ldmicro/confdialog.cpp
+++ b/ldmicro/confdialog.cpp
@@ -170,6 +170,7 @@ void ConfDialogGetData (GtkWidget* widget, gpointer data){
buf = const_cast <char*> (gtk_entry_get_text (GTK_ENTRY(BaudTextbox)));
Prog.baudRate = atoi(buf);
DestroyWindow (ConfDialog);
+ ProgramChanged();
}
// Checks for the required key press
@@ -179,6 +180,7 @@ gboolean ConfDialogKeyPress (GtkWidget* widget, GdkEventKey* event, gpointer dat
}
else if (event -> keyval == GDK_KEY_Escape){
DestroyWindow (ConfDialog);
+ ProgramChanged();
gtk_widget_set_sensitive (MainWindow, TRUE);
}
return FALSE;
@@ -186,6 +188,7 @@ gboolean ConfDialogKeyPress (GtkWidget* widget, GdkEventKey* event, gpointer dat
void ConfCallDestroyWindow (HWID widget, gpointer data){
DestroyWindow (ConfDialog);
+ ProgramChanged();
gtk_widget_set_sensitive (MainWindow, TRUE);
}
diff --git a/ldmicro/contactsdialog.cpp b/ldmicro/contactsdialog.cpp
index bf896fa..38750c8 100644
--- a/ldmicro/contactsdialog.cpp
+++ b/ldmicro/contactsdialog.cpp
@@ -128,6 +128,7 @@ void ContactsDialogGetData (BOOL* negated, char* name){
strcpy (name+1, gtk_entry_get_text (GTK_ENTRY (NameTextbox)));
DestroyWindow (ContactsDialog);
+ ProgramChanged();
gtk_widget_set_sensitive (MainWindow, TRUE);
}
@@ -143,6 +144,7 @@ gboolean ContactsDialogKeyPress (HWID widget, GdkEventKey* event, gpointer data)
}
else if (event -> keyval == GDK_KEY_Escape){
DestroyWindow (ContactsDialog);
+ ProgramChanged();
gtk_widget_set_sensitive (MainWindow, TRUE);
}
return FALSE;
@@ -150,6 +152,7 @@ gboolean ContactsDialogKeyPress (HWID widget, GdkEventKey* event, gpointer data)
void ContactsCallDestroyWindow (HWID widget, gpointer data){
DestroyWindow (ContactsDialog);
+ ProgramChanged();
gtk_widget_set_sensitive (MainWindow, TRUE);
}
diff --git a/ldmicro/iolist.cpp b/ldmicro/iolist.cpp
index f20b2f7..b037c10 100644
--- a/ldmicro/iolist.cpp
+++ b/ldmicro/iolist.cpp
@@ -401,15 +401,18 @@ static gboolean AnalogSliderDialogKeyboardProc(GtkWidget* widget, GdkEventKey* e
if (AnalogSliderDone == TRUE || AnalogSliderCancel == TRUE)
{
DestroyWindow (AnalogSliderMain);
+ ProgramChanged();
return FALSE;
}
if (event->keyval == GDK_KEY_Return){
DestroyWindow (AnalogSliderMain);
+ ProgramChanged();
AnalogSliderDone = TRUE;
}
else if (event->keyval == GDK_KEY_Escape){
DestroyWindow (AnalogSliderMain);
+ ProgramChanged();
AnalogSliderDone = TRUE;
AnalogSliderCancel = TRUE;
}
@@ -423,6 +426,7 @@ static gboolean AnalogSliderDialogMouseProc(GtkWidget *widget, GdkEventButton *e
SetAdcShadow((char*)name, v);
if (event->button == 1 && event->type == GDK_BUTTON_RELEASE){
DestroyWindow (AnalogSliderMain);
+ ProgramChanged();
AnalogSliderDone = TRUE;
}
@@ -558,6 +562,7 @@ static void IoDialogProc(BOOL DialogDone, int item)
}
DestroyWindow(IoDialog);
+ ProgramChanged();
}
void IoDialogRowActivateProc(GtkTreeView *tree_view, GtkTreePath *path, GtkTreeViewColumn *column, gpointer user_data)
diff --git a/ldmicro/ldmicro.cpp b/ldmicro/ldmicro.cpp
index cfd25da..bdbb332 100644
--- a/ldmicro/ldmicro.cpp
+++ b/ldmicro/ldmicro.cpp
@@ -712,6 +712,7 @@ gboolean LD_WM_Close_call(GtkWidget *widget, GdkEvent *event, gpointer user_data
FreezeDWORD(IoListHeight);
gtk_main_quit();
+ gdk_threads_leave();
}
gboolean LD_GTK_mouse_click_hook(GtkWidget *widget, GdkEvent *event, gpointer user_data)
@@ -877,15 +878,15 @@ gboolean LD_WM_Paint_call(HWID widget, HCRDC cr, gpointer data)
return FALSE;
}
-void LD_WM_Destroy_call(GtkWidget *widget, GdkEvent *event, gpointer user_data)
+gboolean LD_WM_Destroy_call(GtkWidget *widget, GdkEvent *event, gpointer user_data)
{
/* Handles:
* WM_DESTROY
*/
- g_print("destroy called\n");
- CheckSaveUserCancels();
- return;
+ if(CheckSaveUserCancels())
+ return TRUE;
+
FreezeWindowPos(MainWindow);
FreezeDWORD(IoListHeight);
diff --git a/ldmicro/lutdialog.cpp b/ldmicro/lutdialog.cpp
index e106e31..04e7684 100644
--- a/ldmicro/lutdialog.cpp
+++ b/ldmicro/lutdialog.cpp
@@ -195,6 +195,7 @@ static void DestroyLutControls(BOOL destroyFlag = TRUE)
DestroyWindow(ValuesLabel[i]);
}
}
+ ProgramChanged();
}
}
@@ -222,6 +223,7 @@ static void DestroyLutControlsPiecewise(BOOL destroyFlag = TRUE)
DestroyWindow(ValuesTextbox[i]);
DestroyWindow(ValuesLabel[i]);
}
+ ProgramChanged();
}
}
@@ -434,12 +436,14 @@ void LookUpTableCheckMode (void){
DestroyWindow(ValuesLabel[i]);
}
}
+ ProgramChanged();
}
else {
DestroyLutControls();
if (!x && GTK_IS_ENTRY(StringTextbox))
{
DestroyWindow(StringTextbox);
+ ProgramChanged();
gtk_editable_set_editable (GTK_EDITABLE (CountTextbox), TRUE);
}
}
@@ -456,12 +460,14 @@ gboolean LookUpTableKeyPress (HWID widget, GdkEventKey* event, gpointer data){
LookUpTableCheckMode ();
LookUpTableGetData((gpointer) data);
DestroyWindow (LutDialog);
+ ProgramChanged();
gtk_widget_set_sensitive (MainWindow, TRUE);
g_source_remove (LUT_DIALOG_REFRESH_TIMER_ID_1);
LUT_DIALOG_REFRESH_TIMER_ID_1 = 0;
}
else if (event -> keyval == GDK_KEY_Escape){
DestroyWindow (LutDialog);
+ ProgramChanged();
gtk_widget_set_sensitive (MainWindow, TRUE);
g_source_remove (LUT_DIALOG_REFRESH_TIMER_ID_1);
LUT_DIALOG_REFRESH_TIMER_ID_1 = 0;
@@ -483,6 +489,7 @@ void LutDialogOk (HWID widget, gpointer data)
LookUpTableGetData((gpointer) data);
DestroyWindow (LutDialog);
+ ProgramChanged();
gtk_widget_set_sensitive (MainWindow, TRUE);
g_source_remove (LUT_DIALOG_REFRESH_TIMER_ID_1);
LUT_DIALOG_REFRESH_TIMER_ID_1 = 0;
@@ -492,6 +499,7 @@ void LutDialogOk (HWID widget, gpointer data)
void LutCallCancel (HWID widget, gpointer data)
{
DestroyWindow (LutDialog);
+ ProgramChanged();
gtk_widget_set_sensitive (MainWindow, TRUE);
g_source_remove (LUT_DIALOG_REFRESH_TIMER_ID_1);
LUT_DIALOG_REFRESH_TIMER_ID_1 = 0;
@@ -621,6 +629,7 @@ void PiecewiseDialogOk (HWID widget, gpointer data)
PiecewiseDialogGetData((gpointer) data);
DestroyWindow (LutDialog);
+ ProgramChanged();
gtk_widget_set_sensitive (MainWindow, TRUE);
g_source_remove (LUT_DIALOG_REFRESH_TIMER_ID_2);
LUT_DIALOG_REFRESH_TIMER_ID_2 = 0;
@@ -633,12 +642,14 @@ gboolean PiecewiseDialogKeyPress (HWID widget, GdkEventKey* event, gpointer data
PiecewiseDialogPointTextbox (piecewiseTmpCount);
PiecewiseDialogGetData((gpointer) data);
DestroyWindow (LutDialog);
+ ProgramChanged();
gtk_widget_set_sensitive (MainWindow, TRUE);
g_source_remove (LUT_DIALOG_REFRESH_TIMER_ID_2);
LUT_DIALOG_REFRESH_TIMER_ID_2 = 0;
}
else if (event -> keyval == GDK_KEY_Escape){
DestroyWindow (LutDialog);
+ ProgramChanged();
gtk_widget_set_sensitive (MainWindow, TRUE);
g_source_remove (LUT_DIALOG_REFRESH_TIMER_ID_2);
LUT_DIALOG_REFRESH_TIMER_ID_2 = 0;
@@ -650,6 +661,7 @@ gboolean PiecewiseDialogKeyPress (HWID widget, GdkEventKey* event, gpointer data
void PiecewiseCallCancel (HWID widget, gpointer data)
{
DestroyWindow (LutDialog);
+ ProgramChanged();
gtk_widget_set_sensitive (MainWindow, TRUE);
g_source_remove (LUT_DIALOG_REFRESH_TIMER_ID_2);
LUT_DIALOG_REFRESH_TIMER_ID_2 = 0;
diff --git a/ldmicro/resetdialog.cpp b/ldmicro/resetdialog.cpp
index 238814a..ff250df 100644
--- a/ldmicro/resetdialog.cpp
+++ b/ldmicro/resetdialog.cpp
@@ -96,6 +96,7 @@ void ResetDialogGetData (char* name){
strcpy (name+1, gtk_entry_get_text (GTK_ENTRY (NameTextbox)));
gtk_widget_set_sensitive (MainWindow, TRUE);
DestroyWindow (ResetDialog);
+ ProgramChanged();
}
// Mouse click callback
@@ -110,6 +111,7 @@ gboolean ResetDialogKeyPress (HWID widget, GdkEventKey* event, gpointer data){
}
else if (event -> keyval == GDK_KEY_Escape){
DestroyWindow (ResetDialog);
+ ProgramChanged();
gtk_widget_set_sensitive (MainWindow, TRUE);
}
return FALSE;
@@ -117,6 +119,7 @@ gboolean ResetDialogKeyPress (HWID widget, GdkEventKey* event, gpointer data){
void ResetCallDestroyWindow (HWID widget, gpointer data){
DestroyWindow (ResetDialog);
+ ProgramChanged();
gtk_widget_set_sensitive (MainWindow, TRUE);
}
diff --git a/ldmicro/simpledialog.cpp b/ldmicro/simpledialog.cpp
index 0d63a22..b41bae1 100644
--- a/ldmicro/simpledialog.cpp
+++ b/ldmicro/simpledialog.cpp
@@ -303,12 +303,14 @@ void SimpleDialogWrapUp()
}
DestroyWindow(SimpleDialog);
+ ProgramChanged();
SIMPLE_DIALOG_ACTIVE = FALSE;
}
void SimpleDialogCancelProc()
{
DestroyWindow(SimpleDialog);
+ ProgramChanged();
SIMPLE_DIALOG_ACTIVE = FALSE;
}
diff --git a/ldmicro/simulate.cpp b/ldmicro/simulate.cpp
index 0b3c206..ff7a870 100644
--- a/ldmicro/simulate.cpp
+++ b/ldmicro/simulate.cpp
@@ -956,6 +956,7 @@ void DestroyUartSimulationWindow(void)
FreezeDWORD(TerminalH);
DestroyWindow(UartSimulationWindow);
+ ProgramChanged();
UartSimulationWindow = NULL;
}