protected virtual void InitButtons() { Array values = Enum.GetValues(typeof(AlphabetChars)); int x_step = (int)((Width * 0.950) / values.Length); uint b_width = (uint)x_step; uint b_height = (uint)(Height - 2); int x = (int)(Margin * 0.5f + x_step); int y = (int)(Height * 0.5) + 2; foreach (AlphabetChars key in values) { buttons[key] = new AlphabetButton(b_width, b_height, key); buttons[key].ButtonReleaseEvent += HandleButtonReleaseEvent; Add(buttons[key]); buttons[key].SetAnchorPoint((float)buttons[key].Width * 0.5f, (float)buttons[key].Height * 0.5f); buttons[key].SetPosition(x, y); x += x_step; } }
protected virtual void InitButtons() { Array values = Enum.GetValues(typeof(AlphabetChars)); int x_step = (int) ((Width * 0.950) / values.Length); uint b_width = (uint) x_step; uint b_height = (uint) (Height - 2); int x = (int) (Margin*0.5f + x_step); int y = (int) (Height * 0.5)+2; foreach (AlphabetChars key in values) { buttons[key] = new AlphabetButton (b_width, b_height, key); buttons[key].ButtonReleaseEvent += HandleButtonReleaseEvent; Add (buttons[key]); buttons[key].SetAnchorPoint ((float) buttons[key].Width*0.5f, (float) buttons[key].Height*0.5f); buttons[key].SetPosition (x, y); x += x_step; } }