Example #1
0
void wxStatusBarMac::DrawFieldText(wxDC& dc, int i)
{
    int leftMargin = 2;
    
    wxRect rect;
    GetFieldRect(i, rect);
    
    if ( !IsWindowHilited( MAC_WXHWND( MacGetRootWindow() ) ) )
    {
        dc.SetTextForeground( wxColour( 0x80 , 0x80 , 0x80 ) ) ;
    }
    
    wxString text(GetStatusText(i));
    
    long x, y;
    
    dc.GetTextExtent(text, &x, &y);
    
    int xpos = rect.x + leftMargin + 1 ;
    int ypos = 1 ;
    
    dc.SetClippingRegion(rect.x, 0, rect.width, m_height);
    
    dc.DrawText(text, xpos, ypos);
    
    dc.DestroyClippingRegion();
}
Example #2
0
void wxStatusBar95::SetStatusStyles(int n, const int styles[])
{
    wxStatusBarBase::SetStatusStyles(n, styles);

    if (n != m_nFields)
        return;

    for (int i = 0; i < n; i++)
    {
        int style;
        switch(styles[i])
        {
        case wxSB_RAISED:
            style = SBT_POPOUT;
            break;
        case wxSB_FLAT:
            style = SBT_NOBORDERS;
            break;
        case wxSB_NORMAL:
        default:
            style = 0;
            break;
        }
        // The SB_SETTEXT message is both used to set the field's text as well as
        // the fields' styles. MSDN library doesn't mention
        // that nField and style have to be 'ORed'
        wxString text = GetStatusText(i);
        if (!StatusBar_SetText(GetHwnd(), style | i, text))
        {
            wxLogLastError(wxT("StatusBar_SetText"));
        }
    }
}
Example #3
0
void wxStatusBarMac::DrawFieldText(wxDC& dc, int i)
{
    int leftMargin = 2;
    int w, h ;
    GetSize( &w , &h ) ;
    wxRect rect;
    GetFieldRect(i, rect);
    
    if ( !MacIsReallyHilited()  )
    {
        dc.SetTextForeground( wxColour( 0x80 , 0x80 , 0x80 ) ) ;
    }
    
    wxString text(GetStatusText(i));
    
    long x, y;
    
    dc.GetTextExtent(text, &x, &y);
    
    int xpos = rect.x + leftMargin + 1 ;
    int ypos = 1 ;
    
    if ( MacGetTopLevelWindow()->MacGetMetalAppearance()  )
        ypos++ ;
        
    dc.SetClippingRegion(rect.x, 0, rect.width, h);
    
    dc.DrawText(text, xpos, ypos);
    
    dc.DestroyClippingRegion();
}
Example #4
0
void wxStatusBarEx::SetStatusText(const wxString& text, int number /*=0*/)
{
	wxString oldText = GetStatusText(number);
	if (oldText != text) {
		wxStatusBar::SetStatusText(text, number);
	}
}
Example #5
0
void wxStatusBarMac::SetStatusText(const wxString& text, int number)
{
    // NOTE: seems this function is identic to wxStatusBarGeneric::SetStatusText;
    //       probably can be removed without problems (FM)

    wxCHECK_RET( (number >= 0) && ((size_t)number < m_panes.GetCount()),
        wxT("invalid status bar field index") );

    if ( GetStatusText(number) == text )
        return;

    wxStatusBarGeneric::SetStatusText(text, number);

    wxRect rect;
    GetFieldRect(number, rect);

    int w, h;
    GetSize( &w, &h );

    rect.y = 0;
    rect.height = h ;

    Refresh( true, &rect );
    Update();
}
Example #6
0
void wxStatusBarGeneric::DrawFieldText(wxDC& dc, int i)
{
    int leftMargin = 2;

    wxRect rect;
    GetFieldRect(i, rect);

    wxString text(GetStatusText(i));

    long x = 0, y = 0;

    dc.GetTextExtent(text, &x, &y);

    int xpos = rect.x + leftMargin;
    int ypos = (int) (((rect.height - y) / 2 ) + rect.y + 0.5) ;

#if defined( __WXGTK__ ) || defined(__WXMAC__)
    xpos++;
    ypos++;
#endif

    dc.SetClippingRegion(rect.x, rect.y, rect.width, rect.height);

    dc.DrawText(text, xpos, ypos);

    dc.DestroyClippingRegion();
}
void HttpClientSocket::OnFirst()
{
	if (!IsResponse())
	{
		Handler().LogError(this, "OnFirst", 0, "Response expected but not received - aborting", LOG_LEVEL_FATAL);
		SetCloseAndDelete();
	}
	m_content = GetHttpVersion() + " " + GetStatus() + " " + GetStatusText() + "\r\n";
}
void t4p::StatusBarWithGaugeClass::SetColumn1Text(const wxString &text) {
    // don't redraw unless necessary
    wxString oldText = GetStatusText(1);
    if (oldText == text) {
        return;
    }
    if (!oldText.IsEmpty() || !text.IsEmpty()) {
        SetStatusText(text, 1);
    }
}
Example #9
0
void wxStatusBarBase::PushStatusText(const wxString& text, int number)
{
    wxListString* st = GetOrCreateStatusStack(number);
    // This long-winded way around avoids an internal compiler error
    // in VC++ 6 with RTTI enabled
    wxString tmp1(GetStatusText(number));
    wxString* tmp = new wxString(tmp1);
    st->Insert(tmp);
    SetStatusText(text, number);
}
Example #10
0
void wxStatusBarUniv::SetStatusText(const wxString& text, int number)
{
    wxCHECK_RET( number >= 0 && (size_t)number < m_panes.GetCount(),
                 _T("invalid status bar field index in SetStatusText()") );

    if ( text == GetStatusText(number) )
    {
        // nothing changed
        return;
    }

    wxStatusBarBase::SetStatusText(text, number);

    RefreshField(number);
}
Example #11
0
void wxStatusBarMac::DrawFieldText(wxDC& dc, const wxRect& rect, int i, int textHeight)
{
    int w, h;
    GetSize( &w , &h );

    wxString text(GetStatusText( i ));

    int xpos = rect.x + wxFIELD_TEXT_MARGIN + 1;
    int ypos = 2 + (rect.height - textHeight) / 2;

    if ( MacGetTopLevelWindow()->GetExtraStyle() & wxFRAME_EX_METAL )
        ypos++;

    dc.SetClippingRegion(rect.x, 0, rect.width, h);
    dc.DrawText(text, xpos, ypos);
    dc.DestroyClippingRegion();
}
Example #12
0
void CBTTestDlg::OnConnect()
{
	int nDevice=m_lbDevices.GetCurSel();
	if (nDevice==LB_ERR)
	{
		MessageBox("Select a device");
		return;

	}

	PBTDevice pBTDevice=(PBTDevice)m_lbDevices.GetItemData(nDevice);
	if (pBTDevice)
	{
		USHORT ConnectionHandle=0;
		DWORD dwReturn=CreateConnection(
						pBTDevice->BD_ADDR,
						FBT_HCI_PACKET_TYPE_ALL,
						pBTDevice->PageScanRepetitionMode,
						pBTDevice->PageScanMode,
						pBTDevice->ClockOffset,
						TRUE,
						pBTDevice->ConnectionHandle);

		CString szMsg;
		if (FBT_HCI_SUCCESS(dwReturn))
		{
			szMsg.Format("Connected on handle 0x%04x", pBTDevice->ConnectionHandle);
			MessageBox(szMsg);

		}

		else
		{
			szMsg.Format("Connect failed (%s)", GetStatusText((BYTE)dwReturn));
			MessageBox(szMsg);

		}

	}

}
Example #13
0
void wxStatusBar95::SetStatusText(const wxString& strText, int nField)
{
    wxCHECK_RET( (nField >= 0) && (nField < m_nFields),
                 _T("invalid statusbar field index") );

    if ( strText == GetStatusText(nField) )
    {
       // don't call StatusBar_SetText() to avoid flicker
       return;
    }

    // Get field style, if any
    int style;
    if (m_statusStyles)
    {
        switch(m_statusStyles[nField])
        {
        case wxSB_RAISED:
            style = SBT_POPOUT;
            break;
        case wxSB_FLAT:
            style = SBT_NOBORDERS;
            break;
        case wxSB_NORMAL:
        default:
            style = 0;
            break;
        }
    }
    else
        style = 0;

    // Pass both field number and style. MSDN library doesn't mention
    // that nField and style have to be 'ORed'
    if ( !StatusBar_SetText(GetHwnd(), nField | style, strText) )
    {
        wxLogLastError(wxT("StatusBar_SetText"));
    }
}
Example #14
0
void wxStatusBarUniv::DoDraw(wxControlRenderer *renderer)
{
    // get the fields rect
    wxCoord borderBetweenFields;
    wxRect rect = GetTotalFieldRect(&borderBetweenFields);

    // prepare the DC
    wxDC& dc = renderer->GetDC();
    dc.SetFont(GetFont());
    dc.SetTextForeground(GetForegroundColour());

    // do draw the fields
    int flags = IsEnabled() ? 0 : (int)wxCONTROL_DISABLED;
    for ( int n = 0; n < (int)m_panes.GetCount(); n++ )
    {
        rect.width = m_widthsAbs[n];

        if ( IsExposed(rect) )
        {
            wxTopLevelWindow *parentTLW = wxDynamicCast(GetParent(), wxTopLevelWindow);

            // the size grip may be drawn only on the last field and only if we
            // have the corresponding style and even then only if we really can
            // resize this frame
            if ( n == (int)m_panes.GetCount() - 1 &&
                 HasFlag(wxST_SIZEGRIP) &&
                 GetParent()->HasFlag(wxRESIZE_BORDER) &&
                 parentTLW && !parentTLW->IsMaximized() )
            {
                flags |= wxCONTROL_SIZEGRIP;
            }

            m_renderer->DrawStatusField(dc, rect, GetStatusText(n), flags, m_panes[n].GetStyle());
        }

        rect.x += rect.width + borderBetweenFields;
    }
}
	void AccountActionsManager::handleChangeStatusRequested ()
	{
		auto action = qobject_cast<QAction*> (sender ());
		const auto acc = GetAccountFromSender (sender (), Q_FUNC_INFO);

		QVariant stateVar = action->property ("Azoth/TargetState");
		EntryStatus status;
		if (!stateVar.isNull ())
		{
			const auto state = stateVar.value<State> ();
			status = EntryStatus (state, GetStatusText (action, state));
		}
		else
		{
			SetStatusDialog ssd (acc->GetAccountID ());
			if (ssd.exec () != QDialog::Accepted)
				return;

			status = EntryStatus (ssd.GetState (), ssd.GetStatusText ());
		}

		acc->ChangeState (status);
	}
Example #16
0
void wxStatusBarMac::DrawFieldText(wxDC& dc, const wxRect& rect, int i, int WXUNUSED(textHeight))
{
    int w, h;
    GetSize( &w , &h );

    if ( !MacIsReallyHilited() )
        dc.SetTextForeground( wxColour( 0x80, 0x80, 0x80 ) );

    wxString text(GetStatusText( i ));

    /*wxCoord x, y;
    dc.GetTextExtent(text, &x, &y);    -- seems unused (FM)*/

    int xpos = rect.x + wxFIELD_TEXT_MARGIN + 1;
    int ypos = 1;

    if ( MacGetTopLevelWindow()->GetExtraStyle() & wxFRAME_EX_METAL )
        ypos++;

    dc.SetClippingRegion(rect.x, 0, rect.width, h);
    dc.DrawText(text, xpos, ypos);
    dc.DestroyClippingRegion();
}
Example #17
0
void wxStatusBar::DoUpdateStatusText(int nField)
{
    if (!m_pDC)
        return;

    // Get field style, if any
    int style;
    switch(m_panes[nField].GetStyle())
    {
    case wxSB_RAISED:
        style = SBT_POPOUT;
        break;
    case wxSB_FLAT:
        style = SBT_NOBORDERS;
        break;

    case wxSB_NORMAL:
    default:
        style = 0;
        break;
    }

    wxRect rc;
    GetFieldRect(nField, rc);

    const int maxWidth = rc.GetWidth() - MSWGetMetrics().textMargin;

    wxString text = GetStatusText(nField);

    // do we need to ellipsize this string?
    wxEllipsizeMode ellmode = (wxEllipsizeMode)-1;
    if (HasFlag(wxSTB_ELLIPSIZE_START)) ellmode = wxELLIPSIZE_START;
    else if (HasFlag(wxSTB_ELLIPSIZE_MIDDLE)) ellmode = wxELLIPSIZE_MIDDLE;
    else if (HasFlag(wxSTB_ELLIPSIZE_END)) ellmode = wxELLIPSIZE_END;

    if (ellmode == (wxEllipsizeMode)-1)
    {
        // if we have the wxSTB_SHOW_TIPS we must set the ellipsized flag even if
        // we don't ellipsize the text but just truncate it
        if (HasFlag(wxSTB_SHOW_TIPS))
            SetEllipsizedFlag(nField, m_pDC->GetTextExtent(text).GetWidth() > maxWidth);
    }
    else
    {
        text = wxControl::Ellipsize(text,
                                     *m_pDC,
                                     ellmode,
                                     maxWidth,
                                     wxELLIPSIZE_FLAGS_EXPAND_TABS);

        // update the ellipsization status for this pane; this is used later to
        // decide whether a tooltip should be shown or not for this pane
        // (if we have wxSTB_SHOW_TIPS)
        SetEllipsizedFlag(nField, text != GetStatusText(nField));
    }

    // Set the status text in the native control passing both field number and style.
    // NOTE: MSDN library doesn't mention that nField and style have to be 'ORed'
    if ( !StatusBar_SetText(GetHwnd(), nField | style, text.wx_str()) )
    {
        wxLogLastError("StatusBar_SetText");
    }

#if wxUSE_TOOLTIPS
    if (HasFlag(wxSTB_SHOW_TIPS))
    {
        wxASSERT(m_tooltips.size() == m_panes.GetCount());

        if (m_tooltips[nField])
        {
            if (GetField(nField).IsEllipsized())
            {
                // update the rect of this tooltip:
                m_tooltips[nField]->SetRect(rc);

                // update also the text:
                m_tooltips[nField]->SetTip(GetStatusText(nField));
            }
            else
            {
                // delete the tooltip associated with this pane; it's not needed anymore
                wxDELETE(m_tooltips[nField]);
            }
        }
        else
        {
            // create a new tooltip for this pane if needed
            if (GetField(nField).IsEllipsized())
                m_tooltips[nField] = new wxToolTip(this, nField, GetStatusText(nField), rc);
            //else: leave m_tooltips[nField]==NULL
        }
    }
#endif // wxUSE_TOOLTIPS
}
Example #18
0
void MyVideoCaptureWindow::OnVideoFrameEvent( wxVideoCaptureEvent &event )
{
    m_frame->SetStatusText(GetStatusText(event.GetFrameNumber(), event.GetFramerateMS()), 1);
    event.Skip();
}
Example #19
0
int ContactStatusChanged(MCONTACT hContact, WORD oldStatus, WORD newStatus)
{
	if (opt.LogToDB && (!opt.LogToDB_WinOpen || CheckMsgWnd(hContact))) {
		wchar_t stzStatusText[MAX_SECONDLINE] = { 0 };
		GetStatusText(hContact, newStatus, oldStatus, stzStatusText);
		T2Utf blob(stzStatusText);

		DBEVENTINFO dbei = {};
		dbei.cbBlob = (DWORD)mir_strlen(blob) + 1;
		dbei.pBlob = (PBYTE)blob;
		dbei.eventType = EVENTTYPE_STATUSCHANGE;
		dbei.flags = DBEF_READ | DBEF_UTF;

		dbei.timestamp = (DWORD)time(0);
		dbei.szModule = MODULE;
		MEVENT hDBEvent = db_event_add(hContact, &dbei);

		if (opt.LogToDB_WinOpen && opt.LogToDB_Remove) {
			DBEVENT *dbevent = (DBEVENT *)mir_alloc(sizeof(DBEVENT));
			dbevent->hContact = hContact;
			dbevent->hDBEvent = hDBEvent;
			eventListStatus.insert(dbevent);
		}
	}

	bool bEnablePopup = true, bEnableSound = true;
	char *szProto = GetContactProto(hContact);
	int myStatus = Proto_GetStatus(szProto);

	if (!mir_strcmp(szProto, META_PROTO)) { //this contact is Meta
		MCONTACT hSubContact = db_mc_getMostOnline(hContact);
		char *szSubProto = GetContactProto(hSubContact);
		if (szSubProto == nullptr)
			return 0;

		if (newStatus == ID_STATUS_OFFLINE) {
			// read last online proto for metacontact if exists,
			// to avoid notifying when meta went offline but default contact's proto still online
			DBVARIANT dbv;
			if (!db_get_s(hContact, szProto, "LastOnline", &dbv)) {
				szSubProto = NEWSTR_ALLOCA(dbv.pszVal);
				db_free(&dbv);
			}
		}
		else
			db_set_s(hContact, szProto, "LastOnline", szSubProto);

		if (db_get_b(0, MODULE, szSubProto, 1) == 0)
			return 0;

		szProto = szSubProto;
	}
	else {
		if (myStatus == ID_STATUS_OFFLINE || db_get_b(0, MODULE, szProto, 1) == 0)
			return 0;
	}

	if (!opt.FromOffline || oldStatus != ID_STATUS_OFFLINE) { // Either it wasn't a change from Offline or we didn't enable that.
		char buff[8];
		mir_snprintf(buff, "%d", newStatus);
		if (db_get_b(0, MODULE, buff, 1) == 0)
			return 0; // "Notify when a contact changes to one of..." is unchecked
	}

	if (SkipHiddenContact(hContact))
		return 0;

	// check if that proto from which we received statuschange notification, isn't in autodisable list
	if (opt.AutoDisable) {
		char statusIDs[12], statusIDp[12];
		mir_snprintf(statusIDs, "s%d", myStatus);
		mir_snprintf(statusIDp, "p%d", myStatus);
		bEnableSound = db_get_b(0, MODULE, statusIDs, 1) ? FALSE : TRUE;
		bEnablePopup = db_get_b(0, MODULE, statusIDp, 1) ? FALSE : TRUE;
	}

	if (bEnablePopup && db_get_b(hContact, MODULE, "EnablePopups", 1) && !opt.TempDisabled) {
		int wStatus = Proto_GetStatus(szProto);
		wchar_t str[MAX_SECONDLINE] = { 0 };
		if (opt.ShowStatus)
			GetStatusText(hContact, newStatus, oldStatus, str);

		if (opt.ReadAwayMsg && wStatus != ID_STATUS_INVISIBLE && StatusHasAwayMessage(szProto, newStatus))
			db_set_ws(hContact, MODULE, "LastPopupText", str);

		PLUGINDATA *pdp = (PLUGINDATA *)mir_calloc(sizeof(PLUGINDATA));
		pdp->oldStatus = oldStatus;
		pdp->newStatus = newStatus;
		pdp->hAwayMsgHook = nullptr;
		pdp->hAwayMsgProcess = nullptr;
		ShowChangePopup(hContact, Skin_LoadProtoIcon(szProto, newStatus), newStatus, str, pdp);
	}

	if (opt.BlinkIcon && !opt.TempDisabled) {
		HICON hIcon = opt.BlinkIcon_Status ? Skin_LoadProtoIcon(szProto, newStatus) : Skin_LoadIcon(SKINICON_OTHER_USERONLINE);
		wchar_t str[256];
		mir_snwprintf(str, TranslateT("%s is now %s"), Clist_GetContactDisplayName(hContact), StatusList[Index(newStatus)].lpzStandardText);
		BlinkIcon(hContact, hIcon, str);
	}

	if (bEnableSound && db_get_b(0, "Skin", "UseSound", TRUE) && db_get_b(hContact, MODULE, "EnableSounds", 1) && !opt.TempDisabled) {
		if (oldStatus == ID_STATUS_OFFLINE)
			PlayChangeSound(hContact, StatusListEx[ID_STATUS_FROMOFFLINE].lpzSkinSoundName);
		else
			PlayChangeSound(hContact, StatusList[Index(newStatus)].lpzSkinSoundName);
	}

	if (opt.LogToFile) {
		wchar_t stzDate[MAX_STATUSTEXT], stzTime[MAX_STATUSTEXT], stzText[MAX_TEXT_LEN];

		GetTimeFormat(LOCALE_USER_DEFAULT, 0, nullptr, L"HH':'mm", stzTime, _countof(stzTime));
		GetDateFormat(LOCALE_USER_DEFAULT, 0, nullptr, L"dd/MM/yyyy", stzDate, _countof(stzDate));
		mir_snwprintf(stzText, TranslateT("%s, %s. %s changed status to %s (was %s)\r\n"),
			stzDate, stzTime, Clist_GetContactDisplayName(hContact), StatusList[Index(newStatus)].lpzStandardText,
			StatusList[Index(oldStatus)].lpzStandardText);
		LogToFile(stzText);
	}

	return 0;
}
Example #20
0
void wxStatusBarGeneric::DrawFieldText(wxDC& dc, const wxRect& rect, int i, int textHeight)
{
    wxString text(GetStatusText(i));
    if (text.empty())
        return;     // optimization

    int xpos = rect.x + wxFIELD_TEXT_MARGIN,
        maxWidth = rect.width - 2*wxFIELD_TEXT_MARGIN,
        ypos = (int) (((rect.height - textHeight) / 2) + rect.y + 0.5);

    if (ShowsSizeGrip())
    {
        // don't write text over the size grip:
        // NOTE: overloading DoGetClientSize() and GetClientAreaOrigin() wouldn't
        //       work because the adjustment needs to be done only when drawing
        //       the field text and not also when drawing the background, the
        //       size grip itself, etc
        if ((GetLayoutDirection() == wxLayout_RightToLeft && i == 0) ||
            (GetLayoutDirection() != wxLayout_RightToLeft &&
                 i == (int)m_panes.GetCount()-1))
        {
            const wxRect& gripRc = GetSizeGripRect();

            // NOTE: we don't need any special treatment wrt to the layout direction
            //       since DrawText() will automatically adjust the origin of the
            //       text accordingly to the layout in use

            maxWidth -= gripRc.width;
        }
    }

    // eventually ellipsize the text so that it fits the field width

    wxEllipsizeMode ellmode = wxELLIPSIZE_NONE;
    if (HasFlag(wxSTB_ELLIPSIZE_START)) ellmode = wxELLIPSIZE_START;
    else if (HasFlag(wxSTB_ELLIPSIZE_MIDDLE)) ellmode = wxELLIPSIZE_MIDDLE;
    else if (HasFlag(wxSTB_ELLIPSIZE_END)) ellmode = wxELLIPSIZE_END;

    if (ellmode == wxELLIPSIZE_NONE)
    {
        // if we have the wxSTB_SHOW_TIPS we must set the ellipsized flag even if
        // we don't ellipsize the text but just truncate it
        if (HasFlag(wxSTB_SHOW_TIPS))
            SetEllipsizedFlag(i, dc.GetTextExtent(text).GetWidth() > maxWidth);

        dc.SetClippingRegion(rect);
    }
    else
    {
        text = wxControl::Ellipsize(text, dc,
                                    ellmode,
                                    maxWidth,
                                    wxELLIPSIZE_FLAGS_EXPAND_TABS);
            // Ellipsize() will do something only if necessary

        // update the ellipsization status for this pane; this is used later to
        // decide whether a tooltip should be shown or not for this pane
        // (if we have wxSTB_SHOW_TIPS)
        SetEllipsizedFlag(i, text != GetStatusText(i));
    }

#if defined( __WXGTK__ ) || defined(__WXMAC__)
    xpos++;
    ypos++;
#endif

    // draw the text
    dc.DrawText(text, xpos, ypos);

    if (ellmode == wxELLIPSIZE_NONE)
        dc.DestroyClippingRegion();
}
Example #21
0
/*!
errorType STLServerCommandXXX::ReadFixedFields()
Read:
qflag
at_tick
*/
errorType STLServerCommandXXX::ReadFixedFields(StartleRecord &r)
{
/*----------Read the STL QUEUED/IMMEDIATE Flag field--------------------*/
wxInt16 queuedFlag;
wxUint16 atTick;
wxString s;
errorType rv=errNone;

#if STL_DEBUG_USING_XXX
queuedFlag;
atTick;
s;
rv;
r;
#else
	wxString s1="";
    GetSock().Read(&queuedFlag,sizeof (queuedFlag));
    if(GetSock().Error())
	{
		MapWxSocketError sockErr(GetSock().LastError());
        return(sockErr.GetErrorCode());
	}
	s1.Printf("%i ",queuedFlag);

	s.Printf("flag=%i: ",queuedFlag);
    GetStatusText()->AppendText(s);

    if( (queuedFlag != STL_QUEUED) && (queuedFlag != STL_IMMEDIATE) )
    {
        GetStatusText()->AppendText("\n--- Flag error! ---\n");
        rv=errParameter;
    }
	else
	{
		if(queuedFlag==	STL_QUEUED)
			GetStatusText()->AppendText("Queued\n");
		else
			GetStatusText()->AppendText("Immediate\n");
	}
/*-----------------------------------------------------*/

/*--------------Read the atTick field----------------*/
    GetSock().Read(&atTick,sizeof(atTick));
    if(GetSock().Error())
	{
		MapWxSocketError sockErr(GetSock().LastError());
        return(sockErr.GetErrorCode());
	}
	s1=s1+atTick+" ";

	s.Printf("at tick=%i \n",atTick);
    GetStatusText()->AppendText(s);
//----Read all fixed record elements---------------------------------------------

	SetAtTick(atTick);
	SetQueuedFlag(static_cast<STLQueuedFlag>(queuedFlag));
	AppendToReadFromSocketString(s1);
#endif
	return rv;

}
Example #22
0
wxString wxGISStatusBar::GetMessage(int i) const
{
    return GetStatusText(i);
}
Example #23
0
//
// CDVDPlayer::BuildGraph(): Builds a filter graph for playing back the specified
// DVD title/file.  Also gets some interfaces that are required for controlling
// playback.
//
HRESULT CDVDPlayer::BuildGraph(HWND hWndApp, LPDIRECTDRAW pDDObj, LPDIRECTDRAWSURFACE pDDPrimary)
{
    DbgLog((LOG_TRACE, 5, TEXT("CDVDPlayer::BuildGraph() entered"))) ;

    HRESULT     hr ;

    // First release any existing interface pointer(s)
    ReleaseInterfaces() ;
    SetColorKey(253) ;  // default magenta for 8bpp

    // Check if a DVD-Video volume name has been specified; if so, use that
    WCHAR    achwFileName[MAX_PATH] ;
    LPCWSTR  lpszwFileName = NULL ;  // by default
    if (lstrlen(GetFileName()) > 0)  // if something was specified before
    {
#ifdef UNICODE
        lstrcpy(achwFileName, GetFileName()) ;
#else
        MultiByteToWideChar(CP_ACP, 0, GetFileName(), -1, achwFileName, MAX_PATH) ;
#endif // UNICODE

        lpszwFileName = achwFileName ;
    }
    DbgLog((LOG_TRACE, 5, TEXT("DVD file <%s> will be played"), GetFileName())) ;

    // Set DDraw object and surface on DVD graph builder before starting to build graph
    IDDrawExclModeVideo  *pDDXMV ;
    hr = m_pDvdGB->GetDvdInterface(IID_IDDrawExclModeVideo, (LPVOID *)&pDDXMV) ;
    if (FAILED(hr) || NULL == pDDXMV)
    {
        DbgLog((LOG_ERROR, 0,
            TEXT("ERROR: IDvdGB::GetDvdInterface(IDDrawExclModeVideo) failed (Error 0x%lx)"), hr)) ;
        return hr ;
    }
    hr = pDDXMV->SetDDrawObject(pDDObj) ;
    if (FAILED(hr))
    {
        DbgLog((LOG_ERROR, 0, TEXT("ERROR: IDDrawExclModeVideo::SetDDrawObject() failed (Error 0x%lx)"), hr)) ;
        pDDXMV->Release() ;  // release before returning
        return hr ;
    }
    hr = pDDXMV->SetDDrawSurface(pDDPrimary) ;
    if (FAILED(hr))
    {
        DbgLog((LOG_ERROR, 0, TEXT("ERROR: IDDrawExclModeVideo::SetDDrawSurface() failed (Error 0x%lx)"), hr)) ;
        pDDXMV->SetDDrawObject(NULL) ;  // to reset
        pDDXMV->Release() ;  // release before returning
        return hr ;
    }
    pDDXMV->Release() ;  // done with the interface

    // Build the graph
    AM_DVD_RENDERSTATUS   Status ;
    TCHAR                 achBuffer[1000] ;
    hr = m_pDvdGB->RenderDvdVideoVolume(lpszwFileName,
        AM_DVD_HWDEC_PREFER, &Status) ;
    if (FAILED(hr))
    {
        AMGetErrorText(hr, achBuffer, sizeof(achBuffer)) ;
        MessageBox(hWndApp, achBuffer, "Error", MB_OK) ;
        return hr ;
    }
    if (S_FALSE == hr)  // if partial success
    {
        std::basic_string<TCHAR>   l_Text;
        if (GetStatusText(&Status, achBuffer, sizeof(achBuffer)))
	    {
            l_Text.assign(achBuffer);
        }
        else
        {
            l_Text.assign(TEXT("An unknown error has occurred"));
        }
        l_Text.append(TEXT("\n\nDo you still want to continue?"));
        if (IDNO == MessageBox(hWndApp, l_Text.c_str(), TEXT("Warning"), MB_YESNO))
        {
            return E_FAIL;
        }
    }

    GetInterfaces(hWndApp) ;

    hr = GetColorKeyInternal() ;
    ASSERT(SUCCEEDED(hr)) ;

    return S_OK ;
}
Example #24
0
void HttpPostSocket::OnFirst()
{
	int status = atoi(GetStatus().c_str());
	printf("Response status %d: %s\n", status, GetStatusText().c_str());
}
Example #25
0
void StatusBar::SetPanelTextIfDifferent(const wxString& newText, const int panelIndex) {
	if (GetStatusText(panelIndex) != newText) SetStatusText(newText, panelIndex);
}