Ejemplo n.º 1
0
bool wxBlockDoubleSelection::DoMinimize(wxArrayBlockDouble &blocks)
{
    int n;
    for (n=0; n<1000; n++) // should probably just take < 10 at most
    {
        if (!DoDoMinimize(blocks)) break;
    }

#ifdef CHECK_BLOCK_OVERLAP
    for (size_t a=0; a<blocks.GetCount(); a++)
    {
        printf("Checking wxBlockDoubleSelection::DoMinimize %d =", a); PRINT_BLOCK("", blocks[a])
        for (size_t b=a+1; b<blocks.GetCount(); b++)
        {
            if (blocks[a].Intersects(blocks[b]))
            {
                printf("Intersecting blocks in wxBlockDoubleSelection::DoMinimize\n"); fflush(stdout);
                PRINT_BLOCK("",blocks[a])
                PRINT_BLOCK("",blocks[b])
                wxBell();
            }
        }
    }
#endif

    return n != 0;
}
Ejemplo n.º 2
0
bool wxSheetSelection::DoMinimize(wxArraySheetBlock &blocks) const
{
    int n, count = GetCount() > 0 ? 1000 : 0;
    for (n=0; n<count; n++) // usually just takes a few
    {
        if (!DoDoMinimize(blocks)) break;
    }

    // sanity check - this shouldn't and hasn't happened
    wxCHECK_MSG(!count || (n <= count), true, wxT("Unable to minimize wxSheetSelection"));
    
#ifdef CHECK_BLOCK_OVERLAP
    for (size_t a=0; a<blocks.GetCount(); a++)
    {
        for (size_t b=a+1; b<blocks.GetCount(); b++)
        {
            if (blocks[a].Intersects(blocks[b]))
            {
                wxPrintf(wxT("Intersecting blocks in wxBlockIntSelection::DoMinimize\n")); fflush(stdout);
                PRINT_BLOCK(wxT("First  block "), blocks[a]);
                PRINT_BLOCK(wxT("Second block "), blocks[b]);
                wxBell();
            }
        }
    }
#endif    
    
    return n != 0;    
}
Ejemplo n.º 3
0
bool wxBlockIntSelection::DoMinimize(wxArrayBlockInt &blocks)
{
    int n;
    for (n=0; n<1000; n++) // should probably just take a few
    {
        if (!DoDoMinimize(blocks)) break;
    }

#ifdef CHECK_BLOCK_OVERLAP
    for (size_t a=0; a<blocks.GetCount(); a++)
    {
        for (size_t b=a+1; b<blocks.GetCount(); b++)
        {
            if (blocks[a].Intersects(blocks[b]))
            {
                printf("Intersecting blocks in wxBlockIntSelection::DoMinimize"); fflush(stdout);
                wxBell();
            }
        }
    }
#endif

    return n != 0;
}