1 /****************************************************************************
4 Copyright (c) 2001 Jerome Jacovella-St-Louis
7 bet.ec - Poker Bet Window
8 ****************************************************************************/
13 background = activeBorder;
15 clientSize = Size { 140, 80 };
22 size = Size { 40, 20 },
23 anchor = Anchor { horz = -20 };
27 bool NotifyClicked(Button button, int x, int y, Modifiers mods)
29 int theBet = (int) strtod(edit.contents, null) * 2;
30 if(theBet > 0 && *thisBet + theBet >= currentBet)
41 text = currentBet ? "Fold" : "Pass",
42 size = Size { 40, 20 },
43 anchor = Anchor { horz = 20 },
44 hotKey = currentBet ? f : p;
46 bool NotifyClicked(Button button, int x, int y, Modifiers mods)
53 bool OnKeyHit(Key key, unichar ch)
55 if(key == escape) Destroy(0);
58 EditBox edit { this, anchor = Anchor { top = 10 }, size = Size { 80, 20 } };
60 property int * thisBet { set { this.thisBet = value; } };
62 void OnRedraw(Surface surface)
64 surface.SetForeground(red);
65 surface.WriteTextf(0, 65, "$%.2f to you.", (currentBet - *thisBet) / 2.0);