Advertisement
dartmeadow

UI

Sep 4th, 2021
449
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Swift 3.39 KB | None | 0 0
  1. import Foundation
  2. import SwiftUI
  3. import CoreData
  4. import Combine
  5.  
  6.  
  7. @main
  8.  
  9.  
  10.  
  11. struct CotharticrenApp: App {
  12.     /*
  13.     @StateObject var store = LabTableShelf()
  14.     @State private var selectedFolder: String? = "Research"
  15.     @State private var selectedLabTable: LabTable?
  16.  */
  17.     @StateObject var leafstore = pondlily()
  18.     @State private var selectedLeaf: String? = "Research"
  19.     @State private var selectedPond: Pond?
  20.     var body: some Scene {
  21.  
  22.        
  23.         WindowGroup {
  24.             EntryView()
  25.            
  26.         }
  27.    
  28.         /*
  29.         WindowGroup("Orbit Shapes") {
  30.             ShapesView()
  31.            
  32.         }.handlesExternalEvents(matching: Set(arrayLiteral: "Shapes"))
  33.    
  34. */
  35.         WindowGroup {
  36.             NavigationView {
  37.                 ChromiumPond(
  38.                     leafstore: leafstore,
  39.                     selectedLeaf: $selectedLeaf,
  40.                     selectedPond: $selectedPond
  41.                 )
  42.                 Text("Select leaf...")
  43.                 Text("Select pond...")
  44.             }
  45.            }.handlesExternalEvents(matching: Set(arrayLiteral: "ChromiumPond"))
  46.         .commands {
  47.             CommandMenu("Articren") {
  48.                 Button(action: {
  49.                     OpenPondGlass.ChromiumPond.openpond()
  50.                 }){
  51.                             Text("Chromium Pond")
  52.                          }
  53.                     Divider()
  54.              
  55.             }
  56.             CommandMenu("DART Meadow") {
  57.             Button(action: {
  58.                         OpenPondGlass.ExploreDM.exploredm()
  59.                    }){
  60.                         Text("DART Meadow")
  61.                      }
  62.                 Divider()
  63.             }
  64.         }
  65.     }
  66.     /*
  67.         WindowGroup {
  68.             NavigationView {
  69.                 FactoryLab(
  70.                     store: store,
  71.                     selectedFolder: $selectedFolder,
  72.                     selectedLabTable: $selectedLabTable
  73.                 )
  74.                 Text("Select folder...")
  75.                 Text("Select atm26table...")
  76.                 Text("Select orbittable...")
  77.             }
  78.         }.handlesExternalEvents(matching: Set(arrayLiteral: "FactoryLab"))
  79.  */
  80.      
  81.     /*
  82.     Button(action: {
  83.                 OpenWindows.FactoryLab.open()
  84.     }){
  85.                 Text("Factory Lab")
  86.              }
  87.         Divider()
  88. */
  89.                 /*
  90.                 Button(action: {
  91.                             OpenWindows.Shapes.open()
  92.                        }){
  93.                             Text("Orbit Shapes")
  94.                          }
  95.                     Divider()
  96.  */
  97.            
  98. enum OpenPondGlass: String, CaseIterable {
  99.    
  100.     /*
  101.     case Orbit = "Orbit"
  102.     case Shapes  = "Shapes"
  103.     case ATM26  = "ATM26"
  104.     case FactoryLab  = "FactoryLab"
  105.  */
  106.     case ChromiumPond = "ChromiumPond"
  107.     case ExploreDM = "ExploreDM"
  108.     //As many views as you need.
  109.     func exploredm(){
  110.        if let ExploreDM = URL(string: "https://www.dartmeadow.com"){
  111.         NSWorkspace.shared.open(ExploreDM)
  112.         }
  113.         }
  114.    func openpond(){
  115.     if let url = URL(string: "Cotharticren://\(self.rawValue)") { //replace myapp with your app's name
  116.     NSWorkspace.shared.open(url)
  117.    
  118. }
  119.     func Google(_ sender: NSMenuItem) {
  120.         if let url = URL(string: "http://google.fi") {
  121.             NSWorkspace.shared.open(url)
  122.         }
  123.     }
  124.        
  125.  
  126.    }
  127. }
  128.    
  129.     }
  130.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement