本文整理汇总了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);
}
示例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;
}
示例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"));
}
示例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;
}
示例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;
}
示例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;
}
示例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");
}
示例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);
}
示例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");
}
示例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);
}
示例11: TModule
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
// TOWLEXTDll
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
TOWLEXTDll::TOWLEXTDll(bool shouldLoad, bool mustLoad)
:
TModule(OwlExtName, shouldLoad, mustLoad),
GetOWLEXTVersion(*this, "GetOWLEXTVersion")
{
TRACEX(OwlExtModule, 1, "TOWLEXTDll external constructor invoked");
}
示例12: TRACEX
TMsgThread::IdleAction(long /*idleCount*/)
#endif
{
TRACEX(MsgThreads, 1, "TMsgThread::IdleAction() called @" << (void*)this <<
" idleCount " << idleCount);
return false;
}
示例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);
}
示例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 << ".");
}
示例15: TRACEX
uint
TColumnHeader::Transfer(void* /*buffer*/, TTransferDirection /*direction*/)
{
TRACEX(OwlCommCtrl, OWL_CDLEVEL, "TColumnHeader::Transfer is not"\
"implemented!");
return 0;
}