BOOL RcuEditDrillSiteDlg::OnInitDialog()
{
	RcuAcUiBaseDlg::OnInitDialog();

	m_locaCombBox.AddString(_T("左帮"));
	m_locaCombBox.AddString(_T("右帮"));
	m_locaCombBox.AddString(_T("迎头"));

	SetToolTip(IDC_DRILL_WIDTH_EDIT,_T("单位:m"));
	SetToolTip(IDC_DRILL_HEIGHT_EDIT,_T("单位:m"));
	SetToolTip(IDC_DRILL_DIS_EDIT,_T("单位:m"));

	if(m_drill_site.isNull())
	{
		SetDlgItemText(IDOK, _T("新设计钻场"));
		m_locaCombBox.SetCurSel(0);
	}
	else
	{
		SetDlgItemText(IDOK, _T("更新钻场参数"));
		m_locaCombBox.SetCurSel(m_pos);
	}

	//更新数据到界面
	UpdateData(FALSE);

	return TRUE; 
}
Exemplo n.º 2
0
bool nuiLabel::SetRect(const nuiRect& rRect)
{
  bool needRecalcLayout = false;

  if (mUseEllipsis || mWrapping)
    needRecalcLayout = (rRect.GetWidth() != mRect.GetWidth());
    
  nuiWidget::SetRect(rRect);

  nuiRect ideal(mIdealLayoutRect);


  if (needRecalcLayout || ideal.GetWidth() > mRect.GetWidth())
  {
    if (mUseEllipsis)
    {
      CalcLayout();
      nuiSize diff = ideal.GetWidth() - mRect.GetWidth();
      int NbLetterToRemove = ToNearest(diff / (ideal.GetWidth() / mText.GetLength())) + 3;
      nglString text = mText;
      if (NbLetterToRemove > 0)
      {
        int len = text.GetLength();
        text.DeleteRight(MIN(NbLetterToRemove, len));
        text.Append(_T("..."));
      }
      delete mpLayout;
      mpLayout = new nuiTextLayout(mpFont);
      mpLayout->SetWrapX(0);
      mpLayout->Layout(text);
      GetLayoutRect();
    }
    else if (mWrapping)
    {
      CalcLayout();
      delete mpLayout;
      mpLayout = new nuiTextLayout(mpFont);
      delete mpIdealLayout;
      mpIdealLayout = new nuiTextLayout(mpFont);
      mpLayout->SetWrapX(mRect.GetWidth() - mBorderLeft - mBorderRight);
      mpIdealLayout->SetWrapX(mRect.GetWidth() - mBorderLeft - mBorderRight);
      mpLayout->Layout(mText);
      mpIdealLayout->Layout(mText);
      GetLayoutRect();
    }

    SetToolTip(mText);
  }
  else
  {
    if (GetToolTip() == mText)
      SetToolTip(nglString::Empty);
  }

  return true;
}
Exemplo n.º 3
0
void wxCustomStatusBar::OnMouseMotion(wxMouseEvent& event)
{
    event.Skip();
    SetToolTip(wxEmptyString);
    wxPoint point = event.GetPosition();
    for(size_t i = 0; i < m_fields.size(); ++i) {
        if(m_fields.at(i)->HitTest(point)) {
            SetToolTip(m_fields.at(i)->GetTooltip());
            return;
        }
    }
    SetToolTip(m_text);
}
Exemplo n.º 4
0
void LoadSave::Init(int command, gedString title, gedString confirmButtonText)
{
	SetModal();
	this->command = command;

	Text *text;
	Button *button;		
	int y;	

	text = AddText(title, CENTER_TEXT, 5);
	y = DrawHLine(text->Down() + 2);

	if(command == SAVE_DIALOG)
	{
		SetToolTip(TIP_SAVE);

		text = AddText("File: ", 10, y);
		name = AddEditBox(text->Right(), text->Top(), 200);
		dir = AddListDirectory(name->Right() + 2, y, 80, 0, 0, "select");  dir->SetToolTip(TIP_SAVE_FILE);
		dir->SetSave();
		y = name->Down();
	}
	else if(command == LOAD_DIALOG)
	{
		SetToolTip(TIP_LOAD);

		text = AddText("File: ", 40, y);
		dir = AddListDirectory(text->Right(), y, 200, 0, 0); dir->SetToolTip(TIP_LOAD_FILE);
		y = dir->Down();
	}	
	else if(command == MERGE_DIALOG)
	{
		SetToolTip(TIP_MERGE);

		text = AddText("File: ", 40, y);
		dir = AddListDirectory(text->Right(), y, 200, 0, 0); dir->SetToolTip(TIP_MERGE_FILE);
		y = dir->Down();

		command = LOAD_DIALOG;
	}

	
	//Close
	y = DrawHLine(Height() - 40);

	button = AddButton(confirmButtonText, (WIDTH-135)/2, y, 0, 0, LOADSAVE_OK); SetConfirmButton(button);
	button = AddButton("Cancel", button->Right()+8, y, 0, 0, LOADSAVE_CLOSE); SetCancelButton(button);

	chdir(GameControl::Get()->getGamePath().c_str());
}
void FWwiseEventDragDropOp::SetCanDrop(bool InCanDrop)
{
	CanDrop = InCanDrop;
	SetTooltipText();
	if( InCanDrop )
	{
		MouseCursor = EMouseCursor::GrabHandClosed;
		SetToolTip(GetTooltipText(), NULL);
	}
	else
	{
		MouseCursor = EMouseCursor::SlashedCircle;
		SetToolTip(GetTooltipText(), FEditorStyle::GetBrush(TEXT("Graph.ConnectorFeedback.Error")));
	}
}
Exemplo n.º 6
0
DWORD CMiniMapDlg::ActionEvent( CMouse* mouseInfo )
{
	DWORD we = cDialog::ActionEvent( mouseInfo );

	if( ! m_bActive )
	{
		return we;
	}

	if( we & WE_MOUSEOVER )
	{
		cImageRect& rect = m_MiniMap.mRect;
		char text[128] = {0,};
		
		VECTOR2 trans;
		trans.x = GetAbsX() + m_MiniMap.mTranslation.x - rect.left;
		trans.y = GetAbsY() + m_MiniMap.mTranslation.y - rect.top;

		m_IconTable.SetPositionHead();

		for(CMiniMapIcon* pIcon = m_IconTable.GetData();
			0 < pIcon;
			pIcon = m_IconTable.GetData())
		{
			int sort = pIcon->GetToolTip(mouseInfo->GetMouseX(),mouseInfo->GetMouseY(),&trans,text);

			if(sort == 1)				// Npc
			{
				SetToolTip( text, RGB_HALF( 255, 255, 0 ), &m_TooltipImage, RGB_HALF( 0, 0, 0 )  );
			}
			else if(sort == 2)			// Party
			{
				SetToolTip( text, RGB_HALF(185, 241, 69), &m_TooltipImage, RGB_HALF( 0, 0, 0 )  );
			}
			else if(sort == 3)			// Farm
			{
				SetToolTip( text, RGB_HALF( 255, 255, 0 ), &m_TooltipImage, RGB_HALF( 0, 0, 0 )  );
			}
		}
 
		if( ! strlen( text ) )
		{
			SetToolTip("");
		}
	}

	return we;
}
Exemplo n.º 7
0
void wxTabbedCtrl::Create(wxWindow *parent, wxWindowID id,
                          const wxPoint &position, const wxSize &size,
                          long style, const wxString &name) {
    wxWindow::Create(parent, id, position, size, wxNO_BORDER, name);
    active = -1;
    img_list = 0;
    tipTab = -1;
    this->style = style;
    padding.x = 5;
    padding.y = 3;
    hover = false;
    hover_next = false;
    hover_prev = false;
    hover_menu = false;
    m_intStartPage = 0;
    m_intLastPage = 0;
    wxToolTip * tooltip = new wxToolTip( "" );
    tooltip->Enable( true );
    tooltip->SetDelay( 100 );
    SetToolTip(  tooltip );

    wxFont normal_font = wxSystemSettings::GetFont(wxSYS_DEFAULT_GUI_FONT);
    wxFont bold_font = normal_font;
    bold_font.SetWeight(wxFONTWEIGHT_BOLD);
    wxPaintDC dc(this);
    int height = 22, pom = 0;
    dc.SetFont(bold_font);
    dc.GetTextExtent("Aq", &pom, &height);
    SetSizeHints( wxSize(-1, height+padding.y*3) );
}
Exemplo n.º 8
0
VariableEditor::VariableEditor(ExpressionEditor *_editor, ScriptGlobals *_globals)
	: Panel("VariableEditor", (GameControl::Get()->Width() - WIDTH)/2, 
				          (GameControl::Get()->Height() - HEIGHT)/2,
						  WIDTH, HEIGHT)
{
	SetModal();
	SetToolTip(TIP_VARIABLEEDITOR);

	editor = _editor;
	globals = _globals;
	

	Text *text;
	Button *button;	
	int y;

	//Title
	text = AddText("User Variables", CENTER_TEXT, 5);
	y = DrawHLine(text->Down() + 2);

	//Body
	text = AddText("Variables: ", 10, y);
	listVars = AddListPop(text->Right() + 2, text->Top(), 300); listVars->SetToolTip(TIP_VARIABLEEDITOR_VARIABLES);
	button = AddButton("Add", listVars->Left(), listVars->Down() + 2, 0, 0, BT_ADD); button->SetToolTip(TIP_VARIABLEEDITOR_ADD);
	button = AddButton("Edit", button->Right(), button->Top(), 0, 0, BT_EDIT); button->SetToolTip(TIP_VARIABLEEDITOR_EDIT);
	button = AddButton("Remove", button->Right(), button->Top(), 0, 0, BT_REMOVE); button->SetToolTip(TIP_VARIABLEEDITOR_REMOVE);
	
	//Close
	y = DrawHLine(button->Down() + 4);
	button = AddButton("Close", (WIDTH - 60)/2, y, 0, 0, BT_CLOSE);

	UpdateVars();
}
Exemplo n.º 9
0
SToolBarButton::SToolBarButton(wxWindow* parent, string action, string icon)
	: wxControl(parent, -1, wxDefaultPosition, wxDefaultSize, wxBORDER_NONE, wxDefaultValidator, "stbutton")
{
	// Init variables
	this->action = theApp->getAction(action);
	this->state = STATE_NORMAL;

	// Set size
	int size = 22;
	SetSizeHints(size, size, size, size);
	SetMinSize(wxSize(size, size));
	SetSize(size, size);

	// Load icon
	if (icon.IsEmpty())
		this->icon = getIcon(this->action->getIconName());
	else
		this->icon = getIcon(icon);

	// Set tooltip
	string tip = this->action->getText();
	tip.Replace("&", "");
	SetToolTip(tip);

	// Bind events
	Bind(wxEVT_PAINT, &SToolBarButton::onPaint, this);
	Bind(wxEVT_ENTER_WINDOW, &SToolBarButton::onMouseEvent, this);
	Bind(wxEVT_LEAVE_WINDOW, &SToolBarButton::onMouseEvent, this);
	Bind(wxEVT_LEFT_DOWN, &SToolBarButton::onMouseEvent, this);
	Bind(wxEVT_LEFT_UP, &SToolBarButton::onMouseEvent, this);
	Bind(wxEVT_KILL_FOCUS, &SToolBarButton::onFocus, this);
	Bind(wxEVT_LEFT_DCLICK, &SToolBarButton::onMouseEvent, this);
	Bind(wxEVT_ERASE_BACKGROUND, &SToolBarButton::onEraseBackground, this);
}
Exemplo n.º 10
0
HSPictureButton::HSPictureButton(BRect frame, BBitmap* off, BBitmap* on,
		BMessage* message, const char* helpMessage, const char* longHelpMessage,
		uint32 behavior, uint32 mode, uint32 flags)
	: BPictureButton(frame, "?", NULL, NULL, message, behavior, mode, flags)
	, fLongHelpMessage(longHelpMessage)
{
	if (helpMessage)
		SetToolTip(helpMessage);

	BRect rect(0, 0, 0, 0);
	BBitmap* offScreen = new BBitmap(rect, B_RGB_32_BIT, true);
	BView* offView = new BView(rect, "", B_FOLLOW_ALL, 0);

	offScreen->AddChild(offView);
	offScreen->Lock();

	offView->SetHighColor(255, 0, 0);
	offView->SetLowColor(0, 0, 120);
	offView->SetDrawingMode(B_OP_COPY);

	offView->BeginPicture(new BPicture());
	offView->DrawBitmap(on, BPoint(0, 0));
	SetEnabledOn(offView->EndPicture());

	offView->BeginPicture(new BPicture());
	offView->DrawBitmap(off, BPoint(0, 0));
	SetEnabledOff(offView->EndPicture());

	offScreen->Unlock();

	delete offScreen;
}
Exemplo n.º 11
0
void LAYER_WIDGET::insertLayerRow( int aRow, const ROW& aSpec )
{
    wxASSERT( aRow >= 0 );

    int         col;
    int         index = aRow * LYR_COLUMN_COUNT;
    const int   flags = wxALIGN_CENTER_VERTICAL | wxALIGN_LEFT;

    auto& iconProvider = useAlternateBitmap(aRow) ? alternativeRowIcons : defaultRowIcons;

    // column 0
    col = COLUMN_ICON_ACTIVE;
    auto sbm = new INDICATOR_ICON( m_LayerScrolledWindow, iconProvider,
                                   ROW_ICON_PROVIDER::STATE::OFF,
                                   encodeId( col, aSpec.id ) );
    sbm->Bind( wxEVT_LEFT_DOWN, &LAYER_WIDGET::OnLeftDownLayers, this );
    m_LayersFlexGridSizer->wxSizer::Insert( index+col, sbm, 0, flags );

    // column 1 (COLUMN_COLORBM)
    col = COLUMN_COLORBM;

    auto bmb = new COLOR_SWATCH( m_LayerScrolledWindow, aSpec.color, encodeId( col, aSpec.id ),
                                 AreArbitraryColorsAllowed(), getBackgroundLayerColor() );
    bmb->Bind( wxEVT_LEFT_DOWN, &LAYER_WIDGET::OnLeftDownLayers, this );
    bmb->Bind( COLOR_SWATCH_CHANGED, &LAYER_WIDGET::OnLayerSwatchChanged, this );
    bmb->SetToolTip( _("Left double click or middle click for color change, right click for menu" ) );
    m_LayersFlexGridSizer->wxSizer::Insert( index+col, bmb, 0, flags );

    // column 2 (COLUMN_COLOR_LYR_CB)
    col = COLUMN_COLOR_LYR_CB;
    wxCheckBox* cb = new wxCheckBox( m_LayerScrolledWindow, encodeId( col, aSpec.id ), wxEmptyString );
    cb->SetValue( aSpec.state );
    cb->Bind( wxEVT_COMMAND_CHECKBOX_CLICKED, &LAYER_WIDGET::OnLayerCheckBox, this );
    cb->SetToolTip( _( "Enable this for visibility" ) );
    m_LayersFlexGridSizer->wxSizer::Insert( index+col, cb, 0, flags );

    // column 3 (COLUMN_COLOR_LYRNAME)
    col = COLUMN_COLOR_LYRNAME;
    wxStaticText* st = new wxStaticText( m_LayerScrolledWindow, encodeId( col, aSpec.id ), aSpec.rowName );
    shrinkFont( st, m_PointSize );
    st->Bind( wxEVT_LEFT_DOWN, &LAYER_WIDGET::OnLeftDownLayers, this );
    st->SetToolTip( aSpec.tooltip );
    m_LayersFlexGridSizer->wxSizer::Insert( index+col, st, 0, flags );

    // Bind right click eventhandler to all columns
    wxString layerName( aSpec.rowName );

    sbm->Bind( wxEVT_RIGHT_DOWN, [this, bmb, layerName] ( wxMouseEvent& aEvt ) {
        OnRightDownLayer( aEvt, bmb, layerName );
    } );
    bmb->Bind( wxEVT_RIGHT_DOWN, [this, bmb, layerName] ( wxMouseEvent& aEvt ) {
        OnRightDownLayer( aEvt, bmb, layerName );
    } );
    cb->Bind( wxEVT_RIGHT_DOWN, [this, bmb, layerName] ( wxMouseEvent& aEvt ) {
        OnRightDownLayer( aEvt, bmb, layerName );
    } );
    st->Bind( wxEVT_RIGHT_DOWN, [this, bmb, layerName] ( wxMouseEvent& aEvt ) {
        OnRightDownLayer( aEvt, bmb, layerName );
    } );
}
Exemplo n.º 12
0
/**
 *  wechselt den Desktop in den neuen Desktop
 *
 *  @author OLiver
 */
void WindowManager::Switch(void)
{
    // einmal richtig clearen
    glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT);

    SetToolTip(NULL, "");

    // haben wir einen aktuell gültigen Desktop?
    if(desktop)
    {
        // Alle (alten) Fenster zumachen
        for(IgwListIterator it = windows.begin(); it != windows.end(); ++it)
            delete (*it);
        windows.clear();

        // Desktop löschen
        delete desktop;
    }

    // Desktop auf Neuen umstellen
    desktop = nextdesktop;

    // ist der neue Desktop gültig?
    if(desktop)
    {
        // Desktop aktivieren
        desktop->SetActive(true);

        // aufräumen
        nextdesktop = NULL;
        nextdesktop_data = NULL;
    }
}
Exemplo n.º 13
0
void ListPop::SetListText(gedString text)
{
	int width = Width() - 20, n;
	KrRect rect;
	gedString s(text);

	rect.Set(0, 0, 0, 0);
	
	if(s.length() > 5)
	{
		for(n = 1; n <= text.length() && rect.Width() < width; n++)
		{
			s = text.substr(0, n);
			rect = Text::GetDimensions(s);		
		}
		
		if(s.length() != text.length() && n > 3)
		{
			s = s.substr(0, s.length() - 3) + "...";
			SetToolTip(text);
		}
	}
	
	SetText(s);
	selectedText = text;
}
C4Network2ResDlg::ListItem::ListItem(C4Network2ResDlg *pForResDlg, const C4Network2Res *pByRes)
		: pSaveBtn(NULL)
{
	// init by res core (2do)
	iResID = pByRes->getResID();
	const char *szFilename = GetFilename(pByRes->getCore().getFileName());
	// get size
	int iIconSize = ::GraphicsResource.TextFont.GetLineHeight();
	int iWidth = pForResDlg->GetItemWidth();
	int iVerticalIndent = 2;
	SetBounds(C4Rect(0, 0, iWidth, iIconSize+2*iVerticalIndent));
	C4GUI::ComponentAligner ca(GetContainedClientRect(), 0,iVerticalIndent);
	// create subcomponents
	pFileIcon = new C4GUI::Icon(ca.GetFromLeft(iIconSize), C4GUI::Ico_Resource);
	pLabel = new C4GUI::Label(szFilename, iIconSize + IconLabelSpacing,iVerticalIndent, ALeft);
	pProgress = NULL;
	// add components
	AddElement(pFileIcon); AddElement(pLabel);
	// tooltip
	SetToolTip(LoadResStr("IDS_DESC_RESOURCE"));
	// add to listbox (will eventually get moved)
	pForResDlg->AddElement(this);
	// first-time update
	Update(pByRes);
}
Exemplo n.º 15
0
void CProjectListCtrl::OnHover( wxHtmlCellEvent& event )
{
    long i = 0;
    wxHtmlCell* pCell = event.GetCell();
    wxHtmlCell* pRootCell = pCell->GetRootCell();
    wxString strNvidiaIcon = wxT("nvidiaicon");
    wxString strATIIcon = wxT("atiicon");
    wxString strWebsiteIcon = wxT("website");
    wxString strTooltip = wxEmptyString;

    wxHtmlCell* pAnchor = pCell->GetParent()->GetFirstChild();

    if (pAnchor->Find(wxHTML_COND_ISANCHOR, &strNvidiaIcon)) {
        strTooltip = _("Nvidia GPU Supported");
    } else if (pAnchor->Find(wxHTML_COND_ISANCHOR, &strATIIcon)) {
        strTooltip = _("ATI GPU Supported");
    } else if (pAnchor->Find(wxHTML_COND_ISANCHOR, &strWebsiteIcon)) {
        strTooltip = _("Project Website");
    } else {
        // Convert current HTML cell into an array index
        pRootCell->GetId().ToLong(&i);

        strTooltip = m_Items[i]->GetDescription();
    }

    // Set Tooltip to the item currently being hovered over
    SetToolTip(strTooltip);
}
Exemplo n.º 16
0
// class constructor
Resound::MonitorNodeWidget::MonitorNodeWidget(wxWindow* parent, int id, ParameterAddress _addr)
		: Resound::ParameterAddressWidgetBase(parent,id,_addr)
{
	SetWindowStyle(wxSIMPLE_BORDER | wxCLIP_CHILDREN);
	SetBackgroundColour(wxColour(30,100,150));
	SetForegroundColour(wxColour(255,255,255));

	wxSize size(45,45);
	SetSize(size);
	SetMinSize(size);
	SetMaxSize(size);

	// construct the sub objects and sizer
	wxBoxSizer *topSizer = new wxBoxSizer( wxHORIZONTAL );
	wxBoxSizer *leftSizer = new wxBoxSizer( wxVERTICAL );
	SetToolTip(wxConvertMB2WX(addr.get_address().c_str())); 
	//leftSizer->Add(new wxStaticText(this,MNW_LABEL,label, wxPoint(0,0),wxSize(40,18),wxALIGN_CENTRE),wxSizerFlags(0).Align(0).Border(wxALL,0));
	//leftSizer->Add(new wxToggleButton(this,MNW_LOCKBUTTON,_("L"), wxPoint(0,0),wxSize(20,20)),wxSizerFlags(0).Center().Border(wxALL,0));
	topSizer->Add(leftSizer);
	meter = new Resound::ParameterVUMeterWidget(this,MNW_METER,rand() % 128,0,128,_(RESOURCE_DIR "/image/smMeterOff.png"),_(RESOURCE_DIR "/image/smMeterOn.png"));
	meter->SetTarget(addr);
	topSizer->Add(meter,wxSizerFlags(0).Align(0).Border(wxALL,0)); //meter1
	SetSizer(topSizer);
	//topSizer->SetSizeHints(this);   // set size hints to honour minimum size
	topSizer->Layout();
}
Exemplo n.º 17
0
DestroyTimer::DestroyTimer(Actor *actor)
	: BaseAction("Destroy Timer", (GameControl::Get()->Width() - WIDTH)/2, 
				          (GameControl::Get()->Height() - HEIGHT)/2,
						  WIDTH, HEIGHT)
{
	SetModal();
	SetToolTip(TIP_DESTROYTIMER);
	eventActor = actionActor = actor;

	Text *text;
	Button *button;	
	int y;

	//Title
	text = AddText(DESTROY_TIMER, CENTER_TEXT, 5);
	y = DrawHLine(text->Down() + 2);

	//Body
	text = AddText("   Timer: ", 10, y);
	listTimer = AddListPop(text->Right() + 2, text->Top(), 300, 0, LS_TIMER); listTimer->SetToolTip(TIP_DESTROYTIMER_TIMER);
	
	
	//Close
	y = DrawHLine(listTimer->Down() + 2);
	button = AddButton(Action::getEditAction()?"Ok":"Add", (WIDTH-135)/2, y, 0, 0, BT_ADD); button->SetToolTip(TIP_ACTION_ADD); SetConfirmButton(button);
	button = AddButton("Cancel", button->Right()+8, y, 0, 0, BT_CLOSE); button->SetToolTip(TIP_ACTION_CANCEL); SetCancelButton(button);

	GameControl::Get()->PopulateTimers(listTimer);			
	listTimer->SetItem(listTimer->GetText(0));

	if(!ExpressionEditor::getExpressionEditor()) UpdateEdition();
}
Exemplo n.º 18
0
/**
 *  wechselt den Desktop in den neuen Desktop
 */
void WindowManager::Switch()
{
    RTTR_Assert(nextdesktop);
    VIDEODRIVER.ClearScreen();

    SetToolTip(NULL, "");

    // haben wir einen aktuell gültigen Desktop?
    if(curDesktop)
    {
        // Alle (alten) Fenster zumachen
        for(IgwListIterator it = windows.begin(); it != windows.end(); ++it)
            delete (*it);
        windows.clear();
    }

    // Desktop auf Neuen umstellen
    curDesktop.reset(nextdesktop.release());
    curDesktop->SetActive(true);

    for(std::vector<IngameWindow*>::iterator it = nextWnds.begin(); it != nextWnds.end(); ++it)
        Show(*it);
    nextWnds.clear();

    // Dummy mouse move to init hovering etc
    Msg_MouseMove(MouseCoords(VIDEODRIVER.GetMouseX(), VIDEODRIVER.GetMouseY(), false, false, false));
}
Exemplo n.º 19
0
bool
ClipView::GetToolTipAt(BPoint point, BToolTip** _tip)
{
	ClipItem* item = static_cast<ClipItem*>(this->ItemAt(this->IndexOf(point)));
	if (item == NULL)
		return false;

	BString dateString = "";
	bigtime_t added = item->GetTimeAdded();
	if (BDateFormat().Format(dateString, added,
		B_MEDIUM_DATE_FORMAT) != B_OK)
		return false;

	BString timeString = "";
	added = item->GetTimeAdded();
	if (BTimeFormat().Format(timeString, added,
		B_SHORT_TIME_FORMAT) != B_OK)
		return false;

	BString toolTip(B_TRANSLATE_COMMENT("Added:\n%time%\n%date%",
		"Tooltip, don't change the variables %time% and %date%."));
	toolTip.ReplaceAll("%time%", timeString.String());
	toolTip.ReplaceAll("%date%", dateString.String());

	SetToolTip(toolTip.String());
	*_tip = ToolTip();

	return true;
}
Exemplo n.º 20
0
bool
TimeZoneListView::GetToolTipAt(BPoint point, BToolTip** _tip)
{
	TimeZoneListItem* item = static_cast<TimeZoneListItem*>(
		this->ItemAt(this->IndexOf(point)));
	if (item == NULL || !item->HasTimeZone())
		return false;

	BString nowInTimeZone;
	time_t now = time(NULL);
	BLocale::Default()->FormatTime(&nowInTimeZone, now, B_SHORT_TIME_FORMAT,
		&item->TimeZone());

	BString dateInTimeZone;
	BLocale::Default()->FormatDate(&dateInTimeZone, now, B_SHORT_DATE_FORMAT,
		&item->TimeZone());

	BString toolTip = item->Text();
	toolTip << '\n' << item->TimeZone().ShortName() << " / "
			<< item->TimeZone().ShortDaylightSavingName()
			<< B_TRANSLATE("\nNow: ") << nowInTimeZone
			<< " (" << dateInTimeZone << ')';

	SetToolTip(toolTip.String());

	*_tip = ToolTip();

	return true;
}
Exemplo n.º 21
0
	virtual void Pulse()
	{
		char buffer[256];
		time_t now = time(NULL);
		strftime(buffer, sizeof(buffer), "%X", localtime(&now));
		SetToolTip(buffer);
	}
Exemplo n.º 22
0
void CImgButton::SetToolTip(UINT nID)
{
	CString tip;
	tip.LoadString(nID);

	SetToolTip(tip);
}
Exemplo n.º 23
0
	ImmediateView(const char* name, const char* label)
		:
		BStringView(name, label)
	{
		SetToolTip("Easy but immediate!");
		ToolTip()->SetSticky(true);
	}
Exemplo n.º 24
0
void
ViewerAction::SetAllText(const QString &text)
{
    SetText(text);
    SetMenuText(text);
    SetToolTip(text);
}
Exemplo n.º 25
0
void wxExStatusBar::Handle(wxMouseEvent& event, const wxExStatusBarPane& pane)
{
  if (event.LeftUp())
  {
    m_Frame->StatusBarClicked(pane.GetName());
  }
  else if (event.RightUp())
  {
    m_Frame->StatusBarClickedRight(pane.GetName());
  }
  // Show tooltip if tooltip is available, and not yet presented.
  else if (event.Moving())
  {
#if wxUSE_TOOLTIPS
    const wxString tooltip = GetToolTipText();
              
    if (pane.GetHelpText().empty())
    {
      if (!tooltip.empty())
      {
        UnsetToolTip();
      }
    }
    else if (tooltip != pane.GetHelpText())
    {
      SetToolTip(pane.GetHelpText());
    }
#endif    
  }
}
Exemplo n.º 26
0
TimeSliderForwardStepActionUI::TimeSliderForwardStepActionUI(ViewerActionLogic *L) :
    ViewerActionUISingle(L)
{
    SetAllText(tr("Forward step"));
    SetToolTip(tr("Step forward one frame"));
    if (!GetViewerProperties()->GetNowin())
        SetIcon(QIcon(QPixmap(animationforwardstep_xpm)));
}
Exemplo n.º 27
0
TimeSliderReverseStepActionUI::TimeSliderReverseStepActionUI(ViewerActionLogic *L) :
    ViewerActionUISingle(L)
{
    SetAllText(tr("Reverse step"));
    SetToolTip(tr("Step back one frame"));
    if (!GetViewerProperties()->GetNowin())
        SetIcon(QIcon(QPixmap(animationreversestep_xpm)));
}
Exemplo n.º 28
0
AnimationReversePlayActionUI::AnimationReversePlayActionUI(ViewerActionLogic *L) :
    ViewerActionUIToggle(L)
{
    SetAllText(tr("Reverse play"));
    SetToolTip(tr("Play animation in reverse"));
    if (!GetViewerProperties()->GetNowin())
        SetIcons(QPixmap(animationreverseplayon_xpm), QPixmap(animationreverseplayoff_xpm));
}
Exemplo n.º 29
0
SettingChoice::SettingChoice(wxWindow* parent, int &setting, const wxString& tooltip, int num, const wxString choices[], long style)
	: wxChoice(parent, -1, wxDefaultPosition, wxDefaultSize, num, choices)
	, m_setting(setting)
{
	SetToolTip(tooltip);
	Select(m_setting);
	Bind(wxEVT_COMMAND_CHOICE_SELECTED, &SettingChoice::UpdateValue, this);
}
Exemplo n.º 30
0
// show or hide the stop icon
void
ConflictView::SetStopIcon(bool show)
{
	fIcon = show ? fStopIcon : NULL;
	const char* tip = show ? B_TRANSLATE("Error: duplicate keys")
		: NULL;
	SetToolTip(tip);
}