void CabbageTableManager::addTable (String name, String channel, int tableNumber, int tableSize, bool fixedEnv, bool drawHoriz, bool drawOrig, bool toggleMaxMin, bool drawFill, int resizeMode, Point<float> minMax, Colour colour, bool readonly, bool stackMode, int numberOfTables, ChangeListener* listener) { int i = tables.size(); tables.add (new Table(channel, tableNumber, tableSize, fixedEnv, drawHoriz, drawOrig, colour)); if(stackMode==true) tables[i]->setBounds (0, i*(getHeight()/(numberOfTables)), getWidth(), (getHeight()/(numberOfTables))); else tables[i]->setBounds (0, 0, getWidth(), getHeight()); tables[i]->addChangeListener(listener); tables[i]->setOriginalWidth (getWidth()); tables[i]->setViewWidth(getWidth()); tables[i]->toggleMaxMin = toggleMaxMin; toggleMode = toggleMaxMin; tables[i]->drawFill = drawFill; readOnly = readonly; addAndMakeVisible (tables[i]); tables[i]->addMouseListener(this, false); //"this" will now also get mouse events for tables[i] tableToTop(i); //setting this table to the top Logger::writeToLog("MinRange"+String(minMax.getX())); Logger::writeToLog("MaxRange"+String(minMax.getY())); if(resizeMode==1) tables[i]->isResizing = true; if(minMax.getX()!=minMax.getY()) tables[i]->useAmpRanges=true; tables[i]->minMaxAmps = minMax; //the max possible zoom is based on the table with the most indices. It will have a max zoom //of 50 pixels for every index. if ((tableSize*50) > maxNumPixelsPerIndex) { maxNumPixelsPerIndex = (tableSize*50); maxZoom = sqrt(maxNumPixelsPerIndex); } }
void CabbageTableManager::addTable (String name, int tableSize, Colour colour) { int i = tables.size(); tables.add (new Table(tableSize, colour)); tables[i]->setBounds (0, 0, getWidth(), getHeight()); tables[i]->setOriginalWidth (getWidth()); tables[i]->setViewWidth(viewport->getViewWidth()); addAndMakeVisible (tables[i]); tables[i]->addMouseListener(this, true); //"this" will now also get mouse events for tables[i] tableToTop(i); //setting this table to the top //the max possible zoom is based on the table with the most indices. It will have a max zoom //of 50 pixels for every index. if ((tableSize*50) > maxNumPixelsPerIndex) { maxNumPixelsPerIndex = (tableSize*50); maxZoom = sqrt(maxNumPixelsPerIndex); } }