- userbutton added to the wxgui
This commit is contained in:
parent
ec33a610e4
commit
940a5c7b74
@ -20,7 +20,7 @@ Detailed description:
|
||||
the shortcut keyword
|
||||
* the gui stops adding buttons to the headerbar if not enough space is left.
|
||||
This can happen when the screen width is 320 pixels. Done for X11 and Win32.
|
||||
* TODO: implement this feature in the wxWindows gui too
|
||||
* TODO: build a dialog box for the wxWindows gui
|
||||
|
||||
Patch was created with:
|
||||
diff -u
|
||||
@ -32,7 +32,7 @@ Instructions:
|
||||
----------------------------------------------------------------------
|
||||
diff -urN ../bochs/.bochsrc ./.bochsrc
|
||||
--- ../bochs/.bochsrc Fri Aug 2 07:41:04 2002
|
||||
+++ ./.bochsrc Wed Aug 7 22:17:58 2002
|
||||
+++ ./.bochsrc Thu Aug 8 00:14:01 2002
|
||||
@@ -447,6 +447,17 @@
|
||||
#keyboard_type: mf
|
||||
|
||||
@ -53,7 +53,7 @@ diff -urN ../bochs/.bochsrc ./.bochsrc
|
||||
# magic_break
|
||||
diff -urN ../bochs/bochs.h ./bochs.h
|
||||
--- ../bochs/bochs.h Thu Aug 1 09:34:58 2002
|
||||
+++ ./bochs.h Wed Aug 7 20:01:29 2002
|
||||
+++ ./bochs.h Thu Aug 8 00:14:01 2002
|
||||
@@ -660,6 +660,7 @@
|
||||
bx_load32bitOSImage_t load32bitOSImage;
|
||||
bx_log_options log;
|
||||
@ -64,10 +64,10 @@ diff -urN ../bochs/bochs.h ./bochs.h
|
||||
extern bx_options_t bx_options;
|
||||
diff -urN ../bochs/gui/bitmaps/userbutton.h ./gui/bitmaps/userbutton.h
|
||||
--- ../bochs/gui/bitmaps/userbutton.h Thu Jan 1 01:00:00 1970
|
||||
+++ ./gui/bitmaps/userbutton.h Tue Aug 6 17:45:57 2002
|
||||
+++ ./gui/bitmaps/userbutton.h Thu Aug 8 00:14:02 2002
|
||||
@@ -0,0 +1,19 @@
|
||||
+/////////////////////////////////////////////////////////////////////////
|
||||
+// $Id: patch.userbutton,v 1.2 2002-08-07 20:35:57 vruppert Exp $
|
||||
+// $Id: patch.userbutton,v 1.3 2002-08-08 08:05:19 vruppert Exp $
|
||||
+/////////////////////////////////////////////////////////////////////////
|
||||
+#define BX_USER_BMAP_X 32
|
||||
+#define BX_USER_BMAP_Y 32
|
||||
@ -85,9 +85,53 @@ diff -urN ../bochs/gui/bitmaps/userbutton.h ./gui/bitmaps/userbutton.h
|
||||
+ 0xaa, 0xbf, 0xaa, 0x2a, 0x02, 0x00, 0x00, 0x20, 0xfe, 0xff, 0xff, 0x3f,
|
||||
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
|
||||
+ };
|
||||
diff -urN ../bochs/gui/bitmaps/userbutton.xpm ./gui/bitmaps/userbutton.xpm
|
||||
--- ../bochs/gui/bitmaps/userbutton.xpm Thu Jan 1 01:00:00 1970
|
||||
+++ ./gui/bitmaps/userbutton.xpm Thu Aug 8 00:22:23 2002
|
||||
@@ -0,0 +1,40 @@
|
||||
+/* XPM */
|
||||
+static char *userbutton_xpm[] = {
|
||||
+/* columns rows colors chars-per-pixel */
|
||||
+"32 32 2 1",
|
||||
+" c black",
|
||||
+". c white",
|
||||
+/* pixels */
|
||||
+"................................",
|
||||
+".. .... ... .. .. .....",
|
||||
+".. .... .. ...... ..... ... ....",
|
||||
+".. .... .. ...... ..... ... ....",
|
||||
+".. .... ... ... .. .....",
|
||||
+".. .... ...... .. ..... .......",
|
||||
+".. .... ...... .. ..... . .....",
|
||||
+"... ... ... .. ... ....",
|
||||
+"................................",
|
||||
+"................................",
|
||||
+"............................. ..",
|
||||
+".......................... ...",
|
||||
+"......................... ......",
|
||||
+"........................ .......",
|
||||
+"....................... ........",
|
||||
+"....................... ........",
|
||||
+". ..",
|
||||
+". ........................... ..",
|
||||
+". . . . . . . . . . . ... . . ..",
|
||||
+". ........................... ..",
|
||||
+". ........................... ..",
|
||||
+". . . . . . . . . . . . . . . ..",
|
||||
+". .. . . . . . . ... ... . .. ..",
|
||||
+". . . . . . . . . . . . . . . ..",
|
||||
+". .. . . . . . . ....... . .. ..",
|
||||
+". . . . . . . . . ..... . . . ..",
|
||||
+". .. . . . . . . ... ... . .. ..",
|
||||
+". . . . . . . . . . . . ..",
|
||||
+". ........................... ..",
|
||||
+". ..",
|
||||
+"................................",
|
||||
+"................................"
|
||||
+};
|
||||
diff -urN ../bochs/gui/control.cc ./gui/control.cc
|
||||
--- ../bochs/gui/control.cc Wed Aug 7 09:24:32 2002
|
||||
+++ ./gui/control.cc Wed Aug 7 21:02:31 2002
|
||||
+++ ./gui/control.cc Thu Aug 8 00:14:02 2002
|
||||
@@ -368,11 +368,12 @@
|
||||
"7. VGA Update Interval: %d\n"
|
||||
"8. Mouse: %s\n"
|
||||
@ -140,7 +184,7 @@ diff -urN ../bochs/gui/control.cc ./gui/control.cc
|
||||
return -1;
|
||||
diff -urN ../bochs/gui/gui.cc ./gui/gui.cc
|
||||
--- ../bochs/gui/gui.cc Sun Aug 4 10:42:34 2002
|
||||
+++ ./gui/gui.cc Wed Aug 7 22:19:45 2002
|
||||
+++ ./gui/gui.cc Thu Aug 8 00:14:02 2002
|
||||
@@ -37,6 +37,7 @@
|
||||
#include "gui/bitmaps/paste.h"
|
||||
#include "gui/bitmaps/configbutton.h"
|
||||
@ -223,7 +267,7 @@ diff -urN ../bochs/gui/gui.cc ./gui/gui.cc
|
||||
void
|
||||
diff -urN ../bochs/gui/gui.h ./gui/gui.h
|
||||
--- ../bochs/gui/gui.h Sat Apr 20 09:19:35 2002
|
||||
+++ ./gui/gui.h Wed Aug 7 19:41:26 2002
|
||||
+++ ./gui/gui.h Thu Aug 8 00:14:02 2002
|
||||
@@ -83,6 +83,7 @@
|
||||
static void snapshot_handler(void);
|
||||
static void config_handler(void);
|
||||
@ -248,7 +292,7 @@ diff -urN ../bochs/gui/gui.h ./gui/gui.h
|
||||
// align pixmaps towards left or right side of header bar
|
||||
diff -urN ../bochs/gui/siminterface.h ./gui/siminterface.h
|
||||
--- ../bochs/gui/siminterface.h Sun Aug 4 10:42:34 2002
|
||||
+++ ./gui/siminterface.h Wed Aug 7 20:43:02 2002
|
||||
+++ ./gui/siminterface.h Thu Aug 8 00:27:51 2002
|
||||
@@ -158,6 +158,7 @@
|
||||
BXP_KEYBOARD_USEMAPPING,
|
||||
BXP_KEYBOARD_MAP,
|
||||
@ -257,9 +301,19 @@ diff -urN ../bochs/gui/siminterface.h ./gui/siminterface.h
|
||||
BXP_ASK_FOR_PATHNAME, // for general file selection dialog
|
||||
BXP_THIS_IS_THE_LAST // used to determine length of list
|
||||
} bx_id;
|
||||
@@ -173,7 +174,8 @@
|
||||
BX_TOOLBAR_PASTE,
|
||||
BX_TOOLBAR_SNAPSHOT,
|
||||
BX_TOOLBAR_CONFIG,
|
||||
- BX_TOOLBAR_MOUSE_EN
|
||||
+ BX_TOOLBAR_MOUSE_EN,
|
||||
+ BX_TOOLBAR_USER
|
||||
} bx_toolbar_buttons;
|
||||
|
||||
// Log level defines
|
||||
diff -urN ../bochs/gui/win32.cc ./gui/win32.cc
|
||||
--- ../bochs/gui/win32.cc Sat Apr 20 09:19:35 2002
|
||||
+++ ./gui/win32.cc Tue Aug 6 17:38:40 2002
|
||||
+++ ./gui/win32.cc Thu Aug 8 00:14:02 2002
|
||||
@@ -1019,6 +1019,7 @@
|
||||
|
||||
void bx_gui_c::show_headerbar(void) {
|
||||
@ -289,9 +343,65 @@ diff -urN ../bochs/gui/win32.cc ./gui/win32.cc
|
||||
DrawBitmap(MemoryDC, bx_headerbar_entry[i].bitmap, xorigin, 0, SRCCOPY, 0x7);
|
||||
}
|
||||
|
||||
diff -urN ../bochs/gui/wx.cc ./gui/wx.cc
|
||||
--- ../bochs/gui/wx.cc Sat Apr 20 09:19:35 2002
|
||||
+++ ./gui/wx.cc Thu Aug 8 09:31:24 2002
|
||||
@@ -612,6 +612,7 @@
|
||||
case BX_TOOLBAR_SNAPSHOT: snapshot_handler (); break;
|
||||
case BX_TOOLBAR_CONFIG: config_handler (); break;
|
||||
case BX_TOOLBAR_MOUSE_EN: toggle_mouse_enable (); break;
|
||||
+ case BX_TOOLBAR_USER: userbutton_handler (); break;
|
||||
default:
|
||||
wxLogDebug ("unknown toolbar id %d", event_queue[i].u.toolbar.button);
|
||||
}
|
||||
diff -urN ../bochs/gui/wxmain.cc ./gui/wxmain.cc
|
||||
--- ../bochs/gui/wxmain.cc Sat Jun 1 17:44:54 2002
|
||||
+++ ./gui/wxmain.cc Thu Aug 8 09:32:53 2002
|
||||
@@ -55,6 +55,7 @@
|
||||
#include "bitmaps/snapshot.xpm"
|
||||
#include "bitmaps/mouse.xpm"
|
||||
#include "bitmaps/configbutton.xpm"
|
||||
+#include "bitmaps/userbutton.xpm"
|
||||
|
||||
// FIXME: ugly global variables that the bx_gui_c object in wx.cc can use
|
||||
// to access the MyFrame and the MyPanel.
|
||||
@@ -96,7 +97,8 @@
|
||||
ID_Toolbar_Paste,
|
||||
ID_Toolbar_Snapshot,
|
||||
ID_Toolbar_Config,
|
||||
- ID_Toolbar_Mouse_en
|
||||
+ ID_Toolbar_Mouse_en,
|
||||
+ ID_Toolbar_User
|
||||
};
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
@@ -174,6 +176,7 @@
|
||||
EVT_TOOL(ID_Toolbar_Snapshot, MyFrame::OnToolbarClick)
|
||||
EVT_TOOL(ID_Toolbar_Config, MyFrame::OnToolbarClick)
|
||||
EVT_TOOL(ID_Toolbar_Mouse_en, MyFrame::OnToolbarClick)
|
||||
+ EVT_TOOL(ID_Toolbar_User, MyFrame::OnToolbarClick)
|
||||
END_EVENT_TABLE()
|
||||
|
||||
|
||||
@@ -253,6 +256,7 @@
|
||||
BX_ADD_TOOL(ID_Toolbar_Snapshot, snapshot_xpm, "Save screen snapshot");
|
||||
BX_ADD_TOOL(ID_Toolbar_Config, configbutton_xpm, "Runtime Configuration");
|
||||
BX_ADD_TOOL(ID_Toolbar_Mouse_en, mouse_xpm, "Mouse Enable/Disable");
|
||||
+ BX_ADD_TOOL(ID_Toolbar_User, userbutton_xpm, "Keyboard shortcut");
|
||||
|
||||
tb->Realize();
|
||||
|
||||
@@ -540,6 +544,7 @@
|
||||
case ID_Toolbar_Snapshot: which = BX_TOOLBAR_SNAPSHOT; break;
|
||||
case ID_Toolbar_Config: which = BX_TOOLBAR_CONFIG; break;
|
||||
case ID_Toolbar_Mouse_en: which = BX_TOOLBAR_MOUSE_EN; break;
|
||||
+ case ID_Toolbar_User: which = BX_TOOLBAR_USER; break;
|
||||
default:
|
||||
wxLogError ("unknown toolbar id %d", id);
|
||||
}
|
||||
diff -urN ../bochs/gui/x.cc ./gui/x.cc
|
||||
--- ../bochs/gui/x.cc Sat May 18 18:02:20 2002
|
||||
+++ ./gui/x.cc Tue Aug 6 17:38:40 2002
|
||||
+++ ./gui/x.cc Thu Aug 8 00:14:02 2002
|
||||
@@ -1245,15 +1245,23 @@
|
||||
bx_gui_c::show_headerbar(void)
|
||||
{
|
||||
@ -320,7 +430,7 @@ diff -urN ../bochs/gui/x.cc ./gui/x.cc
|
||||
xorigin, 0, 1);
|
||||
diff -urN ../bochs/main.cc ./main.cc
|
||||
--- ../bochs/main.cc Sun Aug 4 10:42:34 2002
|
||||
+++ ./main.cc Wed Aug 7 21:06:21 2002
|
||||
+++ ./main.cc Thu Aug 8 00:14:02 2002
|
||||
@@ -1023,6 +1023,12 @@
|
||||
bx_options.Okeyboard_type->set_format ("Keyboard type: %s");
|
||||
bx_options.Okeyboard_type->set_ask_format ("Enter keyboard type: [%s] ");
|
||||
|
Loading…
Reference in New Issue
Block a user