/* BrowserCanvas::onMouseEvent * Called when a key is pressed within the canvas *******************************************************************/ void BrowserCanvas::onKeyDown(wxKeyEvent& e) { bool handled = true; int num_cols = GetSize().x / fullItemSizeX(); int selected = itemIndex(item_selected); // Down arrow if (e.GetKeyCode() == WXK_DOWN) { selected += num_cols; showItem(selected, false); } // Up arrow else if (e.GetKeyCode() == WXK_UP) { selected -= num_cols; showItem(selected); } // Left arrow else if (e.GetKeyCode() == WXK_LEFT) { selected--; showItem(selected); } // Right arrow else if (e.GetKeyCode() == WXK_RIGHT) { selected++; showItem(selected, false); } else { e.Skip(); handled = false; } if (handled) { // Clamp selection if (selected >= (int)items_filter.size()) selectItem((int)items_filter.size() - 1); if (selected < 0) selectItem(0); // Refresh canvas Refresh(); } }
void PSP_FileManager ::showAllItems ( unsigned short fromFileIndex ) { unsigned short winX = winXStart; unsigned short winY = winTitleHeighSpare ; unsigned short maxItemCount1Window = getMaxItemCountInWindow (); unsigned short showedItemCount = 0; unsigned short fileIndex = fromFileIndex; //clearOnScreenItem(); // clear window this->showWindow(); // this->drawTitle(); PSP_GRAPHICS::drawHorizonLine ( rectangle.x + 2 , rectangle.x + rectangle.width - 2 , winTitleHeighSpare + rectangle.y -2 , RGBColor::getShortColor( 160, 160, 160) ); drawIndexFrom= fromFileIndex; do { if ( fileIndex >= this->fileCount + this->dirCount) { break; } if ( showedItemCount >= maxItemCount1Window ) { break; } showItem( winX, winY, fileIndex ); winY = winY+ DotFont16ASCfont_heigh + this->spaceBetweenLine; showedItemCount ++; fileIndex ++; }while( true ); }
static CSEM_Error showProperty(CSEM_Property *property, int depth) { CSEM_Error error = CSEM_ERROR_NONE; if(property) { int i = 0; CSEM_List *names = CSEM_Property_GetNames(property); CSEM_List *values = NULL, *types = NULL; if((error = CSEM_Property_GetValues(property, &values, &types))) { goto FINISH; } for(i = 0; names && i < CSEM_List_Size(names); i++) { INDENT(depth);printf("@property=%s\n", (char *)CSEM_List_Get(names, i)); } for(i = 0; values && i < CSEM_List_Size(values); i++) { int *type = CSEM_List_Get(types, i); if(*type == CSEM_VALUE_TYPE_STR || *type == CSEM_VALUE_TYPE_URL) { INDENT(depth);printf("\"%s\"\n", (char *)CSEM_List_Get(values, i)); } else if(*type == CSEM_VALUE_TYPE_ITEM) { CSEM_Item *item = CSEM_List_Get(values, i); showItem(item, depth + 1); } else if(*type == CSEM_VALUE_TYPE_PROPERTY) { CSEM_Property *property = CSEM_List_Get(values, i); showProperty(property, depth + 1); } } } FINISH: return error; }
void UIQuestion::showDescription(CursorType cursor) { switch (g_vm->getGameID()) { case GType_BlueForce: if (cursor == INV_FOREST_RAP) { // Forest rap item has a graphical display showItem(5, 1, 1); } else { // Display object description SceneItem::display2(9001, (int)cursor); } break; case GType_Ringworld2: if ((cursor == R2_COM_SCANNER) || (cursor == R2_COM_SCANNER_2)) { // Show communicator Ringworld2::SceneExt *scene = static_cast<Ringworld2::SceneExt *> (R2_GLOBALS._sceneManager._scene); if (!scene->_sceneAreas.contains(R2_GLOBALS._scannerDialog)) R2_GLOBALS._scannerDialog->setup2(4, 1, 1, 160, 125); } else { // Show object description SceneItem::display2(3, (int)cursor); } break; default: break; } }
void QgsMessageBar::popItem( QgsMessageBarItem *item ) { Q_ASSERT( item ); if ( item != mCurrentItem && !mItems.contains( item ) ) return; if ( item == mCurrentItem ) { if ( mCurrentItem ) { QWidget *widget = dynamic_cast<QWidget*>( mCurrentItem ); mLayout->removeWidget( widget ); mCurrentItem->hide(); disconnect( mCurrentItem, SIGNAL( styleChanged( QString ) ), this, SLOT( setStyleSheet( QString ) ) ); delete mCurrentItem; mCurrentItem = 0; } if ( !mItems.isEmpty() ) { showItem( mItems.first() ); } else { hide(); } } else { mItems.removeOne( item ); } emit widgetRemoved( item ); }
void K3IconViewSearchLine::clear() { // Clear hidden list, give items back to QIconView, if it still exists Q3IconViewItem *item = NULL; QIconViewItemList::iterator it = d->hiddenItems.begin(); while ( it != d->hiddenItems.end() ) { item = *it; ++it; if ( item != NULL ) { if ( d->iconView != NULL ) showItem( item ); else delete item; } } if ( ! d->hiddenItems.isEmpty() ) kDebug() << __FILE__ << ":" << __LINE__ << "hiddenItems is not empty as it should be. " << d->hiddenItems.count() << " items are still there.\n" << endl; d->search = ""; d->queuedSearches = 0; KLineEdit::clear(); }
void showResults( List* resultsList, Item* resultsLevel ) { // Display header wprintf_s( TEXT( " %19s %47s %12s %s\n" ), TEXT( "Date Modified" ), TEXT( "Coords" ), TEXT( "Size" ), TEXT( "Name" ) ); wprintf_s( TEXT( " %19s %47s %12s %s\n" ), TEXT( "-------------------" ), TEXT( "-----------------------------------------------" ), TEXT( "------------" ), TEXT( "--------------------------------" ) ); // Display founded entries Traverse( resultsList, showItem ); // Display totals wprintf_s( TEXT( " %19s %47s %12s %s\n" ), TEXT( "-------------------" ), TEXT( "-----------------------------------------------" ), TEXT( "------------" ), TEXT( "--------------------------------" ) ); showItem( resultsLevel ); }
void QgsMessageBar::pushItem( QgsMessageBarItem *item ) { resetCountdown(); // avoid duplicated widget popWidget( item ); showItem( item ); }
void QgsMessageBar::popItem( QgsMessageBarItem *item ) { Q_ASSERT( item ); if ( item != mCurrentItem && !mItems.contains( item ) ) return; if ( item == mCurrentItem ) { if ( mCurrentItem ) { QWidget *widget = mCurrentItem; mLayout->removeWidget( widget ); mCurrentItem->hide(); disconnect( mCurrentItem, &QgsMessageBarItem::styleChanged, this, &QWidget::setStyleSheet ); mCurrentItem->deleteLater(); mCurrentItem = nullptr; } if ( !mItems.isEmpty() ) { showItem( mItems.at( 0 ) ); } else { hide(); } } else { mItems.removeOne( item ); } emit widgetRemoved( item ); }
void db_x509req::showContextMenu(QContextMenuEvent *e, const QModelIndex &index) { QMenu *menu = new QMenu(mainwin); QMenu *subExport; currentIdx = index; pki_x509req *req = static_cast<pki_x509req*>(index.internalPointer()); menu->addAction(tr("New Request"), this, SLOT(newItem())); menu->addAction(tr("Import"), this, SLOT(load())); if (index != QModelIndex()) { if (!req->getRefKey()) menu->addAction(tr("Extract public Key"), this, SLOT(extractPubkey())); menu->addAction(tr("Rename"), this, SLOT(edit())); menu->addAction(tr("Show Details"), this, SLOT(showItem())); menu->addAction(tr("Sign"), this, SLOT(signReq())); subExport = menu->addMenu(tr("Export")); subExport->addAction(tr("Clipboard"), this, SLOT(pem2clipboard())); subExport->addAction(tr("File"), this, SLOT(store())); subExport->addAction(tr("Template"), this, SLOT(toTemplate())); subExport->addAction(tr("OpenSSL config"), this, SLOT(toOpenssl())); menu->addAction(tr("Delete"), this, SLOT(delete_ask())); subExport->setEnabled(!req->isSpki()); } contextMenu(e, menu); currentIdx = QModelIndex(); return; }
void QgsMessageBar::pushItem( QgsMessageBarItem *item ) { resetCountdown(); // avoid duplicated widget popWidget( item ); showItem( item ); // Log all messages that are sent to the message bar into the message log so the // user can get them back easier. QString formattedTitle = QString( "%1 : %2" ).arg( item->title(), item->text() ); QgsMessageLog::MessageLevel level; switch ( item->level() ) { case QgsMessageBar::INFO: level = QgsMessageLog::INFO; break; case QgsMessageBar::WARNING: level = QgsMessageLog::WARNING; break; case QgsMessageBar::CRITICAL: level = QgsMessageLog::CRITICAL; break; default: level = QgsMessageLog::NONE; break; } QgsMessageLog::logMessage( formattedTitle, tr( "Messages" ), level ); }
int main(int argc, char *argv[]) { CSEM_Error error = CSEM_ERROR_NONE; CSEM_Builder *builder = NULL; CSEM_Url *baseURL = NULL; CSEM_Document *doc = NULL; char *filename = NULL; int fd = -1; /* setup input parameters */ if(argc < 2) { error = CSEM_ERROR_PARAMETER; printf("./sample [filename]\n"); goto FINISH; } filename = argv[1]; /* init */ if((error = CSEM_Builder_Create(&builder))) { goto FINISH; } /* set base url */ if((error = CSEM_URL_Parse("http://localhost/test/", &baseURL))) { goto FINISH; } CSEM_Builder_SetBaseURL(builder, baseURL); /* start build process */ if(!(fd = open(filename, O_RDONLY))) { fprintf(stderr, "failed to open %s\n", filename); goto FINISH; } if((error = CSEM_Builder_Parse(builder, fd))) { fprintf(stderr, "failed parsing %s\n", filename); goto FINISH; } if((error = CSEM_Builder_GetDocument(builder, &doc))) { goto FINISH; } { int i = 0; CSEM_List *nodes = CSEM_Document_GetChildren(doc); for(i = 0; i < CSEM_List_Size(nodes); i++) { CSEM_Node *node = CSEM_List_Get(nodes, i); if(CSEM_Node_GetType(node) == CSEM_NODE_TYPE_ITEM) { CSEM_Item *item = CSEM_Node_GetObject(node); showItem(item, 0); } else if(CSEM_Node_GetType(node) == CSEM_NODE_TYPE_PROPERTY) { CSEM_Property *property = CSEM_Node_GetObject(node); showProperty(property, 0); } } } FINISH: CSEM_Builder_Dispose(builder); CSEM_Document_Dispose(doc); CSEM_URL_Dispose(baseURL); puts("END"); return error ? 1 : 0; }
void freeItem( void* data ) { item* i = (item*)data; printf("Freeing:\n"); showItem(i); free(i->name); free(i); }
void showItems(list_t* list) { listItem* it=&list->begin; while( LISTFWD(list,it) ) { showItem((item*)it->data); } }
void UIQuestion::showDescription(CursorType cursor) { if (cursor == INV_FOREST_RAP) { // Forest rap item has a graphical display showItem(5, 1, 1); } else { // Display object description SceneItem::display2(9001, (int)cursor); } }
void KDGanttViewEventItem::initItem() { isVisibleInGanttView = false; myLeadTime = 0; showItem(true); myGanttView->myTimeTable->updateMyContent(); setDragEnabled( myGanttView->dragEnabled() ); setDropEnabled( myGanttView->dropEnabled() ); }
void KDGanttViewSummaryItem::initItem() { isVisibleInGanttView = false; myActualEndTime = 0; myMiddleTime = 0; showItem(true); myGanttView->myTimeTable->updateMyContent(); setDragEnabled( myGanttView->dragEnabled() ); setDropEnabled( myGanttView->dropEnabled() ); }
MainWindow::MainWindow(QWidget *parent, Qt::WFlags flags) : QWidget(parent, flags) { ui.setupUi(this); ui.treeView->setModel(new AddressModel(this)); ui.treeView->header()->setStretchLastSection(true); connect(ui.treeView,SIGNAL(clicked(QModelIndex)),this,SLOT(showItem(QModelIndex))); ui.map->show(); }
void QgsMessageBar::pushItem( QgsMessageBarItem *item ) { resetCountdown(); // avoid duplicated widget popWidget( item ); showItem( item ); // Log all messages that are sent to the message bar into the message log so the // user can get them back easier. QString formattedTitle = QStringLiteral( "%1 : %2" ).arg( item->title(), item->text() ); QgsMessageLog::logMessage( formattedTitle, tr( "Messages" ), item->level() ); }
void db_x509req::showPki(pki_base *pki) { pki_x509req *req = (pki_x509req *)pki; CertDetail *dlg; dlg = new CertDetail(mainwin); if (dlg) { dlg->setReq(req); connect(dlg->privKey, SIGNAL( doubleClicked(QString) ), mainwin->keys, SLOT( showItem(QString) )); dlg->exec(); delete dlg; } }
/** * 展示 */ void UICenterBag::show() { this->setVisible(true); int index = 0; for ( ITEMS_ITER iter = _items.begin(); iter != _items.end();++iter,++index) { for (DIR_ITEMS_ITER pos = iter->begin(); pos != iter->end();++pos) { (*pos)->showOnlyMe(); showItem(index,*pos); } } openTag = true; }
void db_base::showSelectedItems(XcaTreeView* view) { QModelIndexList indexes = view->getSelectedIndexes(); QModelIndex index; QString items; foreach(index, indexes) { if (index.column() != 0) continue; currentIdx = index; showItem(); } currentIdx = QModelIndex(); }
CSEM_Error showProperty(CSEM_Property *property, cJSON *json_properties) { CSEM_Error error = CSEM_ERROR_NONE; if(property) { int i = 0; CSEM_List *names = CSEM_Property_GetNames(property); CSEM_List *values = NULL, *types = NULL; cJSON *json_prop_values = cJSON_CreateArray(); char names_str[256]; memset(names_str, 0, sizeof(names_str)); if((error = CSEM_Property_GetValues(property, &values, &types))) { goto FINISH; } if(names) { for(i = 0; names && i < CSEM_List_Size(names); i++) { if(i) { strcat(names_str, ","); } strcat(names_str, CSEM_List_Get(names, i)); } } for(i = 0; values && i < CSEM_List_Size(values); i++) { cJSON *json_prop_value = NULL; int *type = CSEM_List_Get(types, i); if(*type == CSEM_VALUE_TYPE_STR) { json_prop_value = cJSON_CreateString(CSEM_List_Get(values, i)); } else if(*type == CSEM_VALUE_TYPE_URL) { char value_str[256]; strcpy(value_str, "__URL__:"); strcat(value_str, CSEM_List_Get(values, i)); json_prop_value = cJSON_CreateString(value_str); } else if(*type == CSEM_VALUE_TYPE_ITEM) { CSEM_Item *item = CSEM_List_Get(values, i); json_prop_value = cJSON_CreateObject(); showItem(item, json_prop_value); } else if(*type == CSEM_VALUE_TYPE_PROPERTY) { CSEM_Property *property = CSEM_List_Get(values, i); json_prop_value = cJSON_CreateObject(); showProperty(property, json_prop_value); } cJSON_AddItemToArray(json_prop_values, json_prop_value); } cJSON_AddItemToObject(json_properties, names_str, json_prop_values); } FINISH: return error; }
ObjectViewer::ObjectViewer(QWidget* parent, Qt::WindowFlags f) : ViewerInterface(parent, f) { mainLayout = new QHBoxLayout(this); auto leftLayout = new QVBoxLayout; objectList = new QTableView; objectMenu = new QMenu(objectList); objectList->setContextMenuPolicy(Qt::CustomContextMenu); auto viewModelAction = new QAction("View Model", objectMenu); objectMenu->addAction(viewModelAction); connect(viewModelAction, SIGNAL(triggered()), this, SLOT(menuViewModel())); connect(objectList, SIGNAL(customContextMenuRequested(QPoint)), this, SLOT(onCustomContextMenu(QPoint))); filterModel = new ObjectSearchModel(this); objectList->setModel(filterModel); objectList->setColumnWidth(0, 50); objectList->setColumnWidth(1, 150); objectList->setColumnWidth(2, 200); objectList->setSortingEnabled(true); objectList->setSelectionBehavior(QAbstractItemView::SelectionBehavior::SelectRows); connect(objectList->selectionModel(), SIGNAL(currentChanged(QModelIndex, QModelIndex)), this, SLOT(showItem(QModelIndex))); leftLayout->addLayout(searchControls(filterModel)); leftLayout->addWidget(objectList); mainLayout->addLayout(leftLayout, 6); previewWidget = createViewer(); previewWidget->setMode(ViewerWidget::Mode::Object); infoLayout = new QGridLayout; previewID = new QLabel; previewModel = new QLabel; previewClass = new QLabel; infoLayout->addWidget(new QLabel("ID"), 1, 0); infoLayout->addWidget(previewID, 1, 1); infoLayout->addWidget(new QLabel("Type"), 2, 0); infoLayout->addWidget(previewClass, 2, 1); infoLayout->addWidget(new QLabel("Model"), 3, 0); infoLayout->addWidget(previewModel, 3, 1); infoLayout->addWidget(QWidget::createWindowContainer(previewWidget), 0, 0, 1, 2); infoLayout->setRowStretch(0, 1); mainLayout->addLayout(infoLayout, 4); setLayout(mainLayout); }
int PerButton::qt_metacall(QMetaObject::Call _c, int _id, void **_a) { _id = QPushButton::qt_metacall(_c, _id, _a); if (_id < 0) return _id; if (_c == QMetaObject::InvokeMetaMethod) { switch (_id) { case 0: clickItem((*reinterpret_cast< QString(*)>(_a[1])),(*reinterpret_cast< QString(*)>(_a[2]))); break; case 1: showItem(); break; default: ; } _id -= 2; } return _id; }
/* BrowserCanvas::onMouseEvent * Called when a key is pressed within the canvas *******************************************************************/ void BrowserCanvas::onKeyDown(wxKeyEvent& e) { int num_cols = GetSize().x / fullItemSizeX(); int offset; // Down arrow if (e.GetKeyCode() == WXK_DOWN) offset = num_cols; // Up arrow else if (e.GetKeyCode() == WXK_UP) offset = -1 * num_cols; // Left arrow else if (e.GetKeyCode() == WXK_LEFT) offset = -1; // Right arrow else if (e.GetKeyCode() == WXK_RIGHT) offset = 1; // Page up else if (e.GetKeyCode() == WXK_PAGEUP) offset = -1 * num_cols * max(GetSize().y / fullItemSizeY(), 1); // Page down else if (e.GetKeyCode() == WXK_PAGEDOWN) offset = num_cols * max(GetSize().y / fullItemSizeY(), 1); else { e.Skip(); return; } // Clamp selection int selected = itemIndex(item_selected) + offset; if (selected < 0) selected = 0; else if (selected >= (int)items_filter.size()) selected = (int)items_filter.size() - 1; selectItem(selected); showItem(selected, -1 * offset); // Refresh canvas Refresh(); }
void showResults( List* resultsList, Item* resultsLevel, HWND hContsLBox ) { if ( ListIsEmpty( resultsList ) ) MessageBox( NULL, TEXT( "No results - showResults()" ), TEXT( "Dir Glance" ), MB_ICONERROR ); else { // Display founded entries Traverse( resultsList, showItem, hContsLBox ); // Display totals SendMessage( hContsLBox, LB_ADDSTRING, 0, ( LPARAM )TEXT( " =================== ================ ========== ================== ================================" ) ); showItem( resultsLevel, hContsLBox ); } }
void EDA_MSG_PANEL::OnPaint( wxPaintEvent& aEvent ) { wxPaintDC dc( this ); erase( &dc ); dc.SetBackground( wxSystemSettings::GetColour( wxSYS_COLOUR_BTNFACE ) ); dc.SetBackgroundMode( wxSOLID ); dc.SetTextBackground( wxSystemSettings::GetColour( wxSYS_COLOUR_BTNFACE ) ); dc.SetFont( wxSystemSettings::GetFont( wxSYS_DEFAULT_GUI_FONT ) ); for( unsigned i=0; i<m_Items.size(); ++i ) showItem( dc, m_Items[i] ); aEvent.Skip(); }
void Window_Weapon::onItemClick(cocos2d::Ref *sender, Widget::TouchEventType type){ Widget* btn = dynamic_cast<Widget*>(sender); if (btn==nullptr) { return; } switch (type) { case cocos2d::ui::Widget::TouchEventType::BEGAN: break; case cocos2d::ui::Widget::TouchEventType::ENDED: showItem(btn->getTag()); break; default: break; } }
void MainWindow::createDockWindow() { QDockWidget *dock = new QDockWidget(tr(" Buffered images: "), this); dock->setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea); listImage = new QListWidget(dock); listImage->setIconSize(QSize(250,500)); listImage->setContextMenuPolicy(Qt::CustomContextMenu); listImage->setSelectionMode(QAbstractItemView::MultiSelection); connect(listImage, SIGNAL(customContextMenuRequested(const QPoint&)),this, SLOT(showContextMenu())); connect(listImage, SIGNAL(doubleClicked(QModelIndex)),this, SLOT(showItem())); connect(listImage, SIGNAL(itemClicked(QListWidgetItem*)), this, SLOT(HandleItem())); dock->setWidget(listImage); addDockWidget(Qt::LeftDockWidgetArea, dock); }