本文整理汇总了C++中TWindow类的典型用法代码示例。如果您正苦于以下问题:C++ TWindow类的具体用法?C++ TWindow怎么用?C++ TWindow使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了TWindow类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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));
}
示例2: PleaseWaitWnd
TWindow *__FASTCALL__ PleaseWaitWnd()
{
TWindow *w;
w = CrtDlgWndnls(SYSTEM_BUSY,14,1);
w->goto_xy(1,1); w->puts(PLEASE_WAIT);
return w;
}
示例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);
}
示例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);
}
}
示例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");
}
}
}
}
示例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();
}
}
示例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()));
}
}
}
示例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;
}
示例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();
}
}
示例10: iter
void TWindow::NotifyBoundsChanged(const TRect& oldBounds)
{
TListIterator<TWindow> iter(fChildren);
TWindow* window;
while ((window = iter.Next()) != NULL)
window->ParentBoundsChanged(oldBounds, fBounds);
}
示例11: ProcessUpdates
void TWindow::ProcessUpdates()
{
TWindow* window = sFirstUpdate;
sFirstUpdate = NULL;
while (window)
{
window->Update();
window = window->fNextUpdate;
}
}
示例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);
}
示例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;
}
示例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");
}
}
示例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);
}
}