本文整理汇总了C++中DBObjTableField::Name方法的典型用法代码示例。如果您正苦于以下问题:C++ DBObjTableField::Name方法的具体用法?C++ DBObjTableField::Name怎么用?C++ DBObjTableField::Name使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DBObjTableField
的用法示例。
在下文中一共展示了DBObjTableField::Name方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Draw
void UIAttribView::Draw (DBObjRecord *record)
{
DBObjTableField *field;
DBObjectLIST<DBObjTableField> *fields;
UIXYGraphShell *graphCLS;
if (record == (DBObjRecord *) NULL)
{
Cardinal i, numChildren;
WidgetList rowCols;
UIAuxSetLabelString (ItemNameWGT,(char *) "");
XtVaGetValues (FieldsRowCol,XmNchildren, &rowCols, XmNnumChildren, &numChildren,NULL);
for (i = 0;i < numChildren; ++i)
XmTextFieldSetString (XtNameToWidget (rowCols [i],"UIAttribViewTextField"),(char *) "");
return;
}
UIAuxSetLabelString (ItemNameWGT,record->Name ());
switch (DataPTR->Type ())
{
case DBTypeVectorPoint:
case DBTypeVectorLine:
case DBTypeVectorPolygon:
case DBTypeGridDiscrete:
fields = ItemTable->Fields ();
for (field = fields->First ();field != (DBObjTableField *) NULL;field = fields->Next ())
if (DBTableFieldIsVisible (field) == true) DrawField (field->Name (),field->String (record));
break;
case DBTypeGridContinuous:
{
DBCoordinate coord = *((DBCoordinate *) (record->Data ()));
DBGridIF *gridIF = new DBGridIF (DataPTR);
for (record = ItemTable->First ();record != (DBObjRecord *) NULL;record = ItemTable->Next ())
DrawField (record->Name (),gridIF->ValueString (record,coord));
delete gridIF;
} break;
case DBTypeNetwork:
{
DBObjTable *cellTable = DataPTR->Table (DBrNCells);
DBObjTableField *basinFLD = cellTable->Field (DBrNBasin);
DBObjRecord *basinRec;
if ((basinRec = ItemTable->Item (basinFLD->Int (record) - 1)) == (DBObjRecord *) NULL)
{ CMmsgPrint (CMmsgAppError, "BasinID Error in:%s %d",__FILE__,__LINE__); return; }
DrawField ((char *) "Basin Name",basinRec->Name ());
fields = ItemTable->Fields ();
for (field = fields->First ();field != (DBObjTableField *) NULL;field = fields->Next ())
if (DBTableFieldIsVisible (field) == true) DrawField (field->Name (),field->String (basinRec));
fields = cellTable->Fields ();
for (field = fields->First ();field != (DBObjTableField *) NULL;field = fields->Next ())
if (DBTableFieldIsVisible (field) == true) DrawField (field->Name (),field->String (record));
} break;
default: break;
}
if ((graphCLS = (UIXYGraphShell *) DataPTR->Display (UIXYGraphShellStr)) != (UIXYGraphShell *) NULL)
graphCLS->Configure (record);
}
示例2: RGISAnNetworkToGridCBK
void RGISAnNetworkToGridCBK (Widget widget,RGISWorkspace *workspace,XmAnyCallbackStruct *callData)
{
char *selection;
DBInt dataType;
DBDataset *dataset = UIDataset ();
DBObjData *netData = dataset->Data ();
DBObjTable *cellTable = netData->Table (DBrNCells);
DBObjTableField *field;
DBObjData *grdData;
static Widget select = NULL;
if (select == NULL) select = UISelectionCreate ((char *) "Field Selection");
selection = UISelectObject (select,(DBObjectLIST<DBObject> *) (cellTable->Fields ()),DBTableFieldIsSimple);
if (selection == (char *) NULL) return;
if ((field = cellTable->Field (selection)) == (DBObjTableField *) NULL)
{ CMmsgPrint (CMmsgAppError,"Corrupt Network Dataset in: %s %d",__FILE__,__LINE__); return; }
if (DBTableFieldIsCategory (field) && DBTableFieldIsNumeric (field))
{
DBObjData *tmpData;
tmpData = new DBObjData ("",DBTypeGrid);
tmpData->Document (DBDocGeoDomain,netData->Document (DBDocGeoDomain));
tmpData->Document (DBDocSubject,field->Name ());
if (UIDataHeaderForm (tmpData))
{
grdData = DBNetworkToGrid (netData,tmpData->Type ());
grdData->Name (tmpData->Name ());
grdData->Document (DBDocGeoDomain,tmpData->Document (DBDocGeoDomain));
grdData->Document (DBDocSubject,tmpData->Document (DBDocSubject));
grdData->Document (DBDocVersion,tmpData->Document (DBDocVersion));
grdData->Document (DBDocCitationRef,tmpData->Document (DBDocCitationRef));
grdData->Document (DBDocCitationInst,tmpData->Document (DBDocCitationInst));
grdData->Document (DBDocSourceInst,tmpData->Document (DBDocSourceInst));
grdData->Document (DBDocSourcePerson,tmpData->Document (DBDocSourcePerson));
grdData->Document (DBDocOwnerPerson,tmpData->Document (DBDocOwnerPerson));
grdData->Document (DBDocComment,tmpData->Document (DBDocComment));
delete tmpData;
}
else { return; }
}
else
{
if (DBTableFieldIsCategory (field)) dataType = DBTypeGridDiscrete;
else if (DBTableFieldIsNumeric (field)) dataType = DBTypeGridContinuous;
else
{
CMmsgPrint (CMmsgAppError,"Invalid field type in: %s %d",__FILE__,__LINE__);
return;
}
grdData = DBNetworkToGrid (netData,dataType);
if (UIDataHeaderForm (grdData) == false) { delete grdData; return; }
}
UIPauseDialogOpen ((char *) "Converting Network to Grid");
if (RGlibNetworkToGrid (netData,field,grdData) == DBSuccess) workspace->CurrentData (grdData);
else delete grdData;
UIPauseDialogClose ();
}
示例3: DBObject
UIAttribView::UIAttribView (DBObjData *data) : DBObject (data->Name (),sizeof (UIAttribView))
{
DBObjTableField *field;
DBObjectLIST<DBObjTableField> *fields;
Widget mainForm, scrolledW, rowCol, label;
XmString string;
Atom deleteWindowAtom = XmInternAtom(XtDisplay(UITopLevel ()),(char *) "WM_DELETE_WINDOW",FALSE);
DataPTR = data;
ItemTable = DataPTR->Table (DBrNItems);
Name (UIAttribViewSTR);
DShellWGT = XtVaCreatePopupShell ("UIAttribView",xmDialogShellWidgetClass,UITopLevel (),
XmNkeyboardFocusPolicy, XmPOINTER,
XmNtitle, data->Name (),
XmNtransient, False,
XmNminWidth, 400,
XmNminHeight, 300,
NULL);
XmAddWMProtocolCallback (DShellWGT,deleteWindowAtom,(XtCallbackProc) _UIAttribViewDeleteCBK,(XtPointer) this);
mainForm = XtVaCreateWidget ("UIAttribViewForm",xmFormWidgetClass,DShellWGT,
XmNshadowThickness, 0,
NULL);
string = XmStringCreate ((char *) "Item:",UICharSetBold);
label = XtVaCreateManagedWidget ("UIAttribViewNameLabel",xmLabelWidgetClass,mainForm,
XmNtopAttachment, XmATTACH_FORM,
XmNtopOffset, 5,
XmNleftAttachment, XmATTACH_FORM,
XmNleftOffset, 10,
XmNlabelString, string,
XmNrecomputeSize, False,
NULL);
XmStringFree (string);
string = XmStringCreate ((char *) "",UICharSetNormal);
ItemNameWGT = XtVaCreateManagedWidget ("UIAttribViewNameText",xmLabelWidgetClass,mainForm,
XmNtopAttachment, XmATTACH_FORM,
XmNtopOffset, 5,
XmNleftAttachment, XmATTACH_WIDGET,
XmNleftWidget, label,
XmNleftOffset, 5,
XmNlabelString, string,
NULL);
XmStringFree (string);
scrolledW = XtVaCreateManagedWidget ("UIAttribViewScrolledW",xmScrolledWindowWidgetClass,mainForm,
XmNtopAttachment, XmATTACH_WIDGET,
XmNtopWidget, label,
XmNtopOffset, 5,
XmNleftAttachment, XmATTACH_FORM,
XmNleftOffset, 5,
XmNrightAttachment, XmATTACH_FORM,
XmNrightOffset, 5,
XmNbottomAttachment, XmATTACH_FORM,
XmNbottomOffset, 5,
XmNheight, 150,
XmNvisualPolicy, XmCONSTANT,
XmNscrollingPolicy, XmAUTOMATIC,
NULL);
rowCol = XtVaCreateManagedWidget ("UIAttribViewRowColumn",xmRowColumnWidgetClass,scrolledW,
XmNnumColumns, 2,
XmNorientation, XmHORIZONTAL,
XmNrowColumnType, XmWORK_AREA,
NULL);
NamesRowCol = XtVaCreateManagedWidget ("UIAttribViewNamesRowColumn",xmRowColumnWidgetClass,rowCol,
XmNorientation, XmVERTICAL,
XmNrowColumnType, XmWORK_AREA,
XmNpacking, XmPACK_COLUMN,
XmNspacing, 0,
NULL);
FieldsRowCol = XtVaCreateManagedWidget ("UIAttribViewNamesRowColumn",xmRowColumnWidgetClass,rowCol,
XmNorientation, XmVERTICAL,
XmNrowColumnType, XmWORK_AREA,
XmNspacing, 0,
NULL);
switch (DataPTR->Type ())
{
case DBTypeVectorPoint:
case DBTypeVectorLine:
case DBTypeVectorPolygon:
case DBTypeGridDiscrete:
fields = ItemTable->Fields ();
for (field = fields->First ();field != (DBObjTableField *) NULL;field = fields->Next ())
if (DBTableFieldIsVisible (field) == true) NewField (field->Name (),field->Format ());
break;
case DBTypeGridContinuous:
{
DBObjRecord *record;
DBGridIF *gridIF = new DBGridIF (DataPTR);
ItemTable = DataPTR->Table (DBrNLayers);
for (record = ItemTable->First ();record != (DBObjRecord *) NULL;record = ItemTable->Next ())
NewField (record->Name (),gridIF->ValueFormat ());
delete gridIF;
} break;
case DBTypeNetwork:
{
DBObjTable *cellTable = DataPTR->Table (DBrNCells);
NewField ((char *) "Basin Name",(char *) "%s");
fields = ItemTable->Fields ();
for (field = fields->First ();field != (DBObjTableField *) NULL;field = fields->Next ())
//.........这里部分代码省略.........