2025-10-14 14:39:40 +00:00
|
|
|
/* $Id$ */
|
|
|
|
|
/*!
|
|
|
|
|
* %file Mw/Widget/ListBox.h
|
|
|
|
|
* %brief ListBox widget
|
|
|
|
|
*/
|
|
|
|
|
#ifndef __MW_WIDGET_LISTBOX_H__
|
|
|
|
|
#define __MW_WIDGET_LISTBOX_H__
|
|
|
|
|
|
|
|
|
|
#include <Mw/MachDep.h>
|
|
|
|
|
#include <Mw/TypeDefs.h>
|
2025-10-20 21:55:30 +00:00
|
|
|
#include <Mw/Core.h>
|
2025-10-14 14:39:40 +00:00
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
|
extern "C" {
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
/*!
|
|
|
|
|
* %brief ListBox widget class
|
|
|
|
|
*/
|
|
|
|
|
MWDECL MwClass MwListBoxClass;
|
|
|
|
|
|
2025-10-14 16:41:38 +00:00
|
|
|
/*!
|
|
|
|
|
* %brief Inserts item on the listbox
|
|
|
|
|
* %param handle Widget
|
|
|
|
|
* %param index Index
|
2025-10-16 10:38:37 +00:00
|
|
|
* %param pixmap Pixmap
|
2025-10-16 16:47:41 +00:00
|
|
|
* %param ... Text
|
2025-10-14 16:41:38 +00:00
|
|
|
*/
|
2025-10-21 17:30:41 +00:00
|
|
|
MwInline void MwListBoxInsert(MwWidget handle, int index, MwLLPixmap pixmap, ...) {
|
|
|
|
|
va_list va;
|
|
|
|
|
va_start(va, pixmap);
|
|
|
|
|
MwVaWidgetExecute(handle, "mwListBoxInsert", NULL, index, pixmap, &va);
|
|
|
|
|
va_end(va);
|
|
|
|
|
}
|
2025-10-14 16:41:38 +00:00
|
|
|
|
2025-10-14 18:48:06 +00:00
|
|
|
/*!
|
|
|
|
|
* %brief Inserts multiple items on the listbox
|
|
|
|
|
* %param handle Widget
|
|
|
|
|
* %param index Index
|
2025-10-16 16:47:41 +00:00
|
|
|
* %param count Count
|
|
|
|
|
* %param pixmap Pixmap
|
|
|
|
|
* %param ... Text
|
|
|
|
|
*/
|
2025-10-21 17:30:41 +00:00
|
|
|
MwInline void MwListBoxInsertMultiple(MwWidget handle, int index, int count, MwLLPixmap* pixmap, ...) {
|
|
|
|
|
va_list va;
|
|
|
|
|
va_start(va, pixmap);
|
|
|
|
|
MwVaWidgetExecute(handle, "mwListBoxInsertMultiple", NULL, index, count, pixmap, &va);
|
|
|
|
|
va_end(va);
|
|
|
|
|
}
|
2025-10-14 18:48:06 +00:00
|
|
|
|
2025-10-14 17:09:48 +00:00
|
|
|
/*!
|
|
|
|
|
* %brief Deletes item from the listbox
|
|
|
|
|
* %param handle Widget
|
|
|
|
|
* %param index Index
|
|
|
|
|
*/
|
2025-10-20 21:55:30 +00:00
|
|
|
MwInline void MwListBoxDelete(MwWidget handle, int index) {
|
2025-10-21 16:14:09 +00:00
|
|
|
MwVaWidgetExecute(handle, "mwListboxDelete", NULL, index);
|
2025-10-20 21:55:30 +00:00
|
|
|
};
|
2025-10-14 17:09:48 +00:00
|
|
|
|
2025-10-14 18:36:31 +00:00
|
|
|
/*!
|
|
|
|
|
* %brief Gets item from the listbox
|
|
|
|
|
* %param handle Widget
|
|
|
|
|
* %param index Index
|
|
|
|
|
* %return Item
|
|
|
|
|
*/
|
2025-10-20 21:55:30 +00:00
|
|
|
MwInline const char* MwListBoxGet(MwWidget handle, int index) {
|
|
|
|
|
const char* out;
|
2025-10-21 16:14:09 +00:00
|
|
|
MwVaWidgetExecute(handle, "mwListBoxGet", (void*)&out, index);
|
2025-10-20 21:55:30 +00:00
|
|
|
return out;
|
|
|
|
|
};
|
2025-10-14 18:36:31 +00:00
|
|
|
|
2025-10-16 16:47:41 +00:00
|
|
|
/*!
|
|
|
|
|
* %brief Sets an item width of the listbox
|
|
|
|
|
* %param handle Widget
|
|
|
|
|
* %param index Column index
|
|
|
|
|
* %param width Width
|
|
|
|
|
*/
|
2025-10-20 21:55:30 +00:00
|
|
|
MwInline void MwListBoxSetWidth(MwWidget handle, int index, int width) {
|
2025-10-21 16:14:09 +00:00
|
|
|
MwVaWidgetExecute(handle, "mwListBoxSetWidth", NULL, index, width);
|
2025-10-20 21:55:30 +00:00
|
|
|
};
|
2025-10-16 16:47:41 +00:00
|
|
|
|
2025-10-16 18:45:45 +00:00
|
|
|
/*!
|
|
|
|
|
* %brief Resets the listbox
|
|
|
|
|
* %param handle Widget
|
|
|
|
|
*/
|
2025-10-20 21:55:30 +00:00
|
|
|
MwInline void MwListBoxReset(MwWidget handle) {
|
2025-10-21 16:14:09 +00:00
|
|
|
MwVaWidgetExecute(handle, "mwListBoxReset", NULL, handle);
|
2025-10-20 21:55:30 +00:00
|
|
|
};
|
2025-10-16 18:45:45 +00:00
|
|
|
|
2025-10-14 14:39:40 +00:00
|
|
|
#ifdef __cplusplus
|
|
|
|
|
}
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#endif
|