internal UIButton GetCalcButton(int buttonNum, Anaction d, Boolean enabled = true) { UIButton button; UIColor titleColor; var _x = 40 + (buttonNum % 3) * 85; var _y = 140 + (buttonNum / 3) * 60; if (buttonNum < 12) { button = new UIButton(new CGRect(_x, _y, 80, 55)); enabled = true; } else { button = new UIButton(new CGRect(210, _y, 80, 55)); enabled = false; } button.SetBackgroundImage(calcImage, UIControlState.Normal); button.BackgroundColor = UIColor.Blue; button.SetTitle(TranslateButtonIndexToString(buttonNum), UIControlState.Normal); button.Font = UIFont.SystemFontOfSize(24); titleColor = buttonNum == 12 ? UIColor.Red : UIColor.White; button.SetTitleColor(titleColor, UIControlState.Normal); button.SetTitleColor(UIColor.DarkGray, UIControlState.Highlighted); button.TouchUpInside += (o, e) => d(o, e); button.Enabled = enabled; button.Tag = buttonNum; return(button); }
internal UIButton GetTextureButton(string _title, nfloat _x, nfloat _y, Anaction d, bool iscork = false) { var button = new UIButton(new CGRect(_x, _y, ButtonWidth, ButtonWidth)); button.SetBackgroundImage(iscork?corkTexture:woodTexture, UIControlState.Normal); button.BackgroundColor = UIColor.Clear; button.SetTitle(_title, UIControlState.Normal); button.Font = UIFont.SystemFontOfSize(40); button.TouchUpInside += (o, e) => d(o, e); return(button); }