Patch by Alex Wilson (yourpalal): Converted the remaining two translators to use
layout management. Fixed a bug in the HVIFTranslator which did not release the TranslatorSettings in it's destructor. Thanks a bunch! git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@36501 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -169,6 +169,5 @@ HVIFTranslator::DerivedTranslate(BPositionIO *inSource,
|
|||||||
BView *
|
BView *
|
||||||
HVIFTranslator::NewConfigView(TranslatorSettings *settings)
|
HVIFTranslator::NewConfigView(TranslatorSettings *settings)
|
||||||
{
|
{
|
||||||
return new HVIFView(BRect(0, 0, 250, 150), "HVIFTranslator Settings",
|
return new HVIFView("HVIFTranslator Settings", B_WILL_DRAW, settings);
|
||||||
B_FOLLOW_ALL, B_WILL_DRAW, settings);
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,6 +9,7 @@
|
|||||||
#include "HVIFView.h"
|
#include "HVIFView.h"
|
||||||
#include "HVIFTranslator.h"
|
#include "HVIFTranslator.h"
|
||||||
|
|
||||||
|
#include <GroupLayoutBuilder.h>
|
||||||
#include <String.h>
|
#include <String.h>
|
||||||
#include <StringView.h>
|
#include <StringView.h>
|
||||||
|
|
||||||
@@ -17,57 +18,65 @@
|
|||||||
#define HVIF_SETTING_RENDER_SIZE_CHANGED 'rsch'
|
#define HVIF_SETTING_RENDER_SIZE_CHANGED 'rsch'
|
||||||
|
|
||||||
|
|
||||||
HVIFView::HVIFView(const BRect &frame, const char *name, uint32 resizeMode,
|
HVIFView::HVIFView(const char* name, uint32 flags, TranslatorSettings *settings)
|
||||||
uint32 flags, TranslatorSettings *settings)
|
:
|
||||||
: BView(frame, name, resizeMode, flags),
|
BView(name, flags, new BGroupLayout(B_VERTICAL)),
|
||||||
fSettings(settings)
|
fSettings(settings)
|
||||||
{
|
{
|
||||||
SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
BAlignment labelAlignment(B_ALIGN_LEFT, B_ALIGN_NO_VERTICAL);
|
||||||
|
|
||||||
font_height fontHeight;
|
BStringView* title= new BStringView("title",
|
||||||
be_bold_font->GetHeight(&fontHeight);
|
|
||||||
float height = fontHeight.descent + fontHeight.ascent + fontHeight.leading;
|
|
||||||
|
|
||||||
BRect rect(10, 10, 200, 10 + height);
|
|
||||||
BStringView *stringView = new BStringView(rect, "title",
|
|
||||||
"Native Haiku icon format translator");
|
"Native Haiku icon format translator");
|
||||||
stringView->SetFont(be_bold_font);
|
title->SetFont(be_bold_font);
|
||||||
stringView->ResizeToPreferred();
|
title->SetExplicitAlignment(labelAlignment);
|
||||||
AddChild(stringView);
|
|
||||||
|
|
||||||
rect.OffsetBy(0, height + 10);
|
char versionString[256];
|
||||||
char version[256];
|
snprintf(versionString, sizeof(versionString), "Version %d.%d.%d, %s",
|
||||||
snprintf(version, sizeof(version), "Version %d.%d.%d, %s",
|
|
||||||
int(B_TRANSLATION_MAJOR_VERSION(HVIF_TRANSLATOR_VERSION)),
|
int(B_TRANSLATION_MAJOR_VERSION(HVIF_TRANSLATOR_VERSION)),
|
||||||
int(B_TRANSLATION_MINOR_VERSION(HVIF_TRANSLATOR_VERSION)),
|
int(B_TRANSLATION_MINOR_VERSION(HVIF_TRANSLATOR_VERSION)),
|
||||||
int(B_TRANSLATION_REVISION_VERSION(HVIF_TRANSLATOR_VERSION)),
|
int(B_TRANSLATION_REVISION_VERSION(HVIF_TRANSLATOR_VERSION)),
|
||||||
__DATE__);
|
__DATE__);
|
||||||
stringView = new BStringView(rect, "version", version);
|
BStringView* version = new BStringView("version", versionString);
|
||||||
stringView->ResizeToPreferred();
|
version->SetExplicitAlignment(labelAlignment);
|
||||||
AddChild(stringView);
|
|
||||||
|
|
||||||
GetFontHeight(&fontHeight);
|
BStringView* copyright = new BStringView("copyright",
|
||||||
height = fontHeight.descent + fontHeight.ascent + fontHeight.leading;
|
|
||||||
|
|
||||||
rect.OffsetBy(0, height + 5);
|
|
||||||
stringView = new BStringView(rect, "copyright",
|
|
||||||
B_UTF8_COPYRIGHT"2009 Haiku Inc.");
|
B_UTF8_COPYRIGHT"2009 Haiku Inc.");
|
||||||
stringView->ResizeToPreferred();
|
copyright->SetExplicitAlignment(labelAlignment);
|
||||||
AddChild(stringView);
|
|
||||||
|
|
||||||
rect.OffsetBy(0, height + 5);
|
|
||||||
int32 renderSize = fSettings->SetGetInt32(HVIF_SETTING_RENDER_SIZE);
|
int32 renderSize = fSettings->SetGetInt32(HVIF_SETTING_RENDER_SIZE);
|
||||||
BString label = "Render size: ";
|
BString label = "Render size: ";
|
||||||
label << renderSize;
|
label << renderSize;
|
||||||
fRenderSize = new BSlider(rect, "renderSize", label.String(), NULL, 1, 32);
|
|
||||||
|
|
||||||
fRenderSize->ResizeToPreferred();
|
fRenderSize = new BSlider("renderSize", label.String(),
|
||||||
|
NULL, 1, 32, B_HORIZONTAL);
|
||||||
fRenderSize->SetValue(renderSize / 8);
|
fRenderSize->SetValue(renderSize / 8);
|
||||||
fRenderSize->SetHashMarks(B_HASH_MARKS_BOTTOM);
|
fRenderSize->SetHashMarks(B_HASH_MARKS_BOTTOM);
|
||||||
fRenderSize->SetHashMarkCount(16);
|
fRenderSize->SetHashMarkCount(16);
|
||||||
fRenderSize->SetModificationMessage(
|
fRenderSize->SetModificationMessage(
|
||||||
new BMessage(HVIF_SETTING_RENDER_SIZE_CHANGED));
|
new BMessage(HVIF_SETTING_RENDER_SIZE_CHANGED));
|
||||||
AddChild(fRenderSize);
|
fRenderSize->SetExplicitAlignment(labelAlignment);
|
||||||
|
|
||||||
|
float padding = 5.0f;
|
||||||
|
AddChild(BGroupLayoutBuilder(B_VERTICAL, padding)
|
||||||
|
.Add(title)
|
||||||
|
.Add(version)
|
||||||
|
.Add(copyright)
|
||||||
|
.Add(fRenderSize)
|
||||||
|
.AddGlue()
|
||||||
|
.SetInsets(padding, padding, padding, padding)
|
||||||
|
);
|
||||||
|
|
||||||
|
BFont font;
|
||||||
|
GetFont(&font);
|
||||||
|
SetExplicitPreferredSize(
|
||||||
|
BSize((font.Size() * 270) / 12, (font.Size() * 100) / 12));
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
HVIFView::~HVIFView()
|
||||||
|
{
|
||||||
|
fSettings->Release();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -15,16 +15,15 @@
|
|||||||
|
|
||||||
class HVIFView : public BView {
|
class HVIFView : public BView {
|
||||||
public:
|
public:
|
||||||
HVIFView(const BRect &frame, const char *name,
|
HVIFView(const char *name, uint32 flags, TranslatorSettings *settings);
|
||||||
uint32 resizeMode, uint32 flags,
|
~HVIFView();
|
||||||
TranslatorSettings *settings);
|
|
||||||
|
|
||||||
virtual void AttachedToWindow();
|
virtual void AttachedToWindow();
|
||||||
virtual void MessageReceived(BMessage *message);
|
virtual void MessageReceived(BMessage *message);
|
||||||
|
|
||||||
private:
|
private:
|
||||||
BSlider * fRenderSize;
|
BSlider* fRenderSize;
|
||||||
TranslatorSettings *fSettings;
|
TranslatorSettings* fSettings;
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif // HVIF_VIEW_H
|
#endif // HVIF_VIEW_H
|
||||||
|
|||||||
@@ -146,7 +146,8 @@ make_nth_translator(int32 n, image_id you, uint32 flags, ...)
|
|||||||
// Returns:
|
// Returns:
|
||||||
// ---------------------------------------------------------------
|
// ---------------------------------------------------------------
|
||||||
SGITranslator::SGITranslator()
|
SGITranslator::SGITranslator()
|
||||||
: BaseTranslator("SGI images", "SGI image translator",
|
:
|
||||||
|
BaseTranslator("SGI images", "SGI image translator",
|
||||||
SGI_TRANSLATOR_VERSION,
|
SGI_TRANSLATOR_VERSION,
|
||||||
gInputFormats, sizeof(gInputFormats) / sizeof(translation_format),
|
gInputFormats, sizeof(gInputFormats) / sizeof(translation_format),
|
||||||
gOutputFormats, sizeof(gOutputFormats) / sizeof(translation_format),
|
gOutputFormats, sizeof(gOutputFormats) / sizeof(translation_format),
|
||||||
@@ -732,6 +733,5 @@ SGITranslator::DerivedTranslate(BPositionIO *inSource,
|
|||||||
BView *
|
BView *
|
||||||
SGITranslator::NewConfigView(TranslatorSettings *settings)
|
SGITranslator::NewConfigView(TranslatorSettings *settings)
|
||||||
{
|
{
|
||||||
return new SGIView(BRect(0, 0, 225, 175), "SGITranslator Settings",
|
return new SGIView("SGITranslator Settings", B_WILL_DRAW, settings);
|
||||||
B_FOLLOW_ALL, B_WILL_DRAW, settings);
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -33,10 +33,14 @@
|
|||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
|
#include <GroupLayoutBuilder.h>
|
||||||
#include <MenuBar.h>
|
#include <MenuBar.h>
|
||||||
#include <MenuField.h>
|
#include <MenuField.h>
|
||||||
#include <MenuItem.h>
|
#include <MenuItem.h>
|
||||||
#include <PopUpMenu.h>
|
#include <PopUpMenu.h>
|
||||||
|
#include <String.h>
|
||||||
|
#include <StringView.h>
|
||||||
|
#include <TextView.h>
|
||||||
#include <Window.h>
|
#include <Window.h>
|
||||||
|
|
||||||
#include "SGIImage.h"
|
#include "SGIImage.h"
|
||||||
@@ -72,14 +76,11 @@ add_menu_item(BMenu* menu,
|
|||||||
//
|
//
|
||||||
// Returns:
|
// Returns:
|
||||||
// ---------------------------------------------------------------
|
// ---------------------------------------------------------------
|
||||||
SGIView::SGIView(const BRect &frame, const char *name,
|
SGIView::SGIView(const char* name, uint32 flags, TranslatorSettings* settings)
|
||||||
uint32 resize, uint32 flags, TranslatorSettings *settings)
|
:
|
||||||
: BView(frame, name, resize, flags),
|
BView(name, flags, new BGroupLayout(B_VERTICAL)),
|
||||||
fSettings(settings)
|
fSettings(settings)
|
||||||
{
|
{
|
||||||
SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
|
||||||
SetLowColor(ViewColor());
|
|
||||||
|
|
||||||
BPopUpMenu* menu = new BPopUpMenu("pick compression");
|
BPopUpMenu* menu = new BPopUpMenu("pick compression");
|
||||||
|
|
||||||
uint32 currentCompression = fSettings->SetGetInt32(SGI_SETTING_COMPRESSION);
|
uint32 currentCompression = fSettings->SetGetInt32(SGI_SETTING_COMPRESSION);
|
||||||
@@ -96,36 +97,57 @@ SGIView::SGIView(const BRect &frame, const char *name,
|
|||||||
|
|
||||||
// add_menu_item(menu, SGI_COMP_ARLE, "Agressive RLE", currentCompression);
|
// add_menu_item(menu, SGI_COMP_ARLE, "Agressive RLE", currentCompression);
|
||||||
|
|
||||||
BRect menuFrame = Bounds();
|
fCompressionMF = new BMenuField("compression", "Use compression:", menu);
|
||||||
menuFrame.bottom = menuFrame.top + menu->Bounds().Height();
|
|
||||||
fCompressionMF = new BMenuField(menuFrame, "compression",
|
|
||||||
"Use compression:", menu, true/*,
|
|
||||||
B_FOLLOW_LEFT_RIGHT | B_FOLLOW_TOP*/);
|
|
||||||
if (fCompressionMF->MenuBar())
|
|
||||||
fCompressionMF->MenuBar()->ResizeToPreferred();
|
|
||||||
fCompressionMF->ResizeToPreferred();
|
|
||||||
|
|
||||||
// figure out where the text ends
|
BAlignment labelAlignment(B_ALIGN_LEFT, B_ALIGN_NO_VERTICAL);
|
||||||
font_height fh;
|
|
||||||
be_bold_font->GetHeight(&fh);
|
|
||||||
float xbold, ybold;
|
|
||||||
xbold = fh.descent + 1;
|
|
||||||
ybold = fh.ascent + fh.descent * 2 + fh.leading;
|
|
||||||
|
|
||||||
font_height plainh;
|
BStringView* titleView = new BStringView("title", "SGI image translator");
|
||||||
be_plain_font->GetHeight(&plainh);
|
titleView->SetFont(be_bold_font);
|
||||||
float yplain;
|
titleView->SetExplicitAlignment(labelAlignment);
|
||||||
yplain = plainh.ascent + plainh.descent * 2 + plainh.leading;
|
|
||||||
|
|
||||||
// position the menu field below all the text we draw in Draw()
|
char detail[100];
|
||||||
BPoint textOffset(0.0, yplain * 2 + ybold);
|
sprintf(detail, "Version %d.%d.%d %s",
|
||||||
fCompressionMF->MoveTo(textOffset);
|
static_cast<int>(B_TRANSLATION_MAJOR_VERSION(SGI_TRANSLATOR_VERSION)),
|
||||||
|
static_cast<int>(B_TRANSLATION_MINOR_VERSION(SGI_TRANSLATOR_VERSION)),
|
||||||
|
static_cast<int>(B_TRANSLATION_REVISION_VERSION(SGI_TRANSLATOR_VERSION)),
|
||||||
|
__DATE__);
|
||||||
|
BStringView* detailView = new BStringView("details", detail);
|
||||||
|
detailView->SetExplicitAlignment(labelAlignment);
|
||||||
|
|
||||||
AddChild(fCompressionMF);
|
BTextView* infoView = new BTextView("info");
|
||||||
|
infoView->SetText(BString("written by:\n")
|
||||||
|
.Append(author)
|
||||||
|
.Append("\n\nbased on GIMP SGI plugin v1.5:\n")
|
||||||
|
.Append(kSGICopyright).String());
|
||||||
|
infoView->SetExplicitAlignment(labelAlignment);
|
||||||
|
infoView->SetWordWrap(false);
|
||||||
|
infoView->MakeEditable(false);
|
||||||
|
infoView->MakeResizable(true);
|
||||||
|
infoView->SetViewColor(ui_color(B_PANEL_BACKGROUND_COLOR));
|
||||||
|
|
||||||
|
float padding = 5.0f;
|
||||||
|
AddChild(BGroupLayoutBuilder(B_VERTICAL, padding)
|
||||||
|
.Add(titleView)
|
||||||
|
.Add(detailView)
|
||||||
|
.Add(fCompressionMF)
|
||||||
|
.Add(infoView)
|
||||||
|
.AddGlue()
|
||||||
|
.SetInsets(padding, padding, padding, padding)
|
||||||
|
);
|
||||||
|
|
||||||
ResizeToPreferred();
|
BFont font;
|
||||||
|
GetFont(&font);
|
||||||
|
SetExplicitPreferredSize(
|
||||||
|
BSize((font.Size() * 390) / 12, (font.Size() * 180) / 12));
|
||||||
|
|
||||||
|
// TODO: remove this workaround for ticket #4217
|
||||||
|
infoView->SetExplicitPreferredSize(
|
||||||
|
BSize(infoView->LineWidth(4), infoView->TextHeight(0, 80)));
|
||||||
|
infoView->SetExplicitMaxSize(infoView->ExplicitPreferredSize());
|
||||||
|
infoView->SetExplicitMinSize(infoView->ExplicitPreferredSize());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// ---------------------------------------------------------------
|
// ---------------------------------------------------------------
|
||||||
// Destructor
|
// Destructor
|
||||||
//
|
//
|
||||||
@@ -192,148 +214,5 @@ void
|
|||||||
SGIView::AllAttached()
|
SGIView::AllAttached()
|
||||||
{
|
{
|
||||||
fCompressionMF->Menu()->SetTargetForItems(this);
|
fCompressionMF->Menu()->SetTargetForItems(this);
|
||||||
fCompressionMF->ResizeToPreferred();
|
|
||||||
fCompressionMF->SetDivider(fCompressionMF->StringWidth(fCompressionMF->Label()) + 3);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// ---------------------------------------------------------------
|
|
||||||
// AttachedToWindow
|
|
||||||
//
|
|
||||||
// hack to make the window recognize our size
|
|
||||||
//
|
|
||||||
// Preconditions:
|
|
||||||
//
|
|
||||||
// Parameters: area, not used
|
|
||||||
//
|
|
||||||
// Postconditions:
|
|
||||||
//
|
|
||||||
// Returns:
|
|
||||||
// ---------------------------------------------------------------
|
|
||||||
void
|
|
||||||
SGIView::AttachedToWindow()
|
|
||||||
{
|
|
||||||
// Hack for DataTranslations which doesn't resize visible area to requested by view
|
|
||||||
// which makes some parts of bigger than usual translationviews out of visible area
|
|
||||||
// so if it was loaded to DataTranslations resize window if needed
|
|
||||||
BWindow *window = Window();
|
|
||||||
if (!strcmp(window->Name(), "DataTranslations")) {
|
|
||||||
BView *view = Parent();
|
|
||||||
if (view) {
|
|
||||||
BRect frame = view->Frame();
|
|
||||||
float x, y;
|
|
||||||
GetPreferredSize(&x, &y);
|
|
||||||
if (frame.Width() < x || (frame.Height() - 48) < y) {
|
|
||||||
x -= frame.Width();
|
|
||||||
y -= frame.Height() - 48;
|
|
||||||
if (x < 0) x = 0;
|
|
||||||
if (y < 0) y = 0;
|
|
||||||
|
|
||||||
// DataTranslations has main view called "Background"
|
|
||||||
// change it's resizing mode so it will always resize with window
|
|
||||||
// also make sure view will be redrawed after resize
|
|
||||||
view = window->FindView("Background");
|
|
||||||
if (view) {
|
|
||||||
view->SetResizingMode(B_FOLLOW_ALL);
|
|
||||||
view->SetFlags(B_FULL_UPDATE_ON_RESIZE);
|
|
||||||
}
|
|
||||||
|
|
||||||
// The same with "Info..." button, except redrawing, which isn't needed
|
|
||||||
view = window->FindView("Info" B_UTF8_ELLIPSIS);
|
|
||||||
if (view)
|
|
||||||
view->SetResizingMode(B_FOLLOW_RIGHT | B_FOLLOW_BOTTOM);
|
|
||||||
|
|
||||||
window->ResizeBy( x, y);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// ---------------------------------------------------------------
|
|
||||||
// Draw
|
|
||||||
//
|
|
||||||
// Draws information about the SGITranslator to this view.
|
|
||||||
//
|
|
||||||
// Preconditions:
|
|
||||||
//
|
|
||||||
// Parameters: area, not used
|
|
||||||
//
|
|
||||||
// Postconditions:
|
|
||||||
//
|
|
||||||
// Returns:
|
|
||||||
// ---------------------------------------------------------------
|
|
||||||
void
|
|
||||||
SGIView::Draw(BRect area)
|
|
||||||
{
|
|
||||||
SetFont(be_bold_font);
|
|
||||||
font_height fh;
|
|
||||||
GetFontHeight(&fh);
|
|
||||||
float xbold, ybold;
|
|
||||||
xbold = fh.descent + 1;
|
|
||||||
ybold = fh.ascent + fh.descent * 2 + fh.leading;
|
|
||||||
|
|
||||||
const char* text = "SGI image translator";
|
|
||||||
DrawString(text, BPoint(xbold, ybold));
|
|
||||||
|
|
||||||
SetFont(be_plain_font);
|
|
||||||
font_height plainh;
|
|
||||||
GetFontHeight(&plainh);
|
|
||||||
float yplain;
|
|
||||||
yplain = plainh.ascent + plainh.descent * 2 + plainh.leading;
|
|
||||||
|
|
||||||
char detail[100];
|
|
||||||
sprintf(detail, "Version %d.%d.%d %s",
|
|
||||||
static_cast<int>(B_TRANSLATION_MAJOR_VERSION(SGI_TRANSLATOR_VERSION)),
|
|
||||||
static_cast<int>(B_TRANSLATION_MINOR_VERSION(SGI_TRANSLATOR_VERSION)),
|
|
||||||
static_cast<int>(B_TRANSLATION_REVISION_VERSION(SGI_TRANSLATOR_VERSION)),
|
|
||||||
__DATE__);
|
|
||||||
DrawString(detail, BPoint(xbold, yplain + ybold));
|
|
||||||
|
|
||||||
BPoint offset = fCompressionMF->Frame().LeftBottom();
|
|
||||||
offset.x += xbold;
|
|
||||||
offset.y += 2 * ybold;
|
|
||||||
|
|
||||||
text = "written by:";
|
|
||||||
DrawString(text, offset);
|
|
||||||
offset.y += ybold;
|
|
||||||
|
|
||||||
DrawString(author, offset);
|
|
||||||
offset.y += 2 * ybold;
|
|
||||||
|
|
||||||
text = "based on GIMP SGI plugin v1.5:";
|
|
||||||
DrawString(text, offset);
|
|
||||||
offset.y += ybold;
|
|
||||||
|
|
||||||
DrawString(kSGICopyright, offset);
|
|
||||||
}
|
|
||||||
|
|
||||||
// ---------------------------------------------------------------
|
|
||||||
// Draw
|
|
||||||
//
|
|
||||||
// calculated the preferred size of this view
|
|
||||||
//
|
|
||||||
// Preconditions:
|
|
||||||
//
|
|
||||||
// Parameters: width and height
|
|
||||||
//
|
|
||||||
// Postconditions:
|
|
||||||
//
|
|
||||||
// Returns: in width and height, the preferred size...
|
|
||||||
// ---------------------------------------------------------------
|
|
||||||
void
|
|
||||||
SGIView::GetPreferredSize(float* width, float* height)
|
|
||||||
{
|
|
||||||
*width = fCompressionMF->Bounds().Width();
|
|
||||||
// look at the two biggest strings
|
|
||||||
float width1 = StringWidth(kSGICopyright) + 15.0;
|
|
||||||
if (*width < width1)
|
|
||||||
*width = width1;
|
|
||||||
float width2 = be_plain_font->StringWidth(author) + 15.0;
|
|
||||||
if (*width < width2)
|
|
||||||
*width = width2;
|
|
||||||
|
|
||||||
font_height fh;
|
|
||||||
be_bold_font->GetHeight(&fh);
|
|
||||||
float ybold = fh.ascent + fh.descent * 2 + fh.leading;
|
|
||||||
|
|
||||||
*height = fCompressionMF->Bounds().bottom + 7 * ybold;
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -40,20 +40,14 @@ class BMenuField;
|
|||||||
|
|
||||||
class SGIView : public BView {
|
class SGIView : public BView {
|
||||||
public:
|
public:
|
||||||
SGIView(const BRect &frame, const char *name, uint32 resize,
|
SGIView(const char* name, uint32 flags, TranslatorSettings* settings);
|
||||||
uint32 flags, TranslatorSettings *settings);
|
|
||||||
// sets up the view
|
// sets up the view
|
||||||
|
|
||||||
~SGIView();
|
~SGIView();
|
||||||
// releases the SGITranslator settings
|
// releases the SGITranslator settings
|
||||||
|
|
||||||
virtual void AllAttached();
|
virtual void AllAttached();
|
||||||
virtual void AttachedToWindow();
|
virtual void MessageReceived(BMessage* message);
|
||||||
virtual void MessageReceived(BMessage *message);
|
|
||||||
|
|
||||||
virtual void Draw(BRect area);
|
|
||||||
// draws information about the SGITranslator
|
|
||||||
virtual void GetPreferredSize(float* width, float* height);
|
|
||||||
|
|
||||||
enum {
|
enum {
|
||||||
MSG_COMPRESSION_CHANGED = 'cmch',
|
MSG_COMPRESSION_CHANGED = 'cmch',
|
||||||
@@ -62,7 +56,7 @@ public:
|
|||||||
private:
|
private:
|
||||||
BMenuField* fCompressionMF;
|
BMenuField* fCompressionMF;
|
||||||
|
|
||||||
TranslatorSettings *fSettings;
|
TranslatorSettings* fSettings;
|
||||||
// the actual settings for the translator,
|
// the actual settings for the translator,
|
||||||
// shared with the translator
|
// shared with the translator
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user