Style fixes to BStringView related to docs
This commit is contained in:
@@ -11,8 +11,8 @@
|
|||||||
|
|
||||||
class BStringView : public BView {
|
class BStringView : public BView {
|
||||||
public:
|
public:
|
||||||
BStringView(BRect bounds, const char* name,
|
BStringView(BRect frame, const char* name,
|
||||||
const char* text, uint32 resizeFlags
|
const char* text, uint32 resizingMode
|
||||||
= B_FOLLOW_LEFT | B_FOLLOW_TOP,
|
= B_FOLLOW_LEFT | B_FOLLOW_TOP,
|
||||||
uint32 flags = B_WILL_DRAW);
|
uint32 flags = B_WILL_DRAW);
|
||||||
BStringView(const char* name, const char* text,
|
BStringView(const char* name, const char* text,
|
||||||
@@ -34,7 +34,7 @@ public:
|
|||||||
virtual void AllAttached();
|
virtual void AllAttached();
|
||||||
virtual void AllDetached();
|
virtual void AllDetached();
|
||||||
|
|
||||||
virtual void MakeFocus(bool state = true);
|
virtual void MakeFocus(bool focus = true);
|
||||||
|
|
||||||
virtual void GetPreferredSize(float* _width,
|
virtual void GetPreferredSize(float* _width,
|
||||||
float* _height);
|
float* _height);
|
||||||
|
|||||||
@@ -46,40 +46,43 @@ static property_info sPropertyList[] = {
|
|||||||
|
|
||||||
|
|
||||||
BStringView::BStringView(BRect frame, const char* name, const char* text,
|
BStringView::BStringView(BRect frame, const char* name, const char* text,
|
||||||
uint32 resizeMask, uint32 flags)
|
uint32 resizingMode, uint32 flags)
|
||||||
: BView(frame, name, resizeMask, flags | B_FULL_UPDATE_ON_RESIZE),
|
:
|
||||||
fText(text ? strdup(text) : NULL),
|
BView(frame, name, resizingMode, flags | B_FULL_UPDATE_ON_RESIZE),
|
||||||
fStringWidth(text ? StringWidth(text) : 0.0),
|
fText(text ? strdup(text) : NULL),
|
||||||
fAlign(B_ALIGN_LEFT),
|
fStringWidth(text ? StringWidth(text) : 0.0),
|
||||||
fPreferredSize(-1, -1)
|
fAlign(B_ALIGN_LEFT),
|
||||||
|
fPreferredSize(-1, -1)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
BStringView::BStringView(const char* name, const char* text, uint32 flags)
|
BStringView::BStringView(const char* name, const char* text, uint32 flags)
|
||||||
: BView(name, flags | B_FULL_UPDATE_ON_RESIZE),
|
:
|
||||||
fText(text ? strdup(text) : NULL),
|
BView(name, flags | B_FULL_UPDATE_ON_RESIZE),
|
||||||
fStringWidth(text ? StringWidth(text) : 0.0),
|
fText(text ? strdup(text) : NULL),
|
||||||
fAlign(B_ALIGN_LEFT),
|
fStringWidth(text ? StringWidth(text) : 0.0),
|
||||||
fPreferredSize(-1, -1)
|
fAlign(B_ALIGN_LEFT),
|
||||||
|
fPreferredSize(-1, -1)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
BStringView::BStringView(BMessage* data)
|
BStringView::BStringView(BMessage* archive)
|
||||||
: BView(data),
|
:
|
||||||
fText(NULL),
|
BView(archive),
|
||||||
fStringWidth(0.0),
|
fText(NULL),
|
||||||
fPreferredSize(-1, -1)
|
fStringWidth(0.0),
|
||||||
|
fPreferredSize(-1, -1)
|
||||||
{
|
{
|
||||||
int32 align;
|
int32 align;
|
||||||
if (data->FindInt32("_align", &align) == B_OK)
|
if (archive->FindInt32("_align", &align) == B_OK)
|
||||||
fAlign = (alignment)align;
|
fAlign = (alignment)align;
|
||||||
else
|
else
|
||||||
fAlign = B_ALIGN_LEFT;
|
fAlign = B_ALIGN_LEFT;
|
||||||
|
|
||||||
const char* text;
|
const char* text;
|
||||||
if (data->FindString("_text", &text) != B_OK)
|
if (archive->FindString("_text", &text) != B_OK)
|
||||||
text = NULL;
|
text = NULL;
|
||||||
|
|
||||||
SetText(text);
|
SetText(text);
|
||||||
@@ -93,6 +96,9 @@ BStringView::~BStringView()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// #pragma mark - Archiving methods
|
||||||
|
|
||||||
|
|
||||||
BArchivable*
|
BArchivable*
|
||||||
BStringView::Instantiate(BMessage* data)
|
BStringView::Instantiate(BMessage* data)
|
||||||
{
|
{
|
||||||
@@ -118,7 +124,7 @@ BStringView::Archive(BMessage* data, bool deep) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// #pragma mark -
|
// #pragma mark - Hook methods
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
@@ -158,13 +164,13 @@ BStringView::AllDetached()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// #pragma mark -
|
// #pragma mark - Layout methods
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
BStringView::MakeFocus(bool state)
|
BStringView::MakeFocus(bool focus)
|
||||||
{
|
{
|
||||||
BView::MakeFocus(state);
|
BView::MakeFocus(focus);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -227,6 +233,9 @@ BStringView::LayoutAlignment()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// #pragma mark - More hook methods
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
BStringView::FrameMoved(BPoint newPosition)
|
BStringView::FrameMoved(BPoint newPosition)
|
||||||
{
|
{
|
||||||
@@ -241,9 +250,6 @@ BStringView::FrameResized(float newWidth, float newHeight)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// #pragma mark -
|
|
||||||
|
|
||||||
|
|
||||||
void
|
void
|
||||||
BStringView::Draw(BRect updateRect)
|
BStringView::Draw(BRect updateRect)
|
||||||
{
|
{
|
||||||
@@ -446,7 +452,7 @@ BStringView::LayoutInvalidated(bool descendants)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// #pragma mark -
|
// #pragma mark - Perform
|
||||||
|
|
||||||
|
|
||||||
status_t
|
status_t
|
||||||
@@ -457,22 +463,27 @@ BStringView::Perform(perform_code code, void* _data)
|
|||||||
((perform_data_min_size*)_data)->return_value
|
((perform_data_min_size*)_data)->return_value
|
||||||
= BStringView::MinSize();
|
= BStringView::MinSize();
|
||||||
return B_OK;
|
return B_OK;
|
||||||
|
|
||||||
case PERFORM_CODE_MAX_SIZE:
|
case PERFORM_CODE_MAX_SIZE:
|
||||||
((perform_data_max_size*)_data)->return_value
|
((perform_data_max_size*)_data)->return_value
|
||||||
= BStringView::MaxSize();
|
= BStringView::MaxSize();
|
||||||
return B_OK;
|
return B_OK;
|
||||||
|
|
||||||
case PERFORM_CODE_PREFERRED_SIZE:
|
case PERFORM_CODE_PREFERRED_SIZE:
|
||||||
((perform_data_preferred_size*)_data)->return_value
|
((perform_data_preferred_size*)_data)->return_value
|
||||||
= BStringView::PreferredSize();
|
= BStringView::PreferredSize();
|
||||||
return B_OK;
|
return B_OK;
|
||||||
|
|
||||||
case PERFORM_CODE_LAYOUT_ALIGNMENT:
|
case PERFORM_CODE_LAYOUT_ALIGNMENT:
|
||||||
((perform_data_layout_alignment*)_data)->return_value
|
((perform_data_layout_alignment*)_data)->return_value
|
||||||
= BStringView::LayoutAlignment();
|
= BStringView::LayoutAlignment();
|
||||||
return B_OK;
|
return B_OK;
|
||||||
|
|
||||||
case PERFORM_CODE_HAS_HEIGHT_FOR_WIDTH:
|
case PERFORM_CODE_HAS_HEIGHT_FOR_WIDTH:
|
||||||
((perform_data_has_height_for_width*)_data)->return_value
|
((perform_data_has_height_for_width*)_data)->return_value
|
||||||
= BStringView::HasHeightForWidth();
|
= BStringView::HasHeightForWidth();
|
||||||
return B_OK;
|
return B_OK;
|
||||||
|
|
||||||
case PERFORM_CODE_GET_HEIGHT_FOR_WIDTH:
|
case PERFORM_CODE_GET_HEIGHT_FOR_WIDTH:
|
||||||
{
|
{
|
||||||
perform_data_get_height_for_width* data
|
perform_data_get_height_for_width* data
|
||||||
@@ -481,12 +492,14 @@ BStringView::Perform(perform_code code, void* _data)
|
|||||||
&data->preferred);
|
&data->preferred);
|
||||||
return B_OK;
|
return B_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
case PERFORM_CODE_SET_LAYOUT:
|
case PERFORM_CODE_SET_LAYOUT:
|
||||||
{
|
{
|
||||||
perform_data_set_layout* data = (perform_data_set_layout*)_data;
|
perform_data_set_layout* data = (perform_data_set_layout*)_data;
|
||||||
BStringView::SetLayout(data->layout);
|
BStringView::SetLayout(data->layout);
|
||||||
return B_OK;
|
return B_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
case PERFORM_CODE_LAYOUT_INVALIDATED:
|
case PERFORM_CODE_LAYOUT_INVALIDATED:
|
||||||
{
|
{
|
||||||
perform_data_layout_invalidated* data
|
perform_data_layout_invalidated* data
|
||||||
@@ -494,6 +507,7 @@ BStringView::Perform(perform_code code, void* _data)
|
|||||||
BStringView::LayoutInvalidated(data->descendants);
|
BStringView::LayoutInvalidated(data->descendants);
|
||||||
return B_OK;
|
return B_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
case PERFORM_CODE_DO_LAYOUT:
|
case PERFORM_CODE_DO_LAYOUT:
|
||||||
{
|
{
|
||||||
BStringView::DoLayout();
|
BStringView::DoLayout();
|
||||||
@@ -505,12 +519,17 @@ BStringView::Perform(perform_code code, void* _data)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// #pragma mark - FBC padding methods
|
||||||
|
|
||||||
|
|
||||||
void BStringView::_ReservedStringView1() {}
|
void BStringView::_ReservedStringView1() {}
|
||||||
void BStringView::_ReservedStringView2() {}
|
void BStringView::_ReservedStringView2() {}
|
||||||
void BStringView::_ReservedStringView3() {}
|
void BStringView::_ReservedStringView3() {}
|
||||||
|
|
||||||
|
|
||||||
|
// #pragma mark - Private methods
|
||||||
|
|
||||||
|
|
||||||
BStringView&
|
BStringView&
|
||||||
BStringView::operator=(const BStringView&)
|
BStringView::operator=(const BStringView&)
|
||||||
{
|
{
|
||||||
@@ -519,9 +538,6 @@ BStringView::operator=(const BStringView&)
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// #pragma mark -
|
|
||||||
|
|
||||||
|
|
||||||
BSize
|
BSize
|
||||||
BStringView::_ValidatePreferredSize()
|
BStringView::_ValidatePreferredSize()
|
||||||
{
|
{
|
||||||
@@ -552,4 +568,3 @@ B_IF_GCC_2(InvalidateLayout__11BStringViewb,
|
|||||||
|
|
||||||
view->Perform(PERFORM_CODE_LAYOUT_INVALIDATED, &data);
|
view->Perform(PERFORM_CODE_LAYOUT_INVALIDATED, &data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user