#include <mi32/dbedit.h>
Public Types | |
| enum | LABELCOLOR { LABELCOLOR_Normal = 0, LABELCOLOR_Computed, LABELCOLOR_PK, LABELCOLOR_FK } |
| enum | VIEWFLAGS { VIEWFLAG_None = 0, VIEWFLAG_ViewActive = 0x00000001, VIEWFLAG_ViewSelected = 0x00000002, VIEWFLAG_ViewAll = 0x00000004, VIEWFLAG_NoChangeViewMode = 0x00000008, VIEWFLAG_NoSingleRecordView = 0x00000010, VIEWFLAG_NoRecordSelection = 0x00000020, VIEWFLAG_NoAttachmentIndicator = 0x00000040, VIEWFLAG_NoRowControls = (VIEWFLAG_NoRecordSelection|VIEWFLAG_NoAttachmentIndicator), VIEWFLAG_NoNewRecord = 0x00000080, VIEWFLAG_NoDropTable = 0x00000100, VIEWFLAG_NoEditDefn = 0x00000200, VIEWFLAG_TabularView = 0x00000400, VIEWFLAG_NoElementSelection = 0x00000800, VIEWFLAG_NoCreateIfNotExist = 0x00001000, VIEWFLAG_SingleRecordView = 0x00002000 } |
Public Member Functions | |
| int | CallbackAdd (void(*func)(MxdDatabaseEditorCallbackStruct *, void *), void *data, UINT32 reason) |
| void | CallbackRemove (void(*func)(MxdDatabaseEditorCallbackStruct *, void *), void *data, UINT32 reason) |
| void | CallCallbacks (MxdDatabaseEditorCallbackStruct *cbs, UINT32 reason) |
| int | Close () |
| int | Create (MDLGPARENT parent, const RVC::OBJITEM &ParentObjItem, ELEMTYPE elemtype, UINT32 flags=0, const RVC::CREDENTIALS *Credentials=0) |
| DEPRECATED int | Create (MDLGPARENT parent, const MIUNICODE *fname, RVCINODENUM pinode, ELEMTYPE elemtype, UINT32 flags=0) |
| void | DBCallbackResume (bool ReallyIgnore, bool Totally=false) |
| void | DBCallbackSuspend (bool ReallyIgnore, bool Totally=false) |
| DBEDIT () | |
| int | FindRecords (int active) |
| int | Flush () |
| int | FormClose (const RVC::OBJITEM &ObjItem) |
| DEPRECATED int | FormClose (RVCINODENUM Inode) |
| int | FormDrop (MDLGPARENT parent, const RVC::OBJITEM &ObjItem) |
| DEPRECATED int | FormDrop (MDLGPARENT parent, RVCINODENUM inode) |
| int | FormNew (MDLGPARENT parent, VIEWFLAGS flags=VIEWFLAG_None, const RVC::CREDENTIALS *Credentials=0) |
| DEPRECATED int | FormNew (MDLGPARENT parent, INT32 *pinode, VIEWFLAGS flags=VIEWFLAG_None, const RVC::CREDENTIALS *Credentials=0) |
| DEPRECATED int | FormOpen (RVCINODENUM inode, VIEWFLAGS flags=VIEWFLAG_None, const RVC::CREDENTIALS *Credentials=0) |
| int | FormOpen (const RVC::OBJITEM &ObjItem, VIEWFLAGS flags=VIEWFLAG_None, const RVC::CREDENTIALS *Credentials=0) |
| int | GenViewCreate (DBEDIT_TINSTANCE **pinstance, INT32 TableNum, MGUI::LAYOUT_PANE_BASE &ParentPane, DBEDIT::VIEWFLAGS flags) |
| int | GenViewCreate (DBEDIT_TINSTANCE **pinstance, INT32 TableNum, MDLGPARENT parent, MDLGPARENT *pwidget, Arg *uarg, int numuargs, VIEWFLAGS flags=VIEWFLAG_None) |
| int | GetActiveElement () const |
| DEPRECATED int | GetDatabaseHandle () |
| RVC::DBASE_ELEMENT * | GetDBase () const |
| RVC::DBASE::OBSERVER * | GetDBRelateHandle () const |
| ELEMTYPE | GetElemType () const |
| void | GetLabelColor (LABELCOLOR colornum, COLOR &color) |
| UINT32 | GetLabelColor (LABELCOLOR color) |
| void | GetLabelColorFromFlags (UINT32 flags, COLOR &color) |
| UINT32 | GetLabelColorFromFlags (UINT32 flags) |
| int | GetNumOpen () |
| const RVC::OBJITEM & | GetObjItem () const |
| MDLGPARENT | GetParent () const |
| const RVC::OBJITEM & | GetParentObjItem () const |
| bool | GetStyleObject (RVC::STYLE &StyleObj) |
| DBEDIT_TDATA * | GetTableData (int table) const |
| DBEDIT_TINSTANCE * | GetTableInstanceHandle (INT32 TableNum, VIEWFLAGS flags) |
| bool | IsCreated () const |
| int | IsMainLevel () const |
| int | IsPinMapping () const |
| int | IsTableOpen (int TableNum) |
| int | ModalSingleRecordView (INT32 TableNum, INT32 Record, RVC::DBTABLE::RECORD *InitVal, MDLGPARENT parent, UINT32 flags) |
| int | MultiSelectAddElement (INT32 element) |
| int | MultiSelectEnd (UINT32 flags) |
| int | MultiSelectRemoveElement (INT32 element) |
| int | MultiSelectStart (UINT32 flags, ELEMTYPE ElemType, int BaseTable=0) |
| void | OnEvent (const DBEDIT::EVENT &event, bool bDeferable=true) |
| ERRVALUE | OpenTreeView (UINT32 flags=0) |
| int | RefreshActiveElementAttachments (UINT32 flags) |
| int | RefreshAttachments (UINT32 flags) |
| int | SetActiveElement (INT32 element, ELEMTYPE elemtype, UINT32 flags, INT32 BaseTable=0) |
| void | SetBaseTable (int table) |
| void | SetDBRelateHandle (RVC::DBASE::OBSERVER *handle) |
| int | SetElements (ELEMTYPE ElemType, INT32 BaseTable, UINT8 *Bits, INT32 NumElements, INT32 ActiveElement, UINT32 flags) |
| void | SetParent (MDLGPARENT parent) |
| int | SetRecord (int table, INT32 record) |
| int | SetStyleNumber (int StyleNum, int RecNum) |
| int | SetStyleObject (const RVC::OBJITEM &StyleObjItem, const RVC::OBJECTNAME &StyleTableName, const void *dftstyle) |
| int | StyleDialogClose () |
| int | StyleDialogOpen (MDLGPARENT parent) |
| int | TableClose (INT32 TableNum) |
| int | TableCreate (MDLGPARENT parent) |
| int | TableCreate (MDLGPARENT parent, const RVC::DBTABLE::MAKEPARMS &MakeParms, const RVC::DESCRIPTOR *Descriptor=0) |
| DEPRECATED int | TableCreate (MDLGPARENT parent, RVCTABLEINFO *info, DBFIELDINFO *finfo=0) |
| int | TableDestroy (int TableNum) |
| int | TableDrop (MDLGPARENT parent, int TableNum) |
| ERRVALUE | TableEditACL (MDLGPARENT parent, int TableNum) |
| int | TableEditDefinition (MDLGPARENT parent, int TableNum) |
| int | TableOpen (INT32 TableNum, VIEWFLAGS flags=VIEWFLAG_None) |
| int | UpdateDialogs () |
| int | UpdateResume (UINT32 flags) |
| void | UpdateSuspend () |
| ~DBEDIT () | |
Classes | |
| struct | EVENT |
Definition at line 313 of file dbedit.h.
| enum DBEDIT::LABELCOLOR |
| enum DBEDIT::VIEWFLAGS |
Flags for database table viewer.
| DBEDIT::DBEDIT | ( | ) |
Constructor.
Note: Since a constructor can't return an error, it only initialized the class to blank settings. You should call the Create method to actually set the thing up.
| DBEDIT::~DBEDIT | ( | ) |
| int DBEDIT::CallbackAdd | ( | void(*)(MxdDatabaseEditorCallbackStruct *, void *) | func, | |
| void * | data, | |||
| UINT32 | reason | |||
| ) |
Add a callback.
| void DBEDIT::CallbackRemove | ( | void(*)(MxdDatabaseEditorCallbackStruct *, void *) | func, | |
| void * | data, | |||
| UINT32 | reason | |||
| ) |
Remove a callback.
| void DBEDIT::CallCallbacks | ( | MxdDatabaseEditorCallbackStruct * | cbs, | |
| UINT32 | reason | |||
| ) |
Call callbacks.
This should be private. Only used by friend classes.
| int DBEDIT::Close | ( | ) |
Close everything, but don't destroy anything.
| int DBEDIT::Create | ( | MDLGPARENT | parent, | |
| const RVC::OBJITEM & | ParentObjItem, | |||
| ELEMTYPE | elemtype, | |||
| UINT32 | flags = 0, |
|||
| const RVC::CREDENTIALS * | Credentials = 0 | |||
| ) |
Create.
You should call this after constructing the DBEDIT and check for an error. This is because a constructor can't return an error.
| elemtype | Element type of the database to open (ELEMTYPE_Record if pinode is of an OTYPE_DBASE) |
| DEPRECATED int DBEDIT::Create | ( | MDLGPARENT | parent, | |
| const MIUNICODE * | fname, | |||
| RVCINODENUM | pinode, | |||
| ELEMTYPE | elemtype, | |||
| UINT32 | flags = 0 | |||
| ) |
Create.
You should call this after constructing the DBEDIT and check for an error. This is because a constructor can't return an error.
| pinode | Inode of database object's parent (vector, raster, whatever) |
| elemtype | Element type of the database to open (ELEMTYPE_Record if pinode is of an OTYPE_DBASE) |
| void DBEDIT::DBCallbackResume | ( | bool | ReallyIgnore, | |
| bool | Totally = false | |||
| ) |
Resume database callback handling.
If any callbacks happened while suspended (and we're not still suspended) they will be processed.
| Totally | If true, throw out everything - Use with caution |
| void DBEDIT::DBCallbackSuspend | ( | bool | ReallyIgnore, | |
| bool | Totally = false | |||
| ) |
Suspend database callbacks.
Unless ReallyIgnore is set, callbacks which happen while suspended will be queued and processed when resumed. Suspend/Resumes are refcounted.
| Totally | If true, throw out everything - Use with caution |
| int DBEDIT::FindRecords | ( | int | active | ) |
Find records.
Shouldn't this be private? Should only be called by friend classes.
| int DBEDIT::Flush | ( | ) |
Force all unwritten records to be written.
| int DBEDIT::FormClose | ( | const RVC::OBJITEM & | ObjItem | ) |
Close a form.
| DEPRECATED int DBEDIT::FormClose | ( | RVCINODENUM | Inode | ) |
Close a form.
Use the OBJITEM version
| int DBEDIT::FormDrop | ( | MDLGPARENT | parent, | |
| const RVC::OBJITEM & | ObjItem | |||
| ) |
Deleta a form.
| parent | Parent widget for "Are you sure" dialog |
| DEPRECATED int DBEDIT::FormDrop | ( | MDLGPARENT | parent, | |
| RVCINODENUM | inode | |||
| ) |
Deleta a form.
Use the OBJITEM version
| parent | Parent widget for "Are you sure" dialog |
| int DBEDIT::FormNew | ( | MDLGPARENT | parent, | |
| VIEWFLAGS | flags = VIEWFLAG_None, |
|||
| const RVC::CREDENTIALS * | Credentials = 0 | |||
| ) |
Create a new, blank form.
| parent | Parent widget for dialogs |
| DEPRECATED int DBEDIT::FormNew | ( | MDLGPARENT | parent, | |
| INT32 * | pinode, | |||
| VIEWFLAGS | flags = VIEWFLAG_None, |
|||
| const RVC::CREDENTIALS * | Credentials = 0 | |||
| ) |
Create a new, blank form.
| parent | Parent widget for dialogs |
| pinode | INGORED (will go away - use the other version that doesn't have this parameter) |
| DEPRECATED int DBEDIT::FormOpen | ( | RVCINODENUM | inode, | |
| VIEWFLAGS | flags = VIEWFLAG_None, |
|||
| const RVC::CREDENTIALS * | Credentials = 0 | |||
| ) |
| int DBEDIT::FormOpen | ( | const RVC::OBJITEM & | ObjItem, | |
| VIEWFLAGS | flags = VIEWFLAG_None, |
|||
| const RVC::CREDENTIALS * | Credentials = 0 | |||
| ) |
Open a form.
| int DBEDIT::GenViewCreate | ( | DBEDIT_TINSTANCE ** | pinstance, | |
| INT32 | TableNum, | |||
| MGUI::LAYOUT_PANE_BASE & | ParentPane, | |||
| DBEDIT::VIEWFLAGS | flags | |||
| ) |
Create a generic single record view form for a given table.
This form doesn't do anything automatically. This is the MFC version of this function.
| pinstance | instance returned |
| TableNum | Table number to create view for |
| int DBEDIT::GenViewCreate | ( | DBEDIT_TINSTANCE ** | pinstance, | |
| INT32 | TableNum, | |||
| MDLGPARENT | parent, | |||
| MDLGPARENT * | pwidget, | |||
| Arg * | uarg, | |||
| int | numuargs, | |||
| VIEWFLAGS | flags = VIEWFLAG_None | |||
| ) |
Create a generic single record view form for a given table.
This form doesn't do anything automatically. This is the X version of this function.
| pinstance | instance returned |
| TableNum | Table number to create view for |
| parent | Parent widget to create view in |
| pwidget | XmForm returned |
| uarg | Arguments to use when creating form |
| int DBEDIT::GetActiveElement | ( | ) | const [inline] |
| DEPRECATED int DBEDIT::GetDatabaseHandle | ( | ) |
Get the RVC object handle for this database.
| RVC::DBASE_ELEMENT* DBEDIT::GetDBase | ( | ) | const [inline] |
| RVC::DBASE::OBSERVER* DBEDIT::GetDBRelateHandle | ( | ) | const [inline] |
| ELEMTYPE DBEDIT::GetElemType | ( | ) | const [inline] |
| void DBEDIT::GetLabelColor | ( | LABELCOLOR | colornum, | |
| COLOR & | color | |||
| ) |
Get the color to use for a label given a DBEDIT::LABELCOLOR.
| UINT32 DBEDIT::GetLabelColor | ( | LABELCOLOR | color | ) |
Get the color to use for a label given a DBEDIT::LABELCOLOR.
Get the color to use for a label from the DBFIELDINFO.flags.
Get the color to use for a label from the DBFIELDINFO.flags XXX.
These should return a COLORREF, but I don't know where that's defined. I don't think I really want this to include it anyway.
| flags | From DBFIELDINFO.flags |
| int DBEDIT::GetNumOpen | ( | ) |
Get the number of tables open.
| const RVC::OBJITEM& DBEDIT::GetObjItem | ( | ) | const [inline] |
| MDLGPARENT DBEDIT::GetParent | ( | ) | const [inline] |
| const RVC::OBJITEM& DBEDIT::GetParentObjItem | ( | ) | const [inline] |
| bool DBEDIT::GetStyleObject | ( | RVC::STYLE & | StyleObj | ) |
Open the style object associated with a database.
This is for use by DBEDIT_TDATA only (?).
| DBEDIT_TDATA* DBEDIT::GetTableData | ( | int | table | ) | const [inline] |
Returns the instance handle for a given table and open mode.
Will create one unless passed the flag DBVIEW_NoCreateIfNotExist.
| TableNum | Table number to look for |
| flags | DBVIEW_TabularView or 0 |
| bool DBEDIT::IsCreated | ( | ) | const [inline] |
| int DBEDIT::IsMainLevel | ( | ) | const [inline] |
| int DBEDIT::IsPinMapping | ( | ) | const [inline] |
| int DBEDIT::IsTableOpen | ( | int | TableNum | ) |
Returns 1 if the requested table is open in some way.
| TableNum | Table to check for |
| int DBEDIT::ModalSingleRecordView | ( | INT32 | TableNum, | |
| INT32 | Record, | |||
| RVC::DBTABLE::RECORD * | InitVal, | |||
| MDLGPARENT | parent, | |||
| UINT32 | flags | |||
| ) |
Open a table in single record view as a modal dialog.
| TableNum | Table number to open |
| Record | Record to edit (or RECORD_New) |
| InitVal | Initial record values (can be null) |
| parent | Parent widget to use for dialog |
| flags | MxdDATABASE_AutoSave if you don't want a "Do you wish to save changes" question on OK |
| int DBEDIT::MultiSelectAddElement | ( | INT32 | element | ) |
Add an element to the multi-Select list.
| element | Element number or MxdDATABASE_NoElement |
| int DBEDIT::MultiSelectEnd | ( | UINT32 | flags | ) |
Finish a multiple element selection.
| flags | Could pass MxdDATABASE_DontUpdateDialogs |
| int DBEDIT::MultiSelectRemoveElement | ( | INT32 | element | ) |
Remove an element from the multi-Select list.
| element | Element to remove from the selected element set |
Start adding elements to the element list.
SetElements() is the prefered method, but isn't well suited to CAD. Call MultiSelectStart, MultiSelectAddElement as many times as you need, then MultiSelectEnd. If you want to clear the list first, pass MxdDATABASE_Clear.
| flags | MxdDATABASE_Clear |
| ElemType | ELEMTYPE_Xxxx |
| BaseTable | Only needed if for ELEMTYPE_Record |
| void DBEDIT::OnEvent | ( | const DBEDIT::EVENT & | event, | |
| bool | bDeferable = true | |||
| ) |
Open a tree view showing table relationships.
Currently only defined for X
| flags | Old MxdFLAG_Flags |
| int DBEDIT::RefreshActiveElementAttachments | ( | UINT32 | flags | ) |
Notify the database editor that attachments to active element may have changed.
(Should be unnecessary now that we have database callbacks to deal with all this, but you can totally suspend the callbacks).
| flags | Can be MxdDATABASE_DontUpdateDialogs |
| int DBEDIT::RefreshAttachments | ( | UINT32 | flags | ) |
Notify the database editor that attachments may have changed.
(Should be unnecessary now that we have database callbacks to deal with all this, but you can totally suspend the callbacks).
| flags | Can be MxdDATABASE_DontUpdateDialogs |
| int DBEDIT::SetActiveElement | ( | INT32 | element, | |
| ELEMTYPE | elemtype, | |||
| UINT32 | flags, | |||
| INT32 | BaseTable = 0 | |||
| ) |
Set the "active" element.
| element | Element number of MxdDATABASE_NoElement |
| elemtype | ELEMTYPE_Xxxx |
| flags | Can be MxdDATABASE_DontUpdateDialogs |
| BaseTable | Table to use if this is ELEMTYPE_RECORD |
| void DBEDIT::SetBaseTable | ( | int | table | ) |
Set the base table number for PinMapping.
| table | Table number to use |
| void DBEDIT::SetDBRelateHandle | ( | RVC::DBASE::OBSERVER * | handle | ) | [inline] |
| int DBEDIT::SetElements | ( | ELEMTYPE | ElemType, | |
| INT32 | BaseTable, | |||
| UINT8 * | Bits, | |||
| INT32 | NumElements, | |||
| INT32 | ActiveElement, | |||
| UINT32 | flags | |||
| ) |
Set the list of selected elements using a bit array.
| ElemType | ELEMTYPE_Xxxx |
| BaseTable | Base table number |
| Bits | Bit array with selected elements set |
| NumElements | Number of bits in array |
| ActiveElement | Active element number |
| flags | could pass MxdDATABASE_DontUpdateDialogs, but why? |
| void DBEDIT::SetParent | ( | MDLGPARENT | parent | ) | [inline] |
| int DBEDIT::SetRecord | ( | int | table, | |
| INT32 | record | |||
| ) |
Set the current record.
This just Calls SetActiveElement.
| table | Base table number |
| record | Current record number |
| int DBEDIT::SetStyleNumber | ( | int | StyleNum, | |
| int | RecNum | |||
| ) |
Set the style number to edit in the style editor dialog.
Also remembers internally which record this was for. Returns without doing anything if style editor isn't open.
| StyleNum | Style number to edit |
| RecNum | Record number in Style Assignment Table |
| int DBEDIT::SetStyleObject | ( | const RVC::OBJITEM & | StyleObjItem, | |
| const RVC::OBJECTNAME & | StyleTableName, | |||
| const void * | dftstyle | |||
| ) |
Set the style object to use for style samples.
| StyleObjItem | Style object to use |
| StyleTableName | Name of style table |
| dftstyle | Default style appropriate to the database type |
| int DBEDIT::StyleDialogClose | ( | ) |
Close the style dialog.
Actually does nothing.
| int DBEDIT::StyleDialogOpen | ( | MDLGPARENT | parent | ) |
Open the style editor dialog.
| parent | Parent widget for the dialog |
| int DBEDIT::TableClose | ( | INT32 | TableNum | ) |
Close all instances of a given table.
| TableNum | Table number to close (all instances) |
| int DBEDIT::TableCreate | ( | MDLGPARENT | parent | ) |
This uses a wizard to walk the user through the first few steps of creating a table.
| parent | Parent widget for dialogs |
| int DBEDIT::TableCreate | ( | MDLGPARENT | parent, | |
| const RVC::DBTABLE::MAKEPARMS & | MakeParms, | |||
| const RVC::DESCRIPTOR * | Descriptor = 0 | |||
| ) |
| parent | Parent widget for dialogs |
| MakeParms | Defaults for new table (optional) |
| Descriptor | Initial descriptor (can be 0 if no default name) |
| DEPRECATED int DBEDIT::TableCreate | ( | MDLGPARENT | parent, | |
| RVCTABLEINFO * | info, | |||
| DBFIELDINFO * | finfo = 0 | |||
| ) |
Popup a table creation dialog.
This pops up the "New Table" dialog to let the user design a new table.
If the optional tableinfo is supplied, it will be used for defaults and the the new table's info will be returned in it.
| parent | Parent widget for dialogs |
| info | Defaults for new table (optional) |
| finfo | Initial field info (optional) |
| int DBEDIT::TableDestroy | ( | int | TableNum | ) |
Destroy table instance (just the dialog, not the underlying table).
| TableNum | Table number to destroy |
| int DBEDIT::TableDrop | ( | MDLGPARENT | parent, | |
| int | TableNum | |||
| ) |
Drop (delete) a table.
| parent | Parent for "Are you sure" dialog |
| TableNum | Table number to drop |
| ERRVALUE DBEDIT::TableEditACL | ( | MDLGPARENT | parent, | |
| int | TableNum | |||
| ) |
popup a dialog to allow the user to edit the table's Access Control List
| parent | Parent for "Are you sure" dialog |
| TableNum | Table number to drop |
| int DBEDIT::TableEditDefinition | ( | MDLGPARENT | parent, | |
| int | TableNum | |||
| ) |
popup a dialog to allow the user to edit the table's definition.
| parent | Parent for "Are you sure" dialog |
| TableNum | Table number to drop |
Open a table window in DBVIEW_TabularView mode or (default) Single Record View.
| TableNum | Table number to open |
| flags | flags |
| int DBEDIT::UpdateDialogs | ( | ) |
Force all open table windows to update.
| int DBEDIT::UpdateResume | ( | UINT32 | flags | ) |
Similar to DBCallbackResume, but if resuming (it's refcounted so may these can be nested), this will check to see if we think we need to update everything and do so.
In a perfect world, this should never be the case. CallbackResume will handle it all for us.
| flags | could pass MxdDATABASE_DontUpdateDialogs, but why? |
| void DBEDIT::UpdateSuspend | ( | ) |
Just calls DBCallbackSuspend().
1.5.2