summaryrefslogtreecommitdiff
path: root/ldmicro/lib/linuxUI
diff options
context:
space:
mode:
authorNatsuDrag92018-06-06 10:03:16 +0530
committerNatsuDrag92018-06-06 10:03:16 +0530
commit67b618853b13595749ef89c620de4bc8e967cd02 (patch)
treefabcccf6028174da0db9d74038f06f7f95e869c4 /ldmicro/lib/linuxUI
parent3cf43f746d445fdce77af21718881f45fe78d06b (diff)
downloadLDMicroGtk-67b618853b13595749ef89c620de4bc8e967cd02.tar.gz
LDMicroGtk-67b618853b13595749ef89c620de4bc8e967cd02.tar.bz2
LDMicroGtk-67b618853b13595749ef89c620de4bc8e967cd02.zip
Ported functions
Diffstat (limited to 'ldmicro/lib/linuxUI')
-rw-r--r--ldmicro/lib/linuxUI/linuxUI.cpp32
-rw-r--r--ldmicro/lib/linuxUI/linuxUI.h11
2 files changed, 43 insertions, 0 deletions
diff --git a/ldmicro/lib/linuxUI/linuxUI.cpp b/ldmicro/lib/linuxUI/linuxUI.cpp
index 9d912ea..fea10b5 100644
--- a/ldmicro/lib/linuxUI/linuxUI.cpp
+++ b/ldmicro/lib/linuxUI/linuxUI.cpp
@@ -2,6 +2,16 @@
/// Menu Variables
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)
@@ -132,3 +142,25 @@ BOOL GetSaveFileName(OPENFILENAME *ofn)
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 904599e..a7c8ce5 100644
--- a/ldmicro/lib/linuxUI/linuxUI.h
+++ b/ldmicro/lib/linuxUI/linuxUI.h
@@ -28,6 +28,15 @@
#define OFN_HIDEREADONLY 0x00000004
#define OFN_OVERWRITEPROMPT 0x00000002
+/// 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 {
@@ -46,5 +55,7 @@ BOOL isFocus(HWID);
COLORREF RGB(int, int, int);
void 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