int gdKeyGrabber::handle(int e) { int ret = Fl_Group::handle(e); switch(e) { case FL_KEYUP: { int x = Fl::event_key(); if (strlen(Fl::event_text()) != 0 && x != FL_BackSpace && x != FL_Enter && x != FL_Delete && x != FL_Tab && x != FL_End && x != ' ') { gLog("set key '%c' (%d) for channel %d\n", x, x, ch->index); setButtonLabel(x); updateText(x); break; } else gLog("invalid key\n"); } } return(ret); }
/** * @brief EditEntityDialog::init */ void EditEntityDialog::init() { Q_ASSERT(m_Type); Q_ASSERT(m_Scope); Q_ASSERT(m_Project); ui->leName->setText(m_Type->name()); setType(); auto &&db = m_Project->database(); for(auto &&scope : db->scopes()) ui->cbScopes->addItem(scope->name(), QVariant::fromValue(scope)); setScope(); setButtonLabel(ui->pbNewComponent, ui->lstMembers->currentItem()); configure(ui, m_Type); ui->tbRedo->setEnabled(false); ui->tbUndo->setEnabled(false); }
/*-------------------------------------------------------------------------*/ void updateQueueList(void) { lList *qlp = NULL; lList *hl = NULL; lList *rl = NULL; lList *cl = NULL; lEnumeration *whatall = NULL; lCondition *where = NULL; static Boolean filter_on = False; DENTER(GUI_LAYER, "updateQueueList"); cl = qmonMirrorList(SGE_CE_LIST); /* ** copy of host list */ hl = lCopyList("HL", qmonMirrorList(SGE_EH_LIST)); /* ** ** select a subset of the whole queue list (->where) ** and get the list sorted ** */ #ifdef FIXME where = lWhere("%T(%I!=%s)", QU_Type, QU_qname, QU_TEMPLATE); whatall = lWhat("%T(ALL)", QU_Type); #else whatall = lWhat("%T(ALL)", CQ_Type); #endif qlp = lSelect("SQL", qmonMirrorList(SGE_CQ_LIST), where, whatall); lFreeWhere(&where); lFreeWhat(&whatall); #ifdef FIXME /* ** additional filtering */ rl = qmonQFilterRequest(); if (rl) { if (!filter_on) { setButtonLabel(queue_customize, "@{Customize +}"); filter_on = True; } match_queue(&qlp, rl, cl, hl); } else { if (filter_on) { setButtonLabel(queue_customize, "@{Customize}"); filter_on = False; } } /* ** sort the queues according to sequence number and alphabetically */ lPSortList(qlp, "%I+ %I+ %I+", QU_seq_no, QU_qhostname, QU_qname); #endif /* ** save the queue in hash table */ qmonQueueHash(qlp, hl); qmonQueueSetPos(qlp); /* !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ** qlp must not be freed it is referenced in qmonHashQueue ** and freed there */ DEXIT; }
void gdKeyGrabber::__cb_clear() { updateText(0); setButtonLabel(0); }
/** * @brief EditEntityDialog::onCurrentItemChange * @param current * @param previous */ void EditEntityDialog::onCurrentItemChange(QListWidgetItem *current, QListWidgetItem *previous) { Q_UNUSED(previous); setButtonLabel(ui->pbNewComponent, current); m_ComponentsModel->setDisplay(current->data(int(ComponentCustomRoles::Display)).value<models::DisplayPart>()); }
int cellButtonProc(PtWidget_t *widget, ApInfo_t *apinfo, PtCallbackInfo_t *cbinfo) { PtArg_t args[1]; PtWidget_t *thisModule; PtWidget_t *cellButton; RASTER *rasters; PAGE *thisPage; CELL *thisCell, *lastCell; PLOT *thisPlot, *lastPlot; int cellButtonName; void *userData; int RCindex; int i, reFlag, reDefIndex; /* eliminate 'unreferenced' warnings */ widget = widget, apinfo = apinfo, cbinfo = cbinfo; reDefIndex = 0; /* get a pointer to the rasters structure */ rasters = getRasters(); /* get pointer to the window module that contains this widget */ thisModule = ApGetInstance(widget); /* figure out this raster page */ thisPage = getRasterPage(rasters->curPageIndx); /* get this button's position argument */ PtSetArg(&args[0], Pt_ARG_USER_DATA, &userData, 0); PtGetResources(widget, 1, args); sscanf(userData, "%d", &RCindex); /* mark the selected button yellow */ /* first set the fill color of all buttons to grey */ PtSetArg(&args[0], Pt_ARG_FILL_COLOR, Pg_GREY, 0); for(i = 0; i < 64; i++) { cellButtonName = getCellButtonName(i); cellButton = ApGetWidgetPtr(thisModule, cellButtonName); if(!cellButton) continue; /* skip bad widgets */ PtSetResources(cellButton, 1, args); } /* now set this button's fill color to yellow */ PtSetArg(&args[0], Pt_ARG_FILL_COLOR, Pg_YELLOW, 0); PtSetResources(widget, 1, args); /* first find out if the user is defining a new cell * or redefining an old cell * to do this, compare the position index of each * previously defined cell with that of the selected cell */ reFlag = 0; for(i = 0; i < thisPage->nDefCells; i++) { thisCell = getRasterCell(thisPage->cellsInfo, i); if(thisCell->RCindex == RCindex) { /* true if redefining an old cell */ reFlag++; /* make the redefine flag non-zero */ reDefIndex = i; /* index of cell to be redefined */ break; /* quit testing if a previous index matches the selected cell index */ } } /* if the redefine flag is not 0, the user is redefining an old cell */ if(reFlag) { thisPage->curCellIndx = reDefIndex; thisCell = getRasterCell(thisPage->cellsInfo, thisPage->curCellIndx); thisPlot = &thisCell->plotInfo; } /* otherwise, the user is defining a new cell*/ if(!reFlag) { thisPage->curCellIndx = thisPage->nDefCells; thisCell = getRasterCell(thisPage->cellsInfo, thisPage->curCellIndx); thisPlot = &thisCell->plotInfo; /* set the relative location of this cell on the page */ thisCell->RCindex = RCindex; thisCell->colN = RCindex % 8; thisCell->rowN = (thisPage->nRows - 1) - (RCindex / 8); /* if this is not the first cell on the page * initialize it with the values of the last cell */ if(thisPage->curCellIndx) { lastCell = getRasterCell(thisPage->cellsInfo, thisPage->curCellIndx - 1); lastPlot = &lastCell->plotInfo; initPlot(thisPage, thisPlot, lastPlot); } thisPage->nDefCells++; /* increment the number of defined cells on this page */ } /* set the button's label */ setButtonLabel(thisModule, thisCell); initPlotWidgets(thisModule, thisPlot); initGraphWidgets(thisModule, &thisPlot->graph); return( Pt_CONTINUE ); }