summaryrefslogtreecommitdiff
path: root/ldmicro/maincontrols.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'ldmicro/maincontrols.cpp')
-rw-r--r--ldmicro/maincontrols.cpp987
1 files changed, 490 insertions, 497 deletions
diff --git a/ldmicro/maincontrols.cpp b/ldmicro/maincontrols.cpp
index b029322..da454a9 100644
--- a/ldmicro/maincontrols.cpp
+++ b/ldmicro/maincontrols.cpp
@@ -22,9 +22,9 @@
// scrolling, I/O list, menus.
// Jonathan Westhues, Nov 2004
//-----------------------------------------------------------------------------
-#include <windows.h>
-#include <commctrl.h>
-#include <commdlg.h>
+#include "linuxUI.h"
+//#include <commctrl.h>
+//#include <commdlg.h>
#include <stdio.h>
#include <stdlib.h>
#include "ldmicro.h"
@@ -100,25 +100,23 @@ HMENU MNU_COMPILE_AS;
HMENU MNU_MANUAL;
HMENU MNU_ABOUT;
-HMENU MNU_ADV_SIMULATION;
-
// scrollbars for the ladder logic area
-static HWND HorizScrollBar;
-static HWND VertScrollBar;
+// static HWND HorizScrollBar;
+// static HWND VertScrollBar;
int ScrollWidth;
int ScrollHeight;
BOOL NeedHoriz;
// status bar at the bottom of the screen, to display settings
-static HWND StatusBar;
+// static HWND StatusBar;
// have to get back to the menus to gray/ungray, check/uncheck things
-static HMENU FileMenu;
-static HMENU EditMenu;
-static HMENU InstructionMenu;
-static HMENU ProcessorMenu;
-static HMENU SimulateMenu;
-static HMENU TopMenu;
+// static HMENU FileMenu;
+// static HMENU EditMenu;
+// static HMENU InstructionMenu;
+// static HMENU ProcessorMenu;
+// static HMENU SimulateMenu;
+// static HMENU TopMenu;
// listview used to maintain the list of I/O pins with symbolic names, plus
// the internal relay too
@@ -137,91 +135,91 @@ static BOOL RealTimeSimulationRunning;
//-----------------------------------------------------------------------------
void MakeMainWindowControls(void)
{
- GtkWidget* PackBox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0);
- GtkWidget* grid = gtk_grid_new();
- GtkWidget* pane = gtk_paned_new (GTK_ORIENTATION_VERTICAL);
- GtkListStore* IoList = gtk_list_store_new (5,
- G_TYPE_STRING,
- G_TYPE_STRING,
- G_TYPE_STRING,
- G_TYPE_STRING,
- G_TYPE_STRING);
- GtkWidget* view;
- GtkTreeViewColumn* column;
-
- int typeWidth = 85;
- int pinWidth = 100;
- int portWidth = 90;
-
- // Creating a list
- view = gtk_tree_view_new_with_model (GTK_TREE_MODEL(IoList));
- gtk_tree_view_set_model (GTK_TREE_VIEW (view), GTK_TREE_MODEL (IoList));
-
- column = gtk_tree_view_column_new_with_attributes("Name",
- gtk_cell_renderer_text_new(),
- "text", LV_IO_NAME,
- NULL);
- gtk_tree_view_append_column(GTK_TREE_VIEW(view), column);
- gtk_tree_view_column_set_min_width (column, 250);
-
- column = gtk_tree_view_column_new_with_attributes("Type",
- gtk_cell_renderer_spin_new(),
- "text", LV_IO_TYPE,
- NULL);
- gtk_tree_view_append_column(GTK_TREE_VIEW(view), column);
- gtk_tree_view_column_set_min_width (column, typeWidth);
-
- column = gtk_tree_view_column_new_with_attributes("State",
- gtk_cell_renderer_text_new(),
- "text", LV_IO_STATE,
- NULL);
- gtk_tree_view_append_column(GTK_TREE_VIEW(view), column);
- gtk_tree_view_column_set_min_width (column, 100);
-
- column = gtk_tree_view_column_new_with_attributes("Pin on Processor",
- gtk_cell_renderer_text_new(),
- "text", LV_IO_PIN,
- NULL);
- gtk_tree_view_append_column(GTK_TREE_VIEW(view), column);
- gtk_tree_view_column_set_min_width (column, pinWidth);
-
- column = gtk_tree_view_column_new_with_attributes("MCU Port",
- gtk_cell_renderer_text_new(),
- "text", LV_IO_PORT,
- NULL);
- gtk_tree_view_append_column(GTK_TREE_VIEW(view), column);
- gtk_tree_view_column_set_min_width (column, portWidth);
-
- // Appending Menus to grid
- gtk_grid_attach (GTK_GRID (grid), MakeMainWindowMenus(), 0, 0, 1, 1);
-
- // Creating Scrolled Window
- GtkWidget* ScrollWindow = gtk_scrolled_window_new (NULL, NULL);
- gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (ScrollWindow),
- GTK_POLICY_AUTOMATIC,
- GTK_POLICY_ALWAYS);
-
- // Creating a pane to separate Scrolled Window and other widgets
- gtk_paned_add1 (GTK_PANED (pane), ScrollWindow);
- gtk_paned_set_position (GTK_PANED (pane), 0);
- gtk_widget_set_vexpand (ScrollWindow, TRUE);
- gtk_widget_set_hexpand (ScrollWindow, TRUE);
-
- // Appending tree view to pane and pane to grid
- gtk_paned_add2 (GTK_PANED(pane), view);
- gtk_paned_set_position (GTK_PANED (pane), 250);
- gtk_grid_attach (GTK_GRID (grid), pane, 0, 0, 1, 1);
-
- // Creating Status Bar and attaching to grid
- StatusBar = gtk_statusbar_new();
- gtk_statusbar_push (GTK_STATUSBAR (StatusBar),
- gtk_statusbar_get_context_id (GTK_STATUSBAR (StatusBar), "Introduction"),
- "LDMicro Started");
-
- // Appneding Status Bar to box which is then added to Main Window
- gtk_box_pack_start(GTK_BOX(PackBox), grid, TRUE, TRUE, 0);
- gtk_box_pack_start(GTK_BOX(PackBox), StatusBar, FALSE, FALSE, 0);
- gtk_container_add(GTK_CONTAINER(MainWindow), PackBox);
+ // GtkWidget* PackBox = gtk_box_new(GTK_ORIENTATION_VERTICAL, 0);
+ // GtkWidget* grid = gtk_grid_new();
+ // GtkWidget* pane = gtk_paned_new (GTK_ORIENTATION_VERTICAL);
+ // GtkListStore* IoList = gtk_list_store_new (5,
+ // G_TYPE_STRING,
+ // G_TYPE_STRING,
+ // G_TYPE_STRING,
+ // G_TYPE_STRING,
+ // G_TYPE_STRING);
+ // GtkWidget* view;
+ // GtkTreeViewColumn* column;
+
+ // int typeWidth = 85;
+ // int pinWidth = 100;
+ // int portWidth = 90;
+
+ // // Creating a list
+ // view = gtk_tree_view_new_with_model (GTK_TREE_MODEL(IoList));
+ // gtk_tree_view_set_model (GTK_TREE_VIEW (view), GTK_TREE_MODEL (IoList));
+
+ // column = gtk_tree_view_column_new_with_attributes("Name",
+ // gtk_cell_renderer_text_new(),
+ // "text", LV_IO_NAME,
+ // NULL);
+ // gtk_tree_view_append_column(GTK_TREE_VIEW(view), column);
+ // gtk_tree_view_column_set_min_width (column, 250);
+
+ // column = gtk_tree_view_column_new_with_attributes("Type",
+ // gtk_cell_renderer_spin_new(),
+ // "text", LV_IO_TYPE,
+ // NULL);
+ // gtk_tree_view_append_column(GTK_TREE_VIEW(view), column);
+ // gtk_tree_view_column_set_min_width (column, typeWidth);
+
+ // column = gtk_tree_view_column_new_with_attributes("State",
+ // gtk_cell_renderer_text_new(),
+ // "text", LV_IO_STATE,
+ // NULL);
+ // gtk_tree_view_append_column(GTK_TREE_VIEW(view), column);
+ // gtk_tree_view_column_set_min_width (column, 100);
+
+ // column = gtk_tree_view_column_new_with_attributes("Pin on Processor",
+ // gtk_cell_renderer_text_new(),
+ // "text", LV_IO_PIN,
+ // NULL);
+ // gtk_tree_view_append_column(GTK_TREE_VIEW(view), column);
+ // gtk_tree_view_column_set_min_width (column, pinWidth);
+
+ // column = gtk_tree_view_column_new_with_attributes("MCU Port",
+ // gtk_cell_renderer_text_new(),
+ // "text", LV_IO_PORT,
+ // NULL);
+ // gtk_tree_view_append_column(GTK_TREE_VIEW(view), column);
+ // gtk_tree_view_column_set_min_width (column, portWidth);
+
+ // // Appending Menus to grid
+ // gtk_grid_attach (GTK_GRID (grid), MakeMainWindowMenus(), 0, 0, 1, 1);
+
+ // // Creating Scrolled Window
+ // GtkWidget* ScrollWindow = gtk_scrolled_window_new (NULL, NULL);
+ // gtk_scrolled_window_set_policy (GTK_SCROLLED_WINDOW (ScrollWindow),
+ // GTK_POLICY_AUTOMATIC,
+ // GTK_POLICY_ALWAYS);
+
+ // // Creating a pane to separate Scrolled Window and other widgets
+ // gtk_paned_add1 (GTK_PANED (pane), ScrollWindow);
+ // gtk_paned_set_position (GTK_PANED (pane), 0);
+ // gtk_widget_set_vexpand (ScrollWindow, TRUE);
+ // gtk_widget_set_hexpand (ScrollWindow, TRUE);
+
+ // // Appending tree view to pane and pane to grid
+ // gtk_paned_add2 (GTK_PANED(pane), view);
+ // gtk_paned_set_position (GTK_PANED (pane), 250);
+ // gtk_grid_attach (GTK_GRID (grid), pane, 0, 0, 1, 1);
+
+ // // Creating Status Bar and attaching to grid
+ // StatusBar = gtk_statusbar_new();
+ // gtk_statusbar_push (GTK_STATUSBAR (StatusBar),
+ // gtk_statusbar_get_context_id (GTK_STATUSBAR (StatusBar), "Introduction"),
+ // "LDMicro Started");
+
+ // // Appneding Status Bar to box which is then added to Main Window
+ // gtk_box_pack_start(GTK_BOX(PackBox), grid, TRUE, TRUE, 0);
+ // gtk_box_pack_start(GTK_BOX(PackBox), StatusBar, FALSE, FALSE, 0);
+ // gtk_container_add(GTK_CONTAINER(MainWindow), PackBox);
}
//-----------------------------------------------------------------------------
@@ -230,24 +228,23 @@ void MakeMainWindowControls(void)
//-----------------------------------------------------------------------------
void UpdateMainWindowTitleBar(void)
{
- char line[PATH_MAX+100];
- if(InSimulationMode) {
- if(RealTimeSimulationRunning) {
- strcpy(line, "LDmicro - Simulation (Running)");
- } else {
- strcpy(line, "LDmicro - Simulation (Stopped)");
- }
- } else {
- strcpy(line, "LDmicro - Program Editor");
- }
- if(strlen(CurrentSaveFile) > 0) {
- sprintf(line+strlen(line), " - %s", CurrentSaveFile);
- } else {
- strcat(line, " - (not yet saved)");
- }
+// char line[PATH_MAX+100];
+// if(InSimulationMode) {
+// if(RealTimeSimulationRunning) {
+// strcpy(line, "LDmicro - Simulation (Running)");
+// } else {
+// strcpy(line, "LDmicro - Simulation (Stopped)");
+// }
+// } else {
+// strcpy(line, "LDmicro - Program Editor");
+// }
+// if(strlen(CurrentSaveFile) > 0) {
+// sprintf(line+strlen(line), " - %s", CurrentSaveFile);
+// } else {
+// strcat(line, " - (not yet saved)");
+// }
- gtk_window_set_title (GTK_WINDOW (window), line);
-
+// gtk_window_set_title (GTK_WINDOW (window), line);
}
//-----------------------------------------------------------------------------
@@ -258,66 +255,66 @@ void SetMenusEnabled(BOOL canNegate, BOOL canNormal, BOOL canResetOnly,
BOOL canSetOnly, BOOL canDelete, BOOL canInsertEnd, BOOL canInsertOther,
BOOL canPushDown, BOOL canPushUp, BOOL canInsertComment)
{
- EnableMenuItem(EditMenu, MNU_PUSH_RUNG_UP,
- canPushUp ? MF_ENABLED : MF_GRAYED);
- EnableMenuItem(EditMenu, MNU_PUSH_RUNG_DOWN,
- canPushDown ? MF_ENABLED : MF_GRAYED);
- EnableMenuItem(EditMenu, MNU_DELETE_RUNG,
- (Prog.numRungs > 1) ? MF_ENABLED : MF_GRAYED);
-
- EnableMenuItem(InstructionMenu, MNU_NEGATE,
- canNegate ? MF_ENABLED : MF_GRAYED);
- EnableMenuItem(InstructionMenu, MNU_MAKE_NORMAL,
- canNormal ? MF_ENABLED : MF_GRAYED);
- EnableMenuItem(InstructionMenu, MNU_MAKE_RESET_ONLY,
- canResetOnly ? MF_ENABLED : MF_GRAYED);
- EnableMenuItem(InstructionMenu, MNU_MAKE_SET_ONLY,
- canSetOnly ? MF_ENABLED : MF_GRAYED);
-
- EnableMenuItem(InstructionMenu, MNU_INSERT_COMMENT,
- canInsertComment ? MF_ENABLED : MF_GRAYED);
-
- EnableMenuItem(EditMenu, MNU_DELETE_ELEMENT,
- canDelete ? MF_ENABLED : MF_GRAYED);
-
- int t;
- t = canInsertEnd ? MF_ENABLED : MF_GRAYED;
- EnableMenuItem(InstructionMenu, MNU_INSERT_COIL, t);
- EnableMenuItem(InstructionMenu, MNU_INSERT_RES, t);
- EnableMenuItem(InstructionMenu, MNU_INSERT_MOV, t);
- EnableMenuItem(InstructionMenu, MNU_INSERT_ADD, t);
- EnableMenuItem(InstructionMenu, MNU_INSERT_SUB, t);
- EnableMenuItem(InstructionMenu, MNU_INSERT_MUL, t);
- EnableMenuItem(InstructionMenu, MNU_INSERT_DIV, t);
- EnableMenuItem(InstructionMenu, MNU_INSERT_CTC, t);
- EnableMenuItem(InstructionMenu, MNU_INSERT_PERSIST, t);
- EnableMenuItem(InstructionMenu, MNU_INSERT_READ_ADC, t);
- EnableMenuItem(InstructionMenu, MNU_INSERT_SET_PWM, t);
- EnableMenuItem(InstructionMenu, MNU_INSERT_MASTER_RLY, t);
- EnableMenuItem(InstructionMenu, MNU_INSERT_SHIFT_REG, t);
- EnableMenuItem(InstructionMenu, MNU_INSERT_LUT, t);
- EnableMenuItem(InstructionMenu, MNU_INSERT_PWL, t);
-
- t = canInsertOther ? MF_ENABLED : MF_GRAYED;
- EnableMenuItem(InstructionMenu, MNU_INSERT_TON, t);
- EnableMenuItem(InstructionMenu, MNU_INSERT_TOF, t);
- EnableMenuItem(InstructionMenu, MNU_INSERT_OSR, t);
- EnableMenuItem(InstructionMenu, MNU_INSERT_OSF, t);
- EnableMenuItem(InstructionMenu, MNU_INSERT_RTO, t);
- EnableMenuItem(InstructionMenu, MNU_INSERT_CONTACTS, t);
- EnableMenuItem(InstructionMenu, MNU_INSERT_CTU, t);
- EnableMenuItem(InstructionMenu, MNU_INSERT_CTD, t);
- EnableMenuItem(InstructionMenu, MNU_INSERT_EQU, t);
- EnableMenuItem(InstructionMenu, MNU_INSERT_NEQ, t);
- EnableMenuItem(InstructionMenu, MNU_INSERT_GRT, t);
- EnableMenuItem(InstructionMenu, MNU_INSERT_GEQ, t);
- EnableMenuItem(InstructionMenu, MNU_INSERT_LES, t);
- EnableMenuItem(InstructionMenu, MNU_INSERT_LEQ, t);
- EnableMenuItem(InstructionMenu, MNU_INSERT_SHORT, t);
- EnableMenuItem(InstructionMenu, MNU_INSERT_OPEN, t);
- EnableMenuItem(InstructionMenu, MNU_INSERT_UART_SEND, t);
- EnableMenuItem(InstructionMenu, MNU_INSERT_UART_RECV, t);
- EnableMenuItem(InstructionMenu, MNU_INSERT_FMTD_STR, t);
+ // EnableMenuItem(EditMenu, MNU_PUSH_RUNG_UP,
+ // canPushUp ? MF_ENABLED : MF_GRAYED);
+ // EnableMenuItem(EditMenu, MNU_PUSH_RUNG_DOWN,
+ // canPushDown ? MF_ENABLED : MF_GRAYED);
+ // EnableMenuItem(EditMenu, MNU_DELETE_RUNG,
+ // (Prog.numRungs > 1) ? MF_ENABLED : MF_GRAYED);
+
+ // EnableMenuItem(InstructionMenu, MNU_NEGATE,
+ // canNegate ? MF_ENABLED : MF_GRAYED);
+ // EnableMenuItem(InstructionMenu, MNU_MAKE_NORMAL,
+ // canNormal ? MF_ENABLED : MF_GRAYED);
+ // EnableMenuItem(InstructionMenu, MNU_MAKE_RESET_ONLY,
+ // canResetOnly ? MF_ENABLED : MF_GRAYED);
+ // EnableMenuItem(InstructionMenu, MNU_MAKE_SET_ONLY,
+ // canSetOnly ? MF_ENABLED : MF_GRAYED);
+
+ // EnableMenuItem(InstructionMenu, MNU_INSERT_COMMENT,
+ // canInsertComment ? MF_ENABLED : MF_GRAYED);
+
+ // EnableMenuItem(EditMenu, MNU_DELETE_ELEMENT,
+ // canDelete ? MF_ENABLED : MF_GRAYED);
+
+ // int t;
+ // t = canInsertEnd ? MF_ENABLED : MF_GRAYED;
+ // EnableMenuItem(InstructionMenu, MNU_INSERT_COIL, t);
+ // EnableMenuItem(InstructionMenu, MNU_INSERT_RES, t);
+ // EnableMenuItem(InstructionMenu, MNU_INSERT_MOV, t);
+ // EnableMenuItem(InstructionMenu, MNU_INSERT_ADD, t);
+ // EnableMenuItem(InstructionMenu, MNU_INSERT_SUB, t);
+ // EnableMenuItem(InstructionMenu, MNU_INSERT_MUL, t);
+ // EnableMenuItem(InstructionMenu, MNU_INSERT_DIV, t);
+ // EnableMenuItem(InstructionMenu, MNU_INSERT_CTC, t);
+ // EnableMenuItem(InstructionMenu, MNU_INSERT_PERSIST, t);
+ // EnableMenuItem(InstructionMenu, MNU_INSERT_READ_ADC, t);
+ // EnableMenuItem(InstructionMenu, MNU_INSERT_SET_PWM, t);
+ // EnableMenuItem(InstructionMenu, MNU_INSERT_MASTER_RLY, t);
+ // EnableMenuItem(InstructionMenu, MNU_INSERT_SHIFT_REG, t);
+ // EnableMenuItem(InstructionMenu, MNU_INSERT_LUT, t);
+ // EnableMenuItem(InstructionMenu, MNU_INSERT_PWL, t);
+
+ // t = canInsertOther ? MF_ENABLED : MF_GRAYED;
+ // EnableMenuItem(InstructionMenu, MNU_INSERT_TON, t);
+ // EnableMenuItem(InstructionMenu, MNU_INSERT_TOF, t);
+ // EnableMenuItem(InstructionMenu, MNU_INSERT_OSR, t);
+ // EnableMenuItem(InstructionMenu, MNU_INSERT_OSF, t);
+ // EnableMenuItem(InstructionMenu, MNU_INSERT_RTO, t);
+ // EnableMenuItem(InstructionMenu, MNU_INSERT_CONTACTS, t);
+ // EnableMenuItem(InstructionMenu, MNU_INSERT_CTU, t);
+ // EnableMenuItem(InstructionMenu, MNU_INSERT_CTD, t);
+ // EnableMenuItem(InstructionMenu, MNU_INSERT_EQU, t);
+ // EnableMenuItem(InstructionMenu, MNU_INSERT_NEQ, t);
+ // EnableMenuItem(InstructionMenu, MNU_INSERT_GRT, t);
+ // EnableMenuItem(InstructionMenu, MNU_INSERT_GEQ, t);
+ // EnableMenuItem(InstructionMenu, MNU_INSERT_LES, t);
+ // EnableMenuItem(InstructionMenu, MNU_INSERT_LEQ, t);
+ // EnableMenuItem(InstructionMenu, MNU_INSERT_SHORT, t);
+ // EnableMenuItem(InstructionMenu, MNU_INSERT_OPEN, t);
+ // EnableMenuItem(InstructionMenu, MNU_INSERT_UART_SEND, t);
+ // EnableMenuItem(InstructionMenu, MNU_INSERT_UART_RECV, t);
+ // EnableMenuItem(InstructionMenu, MNU_INSERT_FMTD_STR, t);
}
//-----------------------------------------------------------------------------
@@ -325,15 +322,14 @@ void SetMenusEnabled(BOOL canNegate, BOOL canNormal, BOOL canResetOnly,
//-----------------------------------------------------------------------------
void SetUndoEnabled(BOOL undoEnabled, BOOL redoEnabled)
{
- EnableMenuItem(EditMenu, MNU_UNDO, undoEnabled ? MF_ENABLED : MF_GRAYED);
- EnableMenuItem(EditMenu, MNU_REDO, redoEnabled ? MF_ENABLED : MF_GRAYED);
+ // EnableMenuItem(EditMenu, MNU_UNDO, undoEnabled ? MF_ENABLED : MF_GRAYED);
+ // EnableMenuItem(EditMenu, MNU_REDO, redoEnabled ? MF_ENABLED : MF_GRAYED);
}
//-----------------------------------------------------------------------------
// Create the top-level menu bar for the main window. Mostly static, but we
// create the "select processor" menu from the list in mcutable.h dynamically.
//-----------------------------------------------------------------------------
-
HMENU MakeMainWindowMenus(void)
{
HMENU MenuBox; // Box for alignment
@@ -386,217 +382,215 @@ HMENU MakeMainWindowMenus(void)
MNU_EXPORT = gtk_menu_item_new_with_label("Export As Text");
MNU_EXIT = gtk_menu_item_new_with_label("Exit");
- // Appending menu items (labels) to File menu and adding separators
- gtk_menu_shell_append(GTK_MENU_SHELL (FileMenu), MNU_NEW); // Appending menu items
- gtk_menu_shell_append(GTK_MENU_SHELL (FileMenu), MNU_OPEN);
- gtk_menu_shell_append(GTK_MENU_SHELL (FileMenu), MNU_SAVE);
- gtk_menu_shell_append(GTK_MENU_SHELL (FileMenu), MNU_SAVE_AS);
- FileMenuSeparator = gtk_separator_menu_item_new();
- gtk_menu_shell_append(GTK_MENU_SHELL (FileMenu), FileMenuSeparator);
- gtk_menu_shell_append(GTK_MENU_SHELL (FileMenu), MNU_EXPORT);
- FileMenuSeparator = gtk_separator_menu_item_new();
- gtk_menu_shell_append(GTK_MENU_SHELL (FileMenu), FileMenuSeparator);
- gtk_menu_shell_append(GTK_MENU_SHELL (FileMenu), MNU_EXIT);
-
- // Creating labels for Edit Menu
- MNU_UNDO = gtk_menu_item_new_with_label("Undo");
- MNU_REDO = gtk_menu_item_new_with_label("Redo");
- MNU_INSERT_RUNG_BEFORE = gtk_menu_item_new_with_label("Insert rung Before");
- MNU_INSERT_RUNG_AFTER = gtk_menu_item_new_with_label("Insert Rung After");
- MNU_PUSH_RUNG_UP = gtk_menu_item_new_with_label("Move Selected Rung Up");
- MNU_PUSH_RUNG_DOWN = gtk_menu_item_new_with_label("Move Selected Rung Down");
- MNU_DELETE_ELEMENT = gtk_menu_item_new_with_label("Delete Selected Element");
- MNU_DELETE_RUNG = gtk_menu_item_new_with_label("Delete Rung");
-
- // Appending menu items to Edit menu and adding separators
- gtk_menu_shell_append(GTK_MENU_SHELL (EditMenu), MNU_UNDO);
- gtk_menu_shell_append(GTK_MENU_SHELL (EditMenu), MNU_REDO);
- EditMenuSeparator = gtk_separator_menu_item_new();
- gtk_menu_shell_append(GTK_MENU_SHELL(EditMenu), EditMenuSeparator);
- gtk_menu_shell_append(GTK_MENU_SHELL (EditMenu), MNU_INSERT_RUNG_BEFORE);
- gtk_menu_shell_append(GTK_MENU_SHELL (EditMenu), MNU_INSERT_RUNG_AFTER);
- gtk_menu_shell_append(GTK_MENU_SHELL (EditMenu), MNU_PUSH_RUNG_UP);
- gtk_menu_shell_append(GTK_MENU_SHELL (EditMenu), MNU_PUSH_RUNG_DOWN);
- EditMenuSeparator = gtk_separator_menu_item_new();
- gtk_menu_shell_append(GTK_MENU_SHELL(EditMenu), EditMenuSeparator);
- gtk_menu_shell_append(GTK_MENU_SHELL (EditMenu), MNU_DELETE_ELEMENT);
- gtk_menu_shell_append(GTK_MENU_SHELL (EditMenu), MNU_DELETE_RUNG);
-
- // Creating labels for Settings Menu
- MNU_MCU_SETTINGS = gtk_menu_item_new_with_label ("MCU Parameters...");
- MNU_PROCESSOR_0 = gtk_menu_item_new_with_label ("Microcontroller");
-
- // Appending menu items to Settings menu
- gtk_menu_shell_append (GTK_MENU_SHELL (settings), MNU_MCU_SETTINGS);
- gtk_menu_shell_append (GTK_MENU_SHELL (settings), MNU_PROCESSOR_0);
-
- for (i = 0; i < NUM_SUPPORTED_MCUS; i++){
- ProcessorMenuItems = gtk_check_menu_item_new_with_label (SupportedMcus[i].mcuName);
- gtk_menu_shell_append (GTK_MENU_SHELL (ProcessorMenu), ProcessorMenuItems);
- }
-
- ProcessorMenuItems = gtk_check_menu_item_new_with_label ("(no microcontroller)");
- gtk_menu_shell_append (GTK_MENU_SHELL (ProcessorMenu), ProcessorMenuItems);
- gtk_menu_item_set_submenu(GTK_MENU_ITEM(MNU_PROCESSOR_0), ProcessorMenu);
-
- // Creating labels for Instruction Menu and adding separators
- MNU_INSERT_COMMENT = gtk_menu_item_new_with_label("Insert Comment");
- MNU_INSERT_CONTACTS = gtk_menu_item_new_with_label("Insert Contacts");
- MNU_INSERT_OSR = gtk_menu_item_new_with_label("Insert OSR (One Shot Rising)");
- MNU_INSERT_OSF = gtk_menu_item_new_with_label("Insert OSF (One Shot Falling)");
- MNU_INSERT_TON = gtk_menu_item_new_with_label("Insert TON (Delayed Turn On)");
- MNU_INSERT_TOF = gtk_menu_item_new_with_label("Insert TOF (Delayed Turn Off)");
- MNU_INSERT_RTO = gtk_menu_item_new_with_label("Insert RTO (Retentive Delayed Turn On)");
- MNU_INSERT_CTU = gtk_menu_item_new_with_label("Insert CTU (Count Up)");
- MNU_INSERT_CTD = gtk_menu_item_new_with_label("Insert CTD (Count Down)");
- MNU_INSERT_CTC = gtk_menu_item_new_with_label("Insert CTC (Count Circular)");
- MNU_INSERT_EQU = gtk_menu_item_new_with_label("Insert EQU (Compare for Equals)");
- MNU_INSERT_NEQ = gtk_menu_item_new_with_label("Insert NEQ (Compare for Not Equals)");
- MNU_INSERT_GRT = gtk_menu_item_new_with_label("Insert GRT (Compare for Greater Than)");
- MNU_INSERT_GEQ = gtk_menu_item_new_with_label("Insert GEQ (Compare for Greater Than or Equal)");
- MNU_INSERT_LES = gtk_menu_item_new_with_label("Insert LES (Compare for Less Than)");
- MNU_INSERT_LEQ = gtk_menu_item_new_with_label("Insert LEQ (Compare for Less Than or Equal)");
- MNU_INSERT_OPEN = gtk_menu_item_new_with_label("Insert Open Circuit");
- MNU_INSERT_SHORT = gtk_menu_item_new_with_label("Insert Short Circuit");
- MNU_INSERT_MASTER_RLY = gtk_menu_item_new_with_label("Insert Master Control Relay");
- MNU_INSERT_COIL = gtk_menu_item_new_with_label("Insert Coil");
- MNU_INSERT_RES = gtk_menu_item_new_with_label("Insert RES (Counter/RTO Reset)");
- MNU_INSERT_MOV = gtk_menu_item_new_with_label("Insert MOV (Move)");
- MNU_INSERT_ADD = gtk_menu_item_new_with_label("Insert ADD (16-bit Integer Ad)");
- MNU_INSERT_SUB = gtk_menu_item_new_with_label("Insert SUB (16-bit Integer Subtract)");
- MNU_INSERT_MUL = gtk_menu_item_new_with_label("Insert MUL (16-bit Integer Multiply)");
- MNU_INSERT_DIV = gtk_menu_item_new_with_label("Insert DIV (16-bit Integer Division)");
- MNU_INSERT_SHIFT_REG = gtk_menu_item_new_with_label("Insert Shift Register");
- MNU_INSERT_LUT = gtk_menu_item_new_with_label("Insert Look-Up Table");
- MNU_INSERT_PWL = gtk_menu_item_new_with_label("Insert Piecewise Linear");
- MNU_INSERT_FMTD_STR = gtk_menu_item_new_with_label("Insert Formatted String Over UART");
- MNU_INSERT_UART_SEND = gtk_menu_item_new_with_label("Insert UART Send");
- MNU_INSERT_UART_RECV = gtk_menu_item_new_with_label("Insert UART Receive");
- MNU_INSERT_SET_PWM = gtk_menu_item_new_with_label("Insert Set PWM Output");
- MNU_INSERT_READ_ADC = gtk_menu_item_new_with_label("Insert A/D Converter Read");
- MNU_INSERT_PERSIST = gtk_menu_item_new_with_label("Insert Make Persistent");
- MNU_MAKE_NORMAL = gtk_menu_item_new_with_label("Make Normal");
- MNU_NEGATE = gtk_menu_item_new_with_label("Make Negated");
- MNU_MAKE_SET_ONLY = gtk_menu_item_new_with_label("Make Set-Only");
- MNU_MAKE_RESET_ONLY = gtk_menu_item_new_with_label("Make Reset-Only");
-
- // Appending menu items to Instruction menu and adding separators
- gtk_menu_shell_append (GTK_MENU_SHELL (InstructionMenu), MNU_INSERT_COMMENT);
- InstructionMenuSeparator = gtk_separator_menu_item_new();
- gtk_menu_shell_append (GTK_MENU_SHELL(InstructionMenu), InstructionMenuSeparator);
- gtk_menu_shell_append (GTK_MENU_SHELL (InstructionMenu), MNU_INSERT_CONTACTS);
- InstructionMenuSeparator = gtk_separator_menu_item_new();
- gtk_menu_shell_append (GTK_MENU_SHELL(InstructionMenu), InstructionMenuSeparator);
- gtk_menu_shell_append (GTK_MENU_SHELL (InstructionMenu), MNU_INSERT_OSR);
- InstructionMenuSeparator = gtk_separator_menu_item_new();
- gtk_menu_shell_append (GTK_MENU_SHELL(InstructionMenu), InstructionMenuSeparator);
- gtk_menu_shell_append (GTK_MENU_SHELL (InstructionMenu), MNU_INSERT_OSF);
- gtk_menu_shell_append (GTK_MENU_SHELL (InstructionMenu), MNU_INSERT_TON);
- gtk_menu_shell_append (GTK_MENU_SHELL (InstructionMenu), MNU_INSERT_TOF);
- gtk_menu_shell_append (GTK_MENU_SHELL (InstructionMenu), MNU_INSERT_RTO);
- InstructionMenuSeparator = gtk_separator_menu_item_new();
- gtk_menu_shell_append (GTK_MENU_SHELL(InstructionMenu), InstructionMenuSeparator);
- gtk_menu_shell_append (GTK_MENU_SHELL (InstructionMenu), MNU_INSERT_CTU);
- gtk_menu_shell_append (GTK_MENU_SHELL (InstructionMenu), MNU_INSERT_CTD);
- gtk_menu_shell_append (GTK_MENU_SHELL (InstructionMenu), MNU_INSERT_CTC);
- InstructionMenuSeparator = gtk_separator_menu_item_new();
- gtk_menu_shell_append (GTK_MENU_SHELL(InstructionMenu), InstructionMenuSeparator);
- gtk_menu_shell_append (GTK_MENU_SHELL (InstructionMenu), MNU_INSERT_EQU);
- gtk_menu_shell_append (GTK_MENU_SHELL (InstructionMenu), MNU_INSERT_NEQ);
- gtk_menu_shell_append (GTK_MENU_SHELL (InstructionMenu), MNU_INSERT_GRT);
- gtk_menu_shell_append (GTK_MENU_SHELL (InstructionMenu), MNU_INSERT_GEQ);
- gtk_menu_shell_append (GTK_MENU_SHELL (InstructionMenu), MNU_INSERT_LES);
- gtk_menu_shell_append (GTK_MENU_SHELL (InstructionMenu), MNU_INSERT_LEQ);
- InstructionMenuSeparator = gtk_separator_menu_item_new();
- gtk_menu_shell_append (GTK_MENU_SHELL(InstructionMenu), InstructionMenuSeparator);
- gtk_menu_shell_append (GTK_MENU_SHELL (InstructionMenu), MNU_INSERT_OPEN);
- gtk_menu_shell_append (GTK_MENU_SHELL (InstructionMenu), MNU_INSERT_SHORT);
- gtk_menu_shell_append (GTK_MENU_SHELL (InstructionMenu), MNU_INSERT_MASTER_RLY);
- InstructionMenuSeparator = gtk_separator_menu_item_new();
- gtk_menu_shell_append (GTK_MENU_SHELL(InstructionMenu), InstructionMenuSeparator);
- gtk_menu_shell_append (GTK_MENU_SHELL (InstructionMenu), MNU_INSERT_COIL);
- gtk_menu_shell_append (GTK_MENU_SHELL (InstructionMenu), MNU_INSERT_RES);
- InstructionMenuSeparator = gtk_separator_menu_item_new();
- gtk_menu_shell_append (GTK_MENU_SHELL(InstructionMenu), InstructionMenuSeparator);
- gtk_menu_shell_append (GTK_MENU_SHELL (InstructionMenu), MNU_INSERT_MOV);
- gtk_menu_shell_append (GTK_MENU_SHELL (InstructionMenu), MNU_INSERT_ADD);
- gtk_menu_shell_append (GTK_MENU_SHELL (InstructionMenu), MNU_INSERT_SUB);
- gtk_menu_shell_append (GTK_MENU_SHELL (InstructionMenu), MNU_INSERT_MUL);
- gtk_menu_shell_append (GTK_MENU_SHELL (InstructionMenu), MNU_INSERT_DIV);
- InstructionMenuSeparator = gtk_separator_menu_item_new();
- gtk_menu_shell_append (GTK_MENU_SHELL(InstructionMenu), InstructionMenuSeparator);
- gtk_menu_shell_append (GTK_MENU_SHELL (InstructionMenu), MNU_INSERT_SHIFT_REG);
- gtk_menu_shell_append (GTK_MENU_SHELL (InstructionMenu), MNU_INSERT_LUT);
- gtk_menu_shell_append (GTK_MENU_SHELL (InstructionMenu), MNU_INSERT_PWL);
- gtk_menu_shell_append (GTK_MENU_SHELL (InstructionMenu), MNU_INSERT_FMTD_STR);
- InstructionMenuSeparator = gtk_separator_menu_item_new();
- gtk_menu_shell_append (GTK_MENU_SHELL (InstructionMenu), InstructionMenuSeparator);
- gtk_menu_shell_append (GTK_MENU_SHELL (InstructionMenu), MNU_INSERT_UART_SEND);
- gtk_menu_shell_append (GTK_MENU_SHELL (InstructionMenu), MNU_INSERT_UART_RECV);
- gtk_menu_shell_append (GTK_MENU_SHELL (InstructionMenu), MNU_INSERT_SET_PWM);
- gtk_menu_shell_append (GTK_MENU_SHELL (InstructionMenu), MNU_INSERT_READ_ADC);
- gtk_menu_shell_append (GTK_MENU_SHELL (InstructionMenu), MNU_INSERT_PERSIST);
- InstructionMenuSeparator = gtk_separator_menu_item_new();
- gtk_menu_shell_append (GTK_MENU_SHELL (InstructionMenu), InstructionMenuSeparator);
- gtk_menu_shell_append (GTK_MENU_SHELL (InstructionMenu), MNU_MAKE_NORMAL);
- gtk_menu_shell_append (GTK_MENU_SHELL (InstructionMenu), MNU_NEGATE);
- gtk_menu_shell_append (GTK_MENU_SHELL (InstructionMenu), MNU_MAKE_SET_ONLY);
- gtk_menu_shell_append (GTK_MENU_SHELL (InstructionMenu), MNU_MAKE_RESET_ONLY);
-
- // Creating labels for Simulation Menu
- MNU_COMPILE = gtk_menu_item_new_with_label("Compile");
- MNU_COMPILE_AS = gtk_menu_item_new_with_label("Compile As...");
-
- // Appending menu items to Compile menu
- gtk_menu_shell_append(GTK_MENU_SHELL (compile), MNU_COMPILE);
- gtk_menu_shell_append(GTK_MENU_SHELL (compile), MNU_COMPILE_AS);
-
- // Creating labels for Simulation Menu
- MNU_MANUAL = gtk_menu_item_new_with_label("Manual...");
- MNU_ABOUT = gtk_menu_item_new_with_label("About...");
-
- // Appending menu items to Help menu
- gtk_menu_shell_append(GTK_MENU_SHELL (help), MNU_MANUAL);
- gtk_menu_shell_append(GTK_MENU_SHELL (help), MNU_ABOUT);
-
- // Creating labels for Simulation Menu
- MNU_SIMULATION_MODE = gtk_check_menu_item_new_with_label("Simulation Mode");
- MNU_START_SIMULATION = gtk_menu_item_new_with_label("Start Real-Time Simulation");
- MNU_STOP_SIMULATION = gtk_menu_item_new_with_label("Halt Simulation");
- MNU_SINGLE_CYCLE = gtk_menu_item_new_with_label("Single Cycle");
- MNU_ADV_SIMULATION = gtk_menu_item_new_with_label("Advanced Simulation");
-
- // Appending menu items to Simulate menu and adding separators
- gtk_menu_shell_append(GTK_MENU_SHELL (SimulateMenu), MNU_SIMULATION_MODE);
- gtk_menu_shell_append(GTK_MENU_SHELL (SimulateMenu), MNU_START_SIMULATION);
- gtk_menu_shell_append(GTK_MENU_SHELL (SimulateMenu), MNU_STOP_SIMULATION);
- gtk_menu_shell_append(GTK_MENU_SHELL (SimulateMenu), MNU_SINGLE_CYCLE);
- SimulateMenuSeparator = gtk_separator_menu_item_new();
- gtk_menu_shell_append(GTK_MENU_SHELL(SimulateMenu), SimulateMenuSeparator);
- gtk_menu_shell_append(GTK_MENU_SHELL (SimulateMenu), MNU_ADV_SIMULATION);
-
- // Creating submenus for each menu
- gtk_menu_item_set_submenu(GTK_MENU_ITEM(FileLabel), FileMenu);
- gtk_menu_item_set_submenu(GTK_MENU_ITEM(EditLabel), EditMenu);
- gtk_menu_item_set_submenu(GTK_MENU_ITEM(SettingsLabel), settings);
- gtk_menu_item_set_submenu(GTK_MENU_ITEM(InstructionLabel), InstructionMenu);
- gtk_menu_item_set_submenu(GTK_MENU_ITEM(SimulateLabel), SimulateMenu);
- gtk_menu_item_set_submenu(GTK_MENU_ITEM(CompileLabel), compile);
- gtk_menu_item_set_submenu(GTK_MENU_ITEM(HelpLabel), help);
-
- // Appending the menu item to the menu bar
- gtk_menu_shell_append(GTK_MENU_SHELL(TopMenu), FileLabel);
- gtk_menu_shell_append(GTK_MENU_SHELL(TopMenu), EditLabel);
- gtk_menu_shell_append(GTK_MENU_SHELL(TopMenu), SettingsLabel);
- gtk_menu_shell_append(GTK_MENU_SHELL(TopMenu), InstructionLabel);
- gtk_menu_shell_append(GTK_MENU_SHELL(TopMenu), SimulateLabel);
- gtk_menu_shell_append(GTK_MENU_SHELL(TopMenu), CompileLabel);
- gtk_menu_shell_append(GTK_MENU_SHELL(TopMenu), HelpLabel);
-
- // Packing the menu bar into the box for alignment
- gtk_box_pack_start(GTK_BOX(MenuBox), TopMenu, FALSE, FALSE, 0);
-
- return MenuBox;
+ // // Appending menu items (labels) to File menu and adding separators
+ // gtk_menu_shell_append(GTK_MENU_SHELL (FileMenu), MNU_NEW); // Appending menu items
+ // gtk_menu_shell_append(GTK_MENU_SHELL (FileMenu), MNU_OPEN);
+ // gtk_menu_shell_append(GTK_MENU_SHELL (FileMenu), MNU_SAVE);
+ // gtk_menu_shell_append(GTK_MENU_SHELL (FileMenu), MNU_SAVE_AS);
+ // FileMenuSeparator = gtk_separator_menu_item_new();
+ // gtk_menu_shell_append(GTK_MENU_SHELL (FileMenu), FileMenuSeparator);
+ // gtk_menu_shell_append(GTK_MENU_SHELL (FileMenu), MNU_EXPORT);
+ // FileMenuSeparator = gtk_separator_menu_item_new();
+ // gtk_menu_shell_append(GTK_MENU_SHELL (FileMenu), FileMenuSeparator);
+ // gtk_menu_shell_append(GTK_MENU_SHELL (FileMenu), MNU_EXIT);
+
+ // // Creating labels for Edit Menu
+ // MNU_UNDO = gtk_menu_item_new_with_label("Undo");
+ // MNU_REDO = gtk_menu_item_new_with_label("Redo");
+ // MNU_INSERT_RUNG_BEFORE = gtk_menu_item_new_with_label("Insert rung Before");
+ // MNU_INSERT_RUNG_AFTER = gtk_menu_item_new_with_label("Insert Rung After");
+ // MNU_PUSH_RUNG_UP = gtk_menu_item_new_with_label("Move Selected Rung Up");
+ // MNU_PUSH_RUNG_DOWN = gtk_menu_item_new_with_label("Move Selected Rung Down");
+ // MNU_DELETE_ELEMENT = gtk_menu_item_new_with_label("Delete Selected Element");
+ // MNU_DELETE_RUNG = gtk_menu_item_new_with_label("Delete Rung");
+
+ // // Appending menu items to Edit menu and adding separators
+ // gtk_menu_shell_append(GTK_MENU_SHELL (EditMenu), MNU_UNDO);
+ // gtk_menu_shell_append(GTK_MENU_SHELL (EditMenu), MNU_REDO);
+ // EditMenuSeparator = gtk_separator_menu_item_new();
+ // gtk_menu_shell_append(GTK_MENU_SHELL(EditMenu), EditMenuSeparator);
+ // gtk_menu_shell_append(GTK_MENU_SHELL (EditMenu), MNU_INSERT_RUNG_BEFORE);
+ // gtk_menu_shell_append(GTK_MENU_SHELL (EditMenu), MNU_INSERT_RUNG_AFTER);
+ // gtk_menu_shell_append(GTK_MENU_SHELL (EditMenu), MNU_PUSH_RUNG_UP);
+ // gtk_menu_shell_append(GTK_MENU_SHELL (EditMenu), MNU_PUSH_RUNG_DOWN);
+ // EditMenuSeparator = gtk_separator_menu_item_new();
+ // gtk_menu_shell_append(GTK_MENU_SHELL(EditMenu), EditMenuSeparator);
+ // gtk_menu_shell_append(GTK_MENU_SHELL (EditMenu), MNU_DELETE_ELEMENT);
+ // gtk_menu_shell_append(GTK_MENU_SHELL (EditMenu), MNU_DELETE_RUNG);
+
+ // // Creating labels for Settings Menu
+ // MNU_MCU_SETTINGS = gtk_menu_item_new_with_label ("MCU Parameters...");
+ // MNU_PROCESSOR_0 = gtk_menu_item_new_with_label ("Microcontroller");
+
+ // // Appending menu items to Settings menu
+ // gtk_menu_shell_append (GTK_MENU_SHELL (settings), MNU_MCU_SETTINGS);
+ // gtk_menu_shell_append (GTK_MENU_SHELL (settings), MNU_PROCESSOR_0);
+
+ // for (i = 0; i < NUM_SUPPORTED_MCUS; i++){
+ // ProcessorMenuItems = gtk_check_menu_item_new_with_label (SupportedMcus[i].mcuName);
+ // gtk_menu_shell_append (GTK_MENU_SHELL (ProcessorMenu), ProcessorMenuItems);
+ // }
+
+ // ProcessorMenuItems = gtk_check_menu_item_new_with_label ("(no microcontroller)");
+ // gtk_menu_shell_append (GTK_MENU_SHELL (ProcessorMenu), ProcessorMenuItems);
+ // gtk_menu_item_set_submenu(GTK_MENU_ITEM(MNU_PROCESSOR_0), ProcessorMenu);
+
+ // // Creating labels for Instruction Menu and adding separators
+ // MNU_INSERT_COMMENT = gtk_menu_item_new_with_label("Insert Comment");
+ // MNU_INSERT_CONTACTS = gtk_menu_item_new_with_label("Insert Contacts");
+ // MNU_INSERT_OSR = gtk_menu_item_new_with_label("Insert OSR (One Shot Rising)");
+ // MNU_INSERT_OSF = gtk_menu_item_new_with_label("Insert OSF (One Shot Falling)");
+ // MNU_INSERT_TON = gtk_menu_item_new_with_label("Insert TON (Delayed Turn On)");
+ // MNU_INSERT_TOF = gtk_menu_item_new_with_label("Insert TOF (Delayed Turn Off)");
+ // MNU_INSERT_RTO = gtk_menu_item_new_with_label("Insert RTO (Retentive Delayed Turn On)");
+ // MNU_INSERT_CTU = gtk_menu_item_new_with_label("Insert CTU (Count Up)");
+ // MNU_INSERT_CTD = gtk_menu_item_new_with_label("Insert CTD (Count Down)");
+ // MNU_INSERT_CTC = gtk_menu_item_new_with_label("Insert CTC (Count Circular)");
+ // MNU_INSERT_EQU = gtk_menu_item_new_with_label("Insert EQU (Compare for Equals)");
+ // MNU_INSERT_NEQ = gtk_menu_item_new_with_label("Insert NEQ (Compare for Not Equals)");
+ // MNU_INSERT_GRT = gtk_menu_item_new_with_label("Insert GRT (Compare for Greater Than)");
+ // MNU_INSERT_GEQ = gtk_menu_item_new_with_label("Insert GEQ (Compare for Greater Than or Equal)");
+ // MNU_INSERT_LES = gtk_menu_item_new_with_label("Insert LES (Compare for Less Than)");
+ // MNU_INSERT_LEQ = gtk_menu_item_new_with_label("Insert LEQ (Compare for Less Than or Equal)");
+ // MNU_INSERT_OPEN = gtk_menu_item_new_with_label("Insert Open Circuit");
+ // MNU_INSERT_SHORT = gtk_menu_item_new_with_label("Insert Short Circuit");
+ // MNU_INSERT_MASTER_RLY = gtk_menu_item_new_with_label("Insert Master Control Relay");
+ // MNU_INSERT_COIL = gtk_menu_item_new_with_label("Insert Coil");
+ // MNU_INSERT_RES = gtk_menu_item_new_with_label("Insert RES (Counter/RTO Reset)");
+ // MNU_INSERT_MOV = gtk_menu_item_new_with_label("Insert MOV (Move)");
+ // MNU_INSERT_ADD = gtk_menu_item_new_with_label("Insert ADD (16-bit Integer Ad)");
+ // MNU_INSERT_SUB = gtk_menu_item_new_with_label("Insert SUB (16-bit Integer Subtract)");
+ // MNU_INSERT_MUL = gtk_menu_item_new_with_label("Insert MUL (16-bit Integer Multiply)");
+ // MNU_INSERT_DIV = gtk_menu_item_new_with_label("Insert DIV (16-bit Integer Division)");
+ // MNU_INSERT_SHIFT_REG = gtk_menu_item_new_with_label("Insert Shift Register");
+ // MNU_INSERT_LUT = gtk_menu_item_new_with_label("Insert Look-Up Table");
+ // MNU_INSERT_PWL = gtk_menu_item_new_with_label("Insert Piecewise Linear");
+ // MNU_INSERT_FMTD_STR = gtk_menu_item_new_with_label("Insert Formatted String Over UART");
+ // MNU_INSERT_UART_SEND = gtk_menu_item_new_with_label("Insert UART Send");
+ // MNU_INSERT_UART_RECV = gtk_menu_item_new_with_label("Insert UART Receive");
+ // MNU_INSERT_SET_PWM = gtk_menu_item_new_with_label("Insert Set PWM Output");
+ // MNU_INSERT_READ_ADC = gtk_menu_item_new_with_label("Insert A/D Converter Read");
+ // MNU_INSERT_PERSIST = gtk_menu_item_new_with_label("Insert Make Persistent");
+ // MNU_MAKE_NORMAL = gtk_menu_item_new_with_label("Make Normal");
+ // MNU_NEGATE = gtk_menu_item_new_with_label("Make Negated");
+ // MNU_MAKE_SET_ONLY = gtk_menu_item_new_with_label("Make Set-Only");
+ // MNU_MAKE_RESET_ONLY = gtk_menu_item_new_with_label("Make Reset-Only");
+
+ // // Appending menu items to Instruction menu and adding separators
+ // gtk_menu_shell_append (GTK_MENU_SHELL (InstructionMenu), MNU_INSERT_COMMENT);
+ // InstructionMenuSeparator = gtk_separator_menu_item_new();
+ // gtk_menu_shell_append (GTK_MENU_SHELL(InstructionMenu), InstructionMenuSeparator);
+ // gtk_menu_shell_append (GTK_MENU_SHELL (InstructionMenu), MNU_INSERT_CONTACTS);
+ // InstructionMenuSeparator = gtk_separator_menu_item_new();
+ // gtk_menu_shell_append (GTK_MENU_SHELL(InstructionMenu), InstructionMenuSeparator);
+ // gtk_menu_shell_append (GTK_MENU_SHELL (InstructionMenu), MNU_INSERT_OSR);
+ // InstructionMenuSeparator = gtk_separator_menu_item_new();
+ // gtk_menu_shell_append (GTK_MENU_SHELL(InstructionMenu), InstructionMenuSeparator);
+ // gtk_menu_shell_append (GTK_MENU_SHELL (InstructionMenu), MNU_INSERT_OSF);
+ // gtk_menu_shell_append (GTK_MENU_SHELL (InstructionMenu), MNU_INSERT_TON);
+ // gtk_menu_shell_append (GTK_MENU_SHELL (InstructionMenu), MNU_INSERT_TOF);
+ // gtk_menu_shell_append (GTK_MENU_SHELL (InstructionMenu), MNU_INSERT_RTO);
+ // InstructionMenuSeparator = gtk_separator_menu_item_new();
+ // gtk_menu_shell_append (GTK_MENU_SHELL(InstructionMenu), InstructionMenuSeparator);
+ // gtk_menu_shell_append (GTK_MENU_SHELL (InstructionMenu), MNU_INSERT_CTU);
+ // gtk_menu_shell_append (GTK_MENU_SHELL (InstructionMenu), MNU_INSERT_CTD);
+ // gtk_menu_shell_append (GTK_MENU_SHELL (InstructionMenu), MNU_INSERT_CTC);
+ // InstructionMenuSeparator = gtk_separator_menu_item_new();
+ // gtk_menu_shell_append (GTK_MENU_SHELL(InstructionMenu), InstructionMenuSeparator);
+ // gtk_menu_shell_append (GTK_MENU_SHELL (InstructionMenu), MNU_INSERT_EQU);
+ // gtk_menu_shell_append (GTK_MENU_SHELL (InstructionMenu), MNU_INSERT_NEQ);
+ // gtk_menu_shell_append (GTK_MENU_SHELL (InstructionMenu), MNU_INSERT_GRT);
+ // gtk_menu_shell_append (GTK_MENU_SHELL (InstructionMenu), MNU_INSERT_GEQ);
+ // gtk_menu_shell_append (GTK_MENU_SHELL (InstructionMenu), MNU_INSERT_LES);
+ // gtk_menu_shell_append (GTK_MENU_SHELL (InstructionMenu), MNU_INSERT_LEQ);
+ // InstructionMenuSeparator = gtk_separator_menu_item_new();
+ // gtk_menu_shell_append (GTK_MENU_SHELL(InstructionMenu), InstructionMenuSeparator);
+ // gtk_menu_shell_append (GTK_MENU_SHELL (InstructionMenu), MNU_INSERT_OPEN);
+ // gtk_menu_shell_append (GTK_MENU_SHELL (InstructionMenu), MNU_INSERT_SHORT);
+ // gtk_menu_shell_append (GTK_MENU_SHELL (InstructionMenu), MNU_INSERT_MASTER_RLY);
+ // InstructionMenuSeparator = gtk_separator_menu_item_new();
+ // gtk_menu_shell_append (GTK_MENU_SHELL(InstructionMenu), InstructionMenuSeparator);
+ // gtk_menu_shell_append (GTK_MENU_SHELL (InstructionMenu), MNU_INSERT_COIL);
+ // gtk_menu_shell_append (GTK_MENU_SHELL (InstructionMenu), MNU_INSERT_RES);
+ // InstructionMenuSeparator = gtk_separator_menu_item_new();
+ // gtk_menu_shell_append (GTK_MENU_SHELL(InstructionMenu), InstructionMenuSeparator);
+ // gtk_menu_shell_append (GTK_MENU_SHELL (InstructionMenu), MNU_INSERT_MOV);
+ // gtk_menu_shell_append (GTK_MENU_SHELL (InstructionMenu), MNU_INSERT_ADD);
+ // gtk_menu_shell_append (GTK_MENU_SHELL (InstructionMenu), MNU_INSERT_SUB);
+ // gtk_menu_shell_append (GTK_MENU_SHELL (InstructionMenu), MNU_INSERT_MUL);
+ // gtk_menu_shell_append (GTK_MENU_SHELL (InstructionMenu), MNU_INSERT_DIV);
+ // InstructionMenuSeparator = gtk_separator_menu_item_new();
+ // gtk_menu_shell_append (GTK_MENU_SHELL(InstructionMenu), InstructionMenuSeparator);
+ // gtk_menu_shell_append (GTK_MENU_SHELL (InstructionMenu), MNU_INSERT_SHIFT_REG);
+ // gtk_menu_shell_append (GTK_MENU_SHELL (InstructionMenu), MNU_INSERT_LUT);
+ // gtk_menu_shell_append (GTK_MENU_SHELL (InstructionMenu), MNU_INSERT_PWL);
+ // gtk_menu_shell_append (GTK_MENU_SHELL (InstructionMenu), MNU_INSERT_FMTD_STR);
+ // InstructionMenuSeparator = gtk_separator_menu_item_new();
+ // gtk_menu_shell_append (GTK_MENU_SHELL (InstructionMenu), InstructionMenuSeparator);
+ // gtk_menu_shell_append (GTK_MENU_SHELL (InstructionMenu), MNU_INSERT_UART_SEND);
+ // gtk_menu_shell_append (GTK_MENU_SHELL (InstructionMenu), MNU_INSERT_UART_RECV);
+ // gtk_menu_shell_append (GTK_MENU_SHELL (InstructionMenu), MNU_INSERT_SET_PWM);
+ // gtk_menu_shell_append (GTK_MENU_SHELL (InstructionMenu), MNU_INSERT_READ_ADC);
+ // gtk_menu_shell_append (GTK_MENU_SHELL (InstructionMenu), MNU_INSERT_PERSIST);
+ // InstructionMenuSeparator = gtk_separator_menu_item_new();
+ // gtk_menu_shell_append (GTK_MENU_SHELL (InstructionMenu), InstructionMenuSeparator);
+ // gtk_menu_shell_append (GTK_MENU_SHELL (InstructionMenu), MNU_MAKE_NORMAL);
+ // gtk_menu_shell_append (GTK_MENU_SHELL (InstructionMenu), MNU_NEGATE);
+ // gtk_menu_shell_append (GTK_MENU_SHELL (InstructionMenu), MNU_MAKE_SET_ONLY);
+ // gtk_menu_shell_append (GTK_MENU_SHELL (InstructionMenu), MNU_MAKE_RESET_ONLY);
+
+ // // Creating labels for Simulation Menu
+ // MNU_COMPILE = gtk_menu_item_new_with_label("Compile");
+ // MNU_COMPILE_AS = gtk_menu_item_new_with_label("Compile As...");
+
+ // // Appending menu items to Compile menu
+ // gtk_menu_shell_append(GTK_MENU_SHELL (compile), MNU_COMPILE);
+ // gtk_menu_shell_append(GTK_MENU_SHELL (compile), MNU_COMPILE_AS);
+
+ // // Creating labels for Simulation Menu
+ // MNU_MANUAL = gtk_menu_item_new_with_label("Manual...");
+ // MNU_ABOUT = gtk_menu_item_new_with_label("About...");
+
+ // // Appending menu items to Help menu
+ // gtk_menu_shell_append(GTK_MENU_SHELL (help), MNU_MANUAL);
+ // gtk_menu_shell_append(GTK_MENU_SHELL (help), MNU_ABOUT);
+
+ // // Creating labels for Simulation Menu
+ // MNU_SIMULATION_MODE = gtk_check_menu_item_new_with_label("Simulation Mode");
+ // MNU_START_SIMULATION = gtk_menu_item_new_with_label("Start Real-Time Simulation");
+ // MNU_STOP_SIMULATION = gtk_menu_item_new_with_label("Halt Simulation");
+ // MNU_SINGLE_CYCLE = gtk_menu_item_new_with_label("Single Cycle");
+
+ // // Appending menu items to Simulate menu and adding separators
+ // gtk_menu_shell_append(GTK_MENU_SHELL (SimulateMenu), MNU_SIMULATION_MODE);
+ // gtk_menu_shell_append(GTK_MENU_SHELL (SimulateMenu), MNU_START_SIMULATION);
+ // gtk_menu_shell_append(GTK_MENU_SHELL (SimulateMenu), MNU_STOP_SIMULATION);
+ // gtk_menu_shell_append(GTK_MENU_SHELL (SimulateMenu), MNU_SINGLE_CYCLE);
+ // SimulateMenuSeparator = gtk_separator_menu_item_new();
+ // gtk_menu_shell_append(GTK_MENU_SHELL(SimulateMenu), SimulateMenuSeparator);
+
+ // // Creating submenus for each menu
+ // gtk_menu_item_set_submenu(GTK_MENU_ITEM(FileLabel), FileMenu);
+ // gtk_menu_item_set_submenu(GTK_MENU_ITEM(EditLabel), EditMenu);
+ // gtk_menu_item_set_submenu(GTK_MENU_ITEM(SettingsLabel), settings);
+ // gtk_menu_item_set_submenu(GTK_MENU_ITEM(InstructionLabel), InstructionMenu);
+ // gtk_menu_item_set_submenu(GTK_MENU_ITEM(SimulateLabel), SimulateMenu);
+ // gtk_menu_item_set_submenu(GTK_MENU_ITEM(CompileLabel), compile);
+ // gtk_menu_item_set_submenu(GTK_MENU_ITEM(HelpLabel), help);
+
+ // // Appending the menu item to the menu bar
+ // gtk_menu_shell_append(GTK_MENU_SHELL(TopMenu), FileLabel);
+ // gtk_menu_shell_append(GTK_MENU_SHELL(TopMenu), EditLabel);
+ // gtk_menu_shell_append(GTK_MENU_SHELL(TopMenu), SettingsLabel);
+ // gtk_menu_shell_append(GTK_MENU_SHELL(TopMenu), InstructionLabel);
+ // gtk_menu_shell_append(GTK_MENU_SHELL(TopMenu), SimulateLabel);
+ // gtk_menu_shell_append(GTK_MENU_SHELL(TopMenu), CompileLabel);
+ // gtk_menu_shell_append(GTK_MENU_SHELL(TopMenu), HelpLabel);
+
+ // // Packing the menu bar into the box for alignment
+ // gtk_box_pack_start(GTK_BOX(MenuBox), TopMenu, FALSE, FALSE, 0);
+
+ // return MenuBox;
}
//-----------------------------------------------------------------------------
@@ -606,29 +600,29 @@ HMENU MakeMainWindowMenus(void)
//-----------------------------------------------------------------------------
void RefreshScrollbars(void)
{
- SCROLLINFO vert, horiz;
- SetUpScrollbars(&NeedHoriz, &horiz, &vert);
- SetScrollInfo(HorizScrollBar, SB_CTL, &horiz, TRUE);
- SetScrollInfo(VertScrollBar, SB_CTL, &vert, TRUE);
-
- RECT main;
- GetClientRect(MainWindow, &main);
-
- if(NeedHoriz) {
- MoveWindow(HorizScrollBar, 0, IoListTop - ScrollHeight - 2,
- main.right - ScrollWidth - 2, ScrollHeight, TRUE);
- ShowWindow(HorizScrollBar, SW_SHOW);
- EnableWindow(HorizScrollBar, TRUE);
- } else {
- ShowWindow(HorizScrollBar, SW_HIDE);
- }
- MoveWindow(VertScrollBar, main.right - ScrollWidth - 2, 1, ScrollWidth,
- NeedHoriz ? (IoListTop - ScrollHeight - 4) : (IoListTop - 3), TRUE);
-
- MoveWindow(VertScrollBar, main.right - ScrollWidth - 2, 1, ScrollWidth,
- NeedHoriz ? (IoListTop - ScrollHeight - 4) : (IoListTop - 3), TRUE);
-
- InvalidateRect(MainWindow, NULL, FALSE);
+ // SCROLLINFO vert, horiz;
+ // SetUpScrollbars(&NeedHoriz, &horiz, &vert);
+ // SetScrollInfo(HorizScrollBar, SB_CTL, &horiz, TRUE);
+ // SetScrollInfo(VertScrollBar, SB_CTL, &vert, TRUE);
+
+ // RECT main;
+ // GetClientRect(MainWindow, &main);
+
+ // if(NeedHoriz) {
+ // MoveWindow(HorizScrollBar, 0, IoListTop - ScrollHeight - 2,
+ // main.right - ScrollWidth - 2, ScrollHeight, TRUE);
+ // ShowWindow(HorizScrollBar, SW_SHOW);
+ // EnableWindow(HorizScrollBar, TRUE);
+ // } else {
+ // ShowWindow(HorizScrollBar, SW_HIDE);
+ // }
+ // MoveWindow(VertScrollBar, main.right - ScrollWidth - 2, 1, ScrollWidth,
+ // NeedHoriz ? (IoListTop - ScrollHeight - 4) : (IoListTop - 3), TRUE);
+
+ // MoveWindow(VertScrollBar, main.right - ScrollWidth - 2, 1, ScrollWidth,
+ // NeedHoriz ? (IoListTop - ScrollHeight - 4) : (IoListTop - 3), TRUE);
+
+ // InvalidateRect(MainWindow, NULL, FALSE);
}
//-----------------------------------------------------------------------------
@@ -639,7 +633,6 @@ void RefreshScrollbars(void)
//-----------------------------------------------------------------------------
void RefreshControlsToSettings(void)
{
-
}
//-----------------------------------------------------------------------------
@@ -648,24 +641,24 @@ void RefreshControlsToSettings(void)
//-----------------------------------------------------------------------------
void GenerateIoListDontLoseSelection(void)
{
- int i;
- GtkTreeIter* iter;
- GtkTreeModel **IoListPtr = (GtkTreeModel**)GTK_TREE_MODEL (IoList);
- gtk_tree_selection_set_mode(gtk_tree_view_get_selection(GTK_TREE_VIEW(view)),
- GTK_SELECTION_SINGLE);
- IoListSelectionPoint = -1;
- for(i = 0; i < Prog.io.count; i++) {
- if(gtk_tree_selection_get_selected (gtk_tree_view_get_selection(GTK_TREE_VIEW(view)),
- IoListPtr, iter)) {
- IoListSelectionPoint = i;
- break;
- }
- }
- IoListSelectionPoint = GenerateIoList(IoListSelectionPoint);
- // can't just update the listview index; if I/O has been added then the
- // new selection point might be out of range till we refill it
- IoListOutOfSync = TRUE;
- RefreshControlsToSettings();
+ // int i;
+ // GtkTreeIter* iter;
+ // GtkTreeModel **IoListPtr = (GtkTreeModel**)GTK_TREE_MODEL (IoList);
+ // gtk_tree_selection_set_mode(gtk_tree_view_get_selection(GTK_TREE_VIEW(view)),
+ // GTK_SELECTION_SINGLE);
+ // IoListSelectionPoint = -1;
+ // for(i = 0; i < Prog.io.count; i++) {
+ // if(gtk_tree_selection_get_selected (gtk_tree_view_get_selection(GTK_TREE_VIEW(view)),
+ // IoListPtr, iter)) {
+ // IoListSelectionPoint = i;
+ // break;
+ // }
+ // }
+ // IoListSelectionPoint = GenerateIoList(IoListSelectionPoint);
+ // // can't just update the listview index; if I/O has been added then the
+ // // new selection point might be out of range till we refill it
+ // IoListOutOfSync = TRUE;
+ // RefreshControlsToSettings();
}
//-----------------------------------------------------------------------------
@@ -674,62 +667,62 @@ void GenerateIoListDontLoseSelection(void)
//-----------------------------------------------------------------------------
void ToggleSimulationMode(void)
{
- InSimulationMode = !InSimulationMode;
-
- if(InSimulationMode) {
- EnableMenuItem(SimulateMenu, MNU_START_SIMULATION, MF_ENABLED);
- EnableMenuItem(SimulateMenu, MNU_SINGLE_CYCLE, MF_ENABLED);
-
- EnableMenuItem(FileMenu, MNU_OPEN, MF_GRAYED);
- EnableMenuItem(FileMenu, MNU_SAVE, MF_GRAYED);
- EnableMenuItem(FileMenu, MNU_SAVE_AS, MF_GRAYED);
- EnableMenuItem(FileMenu, MNU_NEW, MF_GRAYED);
- EnableMenuItem(FileMenu, MNU_EXPORT, MF_GRAYED);
-
- EnableMenuItem(TopMenu, 1, MF_GRAYED | MF_BYPOSITION);
- EnableMenuItem(TopMenu, 2, MF_GRAYED | MF_BYPOSITION);
- EnableMenuItem(TopMenu, 3, MF_GRAYED | MF_BYPOSITION);
- EnableMenuItem(TopMenu, 5, MF_GRAYED | MF_BYPOSITION);
+ // InSimulationMode = !InSimulationMode;
+
+ // if(InSimulationMode) {
+ // EnableMenuItem(SimulateMenu, MNU_START_SIMULATION, MF_ENABLED);
+ // EnableMenuItem(SimulateMenu, MNU_SINGLE_CYCLE, MF_ENABLED);
+
+ // EnableMenuItem(FileMenu, MNU_OPEN, MF_GRAYED);
+ // EnableMenuItem(FileMenu, MNU_SAVE, MF_GRAYED);
+ // EnableMenuItem(FileMenu, MNU_SAVE_AS, MF_GRAYED);
+ // EnableMenuItem(FileMenu, MNU_NEW, MF_GRAYED);
+ // EnableMenuItem(FileMenu, MNU_EXPORT, MF_GRAYED);
+
+ // EnableMenuItem(TopMenu, 1, MF_GRAYED | MF_BYPOSITION);
+ // EnableMenuItem(TopMenu, 2, MF_GRAYED | MF_BYPOSITION);
+ // EnableMenuItem(TopMenu, 3, MF_GRAYED | MF_BYPOSITION);
+ // EnableMenuItem(TopMenu, 5, MF_GRAYED | MF_BYPOSITION);
- CheckMenuItem(SimulateMenu, MNU_SIMULATION_MODE, MF_CHECKED);
-
- ClearSimulationData();
- // Recheck InSimulationMode, because there could have been a compile
- // error, which would have kicked us out of simulation mode.
- if(UartFunctionUsed() && InSimulationMode) {
- ShowUartSimulationWindow();
- }
- } else {
- RealTimeSimulationRunning = FALSE;
- KillTimer(MainWindow, TIMER_SIMULATE);
-
- EnableMenuItem(SimulateMenu, MNU_START_SIMULATION, MF_GRAYED);
- EnableMenuItem(SimulateMenu, MNU_STOP_SIMULATION, MF_GRAYED);
- EnableMenuItem(SimulateMenu, MNU_SINGLE_CYCLE, MF_GRAYED);
-
- EnableMenuItem(FileMenu, MNU_OPEN, MF_ENABLED);
- EnableMenuItem(FileMenu, MNU_SAVE, MF_ENABLED);
- EnableMenuItem(FileMenu, MNU_SAVE_AS, MF_ENABLED);
- EnableMenuItem(FileMenu, MNU_NEW, MF_ENABLED);
- EnableMenuItem(FileMenu, MNU_EXPORT, MF_ENABLED);
-
- EnableMenuItem(TopMenu, 1, MF_ENABLED | MF_BYPOSITION);
- EnableMenuItem(TopMenu, 2, MF_ENABLED | MF_BYPOSITION);
- EnableMenuItem(TopMenu, 3, MF_ENABLED | MF_BYPOSITION);
- EnableMenuItem(TopMenu, 5, MF_ENABLED | MF_BYPOSITION);
-
- CheckMenuItem(SimulateMenu, MNU_SIMULATION_MODE, MF_UNCHECKED);
-
- if(UartFunctionUsed()) {
- DestroyUartSimulationWindow();
- }
- }
-
- UpdateMainWindowTitleBar();
-
- DrawMenuBar(MainWindow);
- InvalidateRect(MainWindow, NULL, FALSE);
- ListView_RedrawItems(IoList, 0, Prog.io.count - 1);
+ // CheckMenuItem(SimulateMenu, MNU_SIMULATION_MODE, MF_CHECKED);
+
+ // ClearSimulationData();
+ // // Recheck InSimulationMode, because there could have been a compile
+ // // error, which would have kicked us out of simulation mode.
+ // if(UartFunctionUsed() && InSimulationMode) {
+ // ShowUartSimulationWindow();
+ // }
+ // } else {
+ // RealTimeSimulationRunning = FALSE;
+ // KillTimer(MainWindow, TIMER_SIMULATE);
+
+ // EnableMenuItem(SimulateMenu, MNU_START_SIMULATION, MF_GRAYED);
+ // EnableMenuItem(SimulateMenu, MNU_STOP_SIMULATION, MF_GRAYED);
+ // EnableMenuItem(SimulateMenu, MNU_SINGLE_CYCLE, MF_GRAYED);
+
+ // EnableMenuItem(FileMenu, MNU_OPEN, MF_ENABLED);
+ // EnableMenuItem(FileMenu, MNU_SAVE, MF_ENABLED);
+ // EnableMenuItem(FileMenu, MNU_SAVE_AS, MF_ENABLED);
+ // EnableMenuItem(FileMenu, MNU_NEW, MF_ENABLED);
+ // EnableMenuItem(FileMenu, MNU_EXPORT, MF_ENABLED);
+
+ // EnableMenuItem(TopMenu, 1, MF_ENABLED | MF_BYPOSITION);
+ // EnableMenuItem(TopMenu, 2, MF_ENABLED | MF_BYPOSITION);
+ // EnableMenuItem(TopMenu, 3, MF_ENABLED | MF_BYPOSITION);
+ // EnableMenuItem(TopMenu, 5, MF_ENABLED | MF_BYPOSITION);
+
+ // CheckMenuItem(SimulateMenu, MNU_SIMULATION_MODE, MF_UNCHECKED);
+
+ // if(UartFunctionUsed()) {
+ // DestroyUartSimulationWindow();
+ // }
+ // }
+
+ // UpdateMainWindowTitleBar();
+
+ // DrawMenuBar(MainWindow);
+ // InvalidateRect(MainWindow, NULL, FALSE);
+ // ListView_RedrawItems(IoList, 0, Prog.io.count - 1);
}
//-----------------------------------------------------------------------------
@@ -738,11 +731,11 @@ void ToggleSimulationMode(void)
//-----------------------------------------------------------------------------
void StartSimulation(void)
{
- RealTimeSimulationRunning = TRUE;
- EnableMenuItem(SimulateMenu, MNU_START_SIMULATION, MF_GRAYED);
- EnableMenuItem(SimulateMenu, MNU_STOP_SIMULATION, MF_ENABLED);
- StartSimulationTimer();
- UpdateMainWindowTitleBar();
+ // RealTimeSimulationRunning = TRUE;
+ // EnableMenuItem(SimulateMenu, MNU_START_SIMULATION, MF_GRAYED);
+ // EnableMenuItem(SimulateMenu, MNU_STOP_SIMULATION, MF_ENABLED);
+ // StartSimulationTimer();
+ // UpdateMainWindowTitleBar();
}
//-----------------------------------------------------------------------------
@@ -751,11 +744,11 @@ void StartSimulation(void)
//-----------------------------------------------------------------------------
void StopSimulation(void)
{
- RealTimeSimulationRunning = FALSE;
+ // RealTimeSimulationRunning = FALSE;
- EnableMenuItem(SimulateMenu, MNU_START_SIMULATION, MF_ENABLED);
- EnableMenuItem(SimulateMenu, MNU_STOP_SIMULATION, MF_GRAYED);
- KillTimer(MainWindow, TIMER_SIMULATE);
+ // EnableMenuItem(SimulateMenu, MNU_START_SIMULATION, MF_ENABLED);
+ // EnableMenuItem(SimulateMenu, MNU_STOP_SIMULATION, MF_GRAYED);
+ // KillTimer(MainWindow, TIMER_SIMULATE);
- UpdateMainWindowTitleBar();
+ // UpdateMainWindowTitleBar();
}