diff --git a/dvx/dvxWidget.h b/dvx/dvxWidget.h index d60519a..a61b954 100644 --- a/dvx/dvxWidget.h +++ b/dvx/dvxWidget.h @@ -59,17 +59,9 @@ struct WidgetClassT; #define WGT_SIZE_CHARS 0x40000000 #define WGT_SIZE_PERCENT 0x80000000 -static inline int32_t wgtPixels(int32_t v) { - return (int32_t)(WGT_SIZE_PIXELS | ((uint32_t)v & WGT_SIZE_VAL_MASK)); -} - -static inline int32_t wgtChars(int32_t v) { - return (int32_t)(WGT_SIZE_CHARS | ((uint32_t)v & WGT_SIZE_VAL_MASK)); -} - -static inline int32_t wgtPercent(int32_t v) { - return (int32_t)(WGT_SIZE_PERCENT | ((uint32_t)v & WGT_SIZE_VAL_MASK)); -} +#define wgtPixels(v) ((int32_t)(WGT_SIZE_PIXELS | ((uint32_t)(v) & WGT_SIZE_VAL_MASK))) +#define wgtChars(v) ((int32_t)(WGT_SIZE_CHARS | ((uint32_t)(v) & WGT_SIZE_VAL_MASK))) +#define wgtPercent(v) ((int32_t)(WGT_SIZE_PERCENT | ((uint32_t)(v) & WGT_SIZE_VAL_MASK))) // ============================================================ // Widget type enum @@ -935,7 +927,7 @@ void wgtListBoxSetReorderable(WidgetT *w, bool reorderable); // Set tooltip text for a widget (NULL to remove). // Caller owns the string — it must outlive the widget. -static inline void wgtSetTooltip(WidgetT *w, const char *text) { w->tooltip = text; } +void wgtSetTooltip(WidgetT *w, const char *text); // ============================================================ // Debug diff --git a/dvx/widgets/widgetOps.c b/dvx/widgets/widgetOps.c index 82f382c..15332b6 100644 --- a/dvx/widgets/widgetOps.c +++ b/dvx/widgets/widgetOps.c @@ -487,6 +487,17 @@ void wgtSetText(WidgetT *w, const char *text) { } +// ============================================================ +// wgtSetTooltip +// ============================================================ + +void wgtSetTooltip(WidgetT *w, const char *text) { + if (w) { + w->tooltip = text; + } +} + + // ============================================================ // wgtSetVisible // ============================================================ diff --git a/dvxshell/shellExport.c b/dvxshell/shellExport.c index 5ffc2b1..382075b 100644 --- a/dvxshell/shellExport.c +++ b/dvxshell/shellExport.c @@ -349,6 +349,7 @@ DXE_EXPORT_TABLE(shellExportTable) DXE_EXPORT(wgtInvalidatePaint) DXE_EXPORT(wgtSetDebugLayout) DXE_EXPORT(wgtSetText) + DXE_EXPORT(wgtSetTooltip) DXE_EXPORT(wgtGetText) DXE_EXPORT(wgtSetEnabled) DXE_EXPORT(wgtSetVisible)