本文整理汇总了C++中BTabView::SetTabWidth方法的典型用法代码示例。如果您正苦于以下问题:C++ BTabView::SetTabWidth方法的具体用法?C++ BTabView::SetTabWidth怎么用?C++ BTabView::SetTabWidth使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类BTabView
的用法示例。
在下文中一共展示了BTabView::SetTabWidth方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: tst
void
set_tab_width(struct MyGadget *gd,int val)
{
BTabView *bt;
WrkWindow *wi;
button_width tb;
if (wi = (WrkWindow *)gd->pt->Window())
{
BAutolock tst(wi);
if (bt = (BTabView *)((GadView *)gd->pt)->ChildAt(0))
{
switch(val)
{
case 0: tb = B_WIDTH_FROM_WIDEST; break;
case 1: tb = B_WIDTH_AS_USUAL; break;
case 2: tb = B_WIDTH_FROM_LABEL; break;
}
bt->SetTabWidth(tb);
bt->Invalidate();
gd->pt->Invalidate();
}
}
}
示例2: AddViews
void SeqPrefWin::AddViews(const BMessage& prefs)
{
BRect b = Bounds();
/* Add the bottom panel with the Cancel OK buttons. When this
* block is done, it will adjust the bounds accordingly (i.e.,
* without the space used by this view).
*/
{
float buttonW = 60, buttonH = 24;
float edgeR = 8, edgeB = 8, edgeT = 8;
BRect f(b);
f.top = f.bottom - edgeB - buttonH - edgeT;
BView* v = new BView( f, "button_panel", B_FOLLOW_LEFT_RIGHT | B_FOLLOW_BOTTOM, 0 );
if( v ) {
BRect f( b.right - edgeR - buttonW, edgeT, b.right - edgeR, edgeT + buttonH );
BButton* button = new BButton( f, "ok_button", "OK", new BMessage( OK_MSG ), B_FOLLOW_RIGHT | B_FOLLOW_BOTTOM );
if( button ) {
v->AddChild( button );
button->MakeDefault( true );
}
f.OffsetBy( 0-(buttonW + 10), 0 );
button = new BButton( f, "cancel_button", "Cancel", new BMessage( CANCEL_MSG ), B_FOLLOW_RIGHT | B_FOLLOW_BOTTOM );
if( button ) v->AddChild( button );
v->SetViewColor( Prefs().Color(AM_AUX_WINDOW_BG_C) );
AddChild( v );
b.bottom = b.bottom - edgeB - buttonH - edgeT - 1;
}
}
BTabView* tv = new BTabView(b, TABVIEW_STR);
if (!tv) return;
BView* fileView = NewFileView(b, prefs);
if (fileView) tv->AddTab(fileView);
BView* editView = NewEditView(b, prefs);
if (editView) tv->AddTab(editView);
BView* playbackView = NewTrackView(b, prefs);
if (playbackView) tv->AddTab(playbackView);
mFactoryView = NewFactoriesView(b, prefs);
if (mFactoryView) tv->AddTab(mFactoryView);
AddChild(tv);
/* NOTE: Have to do this after the tab view's been added to the window or else
* you get a crash. It's a bug in the tab view, nothing to be done about it.
*/
tv->SetTabWidth(B_WIDTH_FROM_WIDEST);
}