home *** CD-ROM | disk | FTP | other *** search
- /************************************************************************
-
- Software: LCKOWL.DLL
-
- Version: 1.5
- Copyright by Larry Klein, LCK Consulting, December 15, 1992
-
- Developed By: Larry Klein
- LCK Consulting
- 732 Symphony Woods Drive
- Silver Spring, MD 20901
- Phone - 301-593-2745
- Fax - 301-593-4262
- Compuserve - 76330,2525
-
- Purpose: BC++ OWL-derived MDI Frame class that automatically manages
- a status bar, tool bar and toolbox.
- BC++ OWL-derived Window classes that add administrative
- features lacking in OWL.
-
- Requirements: Borland C++ Compiler 3.0 or higher
- LCKUtil.DLL for error message handling
-
- Requirements Drover's Toolbox by Farpoint
- For Extending FarPoint Technologies
- LCKOWL.DLL: P.O. Box 309
- 75 Walnut Street
- Richmond, Ohio 43944-0309
- Phone: 614-765-4333
- Fax: 614-765-4939
-
- DataTable by ProtoView Development Corp
- ProtoView Development Corp
- 353 Georges Road
- Dayton, NJ 08810
- Phone: 908-329-8588
- Fax: 908-329-8624
-
- NOTE: This product was developed by LCK
- Consulting as shareware for general use.
- This software and associated
- documentation are provided "as-is" and
- without any express or implied
- warranties whatsoever. The user is
- advised to test the program thoroughly
- before relying on it. The user assumes
- the entire risk of using the program.
-
- Shareware: If this program is utilized to your
- satisfaction, a $20 shareware fee can be
- sent to the LCK Consulting. This fee
- will go towards upgrading the product.
- Your name and address will be placed on
- a mailing list for further upgrades.
- Where possible, include any bulletin
- board address to which notifications can
- be sent.
-
- ************************************************************************/
-
- #include "string.h"
- #include "owl.h"
- #include "mdi.h"
- #include "dtctl.h"
- #include "lckowl2.h"
-
- #ifndef __LCKOWL_H__
- #define __LCKOWL_H__
-
- #define TOOLBAR_WIDTH 32
- #define TOOLBAR_HEIGHT 32
-
- #define LCK_MAXLEN_TITLE 32
- #define LCK_MAXLEN_CLASSNAME 40
- #define LCK_MAXLEN_DIALOGNAME 40
- #define LCK_MAXLEN_MENUNAME 40
-
- _CLASSDEF(TLCKStatusBar)
- _CLASSDEF(TLCKToolBar)
- _CLASSDEF(TLCKToolBox)
- _CLASSDEF(TMDIChildDialog)
- _CLASSDEF(TMDIChildWindow)
- _CLASSDEF(TMDIFrameTools)
- _CLASSDEF(TWindowTools)
-
- class _EXPORT TWindowTools : public TWindow
- {
- protected:
- PTLCKStatusBar StatusBar;
- PTLCKToolBar ToolBar;
- PTLCKToolBox ToolBox;
- char szClassName[LCK_MAXLEN_CLASSNAME + 1];
- char szMDIMenu[LCK_MAXLEN_MENUNAME + 1], szOldMDIMenu[LCK_MAXLEN_MENUNAME + 1];
- int MDIChildMenuPos, OldMDIChildMenuPos;
- BOOL bMDIMenu;
-
- public:
- BOOL bResize;
- WORD wWindowType;
-
- TWindowTools(PTWindowsObject AParent, LPSTR ATitle, WORD AWindowType = NULL);
- ~TWindowTools();
- virtual void CMCreateStatusBar(RTMessage Msg) = [CM_FIRST + IDM_CREATESTATUSBAR];
- virtual void CMCreateToolBar(RTMessage Msg) = [CM_FIRST + IDM_CREATETOOLBAR];
- virtual void CMCreateToolBox(RTMessage Msg) = [CM_FIRST + IDM_CREATETOOLBOX];
- virtual void CMDestroyStatusBar(RTMessage Msg) = [CM_FIRST + IDM_DESTROYSTATUSBAR];
- virtual void CMDestroyToolBar(RTMessage Msg) = [CM_FIRST + IDM_DESTROYTOOLBAR];
- virtual void CMDestroyToolBox(RTMessage Msg) = [CM_FIRST + IDM_DESTROYTOOLBOX];
- virtual void CMToggleStatusBar(RTMessage Msg) = [CM_FIRST + IDM_TOGGLESTATUSBAR];
- virtual void CMToggleToolBar(RTMessage Msg) = [CM_FIRST + IDM_TOGGLETOOLBAR];
- virtual void CMToggleToolBox(RTMessage Msg) = [CM_FIRST + IDM_TOGGLETOOLBOX];
- virtual LPSTR GetClassName();
- virtual void GetWindowClass(WNDCLASS _FAR & AWndClass);
- void CALLBACK InitStatusBar(LPSTATUSBARITEM AStatusBar, int AItems, int AHeight = NULL,
- DWORD AStyle = WS_CHILD | WS_VISIBLE | SBRS_DRAWTOPLINE | SBRS_PIXELS);
- void CALLBACK InitToolBar(LPTOOLBOXITEM AToolBar, int AItems, int AHeight = TOOLBAR_HEIGHT, int AWidth = TOOLBAR_WIDTH,
- DWORD AStyle = WS_CHILD | WS_CLIPSIBLINGS | WS_VISIBLE | WS_BORDER | TBXS_NOSTATE);
- void CALLBACK InitToolBox(LPTOOLBOXITEM AToolBox, int AItems, LPSTR ATitle = NULL, int AColumns = TBX_RESIZE,
- int ARows = 1, int AHeight = TOOLBAR_HEIGHT, int AWidth = TOOLBAR_WIDTH,
- DWORD AStyle = WS_CLIPSIBLINGS | WS_VISIBLE | WS_BORDER | WS_CAPTION | TBXS_SINGLESEL);
- BOOL IsWindowType(PTWindowsObject Child, Pvoid Param);
- virtual void Resize();
- void SetMDIMenu(LPSTR AMenuName, int AChildMenuPos = 0);
- void SetOldMDIMenu(LPSTR AMenuName, int AChildMenuPos = 0);
- virtual void SetupWindow();
- virtual void WMCommand(RTMessage Msg) = [WM_FIRST + WM_COMMAND];
- virtual void WMMDIActivate(RTMessage Msg) = [WM_FIRST + WM_MDIACTIVATE];
- virtual void WMNCCreate(RTMessage Msg) = [WM_FIRST + WM_NCCREATE];
- virtual void WMNCLButtonDown(RTMessage Msg) = [WM_FIRST + WM_NCLBUTTONDOWN];
- virtual void WMSize(RTMessage Msg) = [WM_FIRST + WM_SIZE];
- };
-
- class _EXPORT TMDIChildDialog : public TDialog
- {
- public:
- TMDIChildDialog(PTWindowsObject AParent, LPSTR ATitle)
- : TDialog(AParent, ATitle) {};
- virtual void Cancel(RTMessage Msg) = [ID_FIRST + IDCANCEL]
- { Parent->CloseWindow(); };
- virtual void Ok(RTMessage Msg) = [ID_FIRST + IDOK]
- { TDialog::Ok(Msg); Parent->CloseWindow(); };
- virtual void WMSetFocus(RTMessage Msg) = [WM_FIRST + WM_SETFOCUS]
- { GetApplication()->SetKBHandler( this ); DefWndProc( Msg ); };
- };
-
- class _EXPORT TMDIChildWindow : public TWindowTools
- {
- protected:
- PTDialog ChildDialog;
- char szDialogName[LCK_MAXLEN_DIALOGNAME + 1];
-
- public:
- TMDIChildWindow(PTWindowsObject AParent, LPSTR ATitle, LPSTR ADialogName, WORD AWindowType = NULL);
- virtual PTDialog CreateChildDialog();
- PTDialog GetChildDialog() { return ChildDialog; };
- virtual void Resize();
- virtual void SetupWindow();
- virtual void WMMDIActivate(RTMessage Msg) = [WM_FIRST + WM_MDIACTIVATE];
- virtual void WMSize(RTMessage Msg) = [WM_FIRST + WM_SIZE];
- };
-
- class _EXPORT TMDIFrameTools : public TMDIFrame
- {
- protected:
- int nWindowTypeCount;
- PTLCKStatusBar StatusBar;
- PTLCKToolBar ToolBar;
- PTLCKToolBox ToolBox;
-
- public:
- TMDIFrameTools(LPSTR ATitle, LPSTR MenuName);
- ~TMDIFrameTools();
- void CloseChildWindows(WORD AWindowType);
- void CloseChildWindow(PTWindowsObject Child, Pvoid Param);
- virtual void CMCreateStatusBar(RTMessage Msg) = [CM_FIRST + IDM_CREATESTATUSBAR];
- virtual void CMCreateToolBar(RTMessage Msg) = [CM_FIRST + IDM_CREATETOOLBAR];
- virtual void CMCreateToolBox(RTMessage Msg) = [CM_FIRST + IDM_CREATETOOLBOX];
- virtual void CMDestroyStatusBar(RTMessage Msg) = [CM_FIRST + IDM_DESTROYSTATUSBAR];
- virtual void CMDestroyToolBar(RTMessage Msg) = [CM_FIRST + IDM_DESTROYTOOLBAR];
- virtual void CMDestroyToolBox(RTMessage Msg) = [CM_FIRST + IDM_DESTROYTOOLBOX];
- virtual void CMToggleStatusBar(RTMessage Msg) = [CM_FIRST + IDM_TOGGLESTATUSBAR];
- virtual void CMToggleToolBar(RTMessage Msg) = [CM_FIRST + IDM_TOGGLETOOLBAR];
- virtual void CMToggleToolBox(RTMessage Msg) = [CM_FIRST + IDM_TOGGLETOOLBOX];
- PTWindowsObject GetFirstChildWindow(WORD AWindowType);
- int GetWindowTypeCount(WORD AWindowType);
- void IncWindowTypeCount(PTWindowsObject Child, Pvoid Param);
- void CALLBACK InitStatusBar(LPSTATUSBARITEM AStatusBar, int AItems, int AHeight = NULL,
- DWORD AStyle = WS_CHILD | WS_VISIBLE | SBRS_DRAWTOPLINE | SBRS_PIXELS);
- void CALLBACK InitToolBar(LPTOOLBOXITEM AToolBar, int AItems, int AHeight = TOOLBAR_HEIGHT, int AWidth = TOOLBAR_WIDTH,
- DWORD AStyle = WS_CHILD | WS_CLIPSIBLINGS | WS_VISIBLE | WS_BORDER | TBXS_NOSTATE);
- void CALLBACK InitToolBox(LPTOOLBOXITEM AToolBox, int AItems, LPSTR ATitle = NULL, int AColumns = TBX_RESIZE,
- int ARows = 1, int AHeight = TOOLBAR_HEIGHT, int AWidth = TOOLBAR_WIDTH,
- DWORD AStyle = WS_CLIPSIBLINGS | WS_VISIBLE | WS_BORDER | WS_CAPTION | TBXS_SINGLESEL);
- BOOL IsWindowType(PTWindowsObject Child, Pvoid Param);
- void Resize();
- virtual void WMCommand(RTMessage Msg) = [WM_FIRST + WM_COMMAND];
- virtual void WMSize(RTMessage Msg) = [WM_FIRST + WM_SIZE];
- };
-
- class _EXPORT TLCKStatusBar
- {
- protected:
- int nItems;
- DWORD Style;
- LPSTATUSBARITEM StatusBar;
-
- public:
- HWND HWindow;
- int nHeight;
-
- TLCKStatusBar(LPSTATUSBARITEM AStatusBar, int AItems, int AHeight = NULL,
- DWORD AStyle = WS_CHILD | WS_VISIBLE | SBRS_DRAWTOPLINE | SBRS_PIXELS);
- ~TLCKStatusBar();
- HWND CALLBACK Create(HWND AWindow);
- void CALLBACK Destroy();
- BOOL CALLBACK Exists() { return HWindow == NULL ? FALSE : TRUE; };
- void CALLBACK SetItemText(WORD AItem, LPSTR AText);
- void CALLBACK SetProgressPos(WORD AItem, WORD APos);
- void CALLBACK SetProgressRange(WORD AItem, WORD AMinimum, WORD AMaximum);
- };
-
- class _EXPORT TLCKToolBar
- {
- protected:
- int nItems;
- DWORD Style;
- LPTOOLBOXITEM ToolBar;
- short x, y, dColCount, dRowCount, dBorderSize;
-
- public:
- HWND HWindow;
- int nHeight;
- int nWidth;
-
- TLCKToolBar(LPTOOLBOXITEM AToolBar, int AItems, int AHeight = TOOLBAR_HEIGHT, int AWidth = TOOLBAR_WIDTH,
- DWORD AStyle = WS_CHILD | WS_CLIPSIBLINGS | WS_VISIBLE | WS_BORDER | TBXS_NOSTATE);
- ~TLCKToolBar();
- HWND CALLBACK Create(HINSTANCE AInst, HWND AWindow);
- void CALLBACK Destroy();
- BOOL CALLBACK Exists() { return HWindow == NULL ? FALSE : TRUE; };
- };
-
- class _EXPORT TLCKToolBox
- {
- protected:
- char Title[LCK_MAXLEN_TITLE];
- int nItems;
- DWORD Style;
- LPTOOLBOXITEM ToolBox;
- short x, y, dColCount, dRowCount, dBorderSize;
-
- public:
- HWND HWindow;
- int nHeight;
- int nWidth;
-
- TLCKToolBox(LPTOOLBOXITEM AToolBox, int AItems, LPSTR ATitle = NULL, int AColumns = TBX_RESIZE,
- int ARows = 1, int AHeight = TOOLBAR_HEIGHT, int AWidth = TOOLBAR_WIDTH,
- DWORD AStyle = WS_CLIPSIBLINGS | WS_VISIBLE | WS_BORDER | WS_CAPTION | TBXS_SINGLESEL);
- ~TLCKToolBox();
- HWND CALLBACK Create(HINSTANCE AInst, HWND AWindow);
- void CALLBACK Destroy();
- BOOL CALLBACK Exists() { return HWindow == NULL ? FALSE : TRUE; };
- };
-
-
- #define LEN_DATATBL_STRING 40
- typedef struct tagCOLUMNCFG {
- COLUMNCFGSTRUCT ColCfg;
- char szFormat[LEN_DATATBL_STRING * 3];
- } COLUMNCFG, FAR * PCOLUMNCFG;
-
- class _EXPORT TWindowTable : public TWindowTools
- {
- protected:
- WORD wTableStyle;
-
- public:
- PTDataTbl DataTbl;
-
- TWindowTable(PTWindowsObject AParent, LPSTR ATitle, WORD AWindowType, WORD ATableStyle = NULL);
- ~TWindowTable();
- virtual void DoubleClick() {};
- virtual void Resize();
- void SetColumns(int NCols, PCOLUMNCFG TableColumns);
- void SetNotifyToAccess();
- virtual void SetupWindow();
- virtual void StatusChange() {};
- virtual void WMCommand(RTMessage Msg) = [WM_FIRST + WM_COMMAND];
- virtual void WMSize(RTMessage Msg) = [WM_FIRST + WM_SIZE];
- };
-
- #endif // __LCKOWL_H__
-