Skip to content

Commit c621bfa

Browse files
committed
backBtn and deleteFn take (str?: string) again now
1 parent 4278d4c commit c621bfa

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

inputMethods.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -358,9 +358,9 @@ namespace microgui {
358358
private readonly MAX_TEXT_LENGTH = 22;
359359

360360
private foregroundColor: number;
361-
private passedDeleteFn: () => void;
361+
private passedDeleteFn: (str?: string) => void;
362362
/** The passed Back Btn function is needed since its given to the constructor, but used by startup() */
363-
private passedBackBtn: () => void;
363+
private passedBackBtn: (str?: string) => void;
364364

365365
constructor(opts: {
366366
app: AppInterface,
@@ -371,8 +371,8 @@ namespace microgui {
371371
defaultTxt?: string,
372372
maxTxtLength?: number,
373373
txtColor?: number,
374-
deleteFn?: () => void,
375-
backBtn?: () => void
374+
deleteFn?: (str?: string) => void,
375+
backBtn?: (str?: string) => void
376376
}) {
377377
super(opts.app, new GridNavigator([[]])) // GridNavigator setup in startup()
378378
this.text = (opts.defaultTxt) ? opts.defaultTxt : ""
@@ -453,7 +453,7 @@ namespace microgui {
453453
}
454454
)
455455

456-
context.onEvent(ControllerButtonEvent.Pressed, controller.B.id, () => this.passedBackBtn())
456+
context.onEvent(ControllerButtonEvent.Pressed, controller.B.id, () => this.passedBackBtn(this.text))
457457
this.navigator.setBtns(this.btns);
458458
}
459459

@@ -511,7 +511,7 @@ namespace microgui {
511511
}
512512

513513
public deleteFn(): void {
514-
this.passedDeleteFn();
514+
this.passedDeleteFn(this.text);
515515
}
516516

517517
public getText() {

0 commit comments

Comments
 (0)