1 | /* pmframe.h -*- C++ -*-
|
---|
2 | Copyright (c) 1996 Eberhard Mattes
|
---|
3 |
|
---|
4 | This file is part of pmgdb.
|
---|
5 |
|
---|
6 | pmgdb is free software; you can redistribute it and/or modify
|
---|
7 | it under the terms of the GNU General Public License as published by
|
---|
8 | the Free Software Foundation; either version 2, or (at your option)
|
---|
9 | any later version.
|
---|
10 |
|
---|
11 | pmgdb is distributed in the hope that it will be useful,
|
---|
12 | but WITHOUT ANY WARRANTY; without even the implied warranty of
|
---|
13 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
---|
14 | GNU General Public License for more details.
|
---|
15 |
|
---|
16 | You should have received a copy of the GNU General Public License
|
---|
17 | along with pmgdb; see the file COPYING. If not, write to
|
---|
18 | the Free Software Foundation, 59 Temple Place - Suite 330,
|
---|
19 | Boston, MA 02111-1307, USA. */
|
---|
20 |
|
---|
21 |
|
---|
22 | // A frame window
|
---|
23 |
|
---|
24 | class pmframe
|
---|
25 | {
|
---|
26 | public:
|
---|
27 |
|
---|
28 | // Constructors and destructors, initialization
|
---|
29 | pmframe (pmapp *app);
|
---|
30 | virtual ~pmframe ();
|
---|
31 | void create (const char *classname, unsigned id, ULONG frame_flags,
|
---|
32 | const SWP *pswp);
|
---|
33 |
|
---|
34 | // Querying private members
|
---|
35 | HWND get_hwndMenu () const { return hwndMenu; }
|
---|
36 | HWND get_hwndClient () const { return hwndClient; }
|
---|
37 | HWND get_hwndFrame () const { return hwndFrame; }
|
---|
38 | HWND get_hwndHelp () const { return hwndHelp; }
|
---|
39 | pmapp *get_app () const { return app; }
|
---|
40 | HAB get_hab () const { return app->get_hab (); }
|
---|
41 | const char *get_name () const { return app->get_name (); }
|
---|
42 | PFNWP get_old_frame_msg () const { return old_frame_msg; }
|
---|
43 | bool get_minimized () const { return minimized; }
|
---|
44 |
|
---|
45 | // Painting
|
---|
46 | void repaint (RECTL *prcl = NULL);
|
---|
47 |
|
---|
48 | // Miscellanea
|
---|
49 | void set_title (const char *title);
|
---|
50 | void win_error () const { app->win_error (); }
|
---|
51 | void focus () const;
|
---|
52 | void top () const;
|
---|
53 | void show (bool visible) const;
|
---|
54 | void menu_check (unsigned idm, bool on) const;
|
---|
55 | void menu_enable (unsigned idm, bool on, bool silent = false) const;
|
---|
56 | bool same_tid () const { return tid == _gettid (); }
|
---|
57 | HWND get_hwndMenu_from_id (unsigned idm) const;
|
---|
58 | bool is_visible () const;
|
---|
59 |
|
---|
60 | protected:
|
---|
61 |
|
---|
62 | // Messages
|
---|
63 | virtual MRESULT wm_paint (HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2) = 0;
|
---|
64 | virtual MRESULT wm_activate (HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2);
|
---|
65 | virtual MRESULT wm_button (HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2);
|
---|
66 | virtual MRESULT wm_char (HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2);
|
---|
67 | virtual MRESULT wm_close (HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2);
|
---|
68 | virtual MRESULT wm_command (HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2);
|
---|
69 | virtual MRESULT wm_create (HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2);
|
---|
70 | virtual MRESULT wm_hscroll (HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2);
|
---|
71 | virtual MRESULT wm_presparamchanged (HWND hwnd, ULONG msg, MPARAM mp1,
|
---|
72 | MPARAM mp2);
|
---|
73 | virtual MRESULT wm_querytrackinfo (HWND hwnd, ULONG msg, MPARAM mp1,
|
---|
74 | MPARAM mp2);
|
---|
75 | virtual MRESULT wm_setfocus (HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2);
|
---|
76 | virtual MRESULT wm_size (HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2);
|
---|
77 | virtual MRESULT wm_timer (HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2);
|
---|
78 | virtual bool wm_user (HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2);
|
---|
79 | virtual MRESULT wm_vscroll (HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2);
|
---|
80 |
|
---|
81 | bool help_init (unsigned help_table_id, const char *title, const char *file,
|
---|
82 | unsigned keys_help_id);
|
---|
83 | void set_keys_help_id (unsigned id) { keys_help_id = id; }
|
---|
84 |
|
---|
85 | private:
|
---|
86 |
|
---|
87 | MRESULT client_msg (HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2);
|
---|
88 | MRESULT frame_msg (HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2);
|
---|
89 |
|
---|
90 | friend MRESULT EXPENTRY
|
---|
91 | pmframe_client_msg (HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2);
|
---|
92 | friend MRESULT EXPENTRY
|
---|
93 | pmframe_frame_msg (HWND hwnd, ULONG msg, MPARAM mp1, MPARAM mp2);
|
---|
94 |
|
---|
95 | // Data members
|
---|
96 |
|
---|
97 | pmapp *app;
|
---|
98 | HWND hwndFrame;
|
---|
99 | HWND hwndClient;
|
---|
100 | HWND hwndMenu;
|
---|
101 | HWND hwndHelp;
|
---|
102 | int tid;
|
---|
103 | unsigned keys_help_id;
|
---|
104 | PFNWP old_frame_msg;
|
---|
105 | bool minimized;
|
---|
106 | };
|
---|