SGITranslator: style fixes for SGIView
This commit is contained in:
@@ -30,6 +30,9 @@
|
|||||||
// DEALINGS IN THE SOFTWARE.
|
// DEALINGS IN THE SOFTWARE.
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
|
|
||||||
|
#include "SGIView.h"
|
||||||
|
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
@@ -46,13 +49,14 @@
|
|||||||
|
|
||||||
#include "SGIImage.h"
|
#include "SGIImage.h"
|
||||||
#include "SGITranslator.h"
|
#include "SGITranslator.h"
|
||||||
#include "SGIView.h"
|
|
||||||
|
|
||||||
const char* author = "Stephan Aßmus, <[email protected]>";
|
const char* author = "Stephan Aßmus, <[email protected]>";
|
||||||
|
|
||||||
#undef B_TRANSLATION_CONTEXT
|
#undef B_TRANSLATION_CONTEXT
|
||||||
#define B_TRANSLATION_CONTEXT "SGIView"
|
#define B_TRANSLATION_CONTEXT "SGIView"
|
||||||
|
|
||||||
|
|
||||||
// add_menu_item
|
// add_menu_item
|
||||||
void
|
void
|
||||||
add_menu_item(BMenu* menu,
|
add_menu_item(BMenu* menu,
|
||||||
@@ -67,19 +71,7 @@ add_menu_item(BMenu* menu,
|
|||||||
menu->AddItem(item);
|
menu->AddItem(item);
|
||||||
}
|
}
|
||||||
|
|
||||||
// ---------------------------------------------------------------
|
|
||||||
// Constructor
|
|
||||||
//
|
|
||||||
// Sets up the view settings
|
|
||||||
//
|
|
||||||
// Preconditions:
|
|
||||||
//
|
|
||||||
// Parameters:
|
|
||||||
//
|
|
||||||
// Postconditions:
|
|
||||||
//
|
|
||||||
// Returns:
|
|
||||||
// ---------------------------------------------------------------
|
|
||||||
SGIView::SGIView(const char* name, uint32 flags, TranslatorSettings* settings)
|
SGIView::SGIView(const char* name, uint32 flags, TranslatorSettings* settings)
|
||||||
:
|
:
|
||||||
BView(name, flags, new BGroupLayout(B_VERTICAL)),
|
BView(name, flags, new BGroupLayout(B_VERTICAL)),
|
||||||
@@ -144,8 +136,8 @@ SGIView::SGIView(const char* name, uint32 flags, TranslatorSettings* settings)
|
|||||||
|
|
||||||
BFont font;
|
BFont font;
|
||||||
GetFont(&font);
|
GetFont(&font);
|
||||||
SetExplicitPreferredSize(
|
SetExplicitPreferredSize(BSize((font.Size() * 390) / 12,
|
||||||
BSize((font.Size() * 390) / 12, (font.Size() * 180) / 12));
|
(font.Size() * 180) / 12));
|
||||||
|
|
||||||
// TODO: remove this workaround for ticket #4217
|
// TODO: remove this workaround for ticket #4217
|
||||||
infoView->SetExplicitPreferredSize(
|
infoView->SetExplicitPreferredSize(
|
||||||
@@ -155,37 +147,19 @@ SGIView::SGIView(const char* name, uint32 flags, TranslatorSettings* settings)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// ---------------------------------------------------------------
|
|
||||||
// Destructor
|
|
||||||
//
|
|
||||||
// Does nothing
|
|
||||||
//
|
|
||||||
// Preconditions:
|
|
||||||
//
|
|
||||||
// Parameters:
|
|
||||||
//
|
|
||||||
// Postconditions:
|
|
||||||
//
|
|
||||||
// Returns:
|
|
||||||
// ---------------------------------------------------------------
|
|
||||||
SGIView::~SGIView()
|
SGIView::~SGIView()
|
||||||
{
|
{
|
||||||
fSettings->Release();
|
fSettings->Release();
|
||||||
}
|
}
|
||||||
|
|
||||||
// ---------------------------------------------------------------
|
|
||||||
// MessageReceived
|
void
|
||||||
//
|
SGIView::AllAttached()
|
||||||
// Handles state changes of the Compression menu field
|
{
|
||||||
//
|
fCompressionMF->Menu()->SetTargetForItems(this);
|
||||||
// Preconditions:
|
}
|
||||||
//
|
|
||||||
// Parameters: area, not used
|
|
||||||
//
|
|
||||||
// Postconditions:
|
|
||||||
//
|
|
||||||
// Returns:
|
|
||||||
// ---------------------------------------------------------------
|
|
||||||
void
|
void
|
||||||
SGIView::MessageReceived(BMessage* message)
|
SGIView::MessageReceived(BMessage* message)
|
||||||
{
|
{
|
||||||
@@ -203,23 +177,3 @@ SGIView::MessageReceived(BMessage* message)
|
|||||||
BView::MessageReceived(message);
|
BView::MessageReceived(message);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// ---------------------------------------------------------------
|
|
||||||
// AllAttached
|
|
||||||
//
|
|
||||||
// sets the target for the controls controlling the configuration
|
|
||||||
//
|
|
||||||
// Preconditions:
|
|
||||||
//
|
|
||||||
// Parameters: area, not used
|
|
||||||
//
|
|
||||||
// Postconditions:
|
|
||||||
//
|
|
||||||
// Returns:
|
|
||||||
// ---------------------------------------------------------------
|
|
||||||
void
|
|
||||||
SGIView::AllAttached()
|
|
||||||
{
|
|
||||||
fCompressionMF->Menu()->SetTargetForItems(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|||||||
@@ -29,15 +29,17 @@
|
|||||||
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
|
||||||
// DEALINGS IN THE SOFTWARE.
|
// DEALINGS IN THE SOFTWARE.
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
#ifndef SGIVIEW_H
|
#ifndef SGIVIEW_H
|
||||||
#define SGIVIEW_H
|
#define SGIVIEW_H
|
||||||
|
|
||||||
|
|
||||||
#include <View.h>
|
#include <View.h>
|
||||||
#include "TranslatorSettings.h"
|
#include "TranslatorSettings.h"
|
||||||
|
|
||||||
|
|
||||||
class BMenuField;
|
class BMenuField;
|
||||||
|
|
||||||
|
|
||||||
class SGIView : public BView {
|
class SGIView : public BView {
|
||||||
public:
|
public:
|
||||||
SGIView(const char* name, uint32 flags, TranslatorSettings* settings);
|
SGIView(const char* name, uint32 flags, TranslatorSettings* settings);
|
||||||
@@ -57,8 +59,8 @@ 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
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
#endif // #ifndef SGIVIEW_H
|
#endif // #ifndef SGIVIEW_H
|
||||||
|
|||||||
Reference in New Issue
Block a user