AppsWarehouse®-Module "inaktiv" einlesen:
Var(awh) // the AppsWarehouse®
"CX_ROOTDIR\\AppsWH\\*.mod" SystemObject Call(ParseLib)
// ParseLib() returns a text reporting syntax errors if there are any
Drop // but we are not interested ...
// ParseLib reads modules as if there had been defined by Extern-Statements -
// and marks these modules as "for introspection only"
// To find literals, however, we need these modules to be loaded completely:
1 /* = introspection mode */ SystemObject Call(GetModules) # -> awh // without our own active module
awh iterate {
Call(LoadExternalModule)
Drop // we are lazy again and ignore possible syntax errors
}
Text-Literale finden
Var(literals) // all text literals
CreateTransCollection(LIST) -> literals
awh iterate {
literals Swap Call(FindMLStrings)
}
Verwendung der Literale
Window( ... , "Text Literals ...") { ... ObjectListView(literals, AUTO_POSITION, ITEM(, 13), 1, 1, 1, 1) [ INITIALIZE: [ "CXI_TEXT_LITERAL::Language(0)" COLOR BLUE ] SetFormat // original text [ "CXI_TEXT_LITERAL::Language(1)" COLOR RED 0, 6, COLUMN 0 ] SetFormat // original text [ "CXI_TEXT_LITERAL::UseCount()" JUSTIFY_RIGHT ] SetFormat // n occurrences literals FillObox // display the collection CXI_TEX_LITERL objects obtained above SELECT: GetObject SendMsg(SHOW_USAGE) ] } Window(... , "Usage of Text Literal") [ SHOW_USAGE: FillWindow ] { ... ObjectListView(CXI_TEXT_LITERAL::usage, ENTIRE, AUTO_POSITION, 1, 1, 1, 1) [ INITIALIZE: [ "CXI_LITERAL_USAGE::Module().Name()" ] SetFormat // name of module [ "CXI_LITERAL_USAGE::Module().FileName()" ] SetFormat // name of source file "CXI_LITERAL_USAGE::Symbol()" SetFormat // symbol [ "CXI_LITERAL_USAGE::UserDescription()" COLOR BLUE ] SetFormat // location of use ] }
Editieren
Window( ... , "Text Literals ...") { ... ObjectListView(literals, AUTO_POSITION, ITEM(, 13), 1, 1, 1, 1) [ INITIALIZE: [ "CXI_TEXT_LITERAL::Language(0)" COLOR BLUE ] SetFormat [ "CXI_TEXT_LITERAL::Language(1)" COLOR RED 0, 6, COLUMN 0 ] SetFormat [ "CXI_TEXT_LITERAL::UseCount()" JUSTIFY_RIGHT ] SetFormat SELECT: GetObject SendMsg(SHOW_USAGE) DOUBLE_CLICK: GetObject SendMsg(EDIT_LITERAL) // edit new multilingual text ] } Window(... , "Edit Literal ...") [ Var(literal) INITIALIZE: 3 [ "Arial" RUSSIAN_CHARSET 12 ] MSFonts EDIT_LITERAL: -> literal, literal FillWindow ] { Prompt(CXI_TEXT_LITERAL::Language(0), LIGHTRED, NO_DRAIN, 20, 10, 900, "") // original text String(CXI_TEXT_LITERAL::alternateString[0], 20, 25, 100) // new text (German) String(CXI_TEXT_LITERAL::alternateString[1], 20, 40, 100) // new text (English) String(CXI_TEXT_LITERAL::alternateString[2], 20, 55, 100) // new text (French) String(CXI_TEXT_LITERAL::alternateString[3], FONT(3), 20, 70, 100) // new text (Russian) Button(33, 50, 100, 8, "save") [ SELECT: literal DrainWindow, literal Call(UpdateString) ] }
zum Original-Window / zur Statement-Definition
Window(... , "Usage of Text Literal") [ SHOW_USAGE: FillWindow ] { ... ObjectListView(CXI_TEXT_LITERAL::usage, ENTIRE, AUTO_POSITION, 1, 1, 1, 1) [ Var(user) INITIALIZE: [ "CXI_LITERAL_USAGE::Module().Name()" ] SetFormat [ "CXI_LITERAL_USAGE::Module().FileName()" ] SetFormat "CXI_LITERAL_USAGE::Symbol()" SetFormat [ "CXI_LITERAL_USAGE::UserDescription()" COLOR BLUE ] SetFormat DOUBLE_CLICK: GetObject Call(GetUser) -> user // get user of this literal user if { user Type case CXI_WINDOW_OBJECT: user OpenWindow(STACK) // show the window default: GetObject Call(Module) user Call(EditStmt) // show source endCase } ] }