Category : Windows 3.X Files
Archive   : ACTTIMS.ZIP
Filename : BORROWDL.CLS
inherit(TimsDialog, #BorrowDlg, #(info), 2, nil)!!
now(class(BorrowDlg))!!
now(BorrowDlg)!!
Def loanBook(self | LBStr, borrower, sys)
{
LBStr := new(String, 32);
LBStr := getLBText(self, IDI_LIST);
borrower := new(BorrowObj, database);
sys := new(SysObj, database);
if findKey(info, ID_CODE, LBStr) = S_OKAY then
setFriend(borrower, getItemText(self, IDI_BORROWER));
setDateBorrowed(borrower, asLong(asInt(getItemText(self, IDI_BORROWED), 10)));
setDateReturned(borrower, 0L);
newObj(borrower);
connect(borrower, info);
connectTo(borrower, sys, LOAN_HISTORY);
endif;
^end(self, 0);
}
!!
Def view(self | LBStr, author)
{
LBStr := new(String, 16);
LBStr := getLBText(self, IDI_LIST);
if size(LBStr) > 0 then
author := new(AuthorObj, database);
if findKey(info, ID_CODE, LBStr) = S_OKAY then
getOwner(info, author);
setItemText(self, IDI_AUTHOR, getName(author));
setItemText(self, IDI_TITLE, getInfoTitle(info));
if limit(getItemText(self, IDI_BORROWER)) > 0 and
limit(getItemText(self, IDI_BORROWED)) > 0 then
enableItem(self, IDI_OK);
else
disableItem(self, IDI_OK);
endif;
else
errorBox("Selected item is not on file.", "TIMS");
endif;
else
setItemText(self, IDI_AUTHOR, "");
setItemText(self, IDI_TITLE, "");
disableItem(self, IDI_OK);
endif;
}
!!
Def modifyBorrower(self)
{
if limit(getItemText(self, IDI_BORROWER)) > 0 and
limit(getItemText(self, IDI_BORROWED)) > 0 and
limit(getLBText(self, IDI_LIST)) > 0 then
enableItem(self, IDI_OK);
else
disableItem(self, IDI_OK);
endif;
}
!!
/* 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 | stat)
{
database := getDB(parent);
info := new(InfoObj, database);
stat := firstKey(info, ID_CODE);
loop
while stat = S_OKAY begin
addLBText(self, IDI_LIST, getIdCode(info));
stat := nextKey(info, ID_CODE);
endLoop;
disableItem(self, IDI_OK);
^1;
}!!
Def command(self, wp, lp)
{ select
case wp == IDI_CANCEL
is ^end(self, 0);
endCase
case wp == IDI_OK
is loanBook(self);
endCase
case wp == IDI_LIST
is view(self);
endCase
case wp == IDI_BORROWED and high(lp) = EN_CHANGE
is modifyBorrower(self);
endCase
case wp == IDI_BORROWER and high(lp) = EN_CHANGE
is modifyBorrower(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/