Category : Windows 3.X Files
Archive   : ACTTIMS.ZIP
Filename : LOANDLG.CLS

 
Output of file : LOANDLG.CLS contained in archive : ACTTIMS.ZIP
/* class comment */!!

inherit(TimsDialog, #LoanDlg, #(numMembers
currScrollPos
maxScrollPos
borrower), 2, nil)!!

now(class(LoanDlg))!!

now(LoanDlg)!!

/* MS-Windows command message is translated to an Actor-style message
for all window objects. */
Def WM_VSCROLL(self, wP, lP)
{ ^vScroll(self, wP, lP);
}!!

/* comment */
Def vScroll(self, wp, lp | newScrollPos, diff, info)
{
newScrollPos := currScrollPos;
select
case wp = SB_LINEUP
is newScrollPos := currScrollPos - 1;
endCase
case wp = SB_LINEDOWN
is newScrollPos := currScrollPos + 1;
endCase
case wp = SB_PAGEUP
is newScrollPos := currScrollPos - 4;
endCase
case wp = SB_PAGEDOWN
is newScrollPos := currScrollPos + 4;
endCase
case wp = SB_TOP
is newScrollPos := 0;
endCase
case wp = SB_BOTTOM
is newScrollPos := maxScrollPos;
endCase
case wp = SB_THUMBPOSITION
is newScrollPos := low(lp);
endCase
endSelect;
newScrollPos := max(min(newScrollPos, maxScrollPos), 0);
if newScrollPos = currScrollPos then
^0;
else
diff := newScrollPos - currScrollPos;
currScrollPos := newScrollPos;
endif;
Call SetScrollPos(itemHandle(self, IDI_SCROLL), SB_CTL, currScrollPos, 1);
if diff > 0 then
loop
while diff > 0 begin
nextMember(borrower, LOAN_HISTORY);
diff := diff - 1;
endLoop;
else
loop
while diff < 0 begin
prevMember(borrower, LOAN_HISTORY);
diff := diff + 1;
endLoop;
endif;
if getDateReturned(borrower) = 0L then
info := new(InfoObj, database);
getOwner(borrower, info);
setItemText(self, IDI_BORROWER, getFriend(borrower));
setItemText(self, IDI_BORROWED, asString(getDateBorrowed(borrower)));
setItemText(self, IDI_TITLE, getInfoTitle(info));
else
setItemText(self, IDI_BORROWER, "");
setItemText(self, IDI_BORROWED, "");
setItemText(self, IDI_TITLE, "");
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 | sys, stat, info, test)
{
database := getDB(parent);
borrower := new(BorrowObj, database);
sys := new(SysObj, database);
currScrollPos := 0;
maxScrollPos := memCount(sys, LOAN_HISTORY) - 1;
Call SetScrollRange(itemHandle(self, IDI_SCROLL), SB_CTL, 0, maxScrollPos, 1);
Call SetScrollPos(itemHandle(self, IDI_SCROLL), SB_CTL, 0, 1);
stat := firstMember(borrower, sys, LOAN_HISTORY);
test := FALSE;
loop
while stat = S_OKAY and test = FALSE begin
if getDateReturned(borrower) = 0L then
info := new(InfoObj, database);
getOwner(borrower, info);
setItemText(self, IDI_BORROWER, getFriend(borrower));
setItemText(self, IDI_BORROWED, asString(getDateBorrowed(borrower)));
setItemText(self, IDI_TITLE, getInfoTitle(info));
Call SetScrollPos(itemHandle(self, IDI_SCROLL), SB_CTL, currScrollPos, 1);
test := TRUE;
else
stat := nextMember(borrower, LOAN_HISTORY);
currScrollPos := currScrollPos + 1;
endif;
endLoop;
if test = FALSE then
currScrollPos = 0;
endif;
^1;
}!!

Def command(self, wp, lp)
{ select
case wp == IDI_OK
is end(self, 0);
endCase
endSelect;
^0;
}!!

  3 Responses to “Category : Windows 3.X Files
Archive   : ACTTIMS.ZIP
Filename : LOANDLG.CLS

  1. Very nice! Thank you for this wonderful archive. I wonder why I found it only now. Long live the BBS file archives!

  2. This is so awesome! 😀 I’d be cool if you could download an entire archive of this at once, though.

  3. 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/