Lade...
 

Pseudo-Class (Beispiel)

Interaktive Definition einer Pseudoklasse - das Datenbank-Layout zur Laufzeit erweitern

Beispiel 1: InstantView®-Code für die interaktive Definition neuer Datenbanken, neuer Segmente und Root-EP-Collections
Var(omgr) Var(segment, repCollection) GetManager(OBJECT) -> omgr // we need the object manager Group(groupDB, SELECT_MULTIPLE, 11, 5, 470, 45, "Database") { Prompt(11, 11, "Path") String(CXS_DATABASE::path, 120, 11, 300) // to enter path of database file Button(FONT(0), 18, 28, 70, 7, "create") [ SELECT: omgr Call(NewDatabase) // create new CXS_DATABASE object DrainWindow(, groupDB) // write input data from GUI into object SendMsg(UPDATE_DATABASES) // update list of database below (in next group) ] } Group(groupSeg, SELECT_MULTIPLE, 11, 50, 470, 70, "Segment") { Prompt(11, 11, "Name") String(CXS_SEGMENT::name, 120, 11, 300) // to enter the name of the segment Prompt(11, 24, "in Database") ObjectCombobox(CXS_SEGMENT::database, 120, 24, 300, 32) // to specify the database [ INITIALIZE: UPDATE_DATABASES: ClearObox omgr Call(GetDatabases) FillObox // display all databases to allow for interactive selection ] Prompt(11, 37, "Split threshold") Integer(CXS_SEGMENT::threshold, 120, 37, 80) // to enter threshold value for segment splitting Button(b0, DEFAULT, 18, 52, 70, 7, "create") [ SELECT: omgr Call(NewSegment) -> segment // create new CXS_SEGMENT object segment DrainWindow(, groupSeg) // write input data from GUI into object SendMsg(UPDATE_SEGMENTS) // update list of segments below (in next group) ] } Group(groupColl, SELECT_MULTIPLE, 11, 125, 470, 70, "Collection") { Prompt(11, 11, "Name") String(CXS_REP_COLLECTION::name, 120, 11, 300) // to enter the root entry point name Prompt(11, 24, "in Segment") ObjectCombobox(CXS_REP_COLLECTION::segment, 120, 24, 300, 32) // to select a segment to store the collection [ INITIALIZE: UPDATE_SEGMENTS: ClearObox omgr Call(GetSegments) FillObox // disply all segments to allow for interactive selection ] Prompt(11, 37, "Type") Enum(CXS_REP_COLLECTION::type, 100, 37, 80, 35) // to select a type: SET, LIST, BAG, or ARRAY Button(FONT(0), 18, 52, 70, 7, "create") [ SELECT: omgr Call(NewREPCollection) -> repCollection // create new CXS_REP_COLLECTION object repCollection DrainWindow(, groupColl) // and write input data from GUI into object ] }

 

Beispiel 2: InstantView®-Code für das interaktive Erzeugen einer Pseudoklasse; Datenbank, Segment und Root-EP-Collections werden als bereits bekannt vorausgesetzt
Var (segment, coll0, coll1, collg) // already containing CXS_SEGMENT and CXS_REP_COLLECTIONs . . . Window(winClass, 33, 11, 619, 36, "Pseudo-Class") [ Var(omgr, metaClass) INITIALIZE: GetManager(OBJECT) -> omgr // we need the object manager ] { Prompt(FONT(0), BLUE, 11, 11, "Name") String(CX_META_CLASS::internalName, 120, 11, 210) // to enter name of pseudo-class Prompt(FONT(0), BLUE, 345, 11, "classID") Integer(CX_META_CLASS::realWorldClassID, 420, 11, 130) // to enter numerical classID Prompt(FONT(0), BLUE, 11, 22, "derive from") ObjectCombobox(CX_META_CLASS::superClass, 120, 22, 430, 50) // derive from another class (pseudo or real one) [ INITIALIZE: 0 SetSort omgr Call(GetMetaClasses) FillObox // show all classes known to the object manager ] Button(RED, 17, 45, 100, 7, "create") [ SELECT: omgr Call(NewMetaClass) -> metaClass, // create new CX_META_CLASS metaClass FillWindow(, winClass) // write input into object 0 segment, // layer and segment [ coll0, coll1 ] collg // collections for domain 0 / 1 and for deleted objects (garbage) metaClass Call(SetPersistenceInfo) metaClass Call(Integrate) // now objects of the new pseudo class could be created ] }