PolycodeAppDelegate.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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 "PolycodeView.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. PolycodeView *polycodeView;
  30. PolycodeAppEventHandler *eventHandler;
  31. NSTimer* timer;
  32. NSMenu *projectMenu;
  33. BOOL mustShowProjectMenu;
  34. }
  35. @property (assign) IBOutlet PolycodeView *polycodeView;
  36. @property (assign) IBOutlet NSWindow *window;
  37. @property (assign) IBOutlet NSMenu *projectMenu;
  38. - (void) showProjectMenu;
  39. // Menu accessors
  40. -(IBAction) refreshProject: (id) sender;
  41. -(IBAction) renameFile: (id) sender;
  42. -(IBAction) removeFile: (id) sender;
  43. -(IBAction) newGroup: (id) sender;
  44. -(IBAction) browseExamples: (id) sender;
  45. -(IBAction) runProject: (id) sender;
  46. -(IBAction) newProject: (id) sender;
  47. -(IBAction) closeProject: (id) sender;
  48. -(IBAction) newFile: (id) sender;
  49. -(IBAction) openProject: (id) sender;
  50. -(IBAction) saveFile: (id) sender;
  51. @end