private void createGovernmentMenu() { Log.Info("StateFunding: NewInstanceConfigView: creating government menu"); int buttonHeight = 30; // Includes space between buttons int top = Image.getHeight() + 10; int bottom = Window.getHeight() - 2 * buttonHeight; int bpos = 0; int badjust = 0; int left = 10; for (int i = 0; i < StateFundingGlobal.fetch.Governments.ToArray().Length; i++) { Government Gov = (Government)StateFundingGlobal.fetch.Governments.ToArray()[i]; ViewGovernmentButton GovBtn = new ViewGovernmentButton(Gov, SelectGovernment); GovBtn.setRelativeTo(Image); GovBtn.setWidth(100); GovBtn.setHeight(buttonHeight - 5); bpos = 30 * i - badjust; if (top + bpos > bottom) { badjust = 30 * i; bpos = 0; left += 110; } GovBtn.setTopAndLeft(top + bpos, left); //GovBtn.setTop(top + bpos); //GovBtn.setLeft(left); this.addComponent(GovBtn); } GvtMenuAdjust = left - 10; // SelectGovernment((Government)StateFundingGlobal.fetch.Governments.ToArray()[0]); }
private void createGovernmentMenu() { for (int i = 0; i < StateFundingGlobal.fetch.Governments.ToArray().Length; i++) { Government Gov = (Government)StateFundingGlobal.fetch.Governments.ToArray()[i]; ViewGovernmentButton GovBtn = new ViewGovernmentButton (Gov, SelectGovernment); GovBtn.setRelativeTo (Image); GovBtn.setWidth (100); GovBtn.setHeight (30); GovBtn.setTop (Image.getHeight() + 10+(35*i)); GovBtn.setLeft (10); this.addComponent (GovBtn); } SelectGovernment ((Government)StateFundingGlobal.fetch.Governments.ToArray () [0]); }
private void createGovernmentMenu() { for (int i = 0; i < StateFundingGlobal.fetch.Governments.ToArray().Length; i++) { Government Gov = (Government)StateFundingGlobal.fetch.Governments.ToArray()[i]; ViewGovernmentButton GovBtn = new ViewGovernmentButton(Gov, SelectGovernment); GovBtn.setRelativeTo(Image); GovBtn.setWidth(100); GovBtn.setHeight(30); GovBtn.setTop(Image.getHeight() + 10 + (35 * i)); GovBtn.setLeft(10); this.addComponent(GovBtn); } SelectGovernment((Government)StateFundingGlobal.fetch.Governments.ToArray() [0]); }