salobj.cxx (bde8a4bd) | salobj.cxx (01367266) |
---|---|
1/************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance --- 33 unchanged lines hidden (view full) --- 42 mnX( 0 ), 43 mnY( 0 ), 44 mnWidth( 20 ), 45 mnHeight( 20 ) 46{ 47 maSysData.nSize = sizeof( maSysData ); 48 maSysData.mpNSView = NULL; 49 | 1/************************************************************** 2 * 3 * Licensed to the Apache Software Foundation (ASF) under one 4 * or more contributor license agreements. See the NOTICE file 5 * distributed with this work for additional information 6 * regarding copyright ownership. The ASF licenses this file 7 * to you under the Apache License, Version 2.0 (the 8 * "License"); you may not use this file except in compliance --- 33 unchanged lines hidden (view full) --- 42 mnX( 0 ), 43 mnY( 0 ), 44 mnWidth( 20 ), 45 mnHeight( 20 ) 46{ 47 maSysData.nSize = sizeof( maSysData ); 48 maSysData.mpNSView = NULL; 49 |
50 NSRect aInitFrame = { { 0, 0 }, { 20, 20 } }; | 50 NSRect aInitFrame = { NSZeroPoint, { 20, 20 } }; |
51 mpClipView = [[NSClipView alloc] initWithFrame: aInitFrame ]; 52 if( mpClipView ) 53 { 54 [mpFrame->getNSView() addSubview: mpClipView]; 55 [mpClipView setHidden: YES]; 56 } 57 maSysData.mpNSView = [[NSView alloc] initWithFrame: aInitFrame]; 58 if( maSysData.mpNSView ) --- 104 unchanged lines hidden (view full) --- 163 mnHeight = nHeight; 164 setClippedPosSize(); 165} 166 167// ----------------------------------------------------------------------- 168 169void AquaSalObject::setClippedPosSize() 170{ | 51 mpClipView = [[NSClipView alloc] initWithFrame: aInitFrame ]; 52 if( mpClipView ) 53 { 54 [mpFrame->getNSView() addSubview: mpClipView]; 55 [mpClipView setHidden: YES]; 56 } 57 maSysData.mpNSView = [[NSView alloc] initWithFrame: aInitFrame]; 58 if( maSysData.mpNSView ) --- 104 unchanged lines hidden (view full) --- 163 mnHeight = nHeight; 164 setClippedPosSize(); 165} 166 167// ----------------------------------------------------------------------- 168 169void AquaSalObject::setClippedPosSize() 170{ |
171 NSRect aViewRect = NSMakeRect( 0, 0, mnWidth, mnHeight); | 171 NSRect aViewRect = { NSZeroPoint, NSMakeSize( mnWidth, mnHeight) }; |
172 if( maSysData.mpNSView ) 173 { 174 NSView* pNSView = maSysData.mpNSView; 175 [pNSView setFrame: aViewRect]; 176 } 177 178 NSRect aClipViewRect = NSMakeRect( mnX, mnY, mnWidth, mnHeight); | 172 if( maSysData.mpNSView ) 173 { 174 NSView* pNSView = maSysData.mpNSView; 175 [pNSView setFrame: aViewRect]; 176 } 177 178 NSRect aClipViewRect = NSMakeRect( mnX, mnY, mnWidth, mnHeight); |
179 NSPoint aClipPt = NSMakePoint( 0, 0); | 179 NSPoint aClipPt = NSZeroPoint; |
180 if( mbClip ) 181 { 182 aClipViewRect.origin.x += mnClipX; 183 aClipViewRect.origin.y += mnClipY; 184 aClipViewRect.size.width = mnClipWidth; 185 aClipViewRect.size.height = mnClipHeight; 186 aClipPt.x = mnClipX; 187 if( mnClipY == 0 ) --- 54 unchanged lines hidden --- | 180 if( mbClip ) 181 { 182 aClipViewRect.origin.x += mnClipX; 183 aClipViewRect.origin.y += mnClipY; 184 aClipViewRect.size.width = mnClipWidth; 185 aClipViewRect.size.height = mnClipHeight; 186 aClipPt.x = mnClipX; 187 if( mnClipY == 0 ) --- 54 unchanged lines hidden --- |