home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Windoware
/
WINDOWARE_1_6.iso
/
miscprog
/
actormdi
/
mdifilew.cls
< prev
next >
Wrap
Text File
|
1990-12-06
|
4KB
|
95 lines
/* MDIFILEW.CLS - This class is a descendant of the
FileWindow class that can be used in an MDI
application. */!!
inherit(FileWindow, #MDIFileWindow, nil, 2, nil)!!
now(class(MDIFileWindow))!!
/* Return the default window style. */
Def style(self)
{ ^WS_OVERLAPPEDWINDOW bitOr WS_VSCROLL bitOr WS_HSCROLL;
}!!
now(MDIFileWindow)!!
/* This message is received whenever the focus changes to a new MDI child
window. The MDI client window is notified that that this window is
either being activated or deactivated.
NOTE: This message must be passed on to the default child procedure */
Def WM_MDIACTIVATE(self, wP, lP)
{ if wP == 0
then deactivateMDIChild(parent, self);
else activateMDIChild(parent, self);
endif;
}!!
/* Default for dialogs is to do nothing. Return 0
to let Windows do normal processing.
WARNING: Do not remove this method! May be redefined
in descendants if they register a private window
class with Windows for their dialogs. */
Def defWndProc(self, msgNum, wP, lP)
{ ^Call DefMDIChildProc(getHWnd(self), msgNum, wP, lP);
}!!
/* Destroy the MDI Child window by passing the WM_MDIDESTROY message
to the MDI Client window. */
Def destroy(self)
{ Call SendMessage(getHWnd(parent), messageID(#WM_MDIDESTROY),
getHWnd(self), 0L);
}!!
/* This message will be received whenever the window has been resized.
NOTE: This message must be passed on to the default child procedure */
Def WM_SIZE(self, wP, lP)
{ WM_SIZE(self:ancestor, wP, lP);
execWindowProc(self, #WM_SIZE, wP, lP);
}!!
/* Set up this windows default procedure so that it will execute the
DefMDIChildProc if the message is not handled by the Actor system.
For MDI child windows in Actor, WM_DESTROY and WM_NCDESTROY messages
are passed to the correct Def Proc this way, WM_SIZE and WM_COMMAND
are handled differently */
Def execWindowProc(self, windMsg, wP, lP)
{ ^Call DefMDIChildProc(getHWnd(self), messageID(windMsg), wP, lP);
}!!
/* Create an MDI child window according to certain specifications. par is
the parent of this child. It should be set to the Frame window
that controls the MDI application. wName is the text that will appear
in the caption bar. rect is a rectangle representing the are in which
the window should be displayed. style defines what attributes the
window should have. It should be noted that, once the WM_MDICREATE
message is sent to the MDIClient, a window will be created AND shown. */
Def create(self, par, wName, rect, style | wndCls, childStruct, childRect)
{ parent := par;
wndCls := wndClass(class(self));
if Call GetClassInfo(HInstance, asciiz(wndCls), new(Struct, 26)) = 0
then register(class(self));
endif;
caption := wName;
wStyle := style;
setCurWindow(System, self);
childStruct := new(Struct, 26);
putLong(childStruct, asciiz(wndCls), 0);
putLong(childStruct, asciiz(caption), 4);
putWord(childStruct, HInstance, 8);
childRect := rect cor
rect(CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT, CW_USEDEFAULT);
putWord(childStruct, left(childRect), 10);
putWord(childStruct, top(childRect), 12);
putWord(childStruct, width(childRect), 14);
putWord(childStruct, height(childRect), 16);
putLong(childStruct, style, 18);
putLong(childStruct, 0L, 22);
hWnd := Call SendMessage(getHWnd(parent),
messageID(#WM_MDICREATE), 0, childStruct);
if hWnd = 0
then alert(System, self, #windCreateError);
endif;
add(Windows, self);
setFileDlg(self, new(FileDialog, "*.*"));
}!!