home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Media Share 13
/
mediashare_13.zip
/
mediashare_13
/
ZIPPED
/
PROGRAM
/
TBIWIN12.ZIP
/
TBIWIN.H
< prev
next >
Wrap
C/C++ Source or Header
|
1992-12-15
|
4KB
|
122 lines
//----------------------------------------------------
// TBIWINDOW.H
//----------------------------------------------------
// TBIWindow Ver 1.2 (c) Copyright Casper Pedersen 1992
// This source must be used, but not changed is it is
// distributed to other people
// If any questions write to
// Casper Pedersen
// P. Knudsensvej 14, 3, V. 11.
// DK-8900 Randers
// Denmark
//
// NOTE
// The TBIWindow will might not work under Win30, that
// is because I use WM_WINDOWPOSCHANGED, which first
// was implemented in Win31.
//----------------------------------------------------
#ifndef TBIWINDOW_H
#define TBIWINDOW_H
//----------------------------------------------------
#include <owl.h>
//----------------------------------------------------
// Defines
//----------------------------------------------------
typedef enum{LEFT, RIGHT} LEFTRIGHT;
// Version no. HIWORD is the major version, and LOWORD is the minor version
#define TBIVERSION 0x00010002
//----------------------------------------------------
// Simple structure used in a double linked list
//----------------------------------------------------
_CLASSDEF(TBIList)
struct TBIList
{
UINT ButtonNo;
HBITMAP ButtonDeactive;
HBITMAP ButtonActive;
PTBIList next;
PTBIList prev;
};
//----------------------------------------------------
// The actual class
//----------------------------------------------------
_CLASSDEF(TBIWindow)
class _EXPORT TBIWindow : public TWindow
{
private:
PTBIList head;
PTBIList tail;
UINT NoButtonsIn; // How many buttons is in window
int ActivatedButton;
LPSTR WinName; // Caption name
BOOL ButtonDown; // is button down
POINT AKTBut; // where the button is pushed
RECT AKTRect;
UINT XEnd; // where to end the list
UINT XStart; // where to start the list
BOOL WinActive;
BOOL WinHidden;
LEFTRIGHT _LR; // Is Buttons Left or Rigth in Caption
BOOL IsInList(UINT ResId);
protected:
void UpdateCaption(void); // updates the caption
UINT ButtonActive; // whitch button is activated
void DisplayButton(void); // dispaly the list
void HighLiteButton(void); // highligthes activated/deativated button
BOOL CalcRect(POINT pt);
UINT CloseSize(void); // Size of SystemMenu
UINT ButtonSize(void); // Size of Minimize and Maximize buttons
virtual LONG TBIGetVersion() { return TBIVERSION; }
virtual LPSTR GetClassName() { return ("TBIWindow"); }
virtual void AboutTBIWindow(void);
public:
// constructor and destructor
TBIWindow(PTWindowsObject AParent, LPSTR ATitle, LEFTRIGHT LR = LEFT, PTModule AModule = NULL);
~TBIWindow();
virtual void GetWindowClass(WNDCLASS _FAR &AWndClass);
// overloaded functions
virtual void WMNCLButtonDBLCLK(RTMessage Msg) = [WM_FIRST + WM_NCLBUTTONDBLCLK];
virtual void WMNCLButtonDown(RTMessage Msg) = [WM_FIRST + WM_NCLBUTTONDOWN];
virtual void WMNCLButtonUp(RTMessage Msg) = [WM_FIRST + WM_NCLBUTTONUP];
virtual void WMLButtonUp(RTMessage Msg) = [WM_FIRST + WM_LBUTTONUP];
virtual void WMNCMouseMove(RTMessage Msg) = [WM_FIRST + WM_NCMOUSEMOVE];
virtual void WMMouseMove(RTMessage Msg) = [WM_FIRST + WM_MOUSEMOVE];
virtual void WMActivate(RTMessage Msg) = [WM_FIRST + WM_ACTIVATE];
virtual void WMMove(RTMessage Msg) = [WM_FIRST + WM_MOVE] { TWindow::WMMove(Msg); UpdateCaption(); }
virtual void WMSize(RTMessage Msg) = [WM_FIRST + WM_SIZE];
virtual void WMWindowPosChanged(RTMessage) = [WM_FIRST + WM_WINDOWPOSCHANGED];
// insertes a button last in list
virtual BOOL AddButton(UINT ResourceID);
// dummy function to use in parent
virtual void ButtonActivated(void);
};
//----------------------------------------------------
#endif
//----------------------------------------------------