-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathInputDlg.cs
More file actions
63 lines (54 loc) · 1.24 KB
/
InputDlg.cs
File metadata and controls
63 lines (54 loc) · 1.24 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
public class InputDlg : Dialog
{
protected string[] info;
public TField tfInput;
private int padLeft;
public InputDlg()
{
padLeft = 40;
if (GameCanvas.w <= 176)
{
padLeft = 10;
}
tfInput = new TField();
tfInput.x = padLeft + 10;
tfInput.y = GameCanvas.h - mScreen.ITEM_HEIGHT - 43;
tfInput.width = GameCanvas.w - 2 * (padLeft + 10);
tfInput.height = mScreen.ITEM_HEIGHT + 2;
tfInput.isFocus = true;
right = tfInput.cmdClear;
}
public void show(string info, Command ok, int type)
{
tfInput.setText(string.Empty);
tfInput.setIputType(type);
this.info = mFont.tahoma_8b.splitFontArray(info, GameCanvas.w - padLeft * 2);
left = new Command(mResources.CLOSE, GameCanvas.gI(), 8882, null);
center = ok;
show();
}
public override void paint(mGraphics g)
{
GameCanvas.paintz.paintInputDlg(g, padLeft, GameCanvas.h - 77 - mScreen.cmdH, GameCanvas.w - padLeft * 2, 69, info);
tfInput.paint(g);
base.paint(g);
}
public override void keyPress(int keyCode)
{
tfInput.keyPressed(keyCode);
base.keyPress(keyCode);
}
public override void update()
{
tfInput.update();
base.update();
}
public override void show()
{
GameCanvas.currentDialog = this;
}
public void hide()
{
GameCanvas.endDlg();
}
}