Ticket #1355: 1355.diff
File 1355.diff, 3.0 KB (added by , 16 years ago) |
---|
-
src/apps/glteapot/TeapotApp.h
13 13 public: 14 14 TeapotApp(const char* sign); 15 15 virtual void MessageReceived(BMessage* msg); 16 // void AboutRequested();17 16 private: 18 17 TeapotWindow* fTeapotWindow; 19 18 }; -
src/apps/glteapot/TeapotWindow.cpp
41 41 BMenuItem* item; 42 42 msg.AddInt32("num", 256); 43 43 menu->AddItem(item = new BMenuItem("Add a teapot", new BMessage(msg), 'N')); 44 item->SetTarget(fObjectView); 44 item->SetTarget(fObjectView); 45 45 menu->AddSeparatorItem(); 46 menu->AddItem(item = new BMenuItem("Quit", new BMessage(B_QUIT_REQUESTED), 'Q')); 47 item->SetTarget(be_app); 48 msg.RemoveName("num"); 46 menu->AddItem(new BMenuItem("Quit", new BMessage(M_FILE_QUIT), 'Q')); 49 47 menuBar->AddItem(menu = new BMenu("Options")); 50 48 menu->AddItem(item = new BMenuItem("Perspective", new BMessage(kMsgPerspective))); 51 49 item->SetTarget(fObjectView); … … 68 66 menu->AddItem(item = new BMenuItem("Gouraud shading", new BMessage(kMsgGouraud))); 69 67 item->SetTarget(fObjectView); 70 68 item->SetMarked(true); 71 // menu->AddItem(item = new BMenuItem("Texture mapped", new BMessage(kMsgTextured)));72 // item->SetTarget(fObjectView);73 69 menu->AddItem(item = new BMenuItem("Fog", new BMessage(kMsgFog))); 74 70 item->SetTarget(fObjectView); 75 71 … … 163 159 bool 164 160 TeapotWindow::QuitRequested() 165 161 { 166 // printf("closing \n");167 162 fObjectView->EnableDirectMode(false); 168 163 be_app->PostMessage(B_QUIT_REQUESTED); 164 169 165 return true; 170 166 } 171 167 … … 182 178 void 183 179 TeapotWindow::MessageReceived(BMessage* msg) 184 180 { 185 // msg->PrintToStream();186 181 switch (msg->what) { 182 case M_FILE_QUIT: 183 PostMessage(B_QUIT_REQUESTED); 184 break; 185 187 186 default: 188 187 BDirectWindow::MessageReceived(msg); 189 } 188 } 190 189 } -
src/apps/glteapot/TeapotWindow.h
10 10 11 11 #include "ObjectView.h" 12 12 13 enum { 14 M_FILE_QUIT 15 }; 16 13 17 class TeapotWindow : public BDirectWindow { 14 18 public: 15 19 TeapotWindow(BRect r, char* name, window_type wt, ulong something); 16 20 17 21 virtual bool QuitRequested(); 18 virtual void DirectConnected( direct_buffer_info* info);22 virtual void DirectConnected(direct_buffer_info* info); 19 23 virtual void MessageReceived(BMessage* msg); 20 24 21 25 private: -
src/apps/glteapot/TeapotApp.cpp
26 26 void 27 27 TeapotApp::MessageReceived(BMessage* msg) 28 28 { 29 // msg->PrintToStream();30 29 switch (msg->what) { 31 30 32 31 default: