Category : Windows 3.X Files
Archive   : ACTTIMS.ZIP
Filename : VIEWINFO.CLS
inherit(TimsDialog, #ViewInfoDlg, #(infoRec
info
searchType
data), 2, nil)!!
now(class(ViewInfoDlg))!!
Def new(self, searchType, value)
{
^init(new(self:Behavior), searchType, value);
}!!
now(ViewInfoDlg)!!
Def init(self, sType, value)
{
searchType := sType;
data := value;
}
!!
Def prevInfo(self)
{
prev(info);
if searchType = #keyword then
getOwnerOfSet(info, infoRec, INFO_TO_KEY);
else
if searchType = #author then
copy(infoRec, info);
read(infoRec);
else
errorIfNil(nil, #NotAValidSearchType);
endif;
endif;
if prev(info) <> 0 then
disableItem(self, IDI_PREVIOUS);
first(info);
else
next(info);
endif;
enableItem(self, IDI_NEXT);
view(self);
}
!!
Def nextInfo(self)
{
next(info);
if searchType = #keyword then
getOwnerOfSet(info, infoRec, INFO_TO_KEY);
else
if searchType = #author then
copy(infoRec, info);
read(infoRec);
else
errorIfNil(nil, #NotAValidSearchType);
endif;
endif;
if next(info) <> 0 then
disableItem(self, IDI_NEXT);
last(info);
else
prev(info);
endif;
enableItem(self, IDI_PREVIOUS);
view(self);
}
!!
Def view(self | stat, tmp1, tmp2)
{
clearLBText(self, IDI_LIST);
clearLBText(self, IDI_ABSTRACT);
setItemText(self, IDI_TITLE, getInfoTitle(infoRec));
setItemText(self, IDI_PUBLISHER, getPublisher(infoRec));
setItemText(self, IDI_PUBLISHED, getPubDate(infoRec));
setItemText(self, IDI_IDCODE, getIdCode(infoRec));
tmp1 := new(AuthorObj, database);
getOwner(infoRec, tmp1);
setItemText(self, IDI_AUTHOR, getName(tmp1));
tmp1 := new(IntersectObj, infoRec, database);
tmp2 := new(KeyWordObj, database);
setOwner(tmp1, infoRec);
stat := first(tmp1);
loop
while stat = S_OKAY begin
getOwnerOfSet(tmp1, tmp2, KEY_TO_INFO);
addLBText(self, IDI_LIST, getWord(tmp2));
stat := next(tmp1);
endLoop;
tmp1 := new(TextObj, database);
setOwner(tmp1, infoRec);
stat := first(tmp1);
loop
while stat = S_OKAY begin
tmp2 := getLine(tmp1);
if limit(tmp2) > 40 then
stat := findBreak(tmp2, 41);
insertLBText(self, IDI_ABSTRACT, subString(tmp2, 0, stat), -1);
tmp2 := leftJustify(delete(tmp2, 0, stat));
endif;
insertLBText(self, IDI_ABSTRACT, tmp2, -1);
stat := next(tmp1);
endLoop;
}!!
/* By returning a 1 from the INITDIALOG message, we
are telling MS-Windows to set the input focus to
first tabstop item. (See MS-Windows Reference). */
Def initDialog(self, wP, lP | tmp, stat, counter)
{
database := getDB(parent);
infoRec := new(InfoObj, database);
if searchType = #keyword then
tmp := new(KeyWordObj, database);
info := new(IntersectObj, tmp, database);
find(tmp, data);
setOwner(info, tmp);
first(info);
getOwnerOfSet(info, infoRec, INFO_TO_KEY);
else
if searchType = #author then
tmp := new(AuthorObj, database);
stat := first(tmp);
loop
while not(data = removeNulls(getName(tmp))) and stat = S_OKAY begin
stat = next(tmp);
endLoop;
info := new(InfoObj, database);
setOwner(info, tmp);
first(info);
copy(infoRec, info);
read(infoRec);
else
errorIfNil(nil, #NotAValidSearchType);
endif;
endif;
if next(info) <> 0 then
disableItem(self, IDI_NEXT);
endif;
prev(info);
disableItem(self, IDI_PREVIOUS);
view(self);
^1;
}!!
Def command(self, wp, lp)
{ select
case wp == IDI_OK
is ^end(self, IDI_OK);
endCase
case wp == IDI_PREVIOUS
is prevInfo(self);
endCase
case wp == IDI_NEXT
is nextInfo(self);
endCase
endSelect;
^0;
}!!
Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!
This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.
But one thing that puzzles me is the “mtswslnkmcjklsdlsbdmMICROSOFT” string. There is an article about it here. It is definitely worth a read: http://www.os2museum.com/wp/mtswslnk/