summaryrefslogtreecommitdiff
path: root/ldmicro/lib
diff options
context:
space:
mode:
authorRamana2018-06-06 10:05:27 +0530
committerGitHub2018-06-06 10:05:27 +0530
commit86b0579d383105db5e5fa8e3e4cbbbf428ededf5 (patch)
tree860b10e7f01fdfc25be90aa0f6228fd6672cb333 /ldmicro/lib
parent1941edf7847565074fc79f339c8f8e609c5dca9d (diff)
parent67b618853b13595749ef89c620de4bc8e967cd02 (diff)
downloadLDMicroGtk-86b0579d383105db5e5fa8e3e4cbbbf428ededf5.tar.gz
LDMicroGtk-86b0579d383105db5e5fa8e3e4cbbbf428ededf5.tar.bz2
LDMicroGtk-86b0579d383105db5e5fa8e3e4cbbbf428ededf5.zip
Merge pull request #2 from NatsuDrag9/GUI_port
Progress sync
Diffstat (limited to 'ldmicro/lib')
-rw-r--r--ldmicro/lib/linuxUI/linuxLD.h2
-rw-r--r--ldmicro/lib/linuxUI/linuxUI.cpp71
-rw-r--r--ldmicro/lib/linuxUI/linuxUI.h11
3 files changed, 46 insertions, 38 deletions
diff --git a/ldmicro/lib/linuxUI/linuxLD.h b/ldmicro/lib/linuxUI/linuxLD.h
index db2a42f..0e4f682 100644
--- a/ldmicro/lib/linuxUI/linuxLD.h
+++ b/ldmicro/lib/linuxUI/linuxLD.h
@@ -78,4 +78,4 @@ class COLORREF : public GdkRGBA{
/// functions
-#endif
+#endif \ No newline at end of file
diff --git a/ldmicro/lib/linuxUI/linuxUI.cpp b/ldmicro/lib/linuxUI/linuxUI.cpp
index 353b31f..349408f 100644
--- a/ldmicro/lib/linuxUI/linuxUI.cpp
+++ b/ldmicro/lib/linuxUI/linuxUI.cpp
@@ -1,43 +1,18 @@
#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
-
+ HWID window;
+
+/// 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 +153,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 0efffca..8efb6ef 100644
--- a/ldmicro/lib/linuxUI/linuxUI.h
+++ b/ldmicro/lib/linuxUI/linuxUI.h
@@ -34,6 +34,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 {
@@ -52,5 +61,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