mirror of
https://gitea.nishi.boats/pyrite-dev/milsko
synced 2025-12-30 22:20:50 +00:00
introduce box widget
This commit is contained in:
@@ -37,6 +37,17 @@
|
||||
#define MwDispatch3(x, y, z) \
|
||||
if(!x->destroyed && x->widget_class != NULL && x->widget_class->y != NULL) x->widget_class->y(x, z)
|
||||
|
||||
/*!
|
||||
* @warning Used internally
|
||||
* @brief Dispatches the handler of widget class
|
||||
* @param x Widget
|
||||
* @param y Handler name
|
||||
* @param z Argument
|
||||
* @param w Argument
|
||||
*/
|
||||
#define MwDispatch4(x, y, z, w) \
|
||||
if(!x->destroyed && x->widget_class != NULL && x->widget_class->y != NULL) x->widget_class->y(x, z, w)
|
||||
|
||||
#define MwWaitMS 30
|
||||
|
||||
#define MwDoubleClickTimeout 250
|
||||
|
||||
@@ -50,5 +50,6 @@
|
||||
#include <Mw/Widget/Separator.h>
|
||||
#include <Mw/Widget/ComboBox.h>
|
||||
#include <Mw/Widget/TreeView.h>
|
||||
#include <Mw/Widget/Box.h>
|
||||
|
||||
#endif
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
#define MwNpadding "Ipadding"
|
||||
#define MwNborderWidth "IborderWidth"
|
||||
#define MwNfillArea "IfillArea"
|
||||
#define MwNboxRatio "IboxRatio"
|
||||
|
||||
#define MwNtitle "Stitle"
|
||||
#define MwNtext "Stext"
|
||||
|
||||
@@ -32,11 +32,13 @@ typedef void* MwWidget;
|
||||
typedef void (*MwHandler)(MwWidget handle);
|
||||
typedef int (*MwHandlerWithStatus)(MwWidget handle);
|
||||
typedef void (*MwHandlerProp)(MwWidget handle, const char* key);
|
||||
typedef void (*MwHandlerChildrenProp)(MwWidget handle, MwWidget child, const char* key);
|
||||
typedef void (*MwHandlerKey)(MwWidget handle, int key);
|
||||
typedef void (*MwHandlerMouse)(MwWidget handle, void* ptr);
|
||||
typedef void (*MwHandlerExecute)(MwWidget handle, const char* name, void* out, va_list args);
|
||||
|
||||
typedef void (*MwUserHandler)(MwWidget handle, void* user_data, void* call_data);
|
||||
typedef void (*MwErrorHandler)(int code, const char* message, void* user_data);
|
||||
typedef void (*MwHandlerExecute)(MwWidget handle, const char* name, void* out, va_list args);
|
||||
|
||||
struct _MwTextKeyValue {
|
||||
char* key;
|
||||
@@ -175,21 +177,26 @@ struct _MwListBoxPacket {
|
||||
};
|
||||
|
||||
struct _MwClass {
|
||||
MwHandlerWithStatus create;
|
||||
MwHandler destroy;
|
||||
MwHandler draw;
|
||||
MwHandler click;
|
||||
MwHandler parent_resize;
|
||||
MwHandlerProp prop_change;
|
||||
MwHandler mouse_move;
|
||||
MwHandlerMouse mouse_up;
|
||||
MwHandlerMouse mouse_down;
|
||||
MwHandlerKey key;
|
||||
MwHandlerExecute execute;
|
||||
MwHandler tick;
|
||||
void* reserved3;
|
||||
void* reserved4;
|
||||
void* reserved5;
|
||||
MwHandlerWithStatus create;
|
||||
MwHandler destroy;
|
||||
MwHandler draw;
|
||||
MwHandler click;
|
||||
MwHandler parent_resize;
|
||||
MwHandlerProp prop_change;
|
||||
MwHandler mouse_move;
|
||||
MwHandlerMouse mouse_up;
|
||||
MwHandlerMouse mouse_down;
|
||||
MwHandlerKey key;
|
||||
MwHandlerExecute execute;
|
||||
MwHandler tick;
|
||||
MwHandler resize;
|
||||
MwHandler children_update;
|
||||
MwHandlerChildrenProp children_prop_change;
|
||||
void* reserved1;
|
||||
void* reserved2;
|
||||
void* reserved3;
|
||||
void* reserved4;
|
||||
void* reserved5;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
24
include/Mw/Widget/Box.h
Normal file
24
include/Mw/Widget/Box.h
Normal file
@@ -0,0 +1,24 @@
|
||||
/*!
|
||||
* @file Mw/Widget/Box.h
|
||||
* @brief Box widget
|
||||
*/
|
||||
#ifndef __MW_WIDGET_BOX_H__
|
||||
#define __MW_WIDGET_BOX_H__
|
||||
|
||||
#include <Mw/MachDep.h>
|
||||
#include <Mw/TypeDefs.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
/*!
|
||||
* @brief Box widget class
|
||||
*/
|
||||
MWDECL MwClass MwBoxClass;
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user