add seven segment

This commit is contained in:
NishiOwO
2025-12-21 14:38:07 +09:00
parent f09960195f
commit 91d9677bf7
11 changed files with 376 additions and 43 deletions

View File

@@ -36,6 +36,7 @@
#define MwNfixedSize "IfixedSize"
#define MwNmargin "Imargin"
#define MwNbitmapFont "IbitmapFont"
#define MwNsevenSegment "IsevenSegment"
#define MwNtitle "Stitle"
#define MwNtext "Stext"

View File

@@ -20,6 +20,9 @@ typedef struct _MwViewport* MwViewport;
typedef struct _MwListBox* MwListBox;
typedef struct _MwComboBox* MwComboBox;
typedef struct _MwTreeView* MwTreeView;
typedef struct _MwScrollBar* MwScrollBar;
typedef struct _MwLabel* MwLabel;
typedef struct _MwLabelSegment MwLabelSegment;
typedef struct _MwListBoxEntry MwListBoxEntry;
typedef struct _MwTreeViewEntry MwTreeViewEntry;
typedef struct _MwDirectoryEntry MwDirectoryEntry;
@@ -164,6 +167,21 @@ struct _MwTreeView {
MwPoint pressed;
};
struct _MwScrollBar {
MwPoint point;
int drag;
int pos;
};
struct _MwLabel {
MwLabelSegment* segment;
};
struct _MwLabelSegment {
int key;
unsigned char value;
};
struct _MwDirectoryEntry {
char* name;
int type;

View File

@@ -17,6 +17,17 @@ extern "C" {
*/
MWDECL MwClass MwLabelClass;
/*!
* @brief Sets the custom data for seven segment
* @param handle Widget
* @param index Index
* @param data Data, `GFEDCBA` as 7-bit value
* @note See https://en.wikipedia.org/wiki/File:7_Segment_Display_with_Labeled_Segments.svg for what alphabets mean here
* */
MwInline void MwLabelSetSevenSegment(MwWidget handle, int index, int data) {
MwVaWidgetExecute(handle, "mwLabelSetSevenSegment", NULL, index, data);
}
#ifdef __cplusplus
}
#endif