本文整理汇总了C++中shell::Pointer类的典型用法代码示例。如果您正苦于以下问题:C++ Pointer类的具体用法?C++ Pointer怎么用?C++ Pointer使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了Pointer类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ShellClosed
void ShellPool::ShellClosed(const ShellEvent::Pointer& e)
{
if (e->doit)
{
Shell::Pointer s = e->GetSource();
IShellListener* l = s->GetExtraShellListener();
if (l != 0)
{
s->SetExtraShellListener(NULL);
l->ShellClosed(e);
// The shell can 'cancel' the close by setting
// the 'doit' to false...if so, do nothing
if (e->doit)
{
availableShells.push_back(s);
s->SetVisible(false);
}
else
{
// Restore the listener
s->SetExtraShellListener(l);
}
}
}
e->doit = false;
}
示例2: GetModalChild
Shell::Pointer Window::GetModalChild(const QList<Shell::Pointer>& toSearch)
{
int modal = Constants::APPLICATION_MODAL | Constants::SYSTEM_MODAL | Constants::PRIMARY_MODAL;
int size = toSearch.size();
for (int i = size - 1; i < size; i--)
{
Shell::Pointer shell = toSearch[i];
// Check if this shell has a modal child
QList<Shell::Pointer> children = shell->GetShells();
Shell::Pointer modalChild = GetModalChild(children);
if (modalChild != 0)
{
return modalChild;
}
// If not, check if this shell is modal itself
if (shell->IsVisible() && (shell->GetStyle() & modal) != 0)
{
return shell;
}
}
return Shell::Pointer(nullptr);
}
示例3: ShellClosed
void ShellPool::ShellClosed(ShellEvent::Pointer e)
{
if (e->doit)
{
Shell::Pointer s = e->GetSource();
IShellListener::Pointer l =
s->GetData(CLOSE_LISTENER).Cast<IShellListener> ();
if (l != 0)
{
s->SetData(Object::Pointer(0), CLOSE_LISTENER);
l->ShellClosed(e);
// The shell can 'cancel' the close by setting
// the 'doit' to false...if so, do nothing
if (e->doit)
{
availableShells.push_back(s);
s->SetVisible(false);
}
else
{
// Restore the listener
s->SetData(l, CLOSE_LISTENER);
}
}
}
e->doit = false;
}
示例4: IsDocked
bool LayoutPart::IsDocked()
{
Shell::Pointer s = this->GetShell();
if (s == 0) {
return false;
}
return s->GetData().Cast<IWorkbenchWindow>() != 0;
}
示例5: SetTitle
void WorkbenchWindowConfigurer::SetTitle(const std::string& title)
{
windowTitle = title;
Shell::Pointer shell = window.Lock()->GetShell();
if (shell)
{
shell->SetText(title);
}
}
示例6: GetTitle
std::string WorkbenchWindowConfigurer::GetTitle()
{
Shell::Pointer shell = window.Lock()->GetShell();
if (shell)
{
// update the cached title
windowTitle = shell->GetText();
}
return windowTitle;
}
示例7: MenuItemTriggered
void SwitchToWindowMenu::MenuItemTriggered(int index)
{
if (index < 0 || index >= windows.size()) return;
IWorkbenchWindow* window = windows[index];
Shell::Pointer windowShell = window->GetShell();
if (windowShell->GetMinimized())
{
windowShell->SetMinimized(false);
}
windowShell->SetActive();
windowShell->GetControl()->raise();
}
示例8: allShells
QList<Shell::Pointer> QtShell::GetShells()
{
GuiWidgetsTweaklet* widgetTweaklet = Tweaklets::Get(GuiWidgetsTweaklet::KEY);
QList<Shell::Pointer> allShells(widgetTweaklet->GetShells());
QList<Shell::Pointer> descendants;
for (int i = 0; i < allShells.size(); ++i)
{
Shell::Pointer shell = allShells[i];
if (widgetTweaklet->GetShell(shell->GetControl()) == this)
{
descendants.push_back(shell);
}
}
return descendants;
}
示例9: AllocateShell
Shell::Pointer ShellPool::AllocateShell(IShellListener* closeListener)
{
Shell::Pointer result;
if (!availableShells.empty())
{
result = availableShells.front();
availableShells.pop_front();
}
else
{
result = Tweaklets::Get(GuiWidgetsTweaklet::KEY)->CreateShell(parentShell.Lock(),
flags);
result->AddShellListener(this);
//result.addDisposeListener(disposeListener);
}
result->SetExtraShellListener(closeListener);
return result;
}
示例10: GetWorkbenchWindow
IWorkbenchWindow::Pointer LayoutPart::GetWorkbenchWindow()
{
Shell::Pointer s = this->GetShell();
if (s == 0)
{
return IWorkbenchWindow::Pointer(0);
}
Object::Pointer data = s->GetData();
if (data.Cast<IWorkbenchWindow>() != 0)
{
return data.Cast<IWorkbenchWindow>();
}
else if (data.Cast<DetachedWindow>() != 0)
{
return data.Cast<DetachedWindow>()->GetWorkbenchPage()->GetWorkbenchWindow();
}
return IWorkbenchWindow::Pointer(0);
}
示例11:
Shell::Pointer Window::DefaultModalParent::GetShell() const
{
Shell::Pointer parent = Tweaklets::Get(GuiWidgetsTweaklet::KEY)->GetActiveShell();
// Make sure we don't pick a parent that has a modal child (this can lock the app)
if (parent == 0)
{
// If this is a top-level window, then there must not be any open modal windows.
parent = Window::GetModalChild(Tweaklets::Get(GuiWidgetsTweaklet::KEY)->GetShells());
}
else
{
// If we picked a parent with a modal child, use the modal child instead
Shell::Pointer modalChild = Window::GetModalChild(parent->GetShells());
if (modalChild != 0)
{
parent = modalChild;
}
}
return parent;
}
示例12: CreateShell
Shell::Pointer Window::CreateShell()
{
Shell::Pointer newParent = this->GetParentShell();
// if (newParent != 0 && newParent.isDisposed())
// {
// parentShell = new SameShellProvider(null);
// newParent = getParentShell();//Find a better parent
// }
//Create the shell
Shell::Pointer newShell = Tweaklets::Get(GuiWidgetsTweaklet::KEY)->CreateShell(newParent, this->GetShellStyle());
// resizeListener = new Listener() {
// public void handleEvent(Event e) {
// resizeHasOccurred = true;
// }
// };
//newShell.addListener(SWT.Resize, resizeListener);
newShell->SetData(Object::Pointer(this));
//Add a listener
newShell->AddShellListener(this->GetShellListener());
//Set the layout
this->ConfigureShell(newShell);
// //Register for font changes
// if (fontChangeListener == null)
// {
// fontChangeListener = new FontChangeListener();
// }
// JFaceResources.getFontRegistry().addListener(fontChangeListener);
return newShell;
}
示例13: CreateShell
Shell::Pointer QtWidgetsTweakletImpl::CreateShell(Shell::Pointer parent, int style)
{
#ifdef __APPLE__
Qt::WindowFlags qtFlags(0);
#else
Qt::WindowFlags qtFlags(Qt::CustomizeWindowHint);
#endif
if (style & Constants::MAX)
qtFlags |= Qt::WindowMaximizeButtonHint;
if (style & Constants::MIN)
qtFlags |= Qt::WindowMinimizeButtonHint;
if (style & Constants::CLOSE)
{
qtFlags |= Qt::WindowSystemMenuHint;
#if QT_VERSION >= 0x040500
qtFlags |= Qt::WindowCloseButtonHint;
#endif
}
if (!(style & Constants::BORDER))
qtFlags |= Qt::FramelessWindowHint;
if (style & Constants::TITLE)
qtFlags |= Qt::WindowTitleHint;
if (style & Constants::TOOL)
qtFlags |= Qt::Tool;
QWidget* parentWidget = nullptr;
if (parent != 0)
parentWidget = static_cast<QWidget*>(parent->GetControl());
auto qtshell = new QtShell(parentWidget, qtFlags);
Shell::Pointer shell(qtshell);
shellList.push_back(shell);
if ((style & Constants::APPLICATION_MODAL)
|| (style & Constants::SYSTEM_MODAL)) qtshell->GetWidget()->setWindowModality(Qt::ApplicationModal);
if (style & Constants::PRIMARY_MODAL) qtshell->GetWidget()->setWindowModality(Qt::WindowModal);
return shell;
}
示例14: ConfigureShell
void Window::ConfigureShell(Shell::Pointer newShell)
{
// The single image version of this code had a comment related to bug
// 46624,
// and some code that did nothing if the stored image was already
// disposed.
// The equivalent in the multi-image version seems to be to remove the
// disposed images from the array passed to the shell.
if (defaultImages.size() > 0)
{
// ArrayList nonDisposedImages = new ArrayList(defaultImages.length);
// for (int i = 0; i < defaultImages.length; ++i)
// {
// if (defaultImages[i] != null && !defaultImages[i].isDisposed())
// {
// nonDisposedImages.add(defaultImages[i]);
// }
// }
//
// if (nonDisposedImages.size() <= 0)
// {
// System.err.println("Window.configureShell: images disposed"); //$NON-NLS-1$
// }
// else
// {
// //Image[] array = new Image[nonDisposedImages.size()];
// nonDisposedImages.toArray(array);
newShell->SetImages(defaultImages);
// }
}
// Layout layout = getLayout();
// if (layout != null)
// {
// newShell.setLayout(layout);
// }
CreateTrimWidgets(newShell);
}
示例15: DisposeShell
void QtWidgetsTweakletImpl::DisposeShell(Shell::Pointer shell)
{
shellList.removeAll(shell);
shell->SetVisible(false);
}