phdControlBase::phdControlBase(phdControlManager * _manager) { selected = focused = dragging = visible = false; x = y = width = height = 10.0; setPopupMenu(NULL); inputLinks.setDrawMode(ldmHorLeft); outputLinks.setDrawMode(ldmHorLeft); }
RKCommandEditorWindow::RKCommandEditorWindow (QWidget *parent, bool use_r_highlighting) : RKMDIWindow (parent, RKMDIWindow::CommandEditorWindow) { RK_TRACE (COMMANDEDITOR); KLibFactory *factory = KLibLoader::self()->factory( "libkatepart" ); if (factory) { // Create the part m_doc = (Kate::Document *) factory->create( this, "katepart", "KParts::ReadWritePart" ); RK_ASSERT (m_doc); m_view = (Kate::View *) m_doc->widget(); } // strip down the khtmlpart's GUI. remove some stuff we definitely don't need. RKCommonFunctions::removeContainers (m_doc, QStringList::split (',', "bookmarks,tools_spelling,tools_spelling_from_cursor,tools_spelling_selection,switch_to_cmd_line"), true); RKCommonFunctions::moveContainer (m_doc, "Menu", "tools", "edit", true); m_doc->insertChildClient (new RKCommandEditorWindowPart (m_view, this)); setPart (m_doc); initializeActivationSignals (); setFocusProxy (m_view); QHBoxLayout *pLayout = new QHBoxLayout( this, 0, -1, "layout"); pLayout->addWidget(m_view); setIcon (SmallIcon ("source")); connect (m_doc, SIGNAL (fileNameChanged ()), this, SLOT (updateCaption ())); connect (m_doc, SIGNAL (modifiedChanged ()), this, SLOT (updateCaption ())); // of course most of the time this causes a redundant call to updateCaption. Not if a modification is undone, however. connect (m_doc, SIGNAL (textChanged ()), this, SLOT (tryCompletionProxy ())); connect (m_view, SIGNAL (filterInsertString (KTextEditor::CompletionEntry *, QString *)), this, SLOT (fixCompletion (KTextEditor::CompletionEntry *, QString *))); connect (m_view, SIGNAL (gotFocus (Kate::View *)), this, SLOT (setPopupMenu (Kate::View *))); completion_timer = new QTimer (this); connect (completion_timer, SIGNAL (timeout ()), this, SLOT (tryCompletion())); if (use_r_highlighting) { setRHighlighting (); hinter = new RKFunctionArgHinter (this, m_view); } else { hinter = 0; } updateCaption (); // initialize QTimer::singleShot (0, this, SLOT (setPopupMenu ())); }
ToolDrawCombocontrol::ToolDrawCombocontrol(ToolMenuHandler* toolMenuHandler, ActionHandler* handler, string id) : ToolButton(handler, id, ACTION_TOOL_DRAW_RECT, GROUP_RULER, false, "rect-draw.png", _("Draw Rectangle")), toolMenuHandler(toolMenuHandler) { XOJ_INIT_TYPE(ToolDrawCombocontrol); setPopupMenu(gtk_menu_new()); drawTypes.push_back(new ToolDrawType(_("Draw Rectangle"), "rect-draw", ACTION_TOOL_DRAW_RECT )); drawTypes.push_back(new ToolDrawType(_("Draw Circle"), "circle-draw", ACTION_TOOL_DRAW_CIRCLE )); drawTypes.push_back(new ToolDrawType(_("Draw Arrow"), "arrow-draw", ACTION_TOOL_DRAW_ARROW )); drawTypes.push_back(new ToolDrawType(_("Draw Line"), "ruler", ACTION_RULER )); drawTypes.push_back(new ToolDrawType(_("Draw coordinate system"), "coordinate-system-draw", ACTION_TOOL_DRAW_COORDINATE_SYSTEM )); drawTypes.push_back(new ToolDrawType(_("Stroke recognizer"), "shape_recognizer", ACTION_SHAPE_RECOGNIZER )); for (ToolDrawType* t : drawTypes) { createMenuItem(t->name, t->icon, t->type); } }
ToolSelectCombocontrol::ToolSelectCombocontrol(ToolMenuHandler * th, ActionHandler * handler, GladeGui * gui, String id) : ToolButton(handler, gui, id, ACTION_TOOL_SELECT_RECT, GROUP_TOOL, true, "rect-select.png", _("Select Rectangle")) { XOJ_INIT_TYPE(ToolSelectCombocontrol); this->labelWidget = NULL; GtkWidget * popup = gtk_menu_new(); GtkWidget * menuItem; this->iconSelectRect = gui->loadIconPixbuf("rect-select.png"); this->iconSelectRgion = gui->loadIconPixbuf("lasso.png"); this->iconSelectObject = gui->loadIconPixbuf("object-select.png"); g_object_ref(this->iconSelectRect); g_object_ref(this->iconSelectRgion); g_object_ref(this->iconSelectObject); menuItem = gtk_image_menu_item_new_with_label(_("Select Rectangle")); gtk_container_add(GTK_CONTAINER(popup), menuItem); th->registerMenupoint(menuItem, ACTION_TOOL_SELECT_RECT, GROUP_TOOL); gtk_image_menu_item_set_always_show_image(GTK_IMAGE_MENU_ITEM(menuItem), true); gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(menuItem), gui->loadIcon("rect-select.png")); gtk_widget_show_all(menuItem); menuItem = gtk_image_menu_item_new_with_label(_("Select Region")); gtk_container_add(GTK_CONTAINER(popup), menuItem); th->registerMenupoint(menuItem, ACTION_TOOL_SELECT_REGION, GROUP_TOOL); gtk_image_menu_item_set_always_show_image(GTK_IMAGE_MENU_ITEM(menuItem), true); gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(menuItem), gui->loadIcon("lasso.png")); gtk_widget_show_all(menuItem); menuItem = gtk_image_menu_item_new_with_label(_("Select Object")); gtk_container_add(GTK_CONTAINER(popup), menuItem); th->registerMenupoint(menuItem, ACTION_TOOL_SELECT_OBJECT, GROUP_TOOL); gtk_image_menu_item_set_always_show_image(GTK_IMAGE_MENU_ITEM(menuItem), true); gtk_image_menu_item_set_image(GTK_IMAGE_MENU_ITEM(menuItem), gui->loadIcon("object-select.png")); gtk_widget_show_all(menuItem); setPopupMenu(popup); }
ListView::ListView( QObject* parent, QWidget* parentWidget ) : View( parent ), m_model( NULL ), m_selectedIssueId( 0 ), m_isRead( false ), m_isSubscribed( false ), m_isAdmin( false ), m_hasIssues( false ), m_currentViewId( 0 ), m_searchColumn( Column_Name ) { QAction* action; action = new QAction( IconLoader::icon( "file-reload" ), tr( "&Update Folder" ), this ); action->setShortcut( QKeySequence::Refresh ); connect( action, SIGNAL( triggered() ), this, SLOT( updateFolder() ), Qt::QueuedConnection ); setAction( "updateFolder", action ); action = new QAction( IconLoader::icon( "issue-open" ), tr( "&Open Issue" ), this ); action->setShortcut( QKeySequence::Open ); connect( action, SIGNAL( triggered() ), this, SLOT( openIssue() ), Qt::QueuedConnection ); setAction( "openIssue", action ); action = new QAction( IconLoader::icon( "issue-new" ), tr( "&Add Issue..." ), this ); action->setShortcut( QKeySequence::New ); connect( action, SIGNAL( triggered() ), this, SLOT( addIssue() ), Qt::QueuedConnection ); setAction( "addIssue", action ); action = new QAction( IconLoader::icon( "edit-modify" ), tr( "&Edit Attributes..." ), this ); action->setShortcut( tr( "F2" ) ); connect( action, SIGNAL( triggered() ), this, SLOT( editIssue() ), Qt::QueuedConnection ); setAction( "editIssue", action ); action = new QAction( IconLoader::icon( "issue-clone" ), tr( "Clone Issue..." ), this ); connect( action, SIGNAL( triggered() ), this, SLOT( cloneIssue() ), Qt::QueuedConnection ); setAction( "cloneIssue", action ); action = new QAction( IconLoader::icon( "issue-move" ), tr( "&Move Issue..." ), this ); action->setIconText( tr( "Move" ) ); connect( action, SIGNAL( triggered() ), this, SLOT( moveIssue() ), Qt::QueuedConnection ); setAction( "moveIssue", action ); action = new QAction( IconLoader::icon( "edit-delete" ), tr( "&Delete Issue" ), this ); action->setIconText( tr( "Delete" ) ); action->setShortcut( QKeySequence::Delete ); connect( action, SIGNAL( triggered() ), this, SLOT( deleteIssue() ), Qt::QueuedConnection ); setAction( "deleteIssue", action ); action = new QAction( IconLoader::icon( "issue" ), tr( "Mark As Read" ), this ); connect( action, SIGNAL( triggered() ), this, SLOT( markAsRead() ), Qt::QueuedConnection ); setAction( "markAsRead", action ); action = new QAction( IconLoader::icon( "folder-read" ), tr( "Mark All As Read" ), this ); action->setIconText( tr( "Mark All As Read", "icon text" ) ); setAction( "popupMarkAll", action ); action = new QAction( IconLoader::icon( "folder-read" ), tr( "Mark All As Read" ), this ); connect( action, SIGNAL( triggered() ), this, SLOT( markAllAsRead() ), Qt::QueuedConnection ); setAction( "markAllAsRead", action ); action = new QAction( IconLoader::icon( "folder-unread" ), tr( "Mark All As Unread" ), this ); connect( action, SIGNAL( triggered() ), this, SLOT( markAllAsUnread() ), Qt::QueuedConnection ); setAction( "markAllAsUnread", action ); action = new QAction( IconLoader::icon( "issue-subscribe" ), tr( "Subscribe" ), this ); connect( action, SIGNAL( triggered() ), this, SLOT( subscribe() ), Qt::QueuedConnection ); setAction( "subscribe", action ); action = new QAction( IconLoader::icon( "file-print" ), tr( "Print List" ), this ); action->setIconText( tr( "Print" ) ); action->setShortcut( QKeySequence::Print ); connect( action, SIGNAL( triggered() ), this, SLOT( printReport() ), Qt::QueuedConnection ); setAction( "printReport", action ); action = new QAction( IconLoader::icon( "export-pdf" ), tr( "Export List" ), this ); action->setIconText( tr( "Export" ) ); setAction( "popupExport", action ); action = new QAction( IconLoader::icon( "export-csv" ), tr( "Export To CSV" ), this ); connect( action, SIGNAL( triggered() ), this, SLOT( exportCsv() ), Qt::QueuedConnection ); setAction( "exportCsv", action ); action = new QAction( IconLoader::icon( "export-html" ), tr( "Export To HTML" ), this ); connect( action, SIGNAL( triggered() ), this, SLOT( exportHtml() ), Qt::QueuedConnection ); setAction( "exportHtml", action ); action = new QAction( IconLoader::icon( "export-pdf" ), tr( "Export To PDF" ), this ); connect( action, SIGNAL( triggered() ), this, SLOT( exportPdf() ), Qt::QueuedConnection ); setAction( "exportPdf", action ); action = new QAction( IconLoader::icon( "configure-views" ), tr( "&Manage Views..." ), this ); connect( action, SIGNAL( triggered() ), this, SLOT( manageViews() ), Qt::QueuedConnection ); setAction( "manageViews", action ); action = new QAction( IconLoader::icon( "view-new" ), tr( "Add View" ), this ); setAction( "popupAddView", action ); action = new QAction( IconLoader::icon( "view-new" ), tr( "&Add View" ), this ); connect( action, SIGNAL( triggered() ), this, SLOT( addView() ), Qt::QueuedConnection ); setAction( "addView", action ); action = new QAction( IconLoader::icon( "view-clone" ), tr( "&Clone View" ), this ); connect( action, SIGNAL( triggered() ), this, SLOT( cloneView() ), Qt::QueuedConnection ); setAction( "cloneView", action ); action = new QAction( IconLoader::icon( "edit-modify" ), tr( "M&odify View" ), this ); connect( action, SIGNAL( triggered() ), this, SLOT( modifyView() ), Qt::QueuedConnection ); setAction( "modifyView", action ); setTitle( "sectionAdd", tr( "Add" ) ); setTitle( "sectionFolder", tr( "Folder" ) ); setTitle( "sectionIssue", tr( "Issue" ) ); setTitle( "sectionViews", tr( "Views" ) ); setTitle( "sectionReport", tr( "Report" ) ); setPopupMenu( "popupExport", "menuExport", "exportPdf" ); setPopupMenu( "popupMarkAll", "menuMarkAll", "markAllAsRead" ); setPopupMenu( "popupAddView", "menuAddView", "addView" ); setDefaultMenuAction( "menuIssue", "openIssue" ); loadXmlUiFile( ":/resources/folderview.xml" ); QWidget* main = new QWidget( parentWidget ); QVBoxLayout* mainLayout = new QVBoxLayout( main ); mainLayout->setMargin( 0 ); mainLayout->setSpacing( 0 ); QHBoxLayout* viewLayout = new QHBoxLayout(); viewLayout->setMargin( 3 ); viewLayout->setSpacing( 5 ); mainLayout->addLayout( viewLayout ); QLabel* viewLabel = new QLabel( tr( "&View:" ), main ); viewLayout->addWidget( viewLabel ); m_viewCombo = new SeparatorComboBox( main ); m_viewCombo->setMaxVisibleItems( 15 ); m_viewCombo->setMaximumWidth( 200 ); m_viewCombo->setMinimumWidth( 100 ); connect( m_viewCombo, SIGNAL( activated( int ) ), this, SLOT( viewActivated( int ) ) ); viewLayout->addWidget( m_viewCombo, 1 ); viewLabel->setBuddy( m_viewCombo ); viewLayout->addStretch( 0 ); QLabel* searchLabel = new QLabel( tr( "&Search:" ), main ); viewLayout->addWidget( searchLabel ); m_searchBox = new SearchEditBox( main ); m_searchBox->setMaximumWidth( 200 ); m_searchBox->setMinimumWidth( 100 ); connect( m_searchBox, SIGNAL( textChanged( const QString& ) ), this, SLOT( quickSearchChanged( const QString& ) ) ); m_searchMenu = new QMenu( m_searchBox ); m_searchBox->setOptionsMenu( m_searchMenu ); m_searchActionGroup = new QActionGroup( this ); connect( m_searchActionGroup, SIGNAL( triggered( QAction* ) ), this, SLOT( searchActionTriggered( QAction* ) ) ); viewLayout->addWidget( m_searchBox, 1 ); searchLabel->setBuddy( m_searchBox ); m_list = new QTreeView( main ); mainLayout->addWidget( m_list ); TreeViewHelper helper( m_list ); helper.initializeView(); connect( m_list, SIGNAL( customContextMenuRequested( const QPoint& ) ), this, SLOT( listContextMenu( const QPoint& ) ) ); connect( m_list->header(), SIGNAL( customContextMenuRequested( const QPoint& ) ), this, SLOT( headerContextMenu( const QPoint& ) ) ); connect( m_list, SIGNAL( doubleClicked( const QModelIndex& ) ), this, SLOT( doubleClicked( const QModelIndex& ) ) ); connect( m_searchBox, SIGNAL( deactivate() ), m_list, SLOT( setFocus() ) ); main->installEventFilter( this ); m_list->installEventFilter( this ); m_list->viewport()->installEventFilter( this ); setMainWidget( main ); setViewerSizeHint( QSize( 700, 500 ) ); setViewerSizeKey( "FolderView" ); m_list->setFocus(); }
//-------------------------------------------------------------------------------------------------------------- phdShapeGroup::phdShapeGroup() { visible = true; focused = NULL; selected = NULL; setPopupMenu(NULL); }
void RKCommandEditorWindow::setPopupMenu (Kate::View*) { setPopupMenu (); }