static char* iMatrixGetValueAttrib(Ihandle* ih) { if (IupGetInt(ih->data->datah, "VISIBLE")) return iupMatrixEditGetValue(ih); else return iupMatrixCellGetValue(ih, ih->data->lines.focus_cell, ih->data->columns.focus_cell); }
void iupMatrixCellUpdateValue(Ihandle* ih) { IFniis value_edit_cb; char *value = iupMatrixEditGetValue(ih); iupMatrixCellSetValue(ih, ih->data->lines.focus_cell, ih->data->columns.focus_cell, value); value_edit_cb = (IFniis)IupGetCallback(ih, "VALUE_EDIT_CB"); if (value_edit_cb) value_edit_cb(ih, ih->data->lines.focus_cell, ih->data->columns.focus_cell, value); iupMatrixPrepareDrawData(ih); iupMatrixDrawCells(ih, ih->data->lines.focus_cell, ih->data->columns.focus_cell, ih->data->lines.focus_cell, ih->data->columns.focus_cell); }
static char* iMatrixListGetValueAttrib(Ihandle* ih) { ImatrixListData* mtxList = (ImatrixListData*)iupAttribGet(ih, "_IUPMTXLIST_DATA"); if (!mtxList->label_col) return NULL; if (ih->data->columns.num <= 1 || ih->data->lines.num <= 1) return NULL; if (ih->data->editing) return iupMatrixEditGetValue(ih); else return iupMatrixGetValue(ih, ih->data->lines.focus_cell, mtxList->label_col); }
static void iMatrixEditUpdateValue(Ihandle* ih) { char *value = iupMatrixEditGetValue(ih); iupAttribSet(ih, "CELL_EDITED", "Yes"); if (ih->data->undo_redo) iupAttribSetClassObject(ih, "UNDOPUSHBEGIN", "EDITCELL"); iupMatrixSetValue(ih, ih->data->edit_lin, ih->data->edit_col, value, 1); if (ih->data->undo_redo) iupAttribSetClassObject(ih, "UNDOPUSHEND", NULL); iupBaseCallValueChangedCb(ih); iupAttribSet(ih, "CELL_EDITED", NULL); iupMatrixPrepareDrawData(ih); iupMatrixDrawCells(ih, ih->data->edit_lin, ih->data->edit_col, ih->data->edit_lin, ih->data->edit_col); }