Localized GLTeapot with a patch by taos. Removed unnecessary 'locale' again from Mandelbrot Jamfile. +alpha3

git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@41604 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
Joachim Seemer 2011-05-20 16:28:11 +00:00
parent 7abffacfbf
commit 74ab6008bd
3 changed files with 86 additions and 48 deletions

View File

@ -17,4 +17,5 @@ DoCatalogs GLTeapot :
x-vnd.Haiku-GLTeapot
:
TeapotApp.cpp
TeapotWindow.cpp
;

View File

@ -4,13 +4,18 @@
*/
#include <stdio.h>
#include <InterfaceKit.h>
#include <Rect.h>
#include <Point.h>
#include <new>
#include <Catalog.h>
#include <InterfaceKit.h>
#include <Point.h>
#include <Rect.h>
#include "TeapotWindow.h"
#undef B_TRANSLATE_CONTEXT
#define B_TRANSLATE_CONTEXT "TeapotWindow"
TeapotWindow::TeapotWindow(BRect rect, const char* name, window_type wt,
ulong something)
:
@ -26,7 +31,7 @@ TeapotWindow::TeapotWindow(BRect rect, const char* name, window_type wt,
BMenu* menu;
BMessage msg(kMsgAddModel);
menuBar->AddItem(menu = new BMenu("File"));
menuBar->AddItem(menu = new BMenu(B_TRANSLATE("File")));
AddChild(menuBar);
menuBar->ResizeToPreferred();
@ -37,122 +42,154 @@ TeapotWindow::TeapotWindow(BRect rect, const char* name, window_type wt,
AddChild(subView);
bounds = subView->Bounds();
fObjectView = new(std::nothrow) ObjectView(bounds, "objectView", B_FOLLOW_ALL_SIDES, type);
fObjectView = new(std::nothrow) ObjectView(bounds, "objectView",
B_FOLLOW_ALL_SIDES, type);
subView->AddChild(fObjectView);
BMenuItem* item;
msg.AddInt32("num", 256);
menu->AddItem(item = new BMenuItem("Add a teapot", new BMessage(msg), 'N'));
menu->AddItem(item = new BMenuItem(B_TRANSLATE("Add a teapot"),
new BMessage(msg), 'N'));
item->SetTarget(fObjectView);
menu->AddSeparatorItem();
menu->AddItem(item = new BMenuItem("Quit", new BMessage(B_QUIT_REQUESTED), 'Q'));
menu->AddItem(item = new BMenuItem(B_TRANSLATE("Quit"),
new BMessage(B_QUIT_REQUESTED), 'Q'));
item->SetTarget(be_app);
msg.RemoveName("num");
menuBar->AddItem(menu = new BMenu("Options"));
menu->AddItem(item = new BMenuItem("Perspective", new BMessage(kMsgPerspective)));
menuBar->AddItem(menu = new BMenu(B_TRANSLATE("Options")));
menu->AddItem(item = new BMenuItem(B_TRANSLATE("Perspective"),
new BMessage(kMsgPerspective)));
item->SetTarget(fObjectView);
item->SetMarked(false);
menu->AddItem(item = new BMenuItem("FPS display", new BMessage(kMsgFPS)));
menu->AddItem(item = new BMenuItem(B_TRANSLATE("FPS display"),
new BMessage(kMsgFPS)));
item->SetTarget(fObjectView);
item->SetMarked(true);
menu->AddItem(item = new BMenuItem("Filled polygons", new BMessage(kMsgFilled)));
menu->AddItem(item = new BMenuItem(B_TRANSLATE("Filled polygons"),
new BMessage(kMsgFilled)));
item->SetTarget(fObjectView);
item->SetMarked(true);
menu->AddItem(item = new BMenuItem("Lighting", new BMessage(kMsgLighting)));
menu->AddItem(item = new BMenuItem(B_TRANSLATE("Lighting"),
new BMessage(kMsgLighting)));
item->SetTarget(fObjectView);
item->SetMarked(true);
menu->AddItem(item = new BMenuItem("Backface culling", new BMessage(kMsgCulling)));
menu->AddItem(item = new BMenuItem(B_TRANSLATE("Backface culling"),
new BMessage(kMsgCulling)));
item->SetTarget(fObjectView);
item->SetMarked(true);
menu->AddItem(item = new BMenuItem("Z-buffered", new BMessage(kMsgZBuffer)));
menu->AddItem(item = new BMenuItem(B_TRANSLATE("Z-buffered"),
new BMessage(kMsgZBuffer)));
item->SetTarget(fObjectView);
item->SetMarked(true);
menu->AddItem(item = new BMenuItem("Gouraud shading", new BMessage(kMsgGouraud)));
menu->AddItem(item = new BMenuItem(B_TRANSLATE("Gouraud shading"),
new BMessage(kMsgGouraud)));
item->SetTarget(fObjectView);
item->SetMarked(true);
// menu->AddItem(item = new BMenuItem("Texture mapped", new BMessage(kMsgTextured)));
// item->SetTarget(fObjectView);
menu->AddItem(item = new BMenuItem("Fog", new BMessage(kMsgFog)));
menu->AddItem(item = new BMenuItem(B_TRANSLATE("Fog"),
new BMessage(kMsgFog)));
item->SetTarget(fObjectView);
BMenu *subMenu;
menuBar->AddItem(menu = new BMenu("Lights"));
menuBar->AddItem(menu = new BMenu(B_TRANSLATE("Lights")));
msg.what = kMsgLights;
msg.AddInt32("num", 1);
menu->AddItem(item = new BMenuItem(subMenu = new BMenu("Upper center"), NULL));
menu->AddItem(item = new BMenuItem(subMenu =
new BMenu(B_TRANSLATE("Upper center")), NULL));
item->SetTarget(fObjectView);
msg.AddInt32("color", lightNone);
subMenu->AddItem(item = new BMenuItem("Off", new BMessage(msg)));
subMenu->AddItem(item = new BMenuItem(B_TRANSLATE("Off"),
new BMessage(msg)));
item->SetTarget(fObjectView);
subMenu->AddSeparatorItem();
msg.ReplaceInt32("color", lightWhite);
subMenu->AddItem(item = new BMenuItem("White", new BMessage(msg)));
subMenu->AddItem(item = new BMenuItem(B_TRANSLATE("White"),
new BMessage(msg)));
item->SetTarget(fObjectView);
item->SetMarked(true);
msg.ReplaceInt32("color", lightYellow);
subMenu->AddItem(item = new BMenuItem("Yellow", new BMessage(msg)));
subMenu->AddItem(item = new BMenuItem(B_TRANSLATE("Yellow"),
new BMessage(msg)));
item->SetTarget(fObjectView);
msg.ReplaceInt32("color", lightBlue);
subMenu->AddItem(item = new BMenuItem("Blue", new BMessage(msg)));
subMenu->AddItem(item = new BMenuItem(B_TRANSLATE("Blue"),
new BMessage(msg)));
item->SetTarget(fObjectView);
msg.ReplaceInt32("color", lightRed);
subMenu->AddItem(item = new BMenuItem("Red", new BMessage(msg)));
subMenu->AddItem(item = new BMenuItem(B_TRANSLATE("Red"),
new BMessage(msg)));
item->SetTarget(fObjectView);
msg.ReplaceInt32("color", lightGreen);
subMenu->AddItem(item = new BMenuItem("Green", new BMessage(msg)));
subMenu->AddItem(item = new BMenuItem(B_TRANSLATE("Green"),
new BMessage(msg)));
item->SetTarget(fObjectView);
msg.RemoveName("color");
msg.ReplaceInt32("num", 2);
menu->AddItem(item = new BMenuItem(subMenu = new BMenu("Lower left"), NULL));
menu->AddItem(item = new BMenuItem(subMenu =
new BMenu(B_TRANSLATE("Lower left")), NULL));
item->SetTarget(fObjectView);
msg.AddInt32("color", lightNone);
subMenu->AddItem(item = new BMenuItem("Off", new BMessage(msg)));
subMenu->AddItem(item = new BMenuItem(B_TRANSLATE("Off"),
new BMessage(msg)));
item->SetTarget(fObjectView);
subMenu->AddSeparatorItem();
msg.ReplaceInt32("color", lightWhite);
subMenu->AddItem(item = new BMenuItem("White", new BMessage(msg)));
subMenu->AddItem(item = new BMenuItem(B_TRANSLATE("White"),
new BMessage(msg)));
item->SetTarget(fObjectView);
msg.ReplaceInt32("color", lightYellow);
subMenu->AddItem(item = new BMenuItem("Yellow", new BMessage(msg)));
subMenu->AddItem(item = new BMenuItem(B_TRANSLATE("Yellow"),
new BMessage(msg)));
item->SetTarget(fObjectView);
msg.ReplaceInt32("color", lightBlue);
subMenu->AddItem(item = new BMenuItem("Blue", new BMessage(msg)));
subMenu->AddItem(item = new BMenuItem(B_TRANSLATE("Blue"),
new BMessage(msg)));
item->SetTarget(fObjectView);
item->SetMarked(true);
msg.ReplaceInt32("color", lightRed);
subMenu->AddItem(item = new BMenuItem("Red", new BMessage(msg)));
subMenu->AddItem(item = new BMenuItem(B_TRANSLATE("Red"),
new BMessage(msg)));
item->SetTarget(fObjectView);
msg.ReplaceInt32("color", lightGreen);
subMenu->AddItem(item = new BMenuItem("Green", new BMessage(msg)));
subMenu->AddItem(item = new BMenuItem(B_TRANSLATE("Green"),
new BMessage(msg)));
item->SetTarget(fObjectView);
msg.RemoveName("color");
msg.ReplaceInt32("num", 3);
menu->AddItem(item = new BMenuItem(subMenu = new BMenu("Right"), NULL));
menu->AddItem(item = new BMenuItem(subMenu =
new BMenu(B_TRANSLATE("Right")), NULL));
item->SetTarget(fObjectView);
msg.AddInt32("color", lightNone);
subMenu->AddItem(item = new BMenuItem("Off", new BMessage(msg)));
subMenu->AddItem(item = new BMenuItem(B_TRANSLATE("Off"),
new BMessage(msg)));
item->SetTarget(fObjectView);
item->SetMarked(true);
subMenu->AddSeparatorItem();
msg.ReplaceInt32("color", lightWhite);
subMenu->AddItem(item = new BMenuItem("White", new BMessage(msg)));
subMenu->AddItem(item = new BMenuItem(B_TRANSLATE("White"),
new BMessage(msg)));
item->SetTarget(fObjectView);
msg.ReplaceInt32("color", lightYellow);
subMenu->AddItem(item = new BMenuItem("Yellow", new BMessage(msg)));
subMenu->AddItem(item = new BMenuItem(B_TRANSLATE("Yellow"),
new BMessage(msg)));
item->SetTarget(fObjectView);
msg.ReplaceInt32("color", lightBlue);
subMenu->AddItem(item = new BMenuItem("Blue", new BMessage(msg)));
subMenu->AddItem(item = new BMenuItem(B_TRANSLATE("Blue"),
new BMessage(msg)));
item->SetTarget(fObjectView);
msg.ReplaceInt32("color", lightRed);
subMenu->AddItem(item = new BMenuItem("Red", new BMessage(msg)));
subMenu->AddItem(item = new BMenuItem(B_TRANSLATE("Red"),
new BMessage(msg)));
item->SetTarget(fObjectView);
msg.ReplaceInt32("color", lightGreen);
subMenu->AddItem(item = new BMenuItem("Green", new BMessage(msg)));
subMenu->AddItem(item = new BMenuItem(B_TRANSLATE("Green"),
new BMessage(msg)));
item->SetTarget(fObjectView);
float f = menuBar->Bounds().IntegerHeight() + 1;

View File

@ -6,7 +6,7 @@ AddSubDirSupportedPlatforms libbe_test ;
Application Mandelbrot :
Mandelbrot.cpp
tsb.cpp
: be locale $(TARGET_LIBSUPC++) $(HAIKU_LOCALE_LIBS)
: be $(TARGET_LIBSUPC++) $(HAIKU_LOCALE_LIBS)
: Mandelbrot.rdef
;