summaryrefslogtreecommitdiff
path: root/ldmicro/lib/linuxUI
diff options
context:
space:
mode:
Diffstat (limited to 'ldmicro/lib/linuxUI')
-rw-r--r--ldmicro/lib/linuxUI/linuxLD.h2
-rw-r--r--ldmicro/lib/linuxUI/linuxUI.cpp70
-rw-r--r--ldmicro/lib/linuxUI/linuxUI.h11
3 files changed, 44 insertions, 39 deletions
diff --git a/ldmicro/lib/linuxUI/linuxLD.h b/ldmicro/lib/linuxUI/linuxLD.h
index c7ce92e..e204c63 100644
--- a/ldmicro/lib/linuxUI/linuxLD.h
+++ b/ldmicro/lib/linuxUI/linuxLD.h
@@ -154,4 +154,4 @@ BOOL HeapFree(
void OutputDebugString(char*);
double GetTickCount(void);
-#endif
+#endif \ No newline at end of file
diff --git a/ldmicro/lib/linuxUI/linuxUI.cpp b/ldmicro/lib/linuxUI/linuxUI.cpp
index 54b42e2..3bebf6d 100644
--- a/ldmicro/lib/linuxUI/linuxUI.cpp
+++ b/ldmicro/lib/linuxUI/linuxUI.cpp
@@ -1,43 +1,15 @@
#include "linuxUI.h"
-/// Menu Variables
-HWID window;
-HWID menu_box; // Box for alignment
-HWID packed_menu_box; // Stores the packed box
-HWID FileMenu; // File Menu
-HWID EditMenu; // Edit Menu
-HWID settings; // Settings Menu
-HWID ProcessorMenu; // Processor Menu
-HWID InstructionMenu; // Instruction Menu
-HWID compile; // Compile Menu
-HWID help; // Help Menu
-HWID SimulateMenu; // Simulate Menu
-HWID menu_bar; // Menu Bar
-HWID file_label; // File menu label
-HWID edit_label; // Edit menu label
-HWID instruction_label; // Instruction menu label
-HWID settings_label; // Settings menu label
-HWID compile_label; // Compile menu label
-HWID help_label; // Help menu label
-HWID simulate_label; // Simulate menu label
-HWID file_menu_items; // File menu item
-HWID edit_menu_items; // Edit menu item
-HWID instruction_menu_items; // Instruction menu item
-HWID settings_menu_items; // Settings menu item
-HWID processor_menu_items; // Processor menu items
-HWID compile_menu_items; // Compile menu item
-HWID help_menu_items; // Help menu item
-HWID simulate_menu_items; // Simulate menu item
-HWID file_menu_separator; // File menu separator
-HWID edit_menu_separator; // Edit menu separator
-HWID instruction_menu_separator; // Instruction menu separator
-HWID simulate_menu_separator; // Simulate menu separator
-
-//Scrollbars for the ladder logic area
-// int ScrollWidth; // Width of scrolling
-// int ScrollHeight; // Height of scrolling
-HWID IoList; // Window for list view
-
+/// EnableMenuItem Variables
+const UINT MF_ENABLED = 0;
+const UINT MF_GRAYED = 1;
+const UINT MF_CHECKED = 2;
+const UINT MF_UNCHECKED = 3;
+
+/// ListStore
+GtkWidget* view;
+GtkTreeViewColumn* column;
+
/// Wraper function for gtk_window_has_toplevel_focus
BOOL isFocus(HWID window)
{
@@ -178,4 +150,26 @@ BOOL GetSaveFileName(OPENFILENAME *ofn)
//g_print("exit\n");
return exitStatus;
+}
+
+void EnableMenuItem(HMENU MenuName, HMENU MenuItem, UINT CheckEnabledItem) {
+ switch (CheckEnabledItem){
+ case MF_ENABLED :
+ gtk_widget_set_sensitive (MenuItem, true);
+ break;
+ case MF_GRAYED :
+ gtk_widget_set_sensitive (MenuItem, false);
+ break;
+ }
+}
+
+void CheckMenuItem(HMENU MenuName, HMENU MenuItem, UINT Check){
+ switch (Check){
+ case MF_CHECKED :
+ gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM(MenuItem), true);
+ break;
+ case MF_UNCHECKED :
+ gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM(MenuItem), false);
+ break;
+ }
} \ No newline at end of file
diff --git a/ldmicro/lib/linuxUI/linuxUI.h b/ldmicro/lib/linuxUI/linuxUI.h
index 199dfc3..c6bb1ac 100644
--- a/ldmicro/lib/linuxUI/linuxUI.h
+++ b/ldmicro/lib/linuxUI/linuxUI.h
@@ -35,6 +35,15 @@
#define OFN_HIDEREADONLY 0x00000200L
#define OFN_OVERWRITEPROMPT 0x00000400L
+/// EnableMenuItem variables
+extern const UINT MF_ENABLED;
+extern const UINT MF_GRAYED;
+extern const UINT MF_CHECKED;
+extern const UINT MF_UNCHECKED;
+
+/// ListStore
+extern GtkWidget* view;
+extern GtkTreeViewColumn* column;
/// data types
typedef struct OpenFileInfoData {
@@ -53,5 +62,7 @@ BOOL isFocus(HWID);
COLORREF RGB(int, int, int);
int MessageBox(HWID, char*, char*, UINT);
BOOL GetSaveFileName(OPENFILENAME* );
+void EnableMenuItem(HMENU, HMENU, UINT);
+void CheckMenuItem(HMENU, HMENU, UINT);
#endif \ No newline at end of file