mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-22 19:01:15 +00:00
Split scroll test in two, as only the visibleRect method wont work for
views without window. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@33614 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
c100baf6b4
commit
1043d6ecce
3 changed files with 40 additions and 0 deletions
|
@ -1,3 +1,8 @@
|
|||
2011-07-23 Fred Kiefer <FredKiefer@gmx.de>
|
||||
|
||||
* Tests/gui/NSView/NSView_visibleRect.m: New test.
|
||||
* Tests/gui/NSView/scrollRectToVisible.m: Use an NSWindow.
|
||||
|
||||
2011-07-23 Fred Kiefer <FredKiefer@gmx.de>
|
||||
|
||||
* Source/NSView.m (autoresize): Handle negative flexible space.
|
||||
|
|
26
Tests/gui/NSView/NSView_visibleRect.m
Normal file
26
Tests/gui/NSView/NSView_visibleRect.m
Normal file
|
@ -0,0 +1,26 @@
|
|||
/*
|
||||
copyright 2011 Fred Kiefer on 18.07.11.
|
||||
*/
|
||||
#include "Testing.h"
|
||||
|
||||
#include <Foundation/NSAutoreleasePool.h>
|
||||
#include <Foundation/NSGeometry.h>
|
||||
#include <AppKit/NSView.h>
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
CREATE_AUTORELEASE_POOL(arp);
|
||||
NSRect f = NSMakeRect(0,0,100,100);
|
||||
NSView *v = [[NSView alloc] initWithFrame: f];
|
||||
int passed = 1;
|
||||
|
||||
if (!NSEqualRects([v visibleRect], f))
|
||||
{
|
||||
passed = 0;
|
||||
}
|
||||
|
||||
pass(passed, "NSView -visibleRect works");
|
||||
|
||||
DESTROY(arp);
|
||||
return 0;
|
||||
}
|
|
@ -6,7 +6,9 @@ copyright 2004 Alexander Malmberg <alexander@malmberg.org>
|
|||
|
||||
#include <Foundation/NSAutoreleasePool.h>
|
||||
#include <Foundation/NSGeometry.h>
|
||||
#include <AppKit/NSApplication.h>
|
||||
#include <AppKit/NSClipView.h>
|
||||
#include <AppKit/NSWindow.h>
|
||||
|
||||
#define TEST(r,s) \
|
||||
if (!NSEqualRects([v visibleRect],r)) \
|
||||
|
@ -22,10 +24,17 @@ copyright 2004 Alexander Malmberg <alexander@malmberg.org>
|
|||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
NSWindow *window;
|
||||
CREATE_AUTORELEASE_POOL(arp);
|
||||
NSClipView *cv=[[NSClipView alloc] initWithFrame: NSMakeRect(0,0,10,10)];
|
||||
NSView *v=[[NSView alloc] initWithFrame: NSMakeRect(0,0,100,100)];
|
||||
[cv setDocumentView: v];
|
||||
[NSApplication sharedApplication];
|
||||
window = [[NSWindow alloc] initWithContentRect: NSMakeRect(100,100,200,200)
|
||||
styleMask: NSClosableWindowMask
|
||||
backing: NSBackingStoreRetained
|
||||
defer: YES];
|
||||
[[window contentView] addSubview: cv];
|
||||
|
||||
/* Initial position. */
|
||||
TEST(NSMakeRect(0,0,10,10),"1")
|
||||
|
|
Loading…
Reference in a new issue