|
@@ -912,19 +912,20 @@ int HandleEditBoxKey(Window *w, querystr
|
|
|
if (DeleteTextBufferChar(&string->text, we->keypress.keycode))
|
|
|
InvalidateWidget(w, wid);
|
|
|
break;
|
|
|
case WKC_LEFT: case WKC_RIGHT: case WKC_END: case WKC_HOME:
|
|
|
if (MoveTextBufferPos(&string->text, we->keypress.keycode))
|
|
|
InvalidateWidget(w, wid);
|
|
|
break;
|
|
|
break;
|
|
|
default:
|
|
|
if (IsValidAsciiChar(we->keypress.ascii)) {
|
|
|
if (InsertTextBufferChar(&string->text, we->keypress.ascii))
|
|
|
InvalidateWidget(w, wid);
|
|
|
} else // key wasn't caught
|
|
|
} else { // key wasn't caught
|
|
|
we->keypress.cont = true;
|
|
|
}
|
|
|
}
|
|
|
|
|
|
return 0;
|
|
|
}
|
|
|
|
|
|
bool HandleCaret(Textbuf *tb)
|
|
@@ -1504,14 +1505,13 @@ static const Widget _select_scenario_wid
|
|
|
|
|
|
static void SelectScenarioWndProc(Window* w, WindowEvent* e)
|
|
|
{
|
|
|
const int list_start = 45;
|
|
|
|
|
|
switch (e->event) {
|
|
|
case WE_PAINT:
|
|
|
{
|
|
|
case WE_PAINT: {
|
|
|
int y,pos;
|
|
|
const FiosItem *item;
|
|
|
|
|
|
if (_savegame_sort_dirty) {
|
|
|
_savegame_sort_dirty = false;
|
|
|
MakeSortedSaveGameList();
|
|
@@ -1553,21 +1553,20 @@ static void SelectScenarioWndProc(Window
|
|
|
SORT_BY_DATE | SORT_DESCENDING : SORT_BY_DATE;
|
|
|
_savegame_sort_dirty = true;
|
|
|
SetWindowDirty(w);
|
|
|
break;
|
|
|
|
|
|
case 6: /* Click the listbox */
|
|
|
if (e->click.pt.y < list_start)
|
|
|
if (e->click.pt.y < list_start) {
|
|
|
GenRandomNewGame(Random(), InteractiveRandom());
|
|
|
else {
|
|
|
char *name;
|
|
|
} else {
|
|
|
int y = (e->click.pt.y - list_start) / 10;
|
|
|
const char* name;
|
|
|
const FiosItem *file;
|
|
|
|
|
|
if (y < 0 || (y += w->vscroll.pos) >= w->vscroll.count)
|
|
|
return;
|
|
|
if (y < 0 || (y += w->vscroll.pos) >= w->vscroll.count) return;
|
|
|
|
|
|
file = _fios_list + y;
|
|
|
|
|
|
name = FiosBrowseTo(file);
|
|
|
if (name != NULL) {
|
|
|
SetFiosType(file->type);
|
|
@@ -1575,14 +1574,12 @@ static void SelectScenarioWndProc(Window
|
|
|
DeleteWindow(w);
|
|
|
StartScenarioEditor(Random(), InteractiveRandom());
|
|
|
}
|
|
|
}
|
|
|
break;
|
|
|
}
|
|
|
case WE_DESTROY:
|
|
|
break;
|
|
|
|
|
|
case WE_RESIZE: {
|
|
|
/* Widget 3 and 4 have to go with halve speed, make it so obiwan */
|
|
|
uint diff = e->sizing.diff.x / 2;
|
|
|
w->widget[3].right += diff;
|
|
|
w->widget[4].left += diff;
|