• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C++ TWindow类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: GetApplication

//
/// Post a OWL-defined message regarding an event [identified by the 'id'
/// parameter] related to the specified view ('view').
//
/// If the current view changes, posts a WM_OWLVIEW message to indicate a change in
/// the status of the view.
//
void
TDocManager::PostEvent(int id, TView& view)
{
  TWindow* win = GetApplication()->GetMainWindow();
  if (win && win->GetHandle())
    win->SendMessage(WM_OWLVIEW, id, TParam2(&view));
}
开发者ID:Meridian59,项目名称:Meridian59,代码行数:14,代码来源:docmanag.cpp


示例2: PleaseWaitWnd

TWindow *__FASTCALL__ PleaseWaitWnd()
{
   TWindow *w;
   w = CrtDlgWndnls(SYSTEM_BUSY,14,1);
   w->goto_xy(1,1); w->puts(PLEASE_WAIT);
   return w;
}
开发者ID:alexey-lysiuk,项目名称:beye,代码行数:7,代码来源:bconsole.cpp


示例3: eventInfo

//
/// When the gadget window receives a WM_COMMAND_ENABLE message, it is likely from a
/// gadget or control within a TControlGadget. This reroutes it to the command
/// target.
//
void
TGadgetWindow::EvCommandEnable(TCommandEnabler& ce)
{
  // If someone derived from TGadgetWindow and handles the command there,
  // give these handlers the first crack.
  //
  TEventInfo eventInfo(WM_COMMAND_ENABLE, ce.GetId());
  if (Find(eventInfo)) {
    Dispatch(eventInfo, 0, TParam2(&ce));
    return;
  }

  TWindow* target = GetParentO();

  // Forward to command target if the enabler was really destined for us, and
  // not a routing from the frame.
  //
  if (target && ce.IsReceiver(*this)) {
    CHECK(target->IsWindow());
    ce.SetReceiver(*target);
    target->EvCommandEnable(ce);
    if( ce.GetHandled() )
      return;
  }

  // Default to TWindow's implementation if the above routing fails
  //
  TWindow::EvCommandEnable(ce);
}
开发者ID:Darkman-M59,项目名称:Meridian59_115,代码行数:34,代码来源:gadgetwi.cpp


示例4: GetHintText

//
// !CQ Auto-hide all docking areas? Give them IDW_s
//
/// Handles checking and unchecking of menu items that are associated with
/// decorations.
//
void
TDecoratedFrame::EvCommandEnable(TCommandEnabler& commandEnabler)
{
  // Provide default command text to TooltipEnablers
  //
  if (dynamic_cast<TTooltipEnabler*>(&commandEnabler))
  {
    tstring hint = GetHintText(commandEnabler.GetId(), htTooltip);
    if (hint.length() > 0)
    {
      commandEnabler.SetText(hint);
      return;
    }
  }

#if 0
  TWindow*  decoration;
  if (DocAreaTop)
    decoration = DocAreaTop->ChildWithId(commandEnabler.GetId());
  else
    decoration = ChildWithId(commandEnabler.GetId());
#else
  TWindow*  decoration = ChildWithId(commandEnabler.GetId());
#endif

  if (!decoration)
    TFrameWindow::EvCommandEnable(commandEnabler);

  else {
    commandEnabler.Enable();
    commandEnabler.SetCheck(decoration->IsWindowVisible() ?
                            TCommandEnabler::Checked :
                            TCommandEnabler::Unchecked);
  }
}
开发者ID:Meridian59,项目名称:Meridian59,代码行数:41,代码来源:decframe.cpp


示例5: addDelegate

void UIAccelerometer::addDelegate(UIAccelerometerDelegate* pDelegate)
{
    UIAccelerometerHandler* pHandler = UIAccelerometerHandler::handlerWithDelegate(pDelegate);

    if (pHandler)
    {
        m_pDelegates->addObject(pHandler);

        if (!m_pSensor)
        {
            m_pSensor = TCOM_Sensors_DataType_Client::GetInstance();

            if (m_pSensor)
            {
                m_pSensor->StartUp();
                m_pSensor->SetDelay(TG3_SENSOR_DELAY_FASTEST);

                TApplication* pApp = TApplication::GetCurrentApplication();
                TWindow* pWnd = pApp->GetActiveWindow();
                m_pSensor->SetWindowCtrlId(pWnd->GetWindowHwndId(), 0);
                m_pSensor->Activate(TG3_SENSOR_TYPE_ACCELEROMETER, TRUE);
            }
            else
            {
                CCLOG("cocos2d: The Accelerometer Sensor Open failed");
            }
        }
    }
}
开发者ID:charlesa101,项目名称:cocos2d-x,代码行数:29,代码来源:CCXUIAccelerometer_uphone.cpp


示例6: GetGadgetWindow

//
/// Sets the text of the gadget. If the given text is blank, then we attempt to
/// load the text from the menu or tooltip.
//
void
TButtonTextGadget::SetText(const tstring& text, bool repaint)
{
  if (text == Text) return;
  Text = text;

  if (Text.length() == 0 && (Style & sText) && GetGadgetWindow())
  {
    TWindow* parent = GetGadgetWindow()->GetParentO();
    TDecoratedFrame* frame= parent ? dynamic_cast<TDecoratedFrame*>(parent) : 0;
    while (parent && !frame){
      parent = parent->GetParentO();
      if (parent)
        frame = dynamic_cast<TDecoratedFrame*>(parent);
    }
    CHECK(frame);
    Text = frame->GetHintText(GetResId().GetInt(), htTooltip);
  }

  if (GetGadgetWindow() && repaint)
  {
    GetGadgetWindow()->GadgetChangedSize(*this);
    Invalidate();
  }
}
开发者ID:Meridian59,项目名称:Meridian59,代码行数:29,代码来源:btntextg.cpp


示例7: GetChildWindow

void TMainMenu::SetWelcomeName()
{
	if(TSettings::GetInstance()->GetNumUsers() == 0)
	{
		TWindow *window = GetChildWindow("welcome", -1);
		if (window)
		{
			window->SetFlags(window->GetFlags() & ~kEnabled);
		}

		window = GetChildWindow("changeplayer", -1);
		if (window)
		{
			window->SetFlags(window->GetFlags() & ~kEnabled);
		}

	}
	else
	{
		TWindow *window = GetChildWindow("welcome", -1);
		if (window)
		{
			TText *text = window->GetCast<TText>();
			text->SetText(TPlatform::GetInstance()->GetStringTable()->GetString("welcome", TSettings::GetInstance()->GetCurrentUserName()));
		}
		
	}
}
开发者ID:ForestMan,项目名称:DefenceGarden,代码行数:28,代码来源:mainmenu.cpp


示例8: CreateEditor

TWindow * __FASTCALL__ CreateEditor(tAbsCoord X1,tAbsCoord Y1,tAbsCoord X2,tAbsCoord Y2,TWindow::twc_flag flags)
{
 TWindow *ret;
 ret = new(zeromem) TWindow(X1,Y1,X2-X1+1,Y2-Y1+1,flags);
 ret->set_color(dialog_cset.editor.active);
 ret->clear();
 return ret;
}
开发者ID:alexey-lysiuk,项目名称:beye,代码行数:8,代码来源:bconsole.cpp


示例9: ASSERT

void TWindow::Create()
{
	ASSERT(!IsCreated());
	if (!IsCreated())
	{
		int screen = gApplication->GetDefaultScreen();
		Window parent = (fParent ? fParent->GetXWindow() : RootWindow(sDisplay, screen));

		XSetWindowAttributes	attributes;
		unsigned long attributesMask = CWBackPixel;
		int border = fBorder;

		attributes.background_pixel = fBackColor.GetPixel();

		if (fStyle == kPopupWindow)
		{
			attributes.save_under = true;
			attributes.override_redirect = true;
			attributesMask |= CWSaveUnder;
			attributesMask |= CWOverrideRedirect;
			border = 1;
		}
		
		fWindow = XCreateWindow(sDisplay, parent, fBounds.left, fBounds.top, GetWidth(), GetHeight(), 
										border,	CopyFromParent, InputOutput, CopyFromParent, attributesMask, &attributes);

		XSelectInput(sDisplay, fWindow, ExposureMask|FocusChangeMask|
									KeyPressMask|KeyReleaseMask|
									ButtonPressMask|ButtonReleaseMask|
									EnterWindowMask|LeaveWindowMask|PointerMotionMask|
									StructureNotifyMask | VisibilityChangeMask /*|SubstructureNotifyMask*/
									);
									
		XWindowAttributes	attr;
		XGetWindowAttributes(sDisplay, fWindow, &attr);
		fDepth = attr.depth;

	 	if (fStyle == kTopLevelWindow)
	 	{
	 		Atom	atoms[2] = { sDeleteWindowAtom, sTakeFocusAtom };
//ignore take focus?			XSetWMProtocols(sDisplay, fWindow, atoms, 2);
			XSetWMProtocols(sDisplay, fWindow, atoms, 1);
		}

		AddWindow(this);

		// give the positioner a chance to do its thing
//		if (fParent && fPositioner)
//			fPositioner(this, fParent->fBounds, fParent->fBounds);

		SetCursor(sDefaultCursor);

		TListIterator<TWindow> iter(fChildren);
		TWindow* child;
		while ((child = iter.Next()) != NULL)
			child->Create();
	}
}
开发者ID:mikevoydanoff,项目名称:zoinks,代码行数:58,代码来源:TWindow.cpp


示例10: iter

void TWindow::NotifyBoundsChanged(const TRect& oldBounds)
{
	TListIterator<TWindow> iter(fChildren);

	TWindow* window;
	
	while ((window = iter.Next()) != NULL)
		window->ParentBoundsChanged(oldBounds, fBounds);
}
开发者ID:mikevoydanoff,项目名称:zoinks,代码行数:9,代码来源:TWindow.cpp


示例11: ProcessUpdates

void TWindow::ProcessUpdates()
{
	TWindow* window = sFirstUpdate;
	sFirstUpdate = NULL;
	
	while (window)
	{
		window->Update();
		window = window->fNextUpdate;
	}
}
开发者ID:mikevoydanoff,项目名称:zoinks,代码行数:11,代码来源:TWindow.cpp


示例12: TRACEX

//
/// When the gadget window receives a WM_COMMAND message, it is likely from a gadget
/// or control within a TControlGadget. This reroutes it to the command target.
//
TResult
TGadgetWindow::EvCommand(uint id, HWND hWndCtl, uint notifyCode) 
{
  TRACEX(OwlCmd, 1, "TGadgetWindow::EvCommand - id(" << id << "), ctl(" <<\
                     hex << uint(hWndCtl) << "), code(" << notifyCode  << ")");

  // First allow any derived class that wants to handle the command
  // NOTE: This search only caters for menu-style WM_COMMANDs (not those
  //       sent by controls)
  //
  TEventInfo  eventInfo(0, id);
  if (Find(eventInfo)) {
    Dispatch(eventInfo, id);
    return 0;
  }


#if 0
  // Prior versions of TGadgetWindow relied on TWindow's EvCommand for
  // dispatching WM_COMMAND events. This required that one derives from
  // a decoration class (eg. TControlbar, TToolbox) to handle control
  // notifications. The current version uses a more generalized logic
  // involving the CommandTarget and a frame ancestor class. This allows
  // a client window to handle notifications of a control in a toolbar
  // without using a TControlbar-derived class.
  // However, if you need to previous behaviour, simply invoke TWindow's
  // EvCommand from this handler.

  return TWindow::EvCommand(id, hWndCtl, notifyCode);
#endif

  TWindow* target;
  TFrameWindow* frame;

  // Find the frame who is our latest ancestor and make it our command target
  //
  for (target = GetParentO(); target; target = target->GetParentO()) {
    frame = TYPESAFE_DOWNCAST(target, TFrameWindow);
    if (frame || !target->GetParentO())
      break;
  }

  // Make sure the frame doesn't think we are its command target, or a BAD
  // loop will happen
  //
  if (target && (!frame || frame->GetCommandTarget() != GetHandle())) {
    CHECK(target->IsWindow());
    return target->EvCommand(id, hWndCtl, notifyCode);
  }

  // If all command routing fails, go back to basic dispatching of TWindow
  //
  return TWindow::EvCommand(id, hWndCtl, notifyCode);
}
开发者ID:Darkman-M59,项目名称:Meridian59_115,代码行数:58,代码来源:gadgetwi.cpp


示例13: ChildWithId

//
/// Search for child with ID = IDW_TOOLBAR, and if found check that it is
/// GadgetWindow and return it;
//
TGadgetWindow*
TDecoratedFrame::GetControlBar()
{
  TWindow* wnd = ChildWithId(IDW_TOOLBAR);
  if(!wnd){
    wnd = FirstThat(IsHaveGadgetWindow);
    if(!wnd || (wnd = wnd->ChildWithId(IDW_TOOLBAR))==0)
      return 0;
  }
  TGadgetWindow* toolBar = TYPESAFE_DOWNCAST(wnd, TGadgetWindow);
  if(toolBar)
    return toolBar;
  return 0;
}
开发者ID:Meridian59,项目名称:Meridian59,代码行数:18,代码来源:decframe.cpp


示例14: new

void BeyeContext::init_tconsole( unsigned long vio_flg,unsigned long twin_flg )
{
    beye_priv& priv = static_cast<beye_priv&>(opaque);
    priv._tconsole=twInit(system(),codepage,vio_flg,twin_flg);
    if(priv._tconsole->vio_width() < 80 || priv._tconsole->vio_height() < 3) {
	if(priv._tconsole->vio_width()>16 && priv._tconsole->vio_height()>2) {
	    unsigned evt,x,y;
	    TWindow *win;
	    x = (priv._tconsole->vio_width()-17)/2;
	    y = (priv._tconsole->vio_height()-3)/2;
	    win = new(zeromem) TWindow(x,y,x+16,y+2,TWindow::Flag_None | TWindow::Flag_NLS);
	    if(!win) goto done;
	    win->set_title(" Error ",TWindow::TMode_Center,error_cset.border);
	    win->into_center();
	    win->set_color(error_cset.main);
	    win->set_frame(TWindow::DOUBLE_FRAME,error_cset.border);
	    win->goto_xy(1,1);
	    win->puts("Screensize<80x3");
	    win->show();
	    do {
		evt = GetEvent(NULL,NULL,win);
	    }while(!(evt == KE_ESCAPE || evt == KE_F(10) || evt == KE_ENTER));
	    delete win;
	}
done:
	twDestroy();
	std::cerr<<"Current size of video buffer is: w="<<priv._tconsole->vio_width()<<" h="<<priv._tconsole->vio_height()<<std::endl;
	throw std::runtime_error("Size of video buffer must be larger than 79x2");
    }
}
开发者ID:alexey-lysiuk,项目名称:beye,代码行数:30,代码来源:main.cpp


示例15: GetLastChild

//
/// Applies the specified 'action' function to each TPropertyPage child of the
/// sheet.
/// \note The logic here traverses the TPropertySheet's ChildList. Therefore
///       we will miss any page that does not have an associated TPropertyPage
///       inserted in the sheet's ChildList.
void
TPropertySheet::ForEachPage(TActionPageFunc action, void* paramList)
{
  if (GetLastChild()) {
    TWindow*  curChild;
    TWindow*  nextChild = GetLastChild()->Next();
    TPropertyPage* curPage;
    do {
      curChild = nextChild;
      nextChild = nextChild->Next();
      curPage = TYPESAFE_DOWNCAST(curChild, TPropertyPage);
      if (curPage)
        action(curPage, paramList);
    } while (curChild != GetLastChild() && GetLastChild() != 0);
  }
}
开发者ID:GarMeridian3,项目名称:Meridian59,代码行数:22,代码来源:propsht.cpp


示例16: TGadget

//
/// Creates a TControlGadget object associated with the specified TControl window.
//
TControlGadget::TControlGadget(TWindow& control, TBorderStyle border)
:
  TGadget(control.GetId(), border)
{
  Control = &control;
  Control->ModifyStyle(0, WS_CLIPSIBLINGS);  // Make sure relayout paints OK
  TRACEX(OwlGadget, OWL_CDLEVEL, "TControlGadget constructed @" << (void*)this);
}
开发者ID:Darkman-M59,项目名称:Meridian59_115,代码行数:11,代码来源:controlg.cpp


示例17: EAlert

void
TApplication::ReadyToRun()
{
	EAlert *alert = new EAlert("Question",
				   "Would you like to run the scroll-test?\nChoose \"Cancel\" to quit.",
				   "Cancel", "OK", NULL,
				   E_WIDTH_AS_USUAL, E_IDEA_ALERT);

	if(alert->Go() != 1)
	{
		Quit();
		return;
	}

	TWindow *win = new TWindow(ERect(100, 100, 550, 500), "Scroll Test", E_TITLED_WINDOW, 0);
	win->Show();
}
开发者ID:D-os,项目名称:EasyToolkitAndExtension,代码行数:17,代码来源:scroll-test.cpp


示例18: SetLocation

//
/// Insert a decoration window into position at one of the four edges.
//
/// After you specify where the decoration should be placed, Insert adds it just
/// above, below, left, or right of the client window. This process is especially
/// important when there are multiple decorations. Insert looks at the decoration's
/// Attr.Style member and checks the WS_VISIBLE flag to tell whether the decoration
/// should initially be visible or hidden.
/// To position the decoration, Insert uses TLocation enum, which describes Top,
/// Left, Bottom, and Right positions where the decoration can be placed.
//
void
TDecoratedFrame::Insert(TWindow& decoration, TLocation location)
{
  // Store away location for remove/re-insetion
  //
  SetLocation(decoration, location);

  // Make sure the decoration has clipsiblings style, since our rearranging
  // causes corners to overlap sometimes.
  //
  ModifyStyle(0, WS_CLIPSIBLINGS);//|WS_CLIPCHILDREN);///????

  // Parent to decframe and remove layoutmetrics in case it's a re-insert
  //
  decoration.SetParent(this);
  RemoveChildLayoutMetrics(decoration);

  // If the window should be visible, proceed with insertion.
  // NOTE: Should we check the 'wfInsertAtEdge' flag here? It mostly
  //       important when hiding/showing decorations [i.e. In EvCommand
  //       handler]. However, it would be nice to check for it and use
  //       something other than ClientWnd if necessary.
  //
  if (decoration.GetWindowAttr().Style & WS_VISIBLE) {
    switch (location) {
      case None:
        break;
      case Top:
        InsertAtTop(decoration, ClientWnd);
        break;
      case Bottom:
        InsertAtBottom(decoration, ClientWnd);
        break;
      case Left:
        InsertAtLeft(decoration, ClientWnd);
        break;
      case Right:
        InsertAtRight(decoration, ClientWnd);
        break;
      default: //JJH added empty default statement
  break;
    }
  }
}
开发者ID:Meridian59,项目名称:Meridian59,代码行数:55,代码来源:decframe.cpp


示例19: if

//
/// Insert a decoration window at the left of the client area, possibly to the
/// left of another given decoration or the client
//
void
TDecoratedFrame::InsertAtLeft(TWindow& decoration, TWindow* insertLeftOf)
{
  TLayoutMetrics  metrics;
  TWindow*        insertRightOf;

  // Get the layout metrics for "insertLeftOf"(the window the decoration is
  // going to be inserted to the left of)
  //
  GetChildLayoutMetrics(*insertLeftOf, metrics);

  insertRightOf = metrics.X.RelWin;

  // If "insertLeftOf" has a border then set its left edge to be the same as
  // the decoration's right edge; otherwise place its left edge one pixel to
  // the right of the decoration's right edge
  //
  metrics.X.Set(lmLeft,
                insertLeftOf->GetWindowAttr().Style & WS_BORDER ? lmSameAs : lmRightOf,
                &decoration, lmRight);
  SetChildLayoutMetrics(*insertLeftOf, metrics);

  // Now set the layout metrics for the decoration so it's left edge is the
  // same as the right edge of "insertRightOf"
  //
  bool overlap = (decoration.GetWindowAttr().Style & WS_BORDER);

  metrics.X.Set(lmLeft, overlap ? lmSameAs : lmRightOf, insertRightOf,
                insertRightOf ? lmRight : lmLeft);

  metrics.Width.AsIs(lmWidth);

  // If the client window & decoration both have or don't have borders then
  // place the decoration so its "y" and "bottom" are the same as the client
  // windows; otherwise place its "y" above/below the client window's "y" and
  // its "bottom" below/above the client window's "bottom" based on who's has
  // borders & who doesn't
  //
  // This way if there are top or bottom decorations they will be tiled
  // over/under the left/right decorations
  //
  if (ToBool(ClientWnd->GetWindowAttr().Style & WS_BORDER) == overlap) {
    metrics.Y.SameAs(ClientWnd, lmTop);
    metrics.Height.SameAs(ClientWnd, lmBottom);
  }
  else if (overlap) {
    metrics.Y.Set(lmTop, lmAbove, ClientWnd, lmTop);
    metrics.Height.Set(lmBottom, lmBelow, ClientWnd, lmBottom);
  }
  else {
    metrics.Y.Set(lmTop, lmBelow, ClientWnd, lmTop);
    metrics.Height.Set(lmBottom, lmAbove, ClientWnd, lmBottom);
  }
  SetChildLayoutMetrics(decoration, metrics);
}
开发者ID:Meridian59,项目名称:Meridian59,代码行数:59,代码来源:decframe.cpp


示例20: GetFirstChild

//
/// Give the decorations an opportunity to do pre-processing. Don't bother
/// checking the client window since it is typically in the focus chain and
/// will be given an opportunity to do pre-processing
//
bool
TDecoratedFrame::PreProcessMsg(MSG& msg)
{
  TWindow*  firstChild = GetFirstChild();

  if (firstChild) {
    TWindow*  child = firstChild;

    do {
      if (child != ClientWnd && child->GetHandle() &&
         (child->GetWindowLong(GWL_STYLE) & WS_VISIBLE) &&
          child->PreProcessMsg(msg))
        return true;

      child = child->Next();
    } while (child != firstChild);
  }

  return TFrameWindow::PreProcessMsg(msg);
}
开发者ID:Meridian59,项目名称:Meridian59,代码行数:25,代码来源:decframe.cpp



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C++ TWsEvent类代码示例发布时间:2022-05-31
下一篇:
C++ TWeakPtr类代码示例发布时间:2022-05-31
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap