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
|
|
|
/*!
|
2025-10-22 17:30:57 +00:00
|
|
|
* %brief Creates a listbox packet
|
|
|
|
|
* %return Packet
|
|
|
|
|
*/
|
|
|
|
|
MWDECL MwListBoxPacket* MwListBoxCreatePacket(void);
|
|
|
|
|
|
|
|
|
|
/*!
|
|
|
|
|
* %brief Destroys a listbox packet
|
|
|
|
|
* %param packet Packet
|
|
|
|
|
*/
|
|
|
|
|
MWDECL void MwListBoxDestroyPacket(MwListBoxPacket* packet);
|
|
|
|
|
|
|
|
|
|
/*!
|
|
|
|
|
* %brief Inserts a new item to a packet
|
|
|
|
|
* %param packet Packet
|
2025-10-14 16:41:38 +00:00
|
|
|
* %param index Index
|
2025-10-22 17:30:57 +00:00
|
|
|
* %return Index
|
2025-10-14 16:41:38 +00:00
|
|
|
*/
|
2025-10-22 17:30:57 +00:00
|
|
|
MWDECL int MwListBoxPacketInsert(MwListBoxPacket* packet, int index);
|
2025-10-14 16:41:38 +00:00
|
|
|
|
2025-10-14 18:48:06 +00:00
|
|
|
/*!
|
2025-10-22 17:30:57 +00:00
|
|
|
* %brief Sets a column of item in a packet
|
|
|
|
|
* %param packet Packet
|
|
|
|
|
* %param index Index
|
|
|
|
|
* %param col Column
|
|
|
|
|
* %param text Text
|
|
|
|
|
*/
|
|
|
|
|
MWDECL void MwListBoxPacketSet(MwListBoxPacket* packet, int index, int col, const char* text);
|
|
|
|
|
|
|
|
|
|
/*!
|
|
|
|
|
* %brief Sets an icon of item in a packet
|
|
|
|
|
* %param packet Packet
|
|
|
|
|
* %param index Index
|
|
|
|
|
* %param icon Icon
|
|
|
|
|
*/
|
|
|
|
|
MWDECL void MwListBoxPacketSetIcon(MwListBoxPacket* packet, int index, MwLLPixmap icon);
|
|
|
|
|
|
|
|
|
|
/*!
|
|
|
|
|
* %brief Inserts item on the listbox
|
2025-10-14 18:48:06 +00:00
|
|
|
* %param handle Widget
|
|
|
|
|
* %param index Index
|
2025-10-22 17:30:57 +00:00
|
|
|
* %param packet Packet
|
2025-10-16 16:47:41 +00:00
|
|
|
*/
|
2025-10-22 17:30:57 +00:00
|
|
|
MwInline void MwListBoxInsert(MwWidget handle, int index, void* packet) {
|
|
|
|
|
MwVaWidgetExecute(handle, "mwListBoxInsert", NULL, index, packet);
|
2025-10-21 17:30:41 +00:00
|
|
|
}
|
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 17:59:04 +00:00
|
|
|
MwVaWidgetExecute(handle, "mwListBoxReset", NULL);
|
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
|