void TableEditor::endEdit(int row,int col,bool accept,bool replace) { Q3Table::endEdit(row,col,accept,replace); setCellContentFromEditor(row,col); if(isEmptyRow(row)) if(numRows()>1) removeRow(row); if(!isEmptyRow(numRows()-1)) addEmptyRow(); }
void PictureListEditor::edit(PictureList *l) { list=l; PictureList &pl=*l; int n=list->size(); setNumRows(n); for(int i=0;i<n;i++) { setText(i,0,QString::number(pl[i].low)); setText(i,1,QString::number(pl[i].high)); setText(i,2,pl[i].path); } addEmptyRow(); adjustCols(); }
void StringListEditor::edit(StringList *l) { list=l; StringList &sl=*l; int n=list->size(); setNumRows(n); for(int i=0;i<n;i++) { setText(i,0,QString::number(sl[i].low)); setText(i,1,QString::number(sl[i].high)); setText(i,2,sl[i].text); } addEmptyRow(); adjustCols(); }
bool CreatureObjectBuffer::handleUpdateObjectPosition(const UpdateObjectPositionMessage &message) { DBSchema::CreatureObjectBufferRow *row=dynamic_cast<DBSchema::CreatureObjectBufferRow*>(findRowByIndex(message.getNetworkId())); if (row==0) { row=addEmptyRow(message.getNetworkId()); } Vector v = message.getWorldspaceTransform().getPosition_p(); row->ws_x = static_cast<double>(v.x); row->ws_y = static_cast<double>(v.y); row->ws_z = static_cast<double>(v.z); return true; }
void CommandListEditor::edit(CommandList *l) { list=l; CommandList &pl=*l; int n=list->size(); setNumRows(n); for(int i=0;i<n;i++) { setText(i,0,QString::number(pl[i].val)); setText(i,1,pl[i].text); /* for(int k=0;k<FAST_KEYS_COUNT;k++) if(pl[i].key==FAST_KEYS[k].key) { setText(i,2,FAST_KEYS[k].name); break; } */ setText(i,2,QString::number(pl[i].filter_value)); } addEmptyRow(); adjustCols(); }
// ============================================================= PythonSettings::PythonSettings(QWidget* parent, const char* name) : QWidget(parent), Ui_PythonSettingsData(), PreferencesEntry() { setINIFileSectionName("PYTHON"); setupUi(this); setObjectName(name); // signals and slots connections connect( choose_button, SIGNAL( clicked() ), this, SLOT( fileSelected() ) ); connect( clear_button, SIGNAL( clicked() ), this, SLOT( clearStartupScript() ) ); connect( font_button, SIGNAL( clicked() ), this, SLOT( selectFont() ) ); connect(new_button, SIGNAL(pressed()), table, SLOT(addEmptyRow())); connect(remove_button, SIGNAL(pressed()), table, SLOT(removeSelection())); registerWidgetForHelpSystem_(widget_stack->widget(0), "pythonInterpreter.html#startup_script"); registerWidgetForHelpSystem_(widget_stack->widget(1), "pythonInterpreter.html#create_hotkeys"); setWidgetStackName("Python"); setWidgetStack(widget_stack); registerWidgets_(); }
void CreatureObjectBuffer::setAttribute(const NetworkId &objectId, Attributes::Enumerator type, Attributes::Value value) { DBSchema::CreatureObjectBufferRow *row=dynamic_cast<DBSchema::CreatureObjectBufferRow*>(findRowByIndex(objectId)); if (row==0) { row=addEmptyRow(objectId); } switch (type) { case 0: row->attribute_0=value; break; case 1: row->attribute_1=value; break; case 2: row->attribute_2=value; break; case 3: row->attribute_3=value; break; case 4: row->attribute_4=value; break; case 5: row->attribute_5=value; break; case 6: row->attribute_6=value; break; case 7: row->attribute_7=value; break; case 8: row->attribute_8=value; break; case 9: row->attribute_9=value; break; case 10: row->attribute_10=value; break; case 11: row->attribute_11=value; break; case 12: row->attribute_12=value; break; case 13: row->attribute_13=value; break; case 14: row->attribute_14=value; break; case 15: row->attribute_15=value; break; case 16: row->attribute_16=value; break; case 17: row->attribute_17=value; break; case 18: row->attribute_18=value; break; case 19: row->attribute_19=value; break; case 20: row->attribute_20=value; break; case 21: row->attribute_21=value; break; case 22: row->attribute_22=value; break; case 23: row->attribute_23=value; break; case 24: row->attribute_24=value; break; case 25: row->attribute_25=value; break; case 26: row->attribute_26=value; break; default: WARNING_STRICT_FATAL(true,("Programmer bug: setAttribute(%s, %i, %i): %i is not a valid attribute identifier",objectId.getValueString().c_str(), type, value, type)); } }