MCPcopy Create free account
hub / github.com/Tablecruncher/tablecruncher / createNewWindow

Method createNewWindow

src/csvapplication.cpp:343–368  ·  view source on GitHub ↗

* Creates a new window * https://stackoverflow.com/questions/5887615/creating-an-array-of-object-pointers-c */

Source from the content-addressed store, hash-verified

341 * https://stackoverflow.com/questions/5887615/creating-an-array-of-object-pointers-c
342 */
343int CsvApplication::createNewWindow() {
344 int newWindowIndex = -1;
345
346 // Look for an unused window slot
347 for(int slot = 0; slot < TCRUNCHER_MAX_WINDOWS; ++slot) {
348 if( !windows[slot].getWindowSlotUsed() ) {
349 newWindowIndex = slot;
350 break;
351 }
352 }
353 if( newWindowIndex == -1 ) {
354#ifdef DEBUG
355 dumpWindows();
356#endif
357 CsvApplication::myFlChoice("", "Maximum number of windows already open.", {"Okay"});
358 return -1;
359 }
360 windows[newWindowIndex].create(createdWindowCount++);
361 updateMenu(newWindowIndex);
362 #ifdef __APPLE__
363 remainOpenWin->hide();
364 #endif
365 // setMenuBar(windows[newWindowIndex].win);
366 windows[newWindowIndex].win->show();
367 return newWindowIndex;
368}
369
370
371size_t CsvApplication::getCreatedWindowCount() {

Callers 3

MyMenuCallbackMethod · 0.80
mainFunction · 0.80
openFileMethod · 0.80

Calls 2

getWindowSlotUsedMethod · 0.80
createMethod · 0.45

Tested by

no test coverage detected