From e32f7e5fe4a1417538c0d2095eeb9253ac906e78 Mon Sep 17 00:00:00 2001 From: Volker Ruppert Date: Tue, 3 Feb 2004 22:40:33 +0000 Subject: [PATCH] - prepared listbox for the advanced log options - disabled textconfig functions no longer used on win32 - fixed CommDlgExtendedError message text --- bochs/gui/textconfig.cc | 6 +++++- bochs/gui/win32dialog.cc | 21 ++++++++++++++++----- bochs/gui/win32res.h | 1 + bochs/win32res.rc | 21 +++++++++++---------- 4 files changed, 33 insertions(+), 16 deletions(-) diff --git a/bochs/gui/textconfig.cc b/bochs/gui/textconfig.cc index 289ecc489..33b9333f3 100644 --- a/bochs/gui/textconfig.cc +++ b/bochs/gui/textconfig.cc @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////// -// $Id: textconfig.cc,v 1.21 2004-02-01 01:40:14 vruppert Exp $ +// $Id: textconfig.cc,v 1.22 2004-02-03 22:40:33 vruppert Exp $ ///////////////////////////////////////////////////////////////////////// // // This is code for a text-mode configuration interface. Note that this file @@ -273,6 +273,7 @@ static char *startup_options_prompt = "\n" "Please choose one: [0] "; +#ifndef WIN32 static char *runtime_menu_prompt = "---------------------\n" "Bochs Runtime Options\n" @@ -295,6 +296,7 @@ static char *runtime_menu_prompt = "16. Quit now\n" "\n" "Please choose one: [15] "; +#endif #define NOT_IMPLEMENTED(choice) \ fprintf (stderr, "ERROR: choice %d not implemented\n", choice); @@ -303,6 +305,7 @@ static char *runtime_menu_prompt = do {fprintf (stderr, "ERROR: menu %d has no choice %d\n", menu, choice); \ assert (0); } while (0) +#ifndef WIN32 void build_runtime_options_prompt (char *format, char *buf, int size) { bx_floppy_options floppyop; @@ -340,6 +343,7 @@ void build_runtime_options_prompt (char *format, char *buf, int size) SIM->get_param_num (BXP_KBD_PASTE_DELAY)->get (), SIM->get_param_string (BXP_USER_SHORTCUT)->getptr ()); } +#endif int do_menu (bx_id id) { bx_list_c *menu = (bx_list_c *)SIM->get_param (id); diff --git a/bochs/gui/win32dialog.cc b/bochs/gui/win32dialog.cc index 454dc195f..2eef86b16 100644 --- a/bochs/gui/win32dialog.cc +++ b/bochs/gui/win32dialog.cc @@ -1,5 +1,5 @@ ///////////////////////////////////////////////////////////////////////// -// $Id: win32dialog.cc,v 1.16 2004-02-02 18:34:24 vruppert Exp $ +// $Id: win32dialog.cc,v 1.17 2004-02-03 22:40:33 vruppert Exp $ ///////////////////////////////////////////////////////////////////////// #include "config.h" @@ -274,6 +274,7 @@ void RuntimeDlgSetTab(HWND hDlg, int tabnum) ShowWindow(GetDlgItem(hDlg, IDSTATUS2), (tabnum == 0) ? SW_SHOW : SW_HIDE); ShowWindow(GetDlgItem(hDlg, IDSTATUS3), (tabnum == 0) ? SW_SHOW : SW_HIDE); ShowWindow(GetDlgItem(hDlg, IDSTATUS4), (tabnum == 0) ? SW_SHOW : SW_HIDE); + ShowWindow(GetDlgItem(hDlg, IDDEVLIST), (tabnum == 1) ? SW_SHOW : SW_HIDE); ShowWindow(GetDlgItem(hDlg, IDLOGLBL1), (tabnum == 1) ? SW_SHOW : SW_HIDE); ShowWindow(GetDlgItem(hDlg, IDLOGLBL2), (tabnum == 1) ? SW_SHOW : SW_HIDE); ShowWindow(GetDlgItem(hDlg, IDLOGLBL3), (tabnum == 1) ? SW_SHOW : SW_HIDE); @@ -298,16 +299,17 @@ void RuntimeDlgSetTab(HWND hDlg, int tabnum) void RuntimeDlgInitLogOpt(HWND hDlg) { char choices[5][16] = {"ignore", "log", "ask user", "end simulation", "no change"}; - int level, idx; + int level, idx, mod, mod_max; int defchoice[5]; + mod_max = SIM->get_n_log_modules (); for (level=0; level<5; level++) { - int mod = 0; + mod = 0; int first = SIM->get_log_action (mod, level); BOOL consensus = true; // now compare all others to first. If all match, then use "first" as // the initial value. - for (mod=1; modget_n_log_modules (); mod++) { + for (mod=1; modget_log_action (mod, level)) { consensus = false; break; @@ -331,6 +333,15 @@ void RuntimeDlgInitLogOpt(HWND hDlg) } } } + idx = 0; + for (mod=0; modget_prefix(mod), "[ ]")) { + SendMessage(GetDlgItem(hDlg, IDDEVLIST), LB_ADDSTRING, 0, (LPARAM)SIM->get_prefix(mod)); + SendMessage(GetDlgItem(hDlg, IDDEVLIST), LB_SETITEMDATA, idx, mod); + idx++; + } + } + EnableWindow(GetDlgItem(hDlg, IDDEVLIST), FALSE); } static BOOL CALLBACK RuntimeDlgProc(HWND hDlg, UINT msg, WPARAM wParam, LPARAM lParam) @@ -559,7 +570,7 @@ int AskFilename(HWND hwnd, bx_param_filename_c *param, const char *ext) ret = -1; } else { if (errcode == 0x3002) { - wsprintf(errtext, "CommDlgExtendedError: illegal filename"); + wsprintf(errtext, "CommDlgExtendedError: invalid filename"); } else { wsprintf(errtext, "CommDlgExtendedError returns 0x%04x", errcode); } diff --git a/bochs/gui/win32res.h b/bochs/gui/win32res.h index 374068fd7..3118f3834 100644 --- a/bochs/gui/win32res.h +++ b/bochs/gui/win32res.h @@ -39,6 +39,7 @@ #define IDSTATUS2 2452 #define IDSTATUS3 2453 #define IDSTATUS4 2454 +#define IDDEVLIST 2460 #define IDLOGLBL1 2461 #define IDLOGLBL2 2462 #define IDLOGLBL3 2463 diff --git a/bochs/win32res.rc b/bochs/win32res.rc index 1d38370dc..583e71365 100644 --- a/bochs/win32res.rc +++ b/bochs/win32res.rc @@ -79,20 +79,21 @@ BEGIN EDITTEXT IDCDROM4, 55, 140, 120, 14, ES_AUTOHSCROLL PUSHBUTTON "Browse...", IDBROWSE4, 183, 140, 50, 14 AUTOCHECKBOX "Inserted", IDSTATUS4, 23, 155, 41, 14, BS_LEFTTEXT | WS_TABSTOP - LTEXT "Debug events", IDLOGLBL1, 20, 37, 70, 14 - COMBOBOX IDLOGEVT1, 95, 35, 65, 56, CBS_DROPDOWNLIST | CBS_AUTOHSCROLL | + LISTBOX IDDEVLIST, 25, 35, 45, 100, WS_VSCROLL | WS_TABSTOP + LTEXT "Debug events", IDLOGLBL1, 80, 37, 55, 14 + COMBOBOX IDLOGEVT1, 165, 35, 65, 56, CBS_DROPDOWNLIST | CBS_AUTOHSCROLL | WS_VSCROLL | WS_TABSTOP - LTEXT "Info events", IDLOGLBL2, 20, 57, 70, 14 - COMBOBOX IDLOGEVT2, 95, 55, 65, 56, CBS_DROPDOWNLIST | CBS_AUTOHSCROLL | + LTEXT "Info events", IDLOGLBL2, 80, 57, 55, 14 + COMBOBOX IDLOGEVT2, 165, 55, 65, 56, CBS_DROPDOWNLIST | CBS_AUTOHSCROLL | WS_VSCROLL | WS_TABSTOP - LTEXT "Error events", IDLOGLBL3, 20, 77, 70, 14 - COMBOBOX IDLOGEVT3, 95, 75, 65, 56, CBS_DROPDOWNLIST | CBS_AUTOHSCROLL | + LTEXT "Error events", IDLOGLBL3, 80, 77, 55, 14 + COMBOBOX IDLOGEVT3, 165, 75, 65, 56, CBS_DROPDOWNLIST | CBS_AUTOHSCROLL | WS_VSCROLL | WS_TABSTOP - LTEXT "Panic events", IDLOGLBL4, 20, 97, 70, 14 - COMBOBOX IDLOGEVT4, 95, 95, 65, 56, CBS_DROPDOWNLIST | CBS_AUTOHSCROLL | + LTEXT "Panic events", IDLOGLBL4, 80, 97, 55, 14 + COMBOBOX IDLOGEVT4, 165, 95, 65, 56, CBS_DROPDOWNLIST | CBS_AUTOHSCROLL | WS_VSCROLL | WS_TABSTOP - LTEXT "Pass events", IDLOGLBL5, 20, 117, 70, 14 - COMBOBOX IDLOGEVT5, 95, 115, 65, 56, CBS_DROPDOWNLIST | CBS_AUTOHSCROLL | + LTEXT "Pass events", IDLOGLBL5, 80, 117, 55, 14 + COMBOBOX IDLOGEVT5, 165, 115, 65, 56, CBS_DROPDOWNLIST | CBS_AUTOHSCROLL | WS_VSCROLL | WS_TABSTOP LTEXT "The advanced log options are still present on the console", IDLOGINFO, 35, 137, 180, 14 PUSHBUTTON "Advanced", IDADVLOGOPT, 95, 155, 60, 14