diff options
author | akshay-c | 2018-07-23 16:29:09 +0530 |
---|---|---|
committer | akshay-c | 2018-07-23 16:29:09 +0530 |
commit | 64b9b4a7cf9d7aa0c947c8771eb43d7a60f1f2f1 (patch) | |
tree | e0bfb634a7e3b0e12563c201009d9adaa9b087a7 /ldmicro | |
parent | e7a0739bd60a65f4c402e27a1543295400ff6b00 (diff) | |
download | LDMicroGtk-64b9b4a7cf9d7aa0c947c8771eb43d7a60f1f2f1.tar.gz LDMicroGtk-64b9b4a7cf9d7aa0c947c8771eb43d7a60f1f2f1.tar.bz2 LDMicroGtk-64b9b4a7cf9d7aa0c947c8771eb43d7a60f1f2f1.zip |
fixes:return control to mainwindow on closing settings dialog, Update state during simulation
Diffstat (limited to 'ldmicro')
-rw-r--r-- | ldmicro/confdialog.cpp | 1 | ||||
-rw-r--r-- | ldmicro/iolist.cpp | 28 | ||||
-rw-r--r-- | ldmicro/maincontrols.cpp | 3 | ||||
-rw-r--r-- | ldmicro/simulate.cpp | 1 |
4 files changed, 18 insertions, 15 deletions
diff --git a/ldmicro/confdialog.cpp b/ldmicro/confdialog.cpp index 2fd8dd7..1830de9 100644 --- a/ldmicro/confdialog.cpp +++ b/ldmicro/confdialog.cpp @@ -203,6 +203,7 @@ void ConfDialogSignalCall () { G_CALLBACK(ConfDialogGetData), NULL); g_signal_connect (G_OBJECT (CancelButton), "clicked", G_CALLBACK(ConfCallDestroyWindow), NULL); + g_signal_connect (ConfDialog, "delete_event", G_CALLBACK (ConfCallDestroyWindow), NULL); } void ShowConfDialog(void) diff --git a/ldmicro/iolist.cpp b/ldmicro/iolist.cpp index f20b2f7..7b5748f 100644 --- a/ldmicro/iolist.cpp +++ b/ldmicro/iolist.cpp @@ -784,7 +784,6 @@ void IoListProc(NMHDR *h) { switch(h->code) { case LVN_GETDISPINFO: { - int item = h->item.iItem; /// Don't confuse people by displaying bogus pin assignments /// for the C target. @@ -809,6 +808,17 @@ void IoListProc(NMHDR *h) g_value_set_string(&val, (const char*)&IO_value_holder); gtk_list_store_set_value (GTK_LIST_STORE(h->hlistFrom), h->hlistIter, LV_IO_PIN, &val); } + + /// case LV_IO_STATE: + if(InSimulationMode) { + char *name = Prog.io.assignment[item].name; + DescribeForIoList(name, IO_value_holder); + } else { + strcpy(IO_value_holder, ""); + } + + g_value_set_string(&val, (const char*)IO_value_holder); + gtk_list_store_set_value (GTK_LIST_STORE(h->hlistFrom), h->hlistIter, LV_IO_STATE, &val); /// case LV_IO_TYPE: char *s = IoTypeToString(Prog.io.assignment[item].type); @@ -818,12 +828,14 @@ void IoListProc(NMHDR *h) /// case LV_IO_NAME: g_value_set_string(&val, (const char*)Prog.io.assignment[item].name); gtk_list_store_set_value (GTK_LIST_STORE(h->hlistFrom), h->hlistIter, LV_IO_NAME, &val); - + /// case LV_IO_PORT: /// Don't confuse people by displaying bogus pin assignments /// for the C target. + if(Prog.mcu && Prog.mcu->whichIsa == ISA_ANSIC) { strcpy(IO_value_holder, ""); + break; } @@ -840,7 +852,6 @@ void IoListProc(NMHDR *h) strcpy(IO_value_holder, ""); break; } - if(UartFunctionUsed() && Prog.mcu) { if((Prog.mcu->uartNeeds.rxPin == pin) || (Prog.mcu->uartNeeds.txPin == pin)) @@ -873,17 +884,6 @@ void IoListProc(NMHDR *h) g_value_set_string(&val, (const char*)IO_value_holder); gtk_list_store_set_value (GTK_LIST_STORE(h->hlistFrom), h->hlistIter, LV_IO_PORT, &val); - - /// case LV_IO_STATE: - if(InSimulationMode) { - char *name = Prog.io.assignment[item].name; - DescribeForIoList(name, IO_value_holder); - } else { - strcpy(IO_value_holder, ""); - } - - g_value_set_string(&val, (const char*)IO_value_holder); - gtk_list_store_set_value (GTK_LIST_STORE(h->hlistFrom), h->hlistIter, LV_IO_STATE, &val); break; } diff --git a/ldmicro/maincontrols.cpp b/ldmicro/maincontrols.cpp index 14aa308..4d046fe 100644 --- a/ldmicro/maincontrols.cpp +++ b/ldmicro/maincontrols.cpp @@ -946,6 +946,7 @@ void ToggleSimulationMode(void) } UpdateMainWindowTitleBar(); + RefreshControlsToSettings(); } //----------------------------------------------------------------------------- @@ -955,7 +956,7 @@ void ToggleSimulationMode(void) // how many elements to populate. //----------------------------------------------------------------------------- void RefreshControlsToSettings(void) -{ +{ GtkTreeIter iter; BOOL path_not_empty = gtk_tree_model_get_iter_first (GTK_TREE_MODEL(IoList), &iter); // g_print("path e = %i\n", path_not_empty); diff --git a/ldmicro/simulate.cpp b/ldmicro/simulate.cpp index 0b3c206..8cee5fe 100644 --- a/ldmicro/simulate.cpp +++ b/ldmicro/simulate.cpp @@ -711,6 +711,7 @@ void SimulateOneCycle(BOOL forceRefresh) if(NeedRedraw || SimulateRedrawAfterNextCycle || forceRefresh) { InvalidateRect(DrawWindow, NULL, FALSE); + RefreshControlsToSettings(); gtk_widget_queue_draw(DrawWindow); // ListView_RedrawItems(IoList, 0, Prog.io.count - 1); } |