FavoriteInfoWindowController.m
上传用户:center1979
上传日期:2022-07-26
资源大小:50633k
文件大小:1k
源码类别:

OpenGL

开发平台:

Visual C++

  1. #import "FavoriteInfoWindowController.h"
  2. @implementation FavoriteInfoWindowController
  3. -(void)updateFavorite:(CelestiaFavorite*)fav
  4. {
  5.     _fav = fav;
  6.     if (_fav == nil) {
  7.         [[self window] performClose:self];
  8.         return;
  9.     }
  10.     if ([fav isFolder]) {
  11.         [[self window] performClose:self];
  12.         _fav = nil;
  13.         return;
  14.     }
  15.     [nameField setStringValue:[fav name]];
  16.     [selectionField setStringValue:[fav selectionName]];
  17.     [jdField setStringValue:[[NSDate dateWithJulian:[fav jd]] description]];
  18.     [coordinateField setStringValue:[fav coordinateSystem]];
  19.     [orientationField setStringValue:[[fav orientation] description]];
  20. }
  21. - (IBAction)navigateTo:(id)sender
  22. {
  23.     [[self window] performClose:self];
  24.     if (_fav != nil)
  25.         [(FavoritesDrawerController*)favoritesDrawerController activateFavorite:_fav];
  26. }
  27. @end