home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
PC World 2000 February
/
PCWorld_2000-02_cd.bin
/
Software
/
TemaCD
/
tcvpa
/
data1.cab
/
MyFileGroup
/
INCLUDE
/
tcWinApp.hpp
< prev
next >
Wrap
C/C++ Source or Header
|
1999-06-03
|
27KB
|
883 lines
#ifndef _INC_TCWINAPP_HPP
#define _INC_TCWINAPP_HPP
#ifdef BUILD_TCWINAPPLIB
#define TCWINAPPLIB __declspec(dllexport)
#else
#ifdef BUILD_LOCAL
#define TCWINAPPLIB
#else
#define TCWINAPPLIB __declspec(dllimport)
#endif
#endif
#include <String.hpp>
#include <Array.hpp>
#include <WUtils.hpp>
#include <Registry.hpp>
#include <UseGDI.hpp>
#include <EvMaster.hpp>
#include <MENU.hpp>
#include <Splitter.hpp>
#define AWindow TC_CWindow
#define TC_IDC_TOOLBAR 1101
#define TC_IDC_STATUSBAR 1102
#define TC_IDC_AREA 1111
#define TC_IDC_SIMPLE 1100
#define TC_SB_AREA_VERT 1
#define TC_SB_AREA_HORZ 2
// *********************************
#define WS_SPLITTER 1
#define WS_SPLITHORZ 2
#define WS_SPLITFIX2 8
#define WS_SPLITSWAP 32
#define WS_SPLITNOMOUSE 64
// *********************************
/*
int PASCAL WinMain(
HINSTANCE hInst,
HINSTANCE hPrevInst,
LPSTR sCmdLine,
int nCmdShow )
{
tcProg = new Program();
tcApp = new AppWindow();
return tcWinMain(hInst,hPrevInst,sCmdLine,nCmdShow);
}
*/
class TC_CMenuItem;
class TC_CDragDrop;
class TC_CProgram;
class TC_CWindow;
class TC_CToolbarMaster;
class TC_CToolbarButton;
struct TC_DragDrop;
struct TC_Event_WM;
struct TC_Event_CM;
struct TC_Event_NM;
struct TC_Event_WIN;
typedef TC_TArrayPTR <TC_CWindow> TCArrayWindow;
struct _CWS
{
int x,y,cx,cy;
int id;
int level;
int unit_size, unit_pos;
int grow_l, grow_t, grow_r, grow_b;
int zoom;
int typeflags;
DWORD style, xstyle;
COLORREF textcolor, backcolor;
char * text;
char * name;
char * font;
char * wclass;
};
struct _ZCWS
{
HWND hwnd;
HFONT hfont;
int cx_char, cy_char;
};
struct _CWSS
{
_CWS cws;
HWND hwnd_parent;
_ZCWS zcws[32];
};
#define ZERO_CWS() memset(&_cws,0,sizeof(_cws));
#define BEGIN_CWS(h) \
_CWSS _cwss;memset(&_cwss,0,sizeof(_cwss));\
_cwss.hwnd_parent=h;\
_CWS &_cws=_cwss.cws;
#define BEGIN_CWS_POPUP BEGIN_CWS(tcHWndMain)
#define BEGIN_CWS_FORM BEGIN_CWS(frame->m_HWnd)
#define _VP_BEGIN_CWS
#define _VP_END_CWS
#define CWSF_TABCONTROL 1
#define CWSF_SPLITTER 2
#define CWSF_SPLIT_HORZ 4
#define CWSF_SPLIT_FIX2 8
#define CWSF_TABITEM 16
#define CWSF_SPLITITEM 32
#define CWSF_SPLITITEMLAST 64
//#define CWSF_TABITEMLAST 128
#define CWSF_AREA 256
#define _D_CREATE_FORM FromCWS( &_cwss );
#define _D_CREATE_WINDOW \
_d_window = new _d_class( _d_args );\
_d_window->FromCWS(&_cwss);
struct TC_WinPosStruct
{
short
x, y, cx, cy, // window size
ccx, ccy, // window client size
mincx, mincy,
maxcx, maxcy;
WORD set; // mask 1-x,y 2-cx,cy 4-ccx,ccy
};
struct TC_WinGrowStruct
{
char
l,
t,
r,
b;
};
struct TC_WinColorStruct
{
COLORREF f;
COLORREF b;
};
struct TC_DragDrop
{
int
act, // action TC_CDragDrop::ddStart, TC_CDragDrop::ddMove .....
x, y, // mouse pos
ret;
};
enum
{
EvT_NONE,
EvT_WM_1, /* id=msg TC_Event_WM WM_.... */
EvT_WM_2, /* id=msg TC_Event_WM WM_.... */
EvT_ALL_CM, /* id=0 TC_Event_CM WM_COMMAND (all notify=HIWORD(wParam) */
EvT_ALL_NM, /* id=0 TC_Event_NM WM_NOTIFY (all NMHDR.code) */
EvT_CM, /* id=notify TC_Event_CM WM_COMMAND */
EvT_NM, /* id=code TC_Event_NM WM_NOTIFY */
EvT_KB_1, /* id=key TC_Event WM_KEYDOWN */
EvT_KB_2, /* id=key TC_Event WM_KEYDOWN */
EvT_CHR_1, /* id=char TC_Event WM_CHAR */
EvT_CHR_2, /* id=char TC_Event WM_CHAR */
EvT_ACCEL, /* id=MAKELONG(vk,mod) TC_Event */
EvT_WIN, /* id=EVWIN_... TC_Event_WIN */
};
enum // event.id
{
EVWIN_NONE,
EVWIN_CREATE, // ---
EVWIN_ACCEL, // TC_Event_WIN::aw[0] === VK_...
// TC_Event_WIN::aw[1] === 1-Shift, 2-Control, 4-Alt
EVWIN_CTLCOLOR, // TC_Event_WIN::msg
EVWIN_DRAWITEM, // TC_Event_WIN::msg
EVWIN_DD, // struct DRAGDROP
};
// WM_....
struct TC_Event_WM
: TC_Event
{
// uMsg = event.id
WPARAM wParam;
LPARAM lParam;
LRESULT lRet;
BOOL done1;
TC_Event_WM() { lRet = 0; done1 = FALSE; }
};
// WM_COMMAND
struct TC_Event_CM
: TC_Event
{
WPARAM wParam;
LPARAM lParam;
LRESULT lRet;
BOOL done1;
TC_CWindow * rec; // WM_NOTIFY receiver
TC_Event_CM() { event.type = EvT_CM; done1 = FALSE; }
};
// WM_NOTIFY
struct TC_Event_NM
: TC_Event
{
WPARAM wParam;
NMHDR * nh;
LRESULT lRet;
BOOL done1;
TC_CWindow * rec; // WM_NOTIFY receiver
TC_Event_NM() { event.type = EvT_NM; done1 = FALSE; }
};
// CTLCOLOR, DRAWITEM, ....
struct TC_Event_WIN
: TC_Event
{
union
{
/* int i;
char c;
long l;
short h;
void *ptr;
POINT point;
SIZE size;
RECT rect;*/
void *ptr;
DWORD dw;
WORD aw[128];
long adw[64];
char sz[256];
TC_DragDrop dd;
struct
{
UINT uMsg;
WPARAM wParam;
LPARAM lParam;
LRESULT lRet;
}
msg;
};
TC_Event_WIN() { event.type = EvT_WIN; }
};
enum
{
WCT_UNKNOWN,
WCT_STATIC,
WCT_EDIT,
WCT_BUTTON,
WCT_LISTBOX,
WCT_COMBOBOX,
WCT_SCROLL,
WCT_TREEVIEW, // 7
WCT_LISTVIEW,
WCT_TABCONTROL,
WCT_TOOLBAR,
WCT_STATUSBAR,
WCT_HEADERCONTROL,
WCT_PROGRESSBAR,
WCT_TRACKBAR,
WCT_UPDOWN, // 15
WCT_TcWindow,
WCT_TcArea,
WCT_TEXT /* = */,
WCT_RECT,
WCT_ICON,
WCT_BITMAP,
WCT_ECOMBO,
WCT_LCOMBO,
WCT_PUSH,
WCT_CHECK,
WCT_RADIO,
WCT_GROUP,
//WCT_SYS_END /* = */
};
#define gszCls_STATIC tc_wclass_ALL[1]
#define gszCls_static tc_wclass_ALL[1]
#define gszCls_Static tc_wclass_ALL[1]
#define gszCls_EDIT tc_wclass_ALL[2]
#define gszCls_edit tc_wclass_ALL[2]
#define gszCls_Edit tc_wclass_ALL[2]
#define gszCls_BUTTON tc_wclass_ALL[3]
#define gszCls_button tc_wclass_ALL[3]
#define gszCls_Button tc_wclass_ALL[3]
#define gszCls_LISTBOX tc_wclass_ALL[4]
#define gszCls_listbox tc_wclass_ALL[4]
#define gszCls_Listbox tc_wclass_ALL[4]
#define gszCls_ListBox tc_wclass_ALL[4]
#define gszCls_COMBOBOX tc_wclass_ALL[5]
#define gszCls_combobox tc_wclass_ALL[5]
#define gszCls_Combobox tc_wclass_ALL[5]
#define gszCls_ComboBox tc_wclass_ALL[5]
#define gszCls_SCROLLBAR tc_wclass_ALL[6]
#define gszCls_SysTreeView32 tc_wclass_ALL[7]
#define gszCls_SysListView32 tc_wclass_ALL[8]
#define gszCls_SysTabControl32 tc_wclass_ALL[9]
#define gszCls_ToolbarWindow32 tc_wclass_ALL[10]
#define gszCls_msctls_statusbar32 tc_wclass_ALL[11]
#define gszCls_SysHeader32 tc_wclass_ALL[12]
#define gszCls_msctls_progress32 tc_wclass_ALL[13]
#define gszCls_msctls_trackbar32 tc_wclass_ALL[14]
#define gszCls_msctls_updown32 tc_wclass_ALL[15]
#define gszCls_WINDOW tc_wclass_ALL[16]
#define gszCls_Window tc_wclass_ALL[16]
#define gszCls_window tc_wclass_ALL[16]
#define gszCls__WINDOW tc_wclass_ALL[16]
#define gszCls__Window tc_wclass_ALL[16]
#define gszCls__window tc_wclass_ALL[16]
#define gszCls_AREA tc_wclass_ALL[17]
#define gszCls_Area tc_wclass_ALL[17]
#define gszCls_area tc_wclass_ALL[17]
#define gszCls_BLOCK tc_wclass_ALL[17]
#define gszCls_Block tc_wclass_ALL[17]
#define gszCls_block tc_wclass_ALL[17]
#define gszCls_PDIALOG tc_wclass_ALL[17]
#define gszCls_CDIALOG tc_wclass_ALL[17]
extern TCWINAPPLIB HWND tcHWndMain ;
extern TCWINAPPLIB HWND tcHWndMDI ;
extern TCWINAPPLIB HWND tcHWndTooltip ;
extern TCWINAPPLIB TC_CProgram* tcProg ;
extern TCWINAPPLIB TC_CWindow* tcApp ;
extern TCWINAPPLIB HINSTANCE tcHInst ;
extern TCWINAPPLIB HICON tcHMainIcon ;
extern TCWINAPPLIB TC_TArrayPTR <TC_CWindow> tcPopups ;
extern TCWINAPPLIB HCURSOR tcHCurSplitV ;
extern TCWINAPPLIB HCURSOR tcHCurSplitH ;
extern TCWINAPPLIB HIMAGELIST tcLbCheckHIL ;
extern TCWINAPPLIB TC_CString tcMenuStr_SC_SIZE ;
extern TCWINAPPLIB TC_CString tcMenuStr_SC_MOVE ;
extern TCWINAPPLIB TC_CString tcMenuStr_SC_MINIMIZE ;
extern TCWINAPPLIB TC_CString tcMenuStr_SC_MAXIMIZE ;
extern TCWINAPPLIB TC_CString tcMenuStr_SC_RESTORE ;
extern TCWINAPPLIB TC_CString tcMenuStr_SC_CLOSE ;
extern TCWINAPPLIB TC_CString tcMenuStr_SC_NEXTWINDOW ;
extern TCWINAPPLIB TC_CString tc_wclass_MAIN ;
extern TCWINAPPLIB TC_CString tc_wclass_MDI ;
extern TCWINAPPLIB char* tc_wclass_ALL [256];
TCWINAPPLIB void _tcCreate_MDICLIENT (int mnu_idx) ;
TCWINAPPLIB HWND tcCreate_MDI_Window () ;
TCWINAPPLIB HWND tcCreate_Popup_Window (HWND par,DWORD style,DWORD xstyle, BOOL dlg) ;
TCWINAPPLIB TC_CWindow* tcNewWin () ;
LRESULT CALLBACK TCWINDOWPROC (HWND hWnd,UINT uMsg,WPARAM wParam,LPARAM lParam) ;
LRESULT CALLBACK TCDIALOGPROC (HWND hWnd,UINT uMsg,WPARAM wParam,LPARAM lParam) ;
extern char tcSPLIT_H_CUR2 [];
extern char tcSPLIT_V_CUR2 [];
extern char tcSPLIT_H_CUR [];
extern char tcSPLIT_V_CUR [];
TCWINAPPLIB int tcWinMain (HINSTANCE hInst,HINSTANCE /*hPrevInst*/,LPSTR sCmdLine,int nCmdShow) ;
TCWINAPPLIB void tcTransDispMSG (MSG *msg) ;
TCWINAPPLIB BOOL tcTranslateAccel (MSG * msg) ;
TCWINAPPLIB BOOL tcTryCallWindowEvent (HWND hwnd, TC_Event *ev) ;
TCWINAPPLIB TC_CWindow* tcCurMDIWindow () ;
TCWINAPPLIB BOOL tcSetFocus (HWND h_wnd) ;
TCWINAPPLIB int tcMsgBox (UINT flg, LPCSTR title, LPCSTR fmt, ...) ;
TCWINAPPLIB HINSTANCE tcLoadLibrary (LPCTSTR lpLibFileName) ;
TCWINAPPLIB FARPROC tcProcAddress (HINSTANCE hi, LPCSTR lpProcName) ;
TCWINAPPLIB void tcRegPath (TC_CString &path) ;
TCWINAPPLIB TC_CString tcRegPath () ;
TCWINAPPLIB BOOL _tcSplit_Get (HWND hWnd, HWND *hwnd1, HWND *hwnd2, int *fix, int *horz) ;
TCWINAPPLIB BOOL tcEv_Wm_Paint_None (TC_Event_WM *e) ;
TCWINAPPLIB TC_CWindow* tcHWnd2Win (HWND hwnd) ;
TCWINAPPLIB void tcAddHWnd2Win (TC_CWindow * win) ;
TCWINAPPLIB void tcDelHWnd2Win (HWND hwnd) ;
TCWINAPPLIB HFONT tcMSFont (UINT op=0) ;
TCWINAPPLIB HFONT tcSMFont (UINT op=0) ;
TCWINAPPLIB int tcCyMSFont () ;
TCWINAPPLIB int tcCySMFont () ;
TCWINAPPLIB BOOL tcSplitCommandLine (LPCSTR src, TC_CArrayString &dst, BOOL no_quote) ;
// **********************************************************************
class TCWINAPPLIB TC_CProgram
{
public: static int m_MDIMenuIndex ;
public: static TC_CMenu* mainMenu ;
public: TC_CProgram () ;
public: virtual ~TC_CProgram () ;
public: virtual int AdjustWinType (HWND hwnd) ;
public: virtual void End () ;
public: virtual void MakeRegPath (TC_CString &path) ;
public: virtual TC_CWindow* NewWin (_CWSS * cwss) ;
public: virtual BOOL Start () ;
public: virtual void GetRegNames (TC_CString &comp, TC_CString &prod, TC_CString &user) =0 ;
}; // end of class TC_CProgram
// **********************************************************************
// **********************************************************************
class TCWINAPPLIB TC_CWindow
: public TC_CEventMaster
{
public:
enum
{
WRUN_MDI,
WRUN_MODAL,
WRUN_POPUP,
WRUN_CHILD
};
public:
struct TC_BitSetStruct
{
unsigned noAutoDel : 1;
unsigned noClose : 1;
unsigned noChildFocus: 1;
unsigned isModal : 1;
unsigned isModalLoop : 1;
unsigned isDlgProc : 1; // for ClassName::sDLG && DM_SETDEFID
unsigned isStdDlg : 1; // Auto:: Ok,Cancel,Yes,No
unsigned isFormRootArea : 1;
unsigned isFormFrame : 1;
unsigned haveCanvas : 1;
unsigned hide_toolbar : 1;
unsigned hide_statusbar : 1;
unsigned area_scroll : 2;
unsigned scroll_foc : 1;
unsigned isHide : 1;
unsigned initHide : 1;
unsigned zoom : 1;
unsigned destruction : 1;
unsigned tooltip : 1;
unsigned noGrow : 1;
unsigned centered : 1;
unsigned skip_WM_SIZE : 1;
unsigned block : 1;
unsigned fixminsize : 1; // for form_area_window
};
public: HWND m_HWnd ;
public: HWND m_HWnd_Focus ;
public: HFONT m_HFont ;
public: BYTE m_WCType ;
public: TC_WinPosStruct m_Pos1 ;
public: TC_WinGrowStruct m_Grow ;
public: TC_WinColorStruct m_Color ;
public: char* m_WinName ;
public: int m_Process ;
public: int m_ModalReturn ;
public: TC_BitSetStruct m_F ;
public: WNDPROC m_OldWndProc ;
public: TC_CWindow () ;
private: void _Constr () ;
public: virtual ~TC_CWindow () ;
public: BOOL Is_Modal () ;
public: BOOL Is_MDI () ;
public: BOOL Is_Frame () ;
public: BOOL Is_Dialog () ;
public: BOOL Is_WSPopup () ;
public: BOOL Is_WSChild () ;
public: BOOL Is_Hide () ;
public: BOOL Is_Enabled () ;
public: BOOL Is_Destruction () ;
public: BOOL Is_Centered () ;
public: DWORD WStyle () ;
public: DWORD WXStyle () ;
public: int GetID () ;
public: TC_CWindow* GetFrame () ;
public: TC_CWindow* GetDialog () ;
public: TC_CWindow* GetForm () ;
public: TC_CWindow* GetParent () ;
public: void GetText (TC_CString &dst, BOOL trm=FALSE) ;
public: TC_CString GetText () ;
public: long GetInt (BOOL * is_empty=0) ;
public: long GetInt (long def, long min, long max) ;
public: int GetRunMode () ;
public: SIZE ClientSize () ;
public: SIZE WindowSize () ;
public: void GetCtrlBounds (int *maxx, int *maxy) ;
public: TC_CWindow* GetToolbar () ;
public: void SetText (LPCSTR text) ;
public: void SetInt (long val) ;
public: void SetClientSize (int cx,int cy) ;
public: void SetClientSize (HWND hwndC) ;
public: void SetStdEv_Scrl (UINT opt) ;
public: void SetFont (HFONT hfont, BOOL dr=TRUE) ;
public: void SetIcon (LPCSTR name) ;
public: void SetTooltip (LPCSTR text, int tb_id=0) ;
public: void SetTBBitmapRc (LPCSTR bmp_name, int cx) ;
public: void AddTBItem (int chk, int iidx, int cmd, LPCSTR tip, RECT *prc=0) ;
public: int AddTBBitmapRc (LPCSTR bmpname, int cx, HINSTANCE hinst=0) ;
public: void AddThickFrame () ;
public: void DoSubclass (HWND hwnd) ;
public: int ModalMsgLoop () ;
public: static HWND _HWndFromCWS (_CWSS * cwss) ;
public: void FromCWS (_CWSS * cwss) ;
public: void Run_Block () ;
public: TC_CWindow* CreateToolbarRc (LPCSTR bmp_name, int cx, TC_CWindow *tb=0, HINSTANCE hi=0) ;
public: TC_CWindow* CreateToolbarBuf (LPCSTR bmp_buf, int cx, TC_CWindow *tb=0) ;
public: TC_CWindow* CreateStatusbar (TC_CWindow *sb=0) ;
public: void RegisterPopup () ;
public: void Show (BOOL show, BOOL set=TRUE) ;
public: BOOL Enable (BOOL enbl) ;
public: void Move (int x,int y,int cx,int cy) ;
public: void Move (const RECT *prc) ;
public: void Close (int ret_=0) ;
public: void FixPos1 () ;
public: void FixPositions () ;
public: BOOL Activate () ;
public: void Redraw (BOOL erase=0) ;
public: void Centre () ;
public: void RemoveTooltip () ;
public: void InitFocus () ;
public: void SwitchTab (int new_idx) ;
public: LRESULT SendMsg (UINT uMsg, WPARAM wParam=0, LPARAM lParam=0) ;
public: LRESULT CallOldProc (UINT uMsg,WPARAM wParam,LPARAM lParam) ;
public: static LRESULT CALLBACK _NewWndProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) ;
public: static LRESULT CALLBACK _Def_MdiChildProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) ;
public: static LRESULT CALLBACK _Def_FrameProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) ;
public: static LRESULT CALLBACK _Dlg_DlgProc (HWND hwnd, UINT uMsg, WPARAM wParam, LPARAM lParam) ;
public: int Form_Run (int run_mode, HWND hwnd_par, TC_CWindow * frame=0) ;
public: void Form_RunChild (HWND h_tmp, BOOL a_size=FALSE) ;
public: TC_CWindow* Form_Area () ;
public: HWND DlgItem_HWnd (int id) ;
public: void DlgItem_GetText (int id, TC_CString &dst) ;
public: void DlgItem_SetText (int id, LPCSTR text) ;
public: void DlgItem_Enable (int id, BOOL enbl) ;
public: void WinPos_Read () ;
public: void WinPos_Write () ;
public: void Try_Split_WriteReg () ;
public: void Try_Split_ReadReg () ;
public: void FrameWinName (TC_CString &dst) ;
public: void WCReset () ;
public: int WCGetCheck () ;
public: void WCSetCheck (int chk) ;
public: int WCAddString (LPCSTR str) ;
public: void WCDelString (int index) ;
public: int WCInsertString (int index, LPCSTR str) ;
public: void WCGetString (int index, TC_CString &dst) ;
public: TC_CString WCGetString (int index) ;
public: void WCSetItemData (int index, ULONG dw) ;
public: ULONG WCGetItemData (int index) ;
public: void WCSetCurSel (int index) ;
public: void WCSetCaretIndex (int index) ;
public: int WCGetCurSel () ;
public: int WCGetCaretIndex () ;
public: int WCGetCount () ;
public: int WCGetSelItems (TCArrayINT *arr) ;
public: void WCLimitText (int len) ;
public: void WCSetReadOnly (BOOL set) ;
public: int WCGetCurTab () ;
public: virtual LRESULT _SysMsgProc (UINT uMsg, WPARAM wParam, LPARAM lParam) ;
public: void _Sys_Check_TTP_Msg (UINT uMsg,WPARAM wParam,LPARAM lParam) ;
public: void _Sys_Wm_Activate (int act) ;
public: void _Sys_Wm_MDIActivate (HWND hwndAct) ;
public: void _Sys_Wm_NcDestroy () ;
public: void _Call_OnSize () ;
public: void _Sys_FixFocus () ;
public: void _Sys_Wm_Setfocus2 () ;
public: void _Sys_OnParentSize (TC_CWindow * par) ;
public: void _Unsubclass () ;
public: void _Sys_FixChildrenPos (BOOL release=FALSE) ;
public: void _Sys_ChildrenReadReg () ;
public: void _Sys_ChildrenCallOnSize () ;
public: BOOL StdEv_Create (TC_Event *) ;
public: BOOL StdEv_Create_Block (TC_Event*) ;
public: BOOL StdEv_Close (TC_Event *e) ;
public: BOOL StdEv_Close1 (TC_Event *) ;
public: BOOL StdEv_Hide (TC_Event*) ;
public: BOOL StdEv_Wm_Destroy (TC_Event *) ;
public: BOOL StdEv_Wm_Enable (TC_Event_WM *e) ;
public: BOOL StdEv_Wm_MenuSelect_Main (TC_Event_WM *e) ;
public: BOOL StdEv_Wm_Paint (TC_Event_WM * e) ;
public: BOOL StdEv_Wm_WPC2 (TC_Event_WM *e) ;
public: BOOL StdEv_Wm_Size2 (TC_Event_WM * e) ;
public: BOOL StdEv_Wm_Focus1 (TC_Event *) ;
public: BOOL StdEv_Wm_CtlColor (TC_Event_WM *e) ;
public: BOOL StdEv_Wm_DrawItem (TC_Event_WM *e) ;
public: BOOL StdEv_Wm_MeasureItem (TC_Event_WM *e) ;
public: BOOL StdEv_Wm_KeyDown1 (TC_Event_WM *e) ;
public: BOOL StdEv_Wm_KeyDown2 (TC_Event_WM *e) ;
public: BOOL StdEv_Wm_KeyChr1 (TC_Event_WM *e) ;
public: BOOL StdEv_Wm_KeyChr2 (TC_Event_WM *e) ;
public: BOOL StdEv_Wm_Notify (TC_Event_WM * e) ;
public: BOOL StdEv_Wm_Command (TC_Event_WM * e) ;
public: BOOL StdEv_Wm_Cmd_Main (TC_Event_WM *e) ;
public: BOOL StdEv_Canvas_Wm_Size (TC_Event_WM * e) ;
public: BOOL StdEv_My_Wm_Notify (TC_Event_NM * e) ;
public: BOOL StdEv_My_Wm_Cmd (TC_Event_CM * e) ;
public: BOOL StdEv_ACCEL (TC_Event_WIN * e) ;
public: BOOL StdEv_My_CtlColor (TC_Event_WIN * e) ;
public: BOOL StdEv_Scrl_Wm_Size (TC_Event_WM * e) ;
public: BOOL StdEv_Scrl_Wm_VScroll (TC_Event_WM *e) ;
public: BOOL StdEv_Scrl_Wm_HScroll (TC_Event_WM *e) ;
public: BOOL StdEv_Tab_Wm_Size2 (TC_Event_WM *e) ;
public: BOOL StdEv_Tab_Switch (TC_Event_NM *enh) ;
public: BOOL StdEv_Pb_NoFoc (TC_Event*) ;
public: virtual void* GetInterface (LPCSTR name) ;
public: virtual const char* GetClassName () ;
public: virtual void WinName (TC_CString &dst) ;
public: virtual void Read_Registry () ;
public: virtual BOOL Form_Creator (TC_CWindow * frame) ;
public: virtual BOOL Form_OnCreate () ;
}; // end of class TC_CWindow
// **********************************************************************
// **********************************************************************
class TCWINAPPLIB TC_CAbout
: public TC_CWindow
{
public: static TC_CString Caption ;
public: static TC_CString Text ;
public: static void Run () ;
public: TC_CAbout () ;
public: BOOL Ev_Create (TC_Event *) ;
public: BOOL Ev_Wm_SetFocus (TC_Event *) ;
public: virtual void* GetInterface (LPCSTR name) ;
public: virtual const char* GetClassName () ;
}; // end of class TC_CAbout
// **********************************************************************
// **********************************************************************
class TCWINAPPLIB TC_COpenSaveFile
{
public: TC_CString Title ;
public: TC_CString File ;
public: TC_CString Path ;
public: TC_CString DefExt ;
public: TC_CString Filters ;
public: int FilterIndex ;
public: TC_COpenSaveFile () ;
public: BOOL GetOpenName () ;
public: BOOL GetSaveName () ;
}; // end of class TC_COpenSaveFile
// **********************************************************************
// **********************************************************************
class TCWINAPPLIB TC_CFileChooser
: public TC_CWindow
{
public: TC_CWindow* mc_FilePath ;
public: TC_COpenSaveFile* m_O ;
public: BOOL bSave ;
public: TC_COpenSaveFile _m_OSF ;
public: TC_CFileChooser () ;
public: virtual void* GetInterface (LPCSTR name) ;
public: virtual const char* GetClassName () ;
public: BOOL Form_Creator (TC_CWindow *frame) ;
public: TC_CWindow * mc_PbSel;
public: BOOL Ev_Click (TC_Event *) ;
}; // end of class TC_CFileChooser
// **********************************************************************
// **********************************************************************
class TCWINAPPLIB TC_CPathChooserDlg
: public TC_CWindow
{
public: static BOOL Run (TC_CString * dst) ;
public: static char img_bmp [];
public: static HIMAGELIST hImgLst ;
public: TC_CString* pStrDest ;
public: TC_CPathChooserDlg () ;
public: BOOL _Run () ;
public: TC_CWindow * mc_Tree;
public: TC_CWindow * mc_Path;
public: void Init () ;
public: BOOL Ev_Done (LPVOID) ;
public: BOOL Ev_Wm_Notify (TC_Event_WM *e) ;
public: static int _sort_func (const void *p1, const void *p2) ;
public: void Fill_Item (HTREEITEM hPar) ;
public: void Sel_Chg (HTREEITEM hitem) ;
public: void Chk_ClrFlg (HTREEITEM hItem) ;
}; // end of class TC_CPathChooserDlg
// **********************************************************************
// **********************************************************************
class TCWINAPPLIB TC_CPathChooser
: public TC_CWindow
{
public: TC_CWindow* mc_Path ;
public: TC_CPathChooser () ;
public: virtual void* GetInterface (LPCSTR name) ;
public: virtual const char* GetClassName () ;
public: BOOL Form_Creator (TC_CWindow *frame) ;
public: BOOL Ev_Click (TC_Event *) ;
}; // end of class TC_CPathChooser
// **********************************************************************
// **********************************************************************
class TCWINAPPLIB TC_CDragDrop
{
public:
enum {
ddStart,
ddMove,
ddEnd,
ddCancel,
ddStop,
};
public:
typedef BOOL (*TST_PROC)(HWND,UINT,WPARAM,LPARAM);
public: static void Use (TC_CWindow * win) ;
public: static BOOL Worked () ;
public: static void DrawHWnd (HWND hwnd) ;
public: static char dd_curs_one [];
public: static char dd_curs_one_p [];
public: static char dd_curs_more [];
public: static char dd_curs_more_p [];
public: static char dd_curs_no [];
public: static HWND hWnd ;
public: static WNDPROC oldWndProc ;
public: static LRESULT CALLBACK _WndProc (HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam) ;
public: static void _Initialize (HWND hwnd) ;
public: static TC_CWindow* pWin ;
public: static POINT Pt ;
public: static int Cap ;
public: static int ok_Post ;
public: static HWND hwnd_Draw ;
public: static TCArrayULONG aProcChk ;
public: static TCArrayULONG aProcSet ;
public: static void Clear () ;
public: static BOOL MsgProc (UINT uMsg, WPARAM wParam, LPARAM lParam) ;
public: static BOOL _Proc_ListBox (HWND lb, UINT uMsg, WPARAM wParam, LPARAM lParam) ;
public: static BOOL Ev_ButtonDown (TC_Event_WM *e) ;
public: static void _Use_Std (TC_CWindow * win) ;
public: static int _OkStart (int x, int y) ;
public: static void _Init () ;
}; // end of class TC_CDragDrop
// **********************************************************************
// **********************************************************************
struct TCWINAPPLIB TC_Former
{
public:
enum {
T_EDIT,
T_LCOMBO,
T_CHECK,
T_AREA,
T_GROUP,
T_MLEDIT,
T_WRAPEDIT,
T_IMGCOMBO,
T_VSCRLGRP,
};
public:
enum {
PB_NONE,
PB_TEXT,
PB_PICT,
PBF_NOFOCUS = 8,
};
public:
enum {
AL_LEFT,
AL_RIGHT,
AL_CENTER,
};
public: int ctrlType ;
public: int pushType ;
public: int align ;
public: int vchars ;
public: int maxlen ;
public: BOOL readonly ;
public: char* Label ;
public: char* pushText ;
public: TC_CWindow* wLabel ;
public: TC_CWindow* wCtrl ;
public: TC_CWindow* wPush ;
private: static void _clr_posgrow (TC_CWindow *win) ;
private: static BOOL _Paint_AsGroup (TC_Event *e) ;
private: static BOOL _VScrlCaptArea (TC_Event_WM *e) ;
public: static void Build (TC_CWindow *area, TC_Former * src, int num, int id_1, int y_0) ;
}; // end of class TC_Former
// **********************************************************************
#define ADD_THIS_TB_BTN(type,iidx,func,dw_u,cls,ttp) \
Add(this,type,iidx,0,\
(C_EVENT_HANDLER)((BOOL(cls::*)(TC_Event*))func),\
dw_u,ttp)
#define ADD_THIS_TB_CMD_BTN(type,iidx,cmd,func,dw_u,cls,ttp) \
Add(this,type,iidx,cmd,\
(C_EVENT_HANDLER)((BOOL(cls::*)(TC_Event*))func),\
dw_u,ttp)
// **********************************************************************
class TCWINAPPLIB TC_CToolbarButton
: public TC_CEventMaster
{
public: int m_Cmd ;
public: int m_ImgIdx ;
public: TC_CToolbarMaster* m_Tb ;
public: TC_CToolbarButton (TC_CToolbarMaster *tb) ;
public: ~TC_CToolbarButton () ;
public: virtual void* GetInterface (LPCSTR name) ;
public: virtual const char* GetClassName () ;
}; // end of class TC_CToolbarButton
// **********************************************************************
// **********************************************************************
class TCWINAPPLIB TC_CToolbarMaster
: public TC_CEventMaster
{
public: TC_TArrayPTR <TC_CToolbarButton> m_Buttons ;
public: int m_FirstCMD ;
public: TC_CWindow * m_TbWin ;
public: TC_CToolbarMaster (TC_CWindow *tb) ;
public: ~TC_CToolbarMaster () ;
public: virtual void* GetInterface (LPCSTR name) ;
public: virtual const char* GetClassName () ;
public: TC_CToolbarButton* Add (TC_CEventMaster *obj, UINT type, int imgidx, int cmd, C_EVENT_HANDLER func, DWORD dwuser, LPCSTR ttp) ;
public: BOOL EatCommand (int cmd) ;
public: BOOL Ev_WmCmd (TC_Event_CM *e) ;
}; // end of class TC_CToolbarMaster
// **********************************************************************
BOOL Dll_Start () ;
void Dll_End () ;
#endif // _INC_TCWINAPP_HPP