1 /* -*-C++-*- $NetBSD: menu.h,v 1.5 2005/12/11 12:17:28 christos Exp $ */
4 * Copyright (c) 2001 The NetBSD Foundation, Inc.
7 * This code is derived from software contributed to The NetBSD Foundation
10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions
13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer.
15 * 2. Redistributions in binary form must reproduce the above copyright
16 * notice, this list of conditions and the following disclaimer in the
17 * documentation and/or other materials provided with the distribution.
19 * THIS SOFTWARE IS PROVIDED BY THE NETBSD FOUNDATION, INC. AND CONTRIBUTORS
20 * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
21 * TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
22 * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE FOUNDATION OR CONTRIBUTORS
23 * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 * POSSIBILITY OF SUCH DAMAGE.
32 class MainTabWindow
: public TabWindow
36 HWND _combobox_serial_speed
;
39 int id
; // index in platid_name_table
40 TCHAR
*name
; // platform name
43 struct PlatMap
*_platmap
;
44 void _sort_platids(HWND w
);
45 int _item_to_platid(int idx
);
46 static int _platcmp(const void *, const void *);
49 void _insert_item(HWND w
, TCHAR
*name
, int id
);
51 explicit MainTabWindow(TabWindowBase
&base
, int id
)
52 : TabWindow(base
, id
, TEXT("WMain")) {
55 virtual ~MainTabWindow(void) { /* NO-OP */ }
56 virtual void init(HWND w
);
57 virtual void command(int id
, int msg
);
64 class OptionTabWindow
: public TabWindow
69 #define IS_CHECKED(x) _is_checked(IDC_OPT_##x)
70 #define SET_CHECK(x, b) _set_check(IDC_OPT_##x,(b))
73 explicit OptionTabWindow(TabWindowBase
&base
, int id
)
74 : TabWindow(base
, id
, TEXT("WOption")) {
78 virtual ~OptionTabWindow(void) { /* NO-OP */ }
79 virtual void init(HWND w
);
80 virtual void command(int id
, int msg
);
84 class ConsoleTabWindow
: public TabWindow
90 BOOL
_open_log_file(void);
95 explicit ConsoleTabWindow(TabWindowBase
&base
, int id
)
96 : TabWindow(base
, id
, TEXT("WConsole")) {
98 _logfile
= INVALID_HANDLE_VALUE
;
100 virtual ~ConsoleTabWindow(void) {
101 if (_logfile
!= INVALID_HANDLE_VALUE
)
102 CloseHandle(_logfile
);
104 virtual void init(HWND
);
105 virtual void command(int, int);
107 void print(TCHAR
*buf
, BOOL
= FALSE
);
111 BOOL
_find_pref_dir(TCHAR
*);