--------------------------------------------------------------------------- define AllowFormVisibleInPixel 100
| 593 | //--------------------------------------------------------------------------- |
| 594 | //#define AllowFormVisibleInPixel 100 |
| 595 | bool CorrectFormRect(int & l, int & t, int & w, int & h) |
| 596 | { |
| 597 | if( l<=-10000 || t<=-10000 || w<=-10000 || h<=-10000 ) |
| 598 | { |
| 599 | l = 50; |
| 600 | t = 50; |
| 601 | w = 300; |
| 602 | h = 300; |
| 603 | return false; |
| 604 | } |
| 605 | |
| 606 | // ��������� ������� ������������ �������� ����� dw, dh |
| 607 | #if __BORLANDC__ >= 0x0560 |
| 608 | // 0x0550 - C++Builder 5.0 Enterprise |
| 609 | // 0x0560 - C++Builder 6.0 Enterprise |
| 610 | int dw = Screen->DesktopWidth; |
| 611 | int dh = Screen->DesktopHeight; |
| 612 | int dl = Screen->DesktopLeft; |
| 613 | int dt = Screen->DesktopTop; |
| 614 | #else |
| 615 | int dw = Screen->Width; |
| 616 | int dh = Screen->Height; |
| 617 | int dl = 0; |
| 618 | int dt = 0; |
| 619 | #endif |
| 620 | /* |
| 621 | dl = -1200 |
| 622 | dt = 0 |
| 623 | dw = 2280 |
| 624 | dh = 1200 |
| 625 | */ |
| 626 | // ������ ���� �� ����� ���� ������ �������� ����� |
| 627 | if( w > dw ) |
| 628 | w = dw; |
| 629 | |
| 630 | // ������ ���� �� ����� ���� ������ �������� ����� |
| 631 | if( h > dh ) |
| 632 | h = dh; |
| 633 | |
| 634 | // ���� ������� �� ����� ������� ? |
| 635 | if( l < dl ) |
| 636 | { |
| 637 | // ���� ����� ����� AllowFormVisibleInPixel �������� - ���������� ��� |
| 638 | //if( l+w < AllowFormVisibleInPixel ) l = 0; |
| 639 | l = dl; |
| 640 | } |
| 641 | |
| 642 | // ���� ������ �� ������ ������� ? |
| 643 | if( ABS(dl)+l+w > dw ) |
| 644 | { |
| 645 | // ���� ����� ����� AllowFormVisibleInPixel �������� �� ���� - ���������� ��� |
| 646 | //if( dw-l < AllowFormVisibleInPixel ) l = 0; |
| 647 | l -= MIN(ABS(dl)+l, ABS(dl)+l+w-dw); |
| 648 | } |
| 649 | |
| 650 | // ���� ������ ����� ? |
| 651 | if( t < dt ) |
| 652 | { |
no outgoing calls
no test coverage detected