bar chart
All checks were successful
pyrite-dev/milsko/pipeline/head This commit looks good

This commit is contained in:
Nishi 2026-09-14 01:09:57 +09:00
commit 120eb5baaf
14 changed files with 405 additions and 44 deletions

View file

@ -113,6 +113,10 @@ enum MwCLIPBOARD {
MwCLIPBOARD_PRIMARY,
};
enum MwCHART {
MwCHART_BAR = 0
};
enum MwMOUSE {
MwMOUSE_LEFT = 1,
MwMOUSE_MIDDLE,

View file

@ -60,6 +60,14 @@ MWDECL MwLLColor MWAPI MwLightenColor(MwWidget handle, MwLLColor color, int r, i
*/
MWDECL void MWAPI MwDrawRect(MwWidget handle, MwRect* rect, MwLLColor color);
/*!
* @brief Draws a rectangle
* @param handle Widget
* @param rect Rectangle area
* @param color Color
*/
MWDECL void MWAPI MwDrawRectLine(MwWidget handle, MwRect* rect, MwLLColor color);
/*!
* @brief Draws a filled rectangle that fades to a darker color
* @param handle Widget

View file

@ -57,6 +57,7 @@
#define MwNhour "Ihour"
#define MwNminute "Iminute"
#define MwNsecond "Isecond"
#define MwNtype "Itype"
#define MwNtitle "Stitle"
#define MwNtext "Stext"

View file

@ -30,6 +30,8 @@ typedef struct _MwBox* MwBox;
typedef struct _MwSubWindow* MwSubWindow;
typedef struct _MwTab* MwTab;
typedef struct _MwTable* MwTable;
typedef struct _MwChartEntry MwChartEntry;
typedef struct _MwChart* MwChart;
typedef struct _MwMouse MwMouse;
typedef struct _MwTTFInfo* MwTTFInfo;
#ifdef _MILSKO
@ -247,6 +249,16 @@ struct _MwTab {
char** names;
};
struct _MwChartEntry {
char* name;
char* color;
double value;
};
struct _MwChart {
MwChartEntry* entries;
};
struct _MwMouse {
MwPoint point;
int button;

View file

@ -17,6 +17,39 @@ extern "C" {
*/
MWDECL MwClass MwChartClass;
/*!
* @brief Adds the entry to the chart
* @param handle Widget
* @param index Index
* @param text Text
* @param value Value
* @return Index
*/
MwInline int MwChartAdd(MwWidget handle, int index, const char* text, double value, const char* color) {
int out;
MwVaWidgetExecute(handle, "mwChartAdd", (void*)&out, index, text, value, color);
return out;
}
/*!
* @brief Deletes item from the chart
* @param handle Widget
* @param index Index
*/
MwInline void MwChartDelete(MwWidget handle, int index) {
MwVaWidgetExecute(handle, "mwChartDelete", NULL, index);
}
/*!
* @brief Resets the chart
* @param handle Widget
*/
MwInline void MwChartReset(MwWidget handle) {
MwVaWidgetExecute(handle, "mwChartReset", NULL);
}
#ifdef __cplusplus
}
#endif

View file

@ -41,6 +41,23 @@ MwInline const char* MwComboBoxGet(MwWidget handle, int index) {
return text;
}
/*!
* @brief Deletes the entry from combobox
* @param handle Widget
* @param index Index
*/
MwInline void MwComboBoxDelete(MwWidget handle, int index) {
MwVaWidgetExecute(handle, "mwComboBoxDelete", NULL, index);
}
/*!
* @brief Resets the combobox
* @param handle Widget
*/
MwInline void MwComboBoxReset(MwWidget handle) {
MwVaWidgetExecute(handle, "mwComboBoxReset", NULL);
}
#ifdef __cplusplus
}
#endif