当前位置: 首页>>代码示例>>C++>>正文


C++ TRACEX函数代码示例

本文整理汇总了C++中TRACEX函数的典型用法代码示例。如果您正苦于以下问题:C++ TRACEX函数的具体用法?C++ TRACEX怎么用?C++ TRACEX使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。


在下文中一共展示了TRACEX函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。

示例1: PRECONDITION

//
/// Calls TButtonGadget::GetDesiredSize  if (Style & sBitmap); calls
/// TGadget::GetDesiredSize and adds the size of the text region.
//
void
TButtonTextGadget::GetDesiredSize(TSize& size)
{
  PRECONDITION(Window);
  TRACEX(OwlGadget, 1, _T("TButtonTextGadget::GetDesiredSize() enter @") << this <<
    _T(" size ") << size);

  if(Style&sBitmap)
    TButtonGadget::GetDesiredSize(size);
  else
    TGadget::GetDesiredSize(size);

  // if paint text -> add text size
  if(Style&sText){
    TSize textSize;
    GetTextSize(textSize);

    TSize gsize;
    TGadget::GetDesiredSize(gsize);
    switch(LayoutStyle){
       case lTextLeft:
       case lTextRight:
         size.cx += textSize.cx + TextSpaceV;
         size.cy =  std::max(size.cy,textSize.cy+gsize.cy);
         break;
       case lTextTop:
       case lTextBottom:
         size.cx += std::max(size.cx,textSize.cx+gsize.cx);
         size.cy += textSize.cy + TextSpaceH;
         break;
    }
  }
  TRACEX(OwlGadget, 1, _T("TButtonTextGadget::GetDesiredSize() leave @") << this <<
    _T(" size ") << size);
}
开发者ID:Meridian59,项目名称:Meridian59,代码行数:39,代码来源:btntextg.cpp

示例2: defined

//
/// Starts the thread executing. The actual call depends on the operating system.
/// Returns the handle of the thread.
/// After the system call we check status. 
//
TThread::THandle TThread::Start()
{
  // If Start() has already been called for this thread, release the
  // previously created system thread object before launching a new one.
  //
  if ((GetStatus() != Created) && Handle) {
    ::CloseHandle(Handle);
  }

# if defined(BI_MULTI_THREAD_RTL)
#    if defined(BI_COMP_MSC) || defined(BI_COMP_GNUC)
  Handle = (HANDLE)::_beginthreadex(0, 4096, &TThread::Execute, this, 0, (uint*)&ThreadId);
#    else
  Handle = (HANDLE)::_beginthreadNT(&TThread::Execute, 4096, this, 0, 0, &ThreadId);
#    endif
# else
  Handle = ::CreateThread(0, 0, &TThread::Execute, this, 0, &ThreadId);
# endif


  if (Handle) {
    TRACEX(OwlThread, 1, _T("Thread started [id:") << Handle << _T(']'));
    Stat = Running;
  }
  else {
    TRACEX(OwlThread, 2, _T("Thread failed to start"));
    Stat = Invalid;
    throw TThreadError(TThreadError::CreationFailure);
  }

  return Handle;
}
开发者ID:AlleyCat1976,项目名称:Meridian59_103,代码行数:37,代码来源:thread.cpp

示例3: TRACEX

//
/// Removes a template from the list of templates currently managed by
/// the DocManager.
//
void
TDocManager::DeleteTemplate(TDocTemplate& tpl)
{
  // Skip static templates
  //
  if (tpl.IsStatic()) {
    TRACEX(OwlDocView, 0, _T("TDocManager::DeleteTemplate() invoked for static"));
    return;
  }

  // Check if it has an owner
  //
  if (!tpl.GetDocManager()) {
    TRACEX(OwlDocView, 0, _T("TDocManager::DeleteTemplate(), templ. has no owner"));
    return;
  }

  // Unreference the template - will be deleted unless documents
  // still reference template.
  //
  if (TDocTemplate::RemoveLink((TRegLink**)&TemplateList, &tpl)) {
    UnRefTemplate(tpl);
    return;
  }

  TRACEX(OwlDocView, 0, _T("TDocManager::DeleteTemplate(), not in app list"));
}
开发者ID:Meridian59,项目名称:Meridian59,代码行数:31,代码来源:docmanag.cpp

示例4: CommAccept

/*==========================================================================*
 * FUNCTION : CommAccept
 * PURPOSE  : To accept a client from a server port
 * CALLS    : 
 * CALLED BY: 
 * ARGUMENTS: IN HANDLE  hPort : The opened server type port
 * RETURN   : HANDLE : NON-NULL: The accepted client handle. NULL: failure
 * COMMENTS : 
 *==========================================================================*/
 HANDLE CommAccept(IN HANDLE hPort)
{
	STD_PORT_DRV *pPort = (STD_PORT_DRV *)hPort;
	STD_PORT_DRV *pClient;
	HANDLE		hClient;

	pClient = NEW(STD_PORT_DRV, 1);
	if (pClient == NULL)
	{
#ifdef _DEBUG_HAL_COMM
		TRACEX("[CommAccept] -- No memory to new STD_PORT_DRV for client.\n");
#endif //_DEBUG_HAL_COMM
		return NULL;
	}

	hClient = pPort->pfnAccept( pPort->hInstance );
	if (hClient == NULL)
	{
#ifdef _DEBUG_HAL_COMM
		TRACEX("[CommAccept] --  Fails on accepting client.\n");
#endif //_DEBUG_HAL_COMM

		DELETE(pClient);

		return NULL;
	}

	*pClient = *pPort;				// get all properties of parent port.
	pClient->hInstance = hClient;	// new instance.
	(*pPort->pLibRef)++;			// increase ref.

	return (HANDLE)pClient;
}
开发者ID:fjw0312,项目名称:android-app-linux-server,代码行数:42,代码来源:halcomm.c

示例5: TRACEX

//
/// Initializes the view. Notifies others a view is created by posting the dnCreate
/// event.
//
TView*
TDocument::InitView(TView* view)
{
  if (!view) {
    TRACEX(OwlDocView, 0, _T("InitView(): 0 view specified!"));
    return 0;
  }
  if (!view->IsOK()) {
    TRACEX(OwlDocView, 0, _T("InitView(): Invalid view object specified!"));
    delete view;
    return 0;
  }

  CHECK(DocManager);
  DocManager->PostEvent(dnCreate, *view);

  if (!view->IsOK()) {
    TRACEX(OwlDocView, 0, _T("InitView(): Invalid view object post dnCreate!"));
    delete view;
    return 0;
  }

  ReindexFrames();
  TView::BumpNextViewId();

  return view;
}
开发者ID:Darkman-M59,项目名称:Meridian59_115,代码行数:31,代码来源:document.cpp

示例6: switch

//
/// Returns the total number of properties for this document, where index is the
/// property index, dest contains the property data, and textlen is the size of the
/// array. If textlen is 0, property data is returned as binary data; otherwise,
/// property data is returned as text data.
//
int
TDocument::GetProperty(int prop, void * dest, int textlen)
{
  LPCTSTR src;
  tchar   numBuf[15];
  switch (prop) {
    case DocumentClass: {
        _USES_CONVERSION;
        src = _A2W(_OBJ_FULLTYPENAME(this));
      }
      break;

    case TemplateName:
      src = Template ? Template->GetDescription() : 0;
      break;

    case ViewCount: {
      int cnt;
      TView* view;
      for (view=ViewList, cnt=0; view != 0; view=view->NextView, cnt++)
        ; // Do nothing
      if (!textlen) {
        *(int *)dest = cnt;
        return sizeof(int);
      }
      wsprintf(numBuf, _T("%d"), cnt);
      src = numBuf;
      break;
    }

    case StoragePath:
      src = DocPath;
      break;

    case DocTitle:
      src = Title;
      break;

    default:
      TRACEX(OwlDocView, 0, _T("GetProperty(): invalid property [") 
             << prop << _T("] specified!") );
      return 0;
  }

  if (!textlen) {
    TRACEX(OwlDocView, 0, _T("GetProperty(): 0-Length buffer specified!"));
    return 0;
  }
  int srclen = src ? static_cast<int>(::_tcslen(src)) : 0;
  if (textlen > srclen)
    textlen = srclen;
  if (textlen)
    memcpy(dest, src, textlen*sizeof(tchar));
  *((LPTSTR)dest + textlen) = 0;
  return srclen;
}
开发者ID:Darkman-M59,项目名称:Meridian59_115,代码行数:62,代码来源:document.cpp

示例7: defined

//
/// Return name of predefined Windows button class
//
/// Overrides TWindow's GetClassName function. Returns the name "BUTTON".
//
TWindow::TGetClassNameReturnType
TButton::GetClassName()
{
#if defined(OWL_SUPPORT_BWCC)
  if (GetApplication()->BWCCEnabled()) {
    TRACEX(OwlControl, 1, "BWCC button used for classname @" << (void*)this);
    return BUTTON_CLASS;
  }
#endif
  TRACEX(OwlControl, 1, "Regular button used for classname @" << (void*)this);
  return _T("BUTTON");
}
开发者ID:AlleyCat1976,项目名称:Meridian59_103,代码行数:17,代码来源:button.cpp

示例8: TRACEX

//
/// Calls TGadget::SetBounds and passes the dimensions of the control gadget's
/// rectangle. SetBounds informs the control gadget of a change in its bounding
/// rectangle.
//
void
TControlGadget::SetBounds(const TRect& bounds)
{
  TRACEX(OwlGadget, 1, "TControlGadget::SetBounds() enter @" << (void*)this <<
    " bounds = " << bounds);

  // Set the gadget bounds, then move & repaint the control
  //
  TGadget::SetBounds(bounds);
  Control->SetWindowPos(0, Bounds, SWP_NOACTIVATE|SWP_NOZORDER|SWP_NOSIZE);

  TRACEX(OwlGadget, 1, "TControlGadget::SetBounds() leave @" << (void*)this <<
    " bounds = " << bounds);
}
开发者ID:Darkman-M59,项目名称:Meridian59_115,代码行数:19,代码来源:controlg.cpp

示例9: defined

//
/// Return name of Windows check box class
//
/// returns "BUTTON."
//
TWindow::TGetClassNameReturnType
TCheckBox::GetClassName()
{
#if defined(OWL_SUPPORT_BWCC)
  if (GetApplication()->BWCCEnabled()) {
    TRACEX(OwlControl, 1, _T("BWCC checkbox used for classname @") << (void*)this);
    // !CQ to be consistent, we should do this trace for ALL bwcc-able controls,
    // !CQ or none.
    return CHECK_CLASS;
  }
#endif
  TRACEX(OwlControl, 1, _T("Regular checkbox used for classname @") << (void*)this);
  return _T("BUTTON");
}
开发者ID:AlleyCat1976,项目名称:Meridian59_103,代码行数:19,代码来源:checkbox.cpp

示例10: TGadgetWindow

//
/// Constructs a TControlBar interface object with the specified direction (either
/// horizontal or vertical) and window font.
//
TControlBar::TControlBar(TWindow*        parent,
                         TTileDirection  direction,
                         TFont*          font,
                         TModule*        module)
:
  TGadgetWindow(parent, direction, font, module)
{
  GetMargins().Units = TMargins::BorderUnits;

  if (GetDirection() == Horizontal){
    GetMargins().Left = GetMargins().Right = TUIMetric::CxFixedFrame;
    GetMargins().Top = GetMargins().Bottom = TUIMetric::CyFixedFrame;
  }
  else {
    GetMargins().Left = GetMargins().Right = TUIMetric::CxFixedFrame;
    GetMargins().Top = GetMargins().Bottom = TUIMetric::CyFixedFrame;
  }

//  Margins.Left = Margins.Right = TUIMetric::CxSizeFrame + 2;  // (6) fixed?
//  Margins.Top = Margins.Bottom = TUIMetric::CyFixedFrame;     // (2) fixed?

  // Toolbars default to having tooltips
  //
  SetWantTooltip(true);

  TRACEX(OwlWin, OWL_CDLEVEL, "TControlBar constructed @" << (void*)this);
}
开发者ID:Darkman-M59,项目名称:Meridian59_115,代码行数:31,代码来源:controlb.cpp

示例11: TModule

//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//                                                                    TOWLEXTDll
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
TOWLEXTDll::TOWLEXTDll(bool shouldLoad, bool mustLoad)
:
TModule(OwlExtName, shouldLoad, mustLoad),
GetOWLEXTVersion(*this, "GetOWLEXTVersion")
{
  TRACEX(OwlExtModule, 1, "TOWLEXTDll external constructor invoked");
}
开发者ID:Meridian59,项目名称:Meridian59,代码行数:10,代码来源:owlext.cpp

示例12: TRACEX

TMsgThread::IdleAction(long /*idleCount*/)
#endif
{
  TRACEX(MsgThreads, 1, "TMsgThread::IdleAction() called @" << (void*)this <<
                        " idleCount " << idleCount);
  return false;
}
开发者ID:AlleyCat1976,项目名称:Meridian59_103,代码行数:7,代码来源:msgthred.cpp

示例13: TRACEX

//
/// Overrides TWindow's SetupWindow function. If the button is the default push
/// button and an owner-drawn button, SetupWindow sends a DM_SETDEFID message to the
/// parent window.
//
/// \note this only works (and IsDefPB should only be true) if Parent is a dialog
//
void
TButton::SetupWindow()
{
  TRACEX(OwlControl, 1, "TButton::SetupWindow() @" << (void*)this);
  if (IsDefPB && ((Attr.Style & BS_OWNERDRAW) == BS_OWNERDRAW))
    Parent->HandleMessage(DM_SETDEFID, Attr.Id);
}
开发者ID:AlleyCat1976,项目名称:Meridian59_103,代码行数:14,代码来源:button.cpp

示例14: CheckValid

//
/// Creates a bitmap object from the given metaFile using the given palette and size
/// arguments.
//
TBitmap::TBitmap(const TMetaFilePict& metaFile, TPalette& palette, const TSize& defSize)
{
  // Adjust size to final metafile size as needed
  //
  TMemoryDC memDC;
  TSize size = metaFile.CalcPlaySize(memDC, defSize);

  // Create bitmap, either mono or screen compatible
  //
  uint16  nColors;
  palette.GetObject(nColors);
  if (nColors > 2) {
    TScreenDC dc;
    Handle = ::CreateCompatibleBitmap(dc, size.cx, size.cy);
  }
  else
    Handle = ::CreateBitmap(size.cx, size.cy, 1, 1, 0);

  CheckValid();
  RefAdd(Handle, Bitmap);

  // clear bitmap, then play metafile onto it
  //
  memDC.SelectObject(*this);

  memDC.SelectStockObject(WHITE_BRUSH);
  memDC.PatBlt(0, 0, size.cx, size.cy);
  memDC.SelectObject(palette, false);

  metaFile.PlayOnto(memDC, size);

  TRACEX(OwlGDI, OWL_CDLEVEL, "TBitmap constructed @" << (void*)this <<
         " from metafile @" << (void*)&metaFile << ".");
}
开发者ID:Darkman-M59,项目名称:Meridian59_115,代码行数:38,代码来源:bitmap.cpp

示例15: TRACEX

uint
TColumnHeader::Transfer(void* /*buffer*/, TTransferDirection /*direction*/)
{
  TRACEX(OwlCommCtrl, OWL_CDLEVEL, "TColumnHeader::Transfer is not"\
                                   "implemented!");
  return 0;
}
开发者ID:Darkman-M59,项目名称:Meridian59_115,代码行数:7,代码来源:colmnhdr.cpp


注:本文中的TRACEX函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。