PolycodeAppDelegate.h 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. //
  2. // PolycodeAppDelegate.h
  3. // Polycode
  4. //
  5. // Created by Ivan Safrin on 11/28/10.
  6. // Copyright 2010 Local Projects. All rights reserved.
  7. //
  8. #import <Cocoa/Cocoa.h>
  9. #import "PolySubstanceView.h"
  10. #include "Polycode.h"
  11. #include "PolycodeIDEApp.h"
  12. using namespace Polycode;
  13. class PolycodeAppEventHandler : public EventHandler {
  14. public:
  15. PolycodeAppEventHandler() {}
  16. ~PolycodeAppEventHandler() {}
  17. void handleEvent(Event *evt) {
  18. switch(evt->getEventCode()) {
  19. case PolycodeIDEApp::EVENT_SHOW_MENU:
  20. [appDelegate showProjectMenu];
  21. break;
  22. }
  23. }
  24. id appDelegate;
  25. };
  26. @interface PolycodeAppDelegate : NSObject <NSApplicationDelegate> {
  27. NSWindow *window;
  28. PolycodeIDEApp *app;
  29. SubstanceView *substanceView;
  30. PolycodeAppEventHandler *eventHandler;
  31. NSTimer* timer;
  32. NSMenu *projectMenu;
  33. BOOL mustShowProjectMenu;
  34. }
  35. @property (assign) IBOutlet SubstanceView *substanceView;
  36. @property (assign) IBOutlet NSWindow *window;
  37. @property (assign) IBOutlet NSMenu *projectMenu;
  38. - (void) showProjectMenu;
  39. // Menu accessors
  40. -(void) newProject: (id) sender;
  41. -(void) closeProject: (id) sender;
  42. -(void) newFile: (id) sender;
  43. -(void) openProject: (id) sender;
  44. -(void) saveFile: (id) sender;
  45. @end