summaryrefslogtreecommitdiff
path: root/src/gui/textbox.cpp
diff options
context:
space:
mode:
authoraura <nw@moneybot.cc>2026-07-28 19:11:34 +0200
committeraura <nw@moneybot.cc>2026-07-28 19:11:34 +0200
commit86d248ed2b033fe36ce53b0387b2cbdcb69c0b72 (patch)
treea70f32a0f44b927a6d137998efa405e330689c0f /src/gui/textbox.cpp
parent468813b133a6a3ff0b85d3b34f1009cfeae815e4 (diff)
finish undo/redo
Diffstat (limited to 'src/gui/textbox.cpp')
-rw-r--r--src/gui/textbox.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/gui/textbox.cpp b/src/gui/textbox.cpp
index 688450b..c367193 100644
--- a/src/gui/textbox.cpp
+++ b/src/gui/textbox.cpp
@@ -178,18 +178,20 @@ void gui_textbox_handle_repeat( GUI_TEXTBOX* tb ) {
if( gui_time() - tb->repeattime > 0.05f ) {
U32 len = strlen( tb->value );
if( is_printable_char( tb->heldkey ) && len < (tb->maxlen - 1) ) {
+ if( tb->pre_cb ) tb->pre_cb( tb );
+
if( tb->keys[SDLK_LSHIFT & 0xff] || tb->keys[SDLK_RSHIFT & 0xff] )
tb->value[len] = tb->heldkey + ('a' - 'A');
else
tb->value[len] = tb->heldkey;
tb->value[++len] = 0;
- if( tb->cb )
- tb->cb( tb );
+
+ if( tb->cb ) tb->cb( tb );
}
else if( tb->heldkey == '\b' && len > 0 ) {
+ if( tb->pre_cb ) tb->pre_cb( tb );
tb->value[--len] = 0;
- if( tb->cb )
- tb->cb( tb );
+ if( tb->cb ) tb->cb( tb );
}
tb->repeattime = gui_time();