Mercurial > hg > tweakathon2ios
view UI code/UIGrid.mm @ 52:89944ab3e129 tip
fix oF linker errors ios8
author | Robert Tubb <rt300@eecs.qmul.ac.uk> |
---|---|
date | Tue, 03 Feb 2015 13:18:23 +0000 |
parents | a223551fdc1f |
children |
line wrap: on
line source
// // UIGrid.cpp // emptyExample // // Created by Robert Tubb on 22/05/2013. // // #include "UIGrid.h" template<class T> void UIGrid<T>::print(){ cout << "uh \n"; } template<class T> UIGrid<T>::UIGrid(int ax,int ay, int awidth, int aheight, int numColumns,int numRows, int spacing,ofColor hi, ofColor lo, ofColor bg) { // grid of what ? double cw = width/(double)numColumns; double ch = height/(double)numRows; double eWidth = cw - spacing; double eHeight = ch - spacing; double ex,ey; double radius = (eWidth < eHeight ? eWidth : eHeight)/6.0; double thickness = radius; for(int i=0; i< numColumns; i++){ ex = x + i*cw + spacing/2.0; for(int j=0; j<numRows; j++){ // make buttons ey = y + j*ch + spacing/2.0; T *butt = new T(ex,ey,eWidth,eHeight,thickness,radius,hi,bg,lo,bg); subElements.push_back(butt); } } }