Browse Source

Added help dialog using old XIB format.

master
Claire 2 years ago
parent
commit
90d02ae07b
  1. 8
      LunaMac.xcodeproj/project.pbxproj
  2. 12
      LunaMac/AppDelegate.swift
  3. 11
      LunaMac/Base.lproj/Main.storyboard
  4. 44
      LunaMac/InfoBox.xib
  5. 72
      LunaMac/MainMenu.xib

8
LunaMac.xcodeproj/project.pbxproj

@ -7,6 +7,8 @@
objects = {
/* Begin PBXBuildFile section */
7E8188BB28DD423B0080C707 /* InfoBox.xib in Resources */ = {isa = PBXBuildFile; fileRef = 7E8188BA28DD423B0080C707 /* InfoBox.xib */; };
7E8188BD28DD46900080C707 /* MainMenu.xib in Resources */ = {isa = PBXBuildFile; fileRef = 7E8188BC28DD46900080C707 /* MainMenu.xib */; };
7ECD0D7C28DD2A4100B90958 /* AppDelegate.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7ECD0D7B28DD2A4100B90958 /* AppDelegate.swift */; };
7ECD0D7E28DD2A4100B90958 /* ViewController.swift in Sources */ = {isa = PBXBuildFile; fileRef = 7ECD0D7D28DD2A4100B90958 /* ViewController.swift */; };
7ECD0D8028DD2A4200B90958 /* Assets.xcassets in Resources */ = {isa = PBXBuildFile; fileRef = 7ECD0D7F28DD2A4200B90958 /* Assets.xcassets */; };
@ -14,6 +16,8 @@
/* End PBXBuildFile section */
/* Begin PBXFileReference section */
7E8188BA28DD423B0080C707 /* InfoBox.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = InfoBox.xib; sourceTree = "<group>"; };
7E8188BC28DD46900080C707 /* MainMenu.xib */ = {isa = PBXFileReference; lastKnownFileType = file.xib; path = MainMenu.xib; sourceTree = "<group>"; };
7ECD0D7828DD2A4100B90958 /* LunaMac.app */ = {isa = PBXFileReference; explicitFileType = wrapper.application; includeInIndex = 0; path = LunaMac.app; sourceTree = BUILT_PRODUCTS_DIR; };
7ECD0D7B28DD2A4100B90958 /* AppDelegate.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = AppDelegate.swift; sourceTree = "<group>"; };
7ECD0D7D28DD2A4100B90958 /* ViewController.swift */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.swift; path = ViewController.swift; sourceTree = "<group>"; };
@ -59,6 +63,8 @@
7ECD0D8128DD2A4200B90958 /* Main.storyboard */,
7ECD0D8428DD2A4200B90958 /* Info.plist */,
7ECD0D8528DD2A4200B90958 /* LunaMac.entitlements */,
7E8188BA28DD423B0080C707 /* InfoBox.xib */,
7E8188BC28DD46900080C707 /* MainMenu.xib */,
);
path = LunaMac;
sourceTree = "<group>";
@ -121,8 +127,10 @@
isa = PBXResourcesBuildPhase;
buildActionMask = 2147483647;
files = (
7E8188BB28DD423B0080C707 /* InfoBox.xib in Resources */,
7ECD0D8028DD2A4200B90958 /* Assets.xcassets in Resources */,
7ECD0D8328DD2A4200B90958 /* Main.storyboard in Resources */,
7E8188BD28DD46900080C707 /* MainMenu.xib in Resources */,
);
runOnlyForDeploymentPostprocessing = 0;
};

12
LunaMac/AppDelegate.swift

@ -5,6 +5,11 @@
// Created by Claire Davis on 9/21/22.
// Copyright © 2022 A Better Geek. All rights reserved.
//
/*
====== TO DO =======
* auto-update at a set interval
* make help menu item work (show the window)
*/
import Cocoa
import Foundation
@ -80,6 +85,13 @@ class AppDelegate: NSObject, NSApplicationDelegate {
func applicationDidFinishLaunching(_ aNotification: Notification) {
updateIcon()
// try showing the xib dialog
var x = NSWindowController(windowNibName: "InfoBox")
x.loadWindow()
var m = NSWindowController(windowNibName: "MainMenu")
m.loadWindow()
}
@objc func buildMenu(key: String = "default") {

11
LunaMac/Base.lproj/Main.storyboard

@ -1,7 +1,8 @@
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.Storyboard.XIB" version="3.0" toolsVersion="11134" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" initialViewController="B8D-0N-5wS">
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.Storyboard.XIB" version="3.0" toolsVersion="14490.70" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="11134"/>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="14490.70"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<scenes>
<!--Application-->
@ -673,7 +674,7 @@
<outlet property="delegate" destination="Voe-Tx-rLC" id="PrD-fu-P6m"/>
</connections>
</application>
<customObject id="Voe-Tx-rLC" customClass="AppDelegate" customModuleProvider="target"/>
<customObject id="Voe-Tx-rLC" customClass="AppDelegate" customModule="LunaMac" customModuleProvider="target"/>
<customObject id="YLy-65-1bz" customClass="NSFontManager"/>
<customObject id="Ady-hI-5gd" userLabel="First Responder" customClass="NSResponder" sceneMemberID="firstResponder"/>
</objects>
@ -703,7 +704,7 @@
<!--View Controller-->
<scene sceneID="hIz-AP-VOD">
<objects>
<viewController id="XfG-lQ-9wD" customClass="ViewController" customModuleProvider="target" sceneMemberID="viewController">
<viewController id="XfG-lQ-9wD" customClass="ViewController" customModule="LunaMac" customModuleProvider="target" sceneMemberID="viewController">
<view key="view" id="m2S-Jp-Qdl">
<rect key="frame" x="0.0" y="0.0" width="480" height="270"/>
<autoresizingMask key="autoresizingMask"/>

44
LunaMac/InfoBox.xib

@ -0,0 +1,44 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="14490.70" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="14490.70"/>
<capability name="documents saved in the Xcode 8 format" minToolsVersion="8.0"/>
</dependencies>
<objects>
<customObject id="-2" userLabel="File's Owner"/>
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
<customObject id="-3" userLabel="Application" customClass="NSObject"/>
<window title="Window" allowsToolTipsWhenApplicationIsInactive="NO" autorecalculatesKeyViewLoop="NO" releasedWhenClosed="NO" animationBehavior="default" id="QvC-M9-y7g">
<windowStyleMask key="styleMask" titled="YES" closable="YES"/>
<windowPositionMask key="initialPositionMask" leftStrut="YES" rightStrut="YES" topStrut="YES" bottomStrut="YES"/>
<rect key="contentRect" x="1044" y="532" width="235" height="148"/>
<rect key="screenRect" x="0.0" y="0.0" width="1366" height="745"/>
<view key="contentView" wantsLayer="YES" id="EiT-Mj-1SZ">
<rect key="frame" x="0.0" y="0.0" width="235" height="148"/>
<autoresizingMask key="autoresizingMask"/>
<subviews>
<textField horizontalHuggingPriority="251" verticalHuggingPriority="750" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="24S-3e-fTg">
<rect key="frame" x="11" y="117" width="212" height="19"/>
<autoresizingMask key="autoresizingMask"/>
<textFieldCell key="cell" lineBreakMode="clipping" alignment="center" title="Using LunaMac 1.0" id="3Ea-1B-yru">
<font key="font" metaFont="system" size="15"/>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
<textField verticalHuggingPriority="750" horizontalCompressionResistancePriority="250" fixedFrame="YES" translatesAutoresizingMaskIntoConstraints="NO" id="Jwa-x9-RgK">
<rect key="frame" x="11" y="12" width="213" height="89"/>
<autoresizingMask key="autoresizingMask"/>
<textFieldCell key="cell" selectable="YES" alignment="left" id="ZyF-AY-vyC">
<font key="font" metaFont="system"/>
<string key="title">LunaMac calculates the current moon phase when it launches. If you see a 🌙 instead of a moon phase, try again from the status bar icon's menu.</string>
<color key="textColor" name="labelColor" catalog="System" colorSpace="catalog"/>
<color key="backgroundColor" name="textBackgroundColor" catalog="System" colorSpace="catalog"/>
</textFieldCell>
</textField>
</subviews>
</view>
<point key="canvasLocation" x="36.5" y="122"/>
</window>
</objects>
</document>

72
LunaMac/MainMenu.xib

@ -0,0 +1,72 @@
<?xml version="1.0" encoding="UTF-8"?>
<document type="com.apple.InterfaceBuilder3.Cocoa.XIB" version="3.0" toolsVersion="14490.70" targetRuntime="MacOSX.Cocoa" propertyAccessControl="none" useAutolayout="YES" customObjectInstantitationMethod="direct">
<dependencies>
<plugIn identifier="com.apple.InterfaceBuilder.CocoaPlugin" version="14490.70"/>
</dependencies>
<objects>
<customObject id="-2" userLabel="File's Owner" customClass="NSApplication"/>
<customObject id="-1" userLabel="First Responder" customClass="FirstResponder"/>
<customObject id="-3" userLabel="Application" customClass="NSObject"/>
<customObject id="YLy-65-1bz" customClass="NSFontManager"/>
<menu title="Main Menu" systemMenu="main" id="AYu-sK-qS6">
<items>
<menuItem title="LunaMac" id="1Xt-HY-uBw">
<modifierMask key="keyEquivalentModifierMask"/>
<menu key="submenu" title="LunaMac" systemMenu="apple" id="uQy-DD-JDr">
<items>
<menuItem title="About LunaMac" id="5kV-Vb-QxS">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="orderFrontStandardAboutPanel:" target="-1" id="Exp-CZ-Vem"/>
</connections>
</menuItem>
<menuItem isSeparatorItem="YES" id="VOq-y0-SEH"/>
<menuItem title="Preferences…" keyEquivalent="," id="BOF-NM-1cW"/>
<menuItem isSeparatorItem="YES" id="wFC-TO-SCJ"/>
<menuItem title="Services" id="NMo-om-nkz">
<modifierMask key="keyEquivalentModifierMask"/>
<menu key="submenu" title="Services" systemMenu="services" id="hz9-B4-Xy5"/>
</menuItem>
<menuItem isSeparatorItem="YES" id="4je-JR-u6R"/>
<menuItem title="Hide NewApplication" keyEquivalent="h" id="Olw-nP-bQN">
<connections>
<action selector="hide:" target="-1" id="PnN-Uc-m68"/>
</connections>
</menuItem>
<menuItem title="Hide Others" keyEquivalent="h" id="Vdr-fp-XzO">
<modifierMask key="keyEquivalentModifierMask" option="YES" command="YES"/>
<connections>
<action selector="hideOtherApplications:" target="-1" id="VT4-aY-XCT"/>
</connections>
</menuItem>
<menuItem title="Show All" id="Kd2-mp-pUS">
<modifierMask key="keyEquivalentModifierMask"/>
<connections>
<action selector="unhideAllApplications:" target="-1" id="Dhg-Le-xox"/>
</connections>
</menuItem>
<menuItem isSeparatorItem="YES" id="kCx-OE-vgT"/>
<menuItem title="Quit NewApplication" keyEquivalent="q" id="4sb-4s-VLi">
<connections>
<action selector="terminate:" target="-1" id="Te7-pn-YzF"/>
</connections>
</menuItem>
</items>
</menu>
</menuItem>
<menuItem title="Help" id="wpr-3q-Mcd">
<modifierMask key="keyEquivalentModifierMask"/>
<menu key="submenu" title="Help" systemMenu="help" id="F2S-fz-NVQ">
<items>
<menuItem title="LunaMac Help" keyEquivalent="?" id="FKE-Sm-Kum">
<connections>
<action selector="showHelp:" target="-1" id="y7X-2Q-9no"/>
</connections>
</menuItem>
</items>
</menu>
</menuItem>
</items>
</menu>
</objects>
</document>
Loading…
Cancel
Save