本文整理汇总了C++中DockWindow类的典型用法代码示例。如果您正苦于以下问题:C++ DockWindow类的具体用法?C++ DockWindow怎么用?C++ DockWindow使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了DockWindow类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: getDockWindow
QWidget* RangeProfilePlotManager::createWidget()
{
DockWindow* pWindow = getDockWindow();
VERIFYRV(pWindow, NULL);
pWindow->attach(SIGNAL_NAME(Window, SessionItemDropped), Slot(this, &RangeProfilePlotManager::dropSessionItem));
pWindow->enableSessionItemDrops(this);
if (!Service<SessionManager>()->isSessionLoading())
{
mpPlot = Service<DesktopServices>()->createPlotWidget(getName(), CARTESIAN_PLOT);
}
if (mpPlot == NULL)
{
return NULL;
}
mpView = mpPlot->getPlot();
#pragma message(__FILE__ "(" STRING(__LINE__) ") : warning : If a SHALLOW_SELECTION selection mode is added " \
"to plot view (OPTICKS-528), mpView should use it (tclarke)")
mpMode = (mpView == NULL) ? NULL : mpView->getMouseMode("SelectionMode");
if (mpMode == NULL)
{
return NULL;
}
mpView->getWidget()->installEventFilter(this);
mpPlot->attach(SIGNAL_NAME(PlotWidget, AboutToShowContextMenu),
Slot(this, &RangeProfilePlotManager::updateContextMenu));
mpView->enableMouseMode(mpMode, true);
mpView->setMouseMode(mpMode);
return mpPlot->getWidget();
}
示例2: getAction
SpectralLibraryMatchResults::~SpectralLibraryMatchResults()
{
Service<DesktopServices> pDesktop;
// remove toolbar button and menu item
QAction* pAction = getAction();
if (pAction != NULL)
{
ToolBar* pToolBar = static_cast<ToolBar*>(pDesktop->getWindow("Spectral", TOOLBAR));
if (pToolBar != NULL)
{
pToolBar->removeItem(pAction);
MenuBar* pMenuBar = pToolBar->getMenuBar();
if (pMenuBar != NULL)
{
pMenuBar->removeMenuItem(pAction);
}
}
}
// dockwindow should still exist so detach from it
DockWindow* pWindow = getDockWindow();
if (pWindow != NULL)
{
pWindow->detach(SIGNAL_NAME(DockWindow, AboutToShowContextMenu),
Slot(this, &SpectralLibraryMatchResults::updateContextMenu));
}
}
示例3: LoadWindow
void
DevicesConfigPanel::Prepare(ContainerWindow &parent, const PixelRect &rc)
{
instance = this;
LoadWindow(NULL, parent,
Layout::landscape ? _T("IDR_XML_DEVICESCONFIGPANEL") :
_T("IDR_XML_DEVICESCONFIGPANEL_L"));
current_device = 0;
for (unsigned i = 0; i < NUMDEV; ++i)
Profile::GetDeviceConfig(i, device_config[i]);
DockWindow *dock = (DockWindow *)form.FindByName(_T("edit"));
assert(dock != NULL);
DeviceEditWidget *edit = new DeviceEditWidget(device_config[0]);
dock->SetWidget(edit);
WndListFrame *list = (WndListFrame *)form.FindByName(_T("list"));
assert(list != NULL);
list->SetPaintItemCallback(PaintDeviceListItem);
list->SetLength(2);
list->SetCursorCallback(DeviceListCursorCallback);
LoadFormProperty(form, _T("prpSetSystemTimeFromGPS"),
CommonInterface::GetComputerSettings().set_system_time_from_gps);
LoadFormProperty(form, _T("prpIgnoreNMEAChecksum"),
NMEAParser::ignore_checksum);
}
示例4: execute
bool MessageLogTestPlugin::execute(PlugInArgList* pInArgList, PlugInArgList* pOutArgList)
{
Service<DesktopServices> pDesktop;
Service<UtilityServices> pUtility;
DockWindow* pWindow = dynamic_cast<DockWindow*>(pDesktop->getWindow("Message Log Window", DOCK_WINDOW));
pWindow->show();
MessageLogMgr* pMgr = pUtility->getMessageLog();
if (pMgr != NULL)
{
MessageLog* pLog = pMgr->getLog("Message Log Test Plugin");
if (pLog != NULL)
{
pLog->createMessage("Added new test Message. Key and Component provided.", "Message Log Test Plugin",
"message1", true, false);
pLog->createMessage("This should be yellow. No Key or Component provided.", "", "", true, false);
pLog->createStep("Added new test Step. Key and Component provided.", "Message Log Test Plugin", "step1",
false);
pLog->createStep("This should be yellow. No Key or Component provided.", "", "", false);
}
}
return true;
}
示例5: QTabWidget
QWidget* SpectralLibraryMatchResults::createWidget()
{
mpTabWidget = new QTabWidget(getDockWindow()->getWidget());
mpTabWidget->setTabPosition(QTabWidget::South);
mpTabWidget->setTabShape(QTabWidget::Rounded);
mpTabWidget->setMinimumHeight(100);
// dockwindow should exist so attach to it
DockWindow* pWindow = getDockWindow();
if (pWindow != NULL)
{
pWindow->attach(SIGNAL_NAME(DockWindow, AboutToShowContextMenu),
Slot(this, &SpectralLibraryMatchResults::updateContextMenu));
// Connect to the session explorer now that the window has been created
if (mpExplorer.get() == NULL)
{
Service<SessionExplorer> pExplorer;
mpExplorer.reset(pExplorer.get());
}
// set location of the results window
#pragma message(__FILE__ "(" STRING(__LINE__) ") : warning : Replace this block when public method to locate DockWindow is available. (rforehan)")
QMainWindow* pMainWindow = dynamic_cast<QMainWindow*>(Service<DesktopServices>()->getMainWidget());
if (pMainWindow != NULL)
{
pMainWindow->addDockWidget(Qt::LeftDockWidgetArea, dynamic_cast<QDockWidget*>(pWindow), Qt::Vertical);
}
}
return mpTabWidget;
}
示例6: ShowWindow
void AutoHideBar::ShowWindow()
{
DockWindow* hiddenwindow = reinterpret_cast<DockWindow*>(tabs[active].dock);
if(!hiddenwindow->IsOpen())
{
Size s = hiddenwindow->GetSizeHint();
Rect r = GetScreenRect();
Rect rr = r;
switch(layout)
{
case LAYOUT_LEFT:
rr.left = r.right;
s.cy = r.GetHeight();
#if defined(PLATFORM_X11)
rr.right += 1;
#endif
break;
case LAYOUT_TOP:
rr.top = r.bottom;
s.cx = r.GetWidth();
#if defined(PLATFORM_X11)
rr.bottom += 1;
#endif
break;
case LAYOUT_RIGHT:
rr.right = r.left;
s.cy = r.GetHeight();
#if defined(PLATFORM_X11)
rr.left -= 1;
#endif
break;
case LAYOUT_BOTTOM:
rr.bottom = r.top;
s.cx = r.GetWidth();
#if defined(PLATFORM_X11)
rr.top -= 1;
#endif
break;
}
popup.SetRect(rr);
popup.Add(hiddenwindow->SizePos());
hiddenwindow->Ctrl::Show();
popup.PopUp(GetOwner(), false, true, false, false);
ctrl = hiddenwindow;
Ctrl::ProcessEvents();
AdjustSize(rr, s);
Animate(popup, rr, GUIEFFECT_SLIDE);
}
}
示例7: createView
View* createView(const char* pName, const char* pType, DataElement* pElement)
{
if (pName == NULL || pType == NULL)
{
setLastError(SIMPLE_BAD_PARAMS);
return NULL;
}
ViewType type(StringUtilities::fromXmlString<ViewType>(std::string(pType)));
RasterElement* pRaster = dynamic_cast<RasterElement*>(pElement);
if (type == SPATIAL_DATA_VIEW && pRaster == NULL)
{
setLastError(SIMPLE_BAD_PARAMS);
return NULL;
}
WindowType windowType;
switch(type)
{
case SPATIAL_DATA_VIEW:
windowType = SPATIAL_DATA_WINDOW;
break;
case PRODUCT_VIEW:
windowType = PRODUCT_WINDOW;
break;
case PLOT_VIEW:
windowType = DOCK_WINDOW;
break;
}
Window* pWindow = Service<DesktopServices>()->createWindow(std::string(pName), windowType);
if (type == PLOT_VIEW)
{
DockWindow* pDockWindow = dynamic_cast<DockWindow*>(pWindow);
if (pDockWindow != NULL)
{
PlotSetGroup* pPlotSetGroup = Service<DesktopServices>()->createPlotSetGroup();
if (pPlotSetGroup == NULL)
{
Service<DesktopServices>()->deleteWindow(pDockWindow);
setLastError(SIMPLE_OTHER_FAILURE);
return NULL;
}
pDockWindow->setWidget(pPlotSetGroup->getWidget());
}
}
View* pView = pWindow == NULL ? NULL : static_cast<ViewWindow*>(pWindow)->getView();
if (pView == NULL)
{
if (Service<DesktopServices>()->getWindow(std::string(pName), windowType) != NULL)
{
setLastError(SIMPLE_EXISTS);
}
else
{
setLastError(SIMPLE_OTHER_FAILURE);
}
return NULL;
}
if (type == SPATIAL_DATA_VIEW)
{
SpatialDataView* pSdv = static_cast<SpatialDataView*>(pView);
if (!pSdv->setPrimaryRasterElement(pRaster))
{
Service<DesktopServices>()->deleteWindow(pWindow);
setLastError(SIMPLE_OTHER_FAILURE);
return NULL;
}
{ // scope
UndoLock lock(pView);
if (pSdv->createLayer(RASTER, pRaster) == NULL)
{
Service<DesktopServices>()->deleteWindow(pWindow);
setLastError(SIMPLE_OTHER_FAILURE);
return NULL;
}
}
}
setLastError(SIMPLE_NO_ERROR);
return pView;
}
示例8: LoadChild
//.........这里部分代码省略.........
// ListBoxControl (WndListFrame)
} else if (StringIsEqual(node.getName(), _T("List"))){
// Determine ItemHeight of the list items
UPixelScalar item_height =
Layout::Scale(StringToIntDflt(node.getAttribute(_T("ItemHeight")), 18));
// Create the ListBoxControl
style.TabStop();
if (IsEmbedded() || Layout::scale_1024 < 2048)
/* sunken edge doesn't fit well on the tiny screen of an
embedded device */
style.Border();
else
style.SunkenEdge();
window = new WndListFrame(parent, *xml_dialog_look,
pos.x, pos.y, size.cx, size.cy,
style,
item_height);
// TabControl (Tabbed)
} else if (StringIsEqual(node.getName(), _T("Tabbed"))) {
// Create the TabControl
style.ControlParent();
TabbedControl *tabbed = new TabbedControl(parent,
pos.x, pos.y, size.cx, size.cy,
style);
window = tabbed;
for (auto i = node.begin(), end = node.end(); i != end; ++i) {
// Load each child control from the child nodes
Window *child = LoadChild(form, *tabbed,
lookup_table,
*i);
if (child != NULL)
tabbed->AddClient(child);
}
// TabBarControl (TabBar)
} else if (StringIsEqual(node.getName(), _T("TabBar"))) {
// Create the TabBarControl
bool flip_orientation = false;
if ( (Layout::landscape && StringToIntDflt(node.getAttribute(_T("Horizontal")), 0)) ||
(!Layout::landscape && StringToIntDflt(node.getAttribute(_T("Vertical")), 0) ) )
flip_orientation = true;
style.ControlParent();
TabBarControl *tabbar = new TabBarControl(parent, *xml_dialog_look,
pos.x, pos.y, size.cx, size.cy,
style, flip_orientation);
window = tabbar;
// TabMenuControl (TabMenu)
} else if (StringIsEqual(node.getName(), _T("TabMenu"))) {
// Create the TabMenuControl
style.ControlParent();
TabMenuControl *tabmenu = new TabMenuControl(parent,
/* XXX this cast is
an ugly hack!
Please rewrite: */
(WndForm &)form,
*xml_dialog_look, caption,
pos.x, pos.y, size.cx, size.cy,
style);
window = tabmenu;
} else if (StringIsEqual(node.getName(), _T("Custom"))) {
// Create a custom Window object with a callback
CreateWindowCallback_t create_callback =
(CreateWindowCallback_t)GetCallBack(lookup_table, node, _T("OnCreate"));
if (create_callback == NULL)
return NULL;
window = create_callback(parent, pos.x, pos.y, size.cx, size.cy, style);
} else if (StringIsEqual(node.getName(), _T("Widget"))) {
style.ControlParent();
DockWindow *dock = new DockWindow();
dock->set(parent, rc, style);
window = dock;
}
if (window != NULL) {
if (!StringIsEmpty(name))
form.AddNamed(name, window);
if (expert)
form.AddExpert(window);
form.AddDestruct(window);
}
return window;
}
示例9: updateContextMenu
void PlotSetImp::updateContextMenu(Subject& subject, const string& signal, const boost::any& value)
{
ContextMenu* pMenu = boost::any_cast<ContextMenu*>(value);
if (pMenu == NULL)
{
return;
}
QObject* pParent = pMenu->getActionParent();
vector<SessionItem*> items = pMenu->getSessionItems();
if (items.empty() == true)
{
return;
}
bool bAddSeparator = false;
bool bAddActivate = false;
bool bAddDelete = false;
string afterId;
vector<DockWindow*> windowItems = pMenu->getSessionItems<DockWindow>();
if (windowItems.size() == 1)
{
DockWindow* pDockWindow = windowItems.front();
if (pDockWindow != NULL)
{
PlotSetGroup* pPlotSetGroup = dynamic_cast<PlotSetGroup*>(pDockWindow->getWidget());
if (pPlotSetGroup != NULL)
{
if (dynamic_cast<PlotSetImp*>(pPlotSetGroup->getCurrentPlotSet()) == this)
{
bAddSeparator = true;
bAddDelete = true;
}
}
}
}
else if (dynamic_cast<SessionExplorer*>(&subject) != NULL)
{
// Make sure all of the selected session items for the menu are plot widgets
vector<PlotWidget*> plots = pMenu->getSessionItems<PlotWidget>();
if (plots.size() != items.size())
{
return;
}
// Make sure all selected plot widget items are contained in this plot set
vector<PlotWidget*>::iterator iter;
for (iter = plots.begin(); iter != plots.end(); ++iter)
{
PlotWidget* pPlot = *iter;
if (pPlot != NULL)
{
if (containsPlot(pPlot) == false)
{
return;
}
}
}
// Check for only one selected plot widget item
if (plots.size() == 1)
{
bAddSeparator = true;
// Add an activate action if the selected plot widget is not currently active
PlotWidget* pPlot = plots.front();
if (pPlot != NULL)
{
if (pPlot != getCurrentPlot())
{
bAddActivate = true;
}
}
}
bAddDelete = true;
afterId = APP_PLOTWIDGET_PRINT_ACTION;
}
// Separator
if (bAddSeparator == true)
{
QAction* pSeparatorAction = new QAction(pParent);
pSeparatorAction->setSeparator(true);
pMenu->addActionAfter(pSeparatorAction, APP_PLOTSET_SEPARATOR_ACTION, afterId);
if (afterId.empty() == false)
{
afterId = APP_PLOTSET_SEPARATOR_ACTION;
}
}
// Activate
if (bAddActivate == true)
{
QAction* pActivateAction = new QAction("&Activate", pParent);
pActivateAction->setAutoRepeat(false);
pActivateAction->setStatusTip("Activates the selected plot in the plot set");
//.........这里部分代码省略.........
示例10: assert
gcc_pure
DeviceEditWidget &GetEditWidget() {
DockWindow *dock = (DockWindow *)form.FindByName(_T("edit"));
assert(dock != NULL);
return *(DeviceEditWidget *)dock->GetWidget();
}
示例11: Show
void Show(const PixelRect &rc) override {
const Layout layout(rc, *waypoint);
if (task_manager != nullptr)
goto_button.MoveAndShow(layout.goto_button);
if (!images.empty()) {
magnify_button.MoveAndShow(layout.magnify_button);
shrink_button.MoveAndShow(layout.shrink_button);
}
previous_button.MoveAndShow(layout.previous_button);
next_button.MoveAndShow(layout.next_button);
close_button.MoveAndShow(layout.close_button);
info_dock.Move(layout.main);
details_panel.Move(layout.main);
details_text.Move(layout.details_text);
#ifdef HAVE_RUN_FILE
if (!waypoint->files_external.empty())
file_list.Move(layout.file_list);
#endif
commands_dock.Move(layout.main);
if (!images.empty())
image_window.Move(layout.main);
UpdatePage();
}
示例12: Move
void Move(const PixelRect &rc) override {
const Layout layout(rc, waypoint);
if (allow_navigation)
goto_button.Move(layout.goto_button);
if (!images.empty()) {
magnify_button.Move(layout.magnify_button);
shrink_button.Move(layout.shrink_button);
}
if (allow_navigation) {
previous_button.Move(layout.previous_button);
next_button.Move(layout.next_button);
}
close_button.Move(layout.close_button);
info_dock.Move(layout.main);
details_panel.Move(layout.main);
details_text.Move(layout.details_text);
#ifdef HAVE_RUN_FILE
if (!waypoint.files_external.empty())
file_list.Move(layout.file_list);
#endif
commands_dock.Move(layout.main);
if (!images.empty())
image_window.Move(layout.main);
}
示例13:
void
WaypointDetailsWidget::UpdatePage()
{
info_dock.SetVisible(page == 0);
details_panel.SetVisible(page == 1);
commands_dock.SetVisible(page == 2);
bool image_page = page >= 3;
if (!images.empty()) {
image_window.SetVisible(image_page);
magnify_button.SetVisible(image_page);
shrink_button.SetVisible(image_page);
}
}
示例14: Hide
void Hide() override {
if (task_manager != nullptr)
goto_button.Hide();
if (!images.empty()) {
magnify_button.Hide();
shrink_button.Hide();
}
previous_button.Hide();
next_button.Hide();
close_button.Hide();
info_dock.Hide();
details_panel.Hide();
commands_dock.Hide();
if (!images.empty())
image_window.Hide();
}
示例15: MoveChildren
void MoveChildren(const Layout &layout) {
waypoint_name.Move(layout.waypoint_name);
waypoint_details.Move(layout.waypoint_details);
waypoint_remove.Move(layout.waypoint_remove);
waypoint_relocate.Move(layout.waypoint_relocate);
type_label.Move(layout.type_label);
change_type.Move(layout.change_type);
map.Move(layout.map);
properties_dock.Move(layout.properties);
optional_starts.Move(layout.optional_starts);
score_exit.Move(layout.score_exit);
}