TimKey return type
This commit is contained in:
@@ -245,7 +245,7 @@ bool tim_radiobutton(cstr txt, i32* state, i32 v, i32 x, i32 y, i32 w, u64 color
|
|||||||
/// @param e persistent edit state, use TimEditState_init() to create new state
|
/// @param e persistent edit state, use TimEditState_init() to create new state
|
||||||
/// @param color frame, background, text
|
/// @param color frame, background, text
|
||||||
/// @return key id or 0
|
/// @return key id or 0
|
||||||
i32 tim_edit(TimEditState* e, i32 x, i32 y, i32 w, u64 color);
|
TimKey tim_edit(TimEditState* e, i32 x, i32 y, i32 w, u64 color);
|
||||||
|
|
||||||
void TimEditState_init(TimEditState* e, i32 capacity, cstr initial_content);
|
void TimEditState_init(TimEditState* e, i32 capacity, cstr initial_content);
|
||||||
|
|
||||||
|
|||||||
@@ -36,7 +36,7 @@ void TimEditState_delete(TimEditState* e) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// @return key id or 0
|
/// @return key id or 0
|
||||||
static i32 edit_event(TimEditState* e, TimRect r) {
|
static TimKey edit_event(TimEditState* e, TimRect r) {
|
||||||
if (tim_is_mouse_click_over(r)) {
|
if (tim_is_mouse_click_over(r)) {
|
||||||
// take focus
|
// take focus
|
||||||
tim->focus = e;
|
tim->focus = e;
|
||||||
@@ -85,7 +85,7 @@ static i32 edit_event(TimEditState* e, TimRect r) {
|
|||||||
return tim->event.key;
|
return tim->event.key;
|
||||||
}
|
}
|
||||||
|
|
||||||
i32 tim_edit(TimEditState* e, i32 x, i32 y, i32 w, u64 color) {
|
TimKey tim_edit(TimEditState* e, i32 x, i32 y, i32 w, u64 color) {
|
||||||
TimRect r = tim_scope_rect_to_absolute(x, y, w, 3);
|
TimRect r = tim_scope_rect_to_absolute(x, y, w, 3);
|
||||||
|
|
||||||
if (tim->event.type == TimEvent_Draw) {
|
if (tim->event.type == TimEvent_Draw) {
|
||||||
|
|||||||
Reference in New Issue
Block a user