예제 #1
0
CWaypoints::CPoint::CPoint(double dLon, double dLat, int iAltitude, const wchar_t * wcName)
: m_OSMPropList()
{
	static int iNextId = 0;
	m_iId = iNextId++;
	m_dLongitude = dLon;
	m_dLatitude = dLat;
	Cache();
	m_iAltitude = iAltitude;
	SetLabel(wcName);
	m_iRadius = 0;
	SYSTEMTIME st;
	FILETIME ft;
	GetSystemTime(&st);
	SystemTimeToFileTime(&st, &ft);
	m_dLastUsed = double(ft.dwHighDateTime) * double(1 << 16) * double(1 << 16) 
		+ double(ft.dwLowDateTime);
	m_fInProximity = false;
}
예제 #2
0
bool wxStaticText::Create(wxWindow *parent, wxWindowID id,
           const wxString& label,
           const wxPoint& pos,
           const wxSize& size,
           long style,
           const wxString& name)
{
    if( !CreateControl( parent, id, pos, size, style,
                        wxDefaultValidator, name ) )
        return false;
    m_labelWidget = (WXWidget) 0;
    PreCreation();

    Widget parentWidget = (Widget) parent->GetClientWidget();

    Widget borderWidget =
        (Widget) wxCreateBorderWidget( (WXWidget)parentWidget, style );

    m_labelWidget =
        XtVaCreateManagedWidget (name.mb_str(),
            xmLabelWidgetClass,
            borderWidget ? borderWidget : parentWidget,
            wxFont::GetFontTag(), m_font.GetFontTypeC(XtDisplay(parentWidget)),
            XmNalignment, ((style & wxALIGN_RIGHT)  ? XmALIGNMENT_END :
                          ((style & wxALIGN_CENTRE) ? XmALIGNMENT_CENTER :
                                                      XmALIGNMENT_BEGINNING)),
            XmNrecomputeSize, ((style & wxST_NO_AUTORESIZE) ? TRUE : FALSE),
            NULL);

    m_mainWidget = borderWidget ? borderWidget : m_labelWidget;

    SetLabel(label);

    wxSize best = GetBestSize();
    if( size.x != -1 ) best.x = size.x;
    if( size.y != -1 ) best.y = size.y;

    PostCreation();
    AttachWidget (parent, m_mainWidget, (WXWidget) NULL,
                  pos.x, pos.y, best.x, best.y);

    return true;
}
예제 #3
0
void Matrix::Read(FILE *f) {
  int r, c;
  char buffer[100];

  fscanf(f, " %s =", buffer);
  buffer[strlen(buffer) - 1] = 0;
  SetLabel(buffer);

  fscanf(f, " [ %d x %d ]", &r, &c);
  Dimension(r, c);

  for (int c = 0; c < cols; c++) {
    fscanf(f, " %s", buffer);
    SetColumnLabel(c, buffer);
  }

  for (int r = 0; r < rows; r++)
    for (int c = 0; c < cols; c++) fscanf(f, " %lf", &((*this)[r][c]));
}
예제 #4
0
bool wxMenu::HandleCommandUpdateStatus( wxMenuItem* item, wxWindow* senderWindow )
{
    int menuid = item ? item->GetId() : 0;
    wxUpdateUIEvent event(menuid);
    event.SetEventObject( this );

    bool processed = false;

    // Try the menu's event handler
    {
        wxEvtHandler *handler = GetEventHandler();
        if ( handler )
            processed = handler->ProcessEvent(event);
    }

    // Try the window the menu was popped up from
    // (and up through the hierarchy)
    if ( !processed )
    {
        wxWindow *win = GetWindow();
        if ( win )
            processed = win->HandleWindowEvent(event);
    }

    if ( !processed && senderWindow != NULL)
    {
        processed = senderWindow->HandleWindowEvent(event);
    }

    if ( processed )
    {
        // if anything changed, update the changed attribute
        if (event.GetSetText())
            SetLabel(menuid, event.GetText());
        if (event.GetSetChecked())
            Check(menuid, event.GetChecked());
        if (event.GetSetEnabled())
            Enable(menuid, event.GetEnabled());
    }

    return processed;
}
예제 #5
0
void InputRequest::Init(const char* label, const char* text, const char* btn0_label, const char* btn1_label, const char* btn2_label)
{
  BRect frame = Bounds();
  fIrView = new InputRequestView(frame, btn0_label, btn1_label, btn2_label);

  // now move and resize the window with the calculated width of our view
  BRect	screenRect = fScreen.Frame();
  MoveTo(BPoint(screenRect.Width()/2-fIrView->Width()/2, screenRect.Height()/2-IR_WINDOW_HEIGHT/2-125));
  ResizeTo(fIrView->Width(), IR_WINDOW_HEIGHT);

  AddChild(fIrView);

  SetLabel(label);
  SetText(text);

  fIrView->SelectText();

  //init
  fButton_index = -1;
}
예제 #6
0
파일: PieView.cpp 프로젝트: ysei/haiku
AppMenuItem::AppMenuItem(const char* appSig, int category)
	:
	BMenuItem(kEmptyStr, NULL),
	fCategory(category),
	fIcon(NULL),
	fIsValid(false)
{
	if (be_roster->FindApp(appSig, &fAppRef) == B_NO_ERROR) {
		fIcon = new BBitmap(BRect(0.0, 0.0, 15.0, 15.0), B_RGBA32);
		if (BNodeInfo::GetTrackerIcon(&fAppRef, fIcon, B_MINI_ICON) == B_OK) {
			BEntry appEntry(&fAppRef);
			if (appEntry.InitCheck() == B_OK) {
				char name[B_FILE_NAME_LENGTH];
				appEntry.GetName(name);
				SetLabel(name);
				fIsValid = true;
			}
		}
	}
}
예제 #7
0
void CargoBody::Init()
{
	m_hitpoints = 1.0f;
	SetLabel(Equip::types[m_type].name);
	SetMassDistributionFromModel();

	std::vector<Color> colors;
	//metallic blue-orangeish color scheme
	colors.push_back(Color(255, 198, 64));
	colors.push_back(Color(0, 222, 255));
	colors.push_back(Color(255, 255, 255));

	SceneGraph::ModelSkin skin;
	skin.SetColors(colors);
	skin.SetDecal("pioneer");
	skin.Apply(GetModel());
	GetModel()->SetColors(colors);

	Properties().Set("type", EnumStrings::GetString("EquipType", m_type));
}
예제 #8
0
void GCardReaderMenu::ShowChipCardDetected()
{
	const char* arypcLabels[8];

	SetLabel(GSoftKeysWindowTemplate::eSOFT_R3, " "); //hide the label


	memset( arypcLabels, 0, sizeof(arypcLabels) );


	arypcLabels[0] = "";
	arypcLabels[1] = "";
	arypcLabels[2] = "";
	arypcLabels[3] = "Chip detected,";
	arypcLabels[4] = "";
	arypcLabels[5] = "please wait...";
	arypcLabels[6] = " ";

	UpdateUserLabels(7, arypcLabels);
}
예제 #9
0
//------------------------------------------------------------------------------
void BMenuField::InitObject(const char *label)
{
	fLabel = NULL;
	fMenu = NULL;
	fMenuBar = NULL;
	fAlign = B_ALIGN_LEFT;
	fStringWidth = 0;
	fEnabled = true;
	fSelected = false;
	fTransition = false;
	fFixedSizeMB = false;
	fMenuTaskID = -1;

	SetLabel(label);

	if (label)
		fDivider = (float)floor(Frame().Width() / 2.0f);
	else
		fDivider = 0;
}
예제 #10
0
void ModPanel::OnPanelProps(wxCommandEvent& event) {
  // Get the copied node:
  iONode ini = (iONode)event.GetClientData();
  if( ini != NULL && StrOp.equals( wModPlan.name(), NodeOp.getName( ini ) ) ) {
    // PropertiesDialog:
    m_ModPlanDlg = new ModPlanDlg( this, ini );
    if( wxID_OK == m_ModPlanDlg->ShowModal() ) {
      SetLabel(wxString( wModPlan.getsubtitle( ini ),wxConvUTF8 ));
      wxGetApp().getFrame()->setPlanTitle( wModPlan.gettitle( ini ) );
    }
    m_ModPlanDlg->Destroy();
    m_ModPlanDlg = NULL;
  }
  else {
    iONode cmd = NodeOp.inst( wSysCmd.name(), NULL, ELEMENT_NODE );
    wSysCmd.setcmd( cmd, wSysCmd.getmodplan );
    wxGetApp().sendToRocrail( cmd, false );
    cmd->base.del(cmd);
  }
}
예제 #11
0
ExplanationLabel::ExplanationLabel(wxWindow *parent, const wxString& label)
    : wxStaticText(parent, wxID_ANY, ""),
      m_text(label),
      m_wrapWidth(-1)
{
    m_text.Replace("\n", " ");
    SetLabel(m_text);

#if defined(__WXOSX__)
    SetWindowVariant(wxWINDOW_VARIANT_SMALL);
    SetForegroundColour(wxColour("#777777"));
#elif defined(__WXGTK__)
    SetWindowVariant(wxWINDOW_VARIANT_SMALL);
#else
    SetForegroundColour(wxSystemSettings::GetColour(wxSYS_COLOUR_GRAYTEXT));
#endif

    SetInitialSize(wxSize(10,10));
    Bind(wxEVT_SIZE, &ExplanationLabel::OnSize, this);
}
예제 #12
0
void wxGenericFontButton::UpdateFont()
{
    if ( !m_selectedFont.Ok() )
        return;

    SetForegroundColour(m_data.GetColour());

    if (HasFlag(wxFNTP_USEFONT_FOR_LABEL))
    {
        // use currently selected font for the label...
        wxButton::SetFont(m_selectedFont);
    }

    if (HasFlag(wxFNTP_FONTDESC_AS_LABEL))
    {
        SetLabel(wxString::Format(wxT("%s, %d"),
                 m_selectedFont.GetFaceName().c_str(),
                 m_selectedFont.GetPointSize()));
    }
}
CViewHeader::CViewHeader(wxWindow* pParent, const wxString& label)
{
	Create(pParent, wxID_ANY);

	m_pComboBox = new CComboBoxEx(this);
	m_pLabel = new wxStaticText(this, wxID_ANY, label, wxDefaultPosition, wxDefaultSize);
	wxSize size = GetSize();
	size.SetHeight(m_pComboBox->GetBestSize().GetHeight() + border_offset);

	SetLabel(label);

	SetSize(size);

#ifdef __WXMSW__
	m_pComboBox->Connect(wxID_ANY, wxEVT_PAINT, (wxObjectEventFunction)(wxEventFunction)(wxPaintEventFunction)&CViewHeader::OnComboPaint, 0, this);
	m_pComboBox->Connect(wxID_ANY, wxEVT_LEFT_DOWN, (wxObjectEventFunction)(wxEventFunction)(wxMouseEventFunction)&CViewHeader::OnComboMouseEvent, 0, this);
	m_pComboBox->Connect(wxID_ANY, wxEVT_LEFT_UP, (wxObjectEventFunction)(wxEventFunction)(wxMouseEventFunction)&CViewHeader::OnComboMouseEvent, 0, this);
	m_bLeftMousePressed = false;
#endif //__WXMSW__
}
예제 #14
0
bool TSliderComponent::ChangeProperty(string APropertyName, string APropertyValue)
{
	ShowDebug(string("ChangeProperty Name=") + APropertyName + string(" Value=") + APropertyValue);
	if (LockLooper())
	{
		FPropertyList->SetPropertyValue(APropertyName,APropertyValue);												
		SetStandardProperties(APropertyName.c_str(),APropertyValue.c_str());
		SetFrameProperties(APropertyName.c_str(),APropertyValue.c_str(),this);																			
		SetSizingProperties(APropertyName.c_str(),APropertyValue.c_str(),this);
		SetFlagsProperties(APropertyName.c_str(),APropertyValue.c_str(),this);	
		if (FindPropertyName(APropertyName,PROP_LABEL)) SetLabel(APropertyValue.c_str());

		if (FindPropertyName(APropertyName,PROP_MESSAGE)) ((TSliderCodeGenerator *)FCodeGenerator)->CreateMessageReceived(!FLoaded);
		
		UnlockLooper();
		return TComponent::ChangeProperty(APropertyName,APropertyValue);		
	}
	return false;

}
예제 #15
0
bool ProjectPanel::Create( wxWindow* parent, wxWindowID id, const wxPoint& pos, const wxSize& size, long style )
{
////@begin ProjectPanel member initialisation
   m_ProjectCtrl = NULL;
////@end ProjectPanel member initialisation

////@begin ProjectPanel creation
   wxPanel::Create( parent, id, pos, size, style );

   CreateControls();
   if (GetSizer())
   {
      GetSizer()->SetSizeHints(this);
   }
////@end ProjectPanel creation
   
   SetLabel( SYMBOL_PROJECTPANEL_TITLE );

   return true;
}
예제 #16
0
TextPointer::TextPointer(GuiText *parent, int w, int h)
	: GuiButton(w, h)
{
	TextPtr = parent;
	fontsize = TextPtr->GetFontSize();
	MarkImage = NULL;
	currentline = -1;
	Position_X = 0;
	Position_Y = 0;
	width = w;
	height = h;
	visibility = true;

	TextPointerImgData = Resources::GetImageData("textpointer_img.png");
	TextPointerImg = new GuiImage(TextPointerImgData);
	TextPointerImg->SetVisible(visibility);

	SetLabel(TextPtr);
	SetImage(TextPointerImg);
}
예제 #17
0
// Update a menu and all submenus recursively. source is the object that has
// the update event handlers defined for it. If NULL, the menu or associated
// window will be used.
void wxMenuBase::UpdateUI(wxEvtHandler* source)
{
    wxWindow * const win = GetWindow();

    if ( !source && win )
        source = win->GetEventHandler();
    if ( !source )
        source = GetEventHandler();
    if ( !source )
        source = this;

    wxMenuItemList::compatibility_iterator  node = GetMenuItems().GetFirst();
    while ( node )
    {
        wxMenuItem* item = node->GetData();
        if ( !item->IsSeparator() )
        {
            wxWindowID itemid = item->GetId();
            wxUpdateUIEvent event(itemid);
            event.SetEventObject( source );

            if ( source->ProcessEvent(event) )
            {
                // if anything changed, update the changed attribute
                if (event.GetSetText())
                    SetLabel(itemid, event.GetText());
                if (event.GetSetChecked())
                    Check(itemid, event.GetChecked());
                if (event.GetSetEnabled())
                    Enable(itemid, event.GetEnabled());
            }

            // recurse to the submenus
            if ( item->GetSubMenu() )
                item->GetSubMenu()->UpdateUI(source);
        }
        //else: item is a separator (which doesn't process update UI events)

        node = node->GetNext();
    }
}
예제 #18
0
//
// Initialize the toolbar
//
void ToolBar::Create( wxWindow *parent )
{
   // Save parameters
   mParent = parent;

   // Create the window and label it
   wxPanel::Create( mParent,
                    mType,
                    wxDefaultPosition,
                    wxDefaultSize,
                    wxNO_BORDER | wxTAB_TRAVERSAL,
                    mTitle );
   SetLabel( mLabel );

   // Go do the rest of the creation
   ReCreateButtons();

   // Let the user see it in all its glory
   Show();
   mVisible = true;
}
예제 #19
0
void CargoBody::Init()
{
	m_hitpoints = 1.0f;
	SetLabel(ScopedTable(m_cargo).CallMethod<std::string>("GetName"));
	SetMassDistributionFromModel();
	m_hasSelfdestruct = true;

	std::vector<Color> colors;
	//metallic blue-orangeish color scheme
	colors.push_back(Color(255, 198, 64));
	colors.push_back(Color(0, 222, 255));
	colors.push_back(Color(255, 255, 255));

	SceneGraph::ModelSkin skin;
	skin.SetColors(colors);
	skin.SetDecal("pioneer");
	skin.Apply(GetModel());
	GetModel()->SetColors(colors);

	Properties().Set("type", ScopedTable(m_cargo).CallMethod<std::string>("GetName"));
}
예제 #20
0
bool wxStaticText::Create( wxWindow *parent,
    wxWindowID id,
    const wxString& label,
    const wxPoint& pos,
    const wxSize& size,
    long style,
    const wxString& name )
{
    m_macIsUserPane = false;

    if ( !wxControl::Create( parent, id, pos, size, style, wxDefaultValidator, name ) )
        return false;

    m_peer = wxWidgetImpl::CreateStaticText( this, parent, id, label, pos, size, style, GetExtraStyle() );

    MacPostControlCreate( pos, size );

    SetLabel(label);

    return true;
}
예제 #21
0
void SpectralSelectionBar::UpdatePrefs()
{
   {
      wxCommandEvent e(EVT_FREQUENCYTEXTCTRL_UPDATED);
      e.SetInt((mbCenterAndWidth? mCenterCtrl : mLowCtrl)->GetFormatIndex());
      OnUpdate(e);
   }

   if (mbCenterAndWidth)
   {
      wxCommandEvent e(EVT_BANDWIDTHTEXTCTRL_UPDATED);
      e.SetInt(mWidthCtrl->GetFormatIndex());
      OnUpdate(e);
   }

   // Set label to pull in language change
   SetLabel(_("Spectral Selection"));

   // Give base class a chance
   ToolBar::UpdatePrefs();
}
예제 #22
0
void ToyLabelWidget::Recv(const QString &path, const OSCArgument *args, size_t count)
{
	QString str;
	if(args && count>0)
	{
		std::string s;
		if( args[0].GetString(s) )
			str = QString::fromUtf8(s.c_str());
	}
	
	if(path == m_TriggerPath)
	{
		FadeLabel *label = static_cast<FadeLabel*>(m_Widget);
		if( m_pClient )
			m_pClient->ToyClient_ResourceRelativePathToAbsolute(str);
		label->SetImagePath(IMAGE_PATH_INDEX_FROM_TRIGGER, str);
		label->SetImageIndex(IMAGE_PATH_INDEX_FROM_TRIGGER);
	}
	else
		SetLabel(str);
}
/*****
Set the value from a Color field. The format should contain %s.
*****/
void tmwxStaticText::SetLabelFormatted(const wxChar* format, 
  const tmFacet::Color c)
{
  wxString text, ktext;
  switch(c) {
    case tmFacet::NOT_ORIENTED:
      ktext = wxT("not oriented");
      break;
    case tmFacet::COLOR_UP:
      ktext = wxT("color up");
      break;
    case tmFacet::WHITE_UP:
      ktext = wxT("white up");
      break;
    default:
      TMFAIL("unknown Color encountered in "\
        "tmwxStaticText::SetLabelFormatted(..)");
  }
  text.Printf(format, ktext.c_str());
  SetLabel(text);
}
예제 #24
0
bool wxHyperlinkCtrl::Create(wxWindow *parent,
                             wxWindowID id,
                             const wxString& label, const wxString& url,
                             const wxPoint& pos,
                             const wxSize& size,
                             long style,
                             const wxString& name)
{
    if ( !HasNativeHyperlinkCtrl() )
    {
        return wxGenericHyperlinkCtrl::Create( parent, id, label, url, pos,
                                               size, style, name );
    }

    if ( !CreateControl(parent, id, pos, size, style,
                        wxDefaultValidator, name) )
    {
        return false;
    }

    SetURL( url );
    SetVisited( false );

    WXDWORD exstyle;
    WXDWORD msStyle = MSWGetStyle(style, &exstyle);

    if ( !MSWCreateControl(WC_LINK, msStyle, pos, size,
                           GetLabelForSysLink( label, url ), exstyle) )
    {
        return false;
    }

    // Make sure both the label and URL are non-empty strings.
    SetURL(url.empty() ? label : url);
    SetLabel(label.empty() ? url : label);

    ConnectMenuHandlers();

    return true;
}
예제 #25
0
void FindReplaceDialog::ShowReplaceControls(bool show)
{
    // detach the find string & its label from the gridbag sizer
    bool isFindDlg(false);
    isFindDlg = gbSizer->GetItemPosition(sz) == wxGBPosition(1, 0);
    if(show == false) {
        // is this dialog is already a 'Find' dialog?
        if(isFindDlg) { return; }

        // remove 'Replace' dialog items
        gbSizer->Detach(m_replaceWithLabel);
        gbSizer->Detach(m_replaceString);

        // reposition the options static sizer
        gbSizer->Detach(sz);
        gbSizer->Add(sz, wxGBPosition(1, 0), wxGBSpan(1, 2), wxALL | wxEXPAND, 5);

    } else {
        // is this dialog is already a 'Replace' dialog?
        if(!isFindDlg) { return; }

        // remmove the 'Options' item frmo pos 1,0
        gbSizer->Detach(sz);
        gbSizer->Add(m_replaceWithLabel, wxGBPosition(1, 0), wxDefaultSpan, wxALL | wxEXPAND, 5);
        gbSizer->Add(m_replaceString, wxGBPosition(1, 1), wxDefaultSpan, wxALL | wxEXPAND, 5);
        gbSizer->Add(sz, wxGBPosition(2, 0), wxGBSpan(1, 2), wxALL | wxEXPAND, 5);
    }

    wxString label = show ? wxT("Replace") : wxT("Find");
    m_replace->Show(show);
    m_replaceAll->Show(show);
    m_replaceString->Show(show);
    m_replacementsMsg->Show(show);
    m_replaceWithLabel->Show(show);
    m_selectionOnly->Show(show);

    SetLabel(label);
    this->Fit();
    GetSizer()->Layout();
}
예제 #26
0
void
BBox::_InitObject(BMessage* archive)
{
	fBounds = Bounds();

	fLabel = NULL;
	fLabelView = NULL;
	fLayoutData = new LayoutData;

	int32 flags = 0;

	BFont font(be_bold_font);

	if (!archive || !archive->HasString("_fname"))
		flags = B_FONT_FAMILY_AND_STYLE;

	if (!archive || !archive->HasFloat("_fflt"))
		flags |= B_FONT_SIZE;

	if (flags != 0)
		SetFont(&font, flags);

	if (archive != NULL) {
		const char *string;
		if (archive->FindString("_label", &string) == B_OK)
			SetLabel(string);

		bool fancy;
		int32 style;

		if (archive->FindBool("_style", &fancy) == B_OK)
			fStyle = fancy ? B_FANCY_BORDER : B_PLAIN_BORDER;
		else if (archive->FindInt32("_style", &style) == B_OK)
			fStyle = (border_style)style;

		bool hasLabelView;
		if (archive->FindBool("_lblview", &hasLabelView) == B_OK)
			fLabelView = ChildAt(0);
	}
}
예제 #27
0
void ToyButtonWidget::Recv(const QString &path, const OSCArgument *args, size_t count)
{
	if(path == m_FeedbackPath)
    {
		FadeButton *button = static_cast<FadeButton*>(m_Widget);

        bool edge = false;
        
        if(args && count>0)
        {
            bool press = false;
            if( args[0].GetBool(press) )
            {
                edge = true;
                
                if( press )
                    button->Press();
                else
                    button->Release();
            }
        }
        
        if( !edge )
        {
            button->Press();
            button->Release();
        }
    }
    else
    {
        std::string str;
        if(args && count>0)
        {
            if( !args[0].GetString(str) )
                str.clear();
        }

        SetLabel( QString::fromUtf8(str.c_str()) );
    }
}
예제 #28
0
/**
 * Constructor for the TextPointer class.
 */
TextPointer::TextPointer(GuiText *parent, int linestodraw)
	: GuiButton(343, 240)
{
	TextPtr = parent;
	fontsize = TextPtr->GetFontSize();
	MarkImage = NULL;
	currentline = -1;
	Position_X = 0;
	Position_Y = 0;
	width = TextPtr->GetTextMaxWidth();
	if(width == 0)
		width = TextPtr->GetTextWidth();
	height = (linestodraw+1)*(fontsize+6);
	visibility = true;

	TextPointerImgData = Resources::GetImageData("textpointer_img.png");
	TextPointerImg = new GuiImage(TextPointerImgData);
	TextPointerImg->SetVisible(visibility);

	SetLabel(TextPtr);
	SetImage(TextPointerImg);
}
예제 #29
0
void W_slider::Init(int x, int y, int w, int h, string l, float v, float f, float t, int p, float bar, float red, float green, float blue)
{
	value = v;
	from = f;
	to = t;
	precision = p;
	barSize = bar;
	mouseOffset = 0;

	if (h>w) vertical = true;

	refName = l;
	name = l;
	//text = new W_label(x+width/2-(strlen(l)*7)/2-4, y-2, 0, 1, name);
	if (l.size())
	{
        text = new W_label(width/2-(l.size()*7)/2-4, 8-(height/2), 0, 1, name);
        this->AddChild(text);
        SetLabel();
	}
	onSetValue = 0;
}
예제 #30
0
void
TWindowMenuItem::_Init(const char* name)
{
	if (fMini) {
		fBitmap = fCurrentWorkSpace
			? AppResSet()->FindBitmap(B_MESSAGE_TYPE, R_WindowHiddenIcon)
			: AppResSet()->FindBitmap(B_MESSAGE_TYPE, R_WindowHiddenSwitchIcon);
	} else {
		fBitmap = fCurrentWorkSpace
			? AppResSet()->FindBitmap(B_MESSAGE_TYPE, R_WindowShownIcon)
			: AppResSet()->FindBitmap(B_MESSAGE_TYPE, R_WindowShownSwitchIcon);
	}

	BFont font(be_plain_font);
	fLabelWidth = ceilf(font.StringWidth(name));
	font_height fontHeight;
	font.GetHeight(&fontHeight);
	fLabelAscent = ceilf(fontHeight.ascent);
	fLabelDescent = ceilf(fontHeight.descent + fontHeight.leading);

	SetLabel(name);
}