aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/gfx_rules.h11
-rw-r--r--include/gwin/frame.h52
-rw-r--r--include/gwin/gwidget.h4
-rw-r--r--include/gwin/gwin.h4
4 files changed, 66 insertions, 5 deletions
diff --git a/include/gfx_rules.h b/include/gfx_rules.h
index 301cf263..d547f923 100644
--- a/include/gfx_rules.h
+++ b/include/gfx_rules.h
@@ -61,12 +61,21 @@
#if GWIN_NEED_HIERARCHY
#if !GQUEUE_NEED_ASYNC
#if GFX_DISPLAY_RULE_WARNINGS
- #warning "GWIN: GQUEUE_NEED_ASYNC is required when a GWIN_NEED_HIERARCHY is enabled. It has been turned on for you."
+ #warning "GWIN: GQUEUE_NEED_ASYNC is required when GWIN_NEED_HIERARCHY is enabled. It has been turned on for you."
#endif
#undef GQUEUE_NEED_ASYNC
#define GQUEUE_NEED_ASYNC TRUE
#endif
#endif
+ #if GWIN_NEED_FRAME
+ #if !GWIN_NEED_HIERARCHY
+ #if GFX_DISPLAY_RULE_WARNINGS
+ #warning "GWIN: GWIN_NEED_HIERARCHY is required when GIWN_NEED_FRAME is enabled. It has been turned on for you."
+ #endif
+ #undef GWIN_NEED_HIERARCHY
+ #define GWIN_NEED_HIERARCHY TRUE
+ #endif
+ #endif
#if GWIN_NEED_BUTTON || GWIN_NEED_SLIDER || GWIN_NEED_CHECKBOX || GWIN_NEED_LABEL || GWIN_NEED_RADIO || GWIN_NEED_LIST || \
GWIN_NEED_IMAGE || GWIN_NEED_CHECKBOX || GWIN_NEED_PROGRESSBAR
#if !GWIN_NEED_WIDGET
diff --git a/include/gwin/frame.h b/include/gwin/frame.h
new file mode 100644
index 00000000..156bdcd0
--- /dev/null
+++ b/include/gwin/frame.h
@@ -0,0 +1,52 @@
+/*
+ * This file is subject to the terms of the GFX License. If a copy of
+ * the license was not distributed with this file, you can obtain one at:
+ *
+ * http://ugfx.org/license.html
+ */
+
+/**
+ * @file include/gwin/frame.h
+ * @brief GWIN Graphic window subsystem header file.
+ *
+ * @defgroup Frame Frame
+ * @ingroup GWIN
+ *
+ * @details A frame is a rectangular window that can have optional border as well as buttons to
+ * close, maximize and minimize it. The main purpose of this widget is to contain children.
+ *
+ * @pre GFX_USE_GWIN must be set to TRUE in your gfxconf.h
+ * @pre GWIN_NEED_FRAME must be set to TRUE in your gfxconf.h
+ * @{
+ */
+
+#ifndef _GWIN_FRAME_H
+#define _GWIN_FRAME_H
+
+#include "gwin/class_gwin.h"
+
+// Flags for gwinFrameCreate()
+#define GWIN_FRAME_BORDER (GWIN_FIRST_CONTROL_FLAG << 0)
+#define GWIN_FRAME_CLOSE_BTN (GWIN_FIRST_CONTROL_FLAG << 1)
+#define GWIN_FRAME_MINMAX_BTN (GWIN_FIRST_CONTROL_FLAG << 2)
+
+typedef struct GFrameObject {
+ GWidgetObject w;
+
+ GHandle btnClose;
+ GHandle btnMin;
+ GHandle btnMax;
+} GFrameObject;
+
+GHandle gwinGFrameCreate(GDisplay *g, GFrameObject *fo, GWidgetInit *pInit, uint16_t flags);
+#define gwinFrameCreate(fo, pInit, flags) gwinGFrameCreate(GDISP, fo, pInit, flags);
+
+GHandle gwinFrameGetClose(GHandle gh);
+
+GHandle gwinFrameGetMin(GHandle gh);
+
+GHandle gwinFrameGetMax(GHandle gh);
+
+#endif /* _GWIN_FRAME_H */
+/** @} */
+
diff --git a/include/gwin/gwidget.h b/include/gwin/gwidget.h
index fa40c51c..8697ca92 100644
--- a/include/gwin/gwidget.h
+++ b/include/gwin/gwidget.h
@@ -304,5 +304,9 @@ bool_t gwinAttachListener(GListener *pl);
#include "gwin/progressbar.h"
#endif
+#if GWIN_NEED_FRAME || defined(__DOXYGEN__)
+ #include "gwin/frame.h"
+#endif
+
#endif /* _GWIDGET_H */
/** @} */
diff --git a/include/gwin/gwin.h b/include/gwin/gwin.h
index 73f7ff82..c59a1bcf 100644
--- a/include/gwin/gwin.h
+++ b/include/gwin/gwin.h
@@ -894,10 +894,6 @@ extern "C" {
#include "gwin/image.h"
#endif
- #if GWIN_NEED_LAYOUT || defined(__DOXYGEN__)
- #include "gwin/layout.h"
- #endif
-
#endif /* GFX_USE_GWIN */
#endif /* _GWIN_H */