mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-06-02 11:31:00 +00:00
Added method [mouseDown:]. Added safety check for unchanged client
view in [setClientView:]. In [drawHashMarksAndLabelsInRect:] use [NSFont smallSystemFontSize] instead of hard coded size. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@13379 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
4e9aa47c4c
commit
e1c4308849
1 changed files with 16 additions and 4 deletions
|
@ -244,7 +244,7 @@ static NSMutableDictionary *units = nil;
|
||||||
unitToPointsConversionFactor: conversionFactor
|
unitToPointsConversionFactor: conversionFactor
|
||||||
stepUpCycle: stepUpCycle
|
stepUpCycle: stepUpCycle
|
||||||
stepDownCycle: stepDownCycle];
|
stepDownCycle: stepDownCycle];
|
||||||
[units setObject: u forKey: uName];
|
[units setObject: u forKey: uName];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void) setMeasurementUnits: (NSString *)uName
|
- (void) setMeasurementUnits: (NSString *)uName
|
||||||
|
@ -268,11 +268,14 @@ static NSMutableDictionary *units = nil;
|
||||||
|
|
||||||
- (void) setClientView: (NSView *)aView
|
- (void) setClientView: (NSView *)aView
|
||||||
{
|
{
|
||||||
|
if (_clientView == aView)
|
||||||
|
return;
|
||||||
|
|
||||||
if (_clientView != nil
|
if (_clientView != nil
|
||||||
&& [_clientView respondsToSelector:
|
&& [_clientView respondsToSelector:
|
||||||
@selector(rulerView:willSetClientView:)])
|
@selector(rulerView:willSetClientView:)])
|
||||||
{
|
{
|
||||||
[_clientView rulerView: self willSetClientView: aView];
|
[_clientView rulerView: self willSetClientView: aView];
|
||||||
}
|
}
|
||||||
/* NB: We should not RETAIN the clientView. */
|
/* NB: We should not RETAIN the clientView. */
|
||||||
_clientView = aView;
|
_clientView = aView;
|
||||||
|
@ -375,6 +378,16 @@ static NSMutableDictionary *units = nil;
|
||||||
return NO;
|
return NO;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
- (void) mouseDown: (NSEvent*)theEvent
|
||||||
|
{
|
||||||
|
if (_clientView != nil
|
||||||
|
&& [_clientView respondsToSelector:
|
||||||
|
@selector(rulerView:handleMouseDown:)])
|
||||||
|
{
|
||||||
|
[_clientView rulerView: self handleMouseDown: theEvent];
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
- (void) moveRulerlineFromLocation: (float)oldLoc
|
- (void) moveRulerlineFromLocation: (float)oldLoc
|
||||||
toLocation: (float)newLoc
|
toLocation: (float)newLoc
|
||||||
{
|
{
|
||||||
|
@ -515,8 +528,7 @@ static NSMutableDictionary *units = nil;
|
||||||
|
|
||||||
[self _verifyCachedValues];
|
[self _verifyCachedValues];
|
||||||
|
|
||||||
/* TODO: should be a user default */
|
font = [NSFont systemFontOfSize: [NSFont smallSystemFontSize]];
|
||||||
font = [NSFont systemFontOfSize: 8];
|
|
||||||
[font set];
|
[font set];
|
||||||
[[NSColor blackColor] set];
|
[[NSColor blackColor] set];
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue