void Document::CreateKeys() { IteratorPtr<Symbol<double>*> iter = _calculator->GetSymbols(); float min = MIN(_size.GetWidth(),_size.GetHeight()); float edgeLength = (int)((float)min/((float)COL)); float xStart = 0,yStart = 0; wxPoint pos(xStart,yStart); int colCount = 1; for(iter->First();!iter->IsDone();iter->Next()) { Key *key = new Key(pos,edgeLength,iter->Current()); _keys.push_back(key); if(colCount>=COL) { pos.x = xStart; pos.y += edgeLength; colCount = 1; } else { colCount++; pos.x += edgeLength; } } }