Category : Windows 3.X Files
Archive   : ACTTIMS.ZIP
Filename : TIMSWIND.CLS
inherit(Window, #TimsWindow, #(TimsMenu
database
timsApp), 2, nil)!!
now(class(TimsWindow))!!
/* Create and return a new Window. par is the parent
window. menuName is the ASCII string specifying the
name of a menu resource. If menuName is nil, there
is no menu. wName is a string containing the
caption for the Window. rect determines where and
how big the Window will be. If rect is nil, the
default is used. id is a control ID. id is only
used if menuName is nil. Both menuName and id may
be nil. style is a numeric value that is a
combination of Windows style values. If style is
nil, the default style is used. */
Def newStyle(self, par, menuName, wName, rect, id, style | theWnd)
{ theWnd := new(self:Behavior);
if menuName
then loadMenu(theWnd, menuName);
else setHMenu(theWnd, setContID(theWnd, id));
endif;
setPaintStruct(theWnd, new(Struct, 32));
create(theWnd, par, wName cor "", rect cor sizeRect(self),
style cor style(self));
setLocRect(theWnd);
^theWnd;
}!!
Def new(self, db, app | title, tmp)
{
title := "Technical Information Management Systems (TIMS)";
^init(newMain(self:ancestor, nil, title, &(0, 0, 700, 300)), db, app);
}
!!
now(TimsWindow)!!
Def loan(self, item | dlg)
{
dlg := new(LoanDlg);
runModal(dlg, IDD_BORROWINGS, self);
}
!!
Def shouldClose(self)
{
close(timsApp);
}
!!
Def getDB(self)
{
^database;
}
!!
Def return(self, item | dlg)
{
dlg := new(ReturnDlg);
runModal(dlg, IDD_RETURNBOOK, self);
}
!!
Def borrow(self, item | dlg)
{
dlg := new(BorrowDlg);
runModal(dlg, IDD_BORROWBOOK, self);
}
!!
Def delete(self, item | dlg)
{
dlg := new(DeleteDlg);
runModal(dlg, IDD_DELETEINFO, self);
}
!!
Def insert(self, item | dlg, temp)
{
dlg := new(InsertDlg);
runModal(dlg, IDD_INSERTINFO, self);
}
!!
Def author(self, item | dlg)
{
dlg := new(AuthorDlg);
^runModal(dlg, IDD_AUTHORS, self);
}
!!
Def keyword(self, item | dlg, tmp)
{
dlg := new(KeyWordDlg);
^runModal(dlg, IDD_KEYWORDS, self);
}
!!
Def command(self, item, lP | msg)
{
if msg := action(TimsMenu, item) then
^perform(self, item, msg);
endif;
}
!!
Def addLoanPopup(self | popup)
{
popup := newPopup(MenuItem, "&Loan");
addItem(popup, new(MenuItem, "&Borrow Book..."+asString(Tab)+"Ctrl+B", IDM_LOAN_BORROWBOOK, #borrow));
addItem(popup, new(MenuItem, "&Return Book..."+asString(Tab)+"Ctrl+R", IDM_LOAN_RETURNBOOK, #return));
addItem(popup, new(MenuItem, MF_SEPARATOR, 0, 0));
addItem(popup, new(MenuItem, "Borrowing&s..."+asString(Tab)+"Ctrl+S", IDM_LOAN_BORROWINGS, #loan));
^popup;
}
!!
Def addEditPopup(self | popup)
{
popup := newPopup(MenuItem, "&Edit");
addItem(popup, new(MenuItem, "&Insert Info..."+asString(Tab)+"Ctrl+I", IDM_EDIT_INSERTINFO, #insert));
addItem(popup, new(MenuItem, "&Delete Info..."+asString(Tab)+"Ctrl+D", IDM_EDIT_DELETEINFO, #delete));
^popup;
}
!!
Def addViewPopup(self | popup)
{
popup := newPopup(MenuItem, "&View");
addItem(popup, new(MenuItem, "Items by &Keyword..."+asString(Tab)+"Ctrl+K", IDM_VIEW_ITEMSBYKEYWORD, #keyword));
addItem(popup, new(MenuItem, "Items by &Author..."+asString(Tab)+"Ctrl+A", IDM_VIEW_ITEMSBYAUTHOR, #author));
^popup;
}
!!
Def init(self, db, app)
{
database := db;
timsApp := app;
TimsMenu := create(new(Menu), self);
addItem(TimsMenu, addViewPopup(self));
addItem(TimsMenu, addEditPopup(self));
addItem(TimsMenu, addLoanPopup(self));
drawMenu(self);
show(self,1);
}
!!
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/