From b6528969181b35c12496e96107ce7e5ebe141072 Mon Sep 17 00:00:00 2001 From: cebix <> Date: Sat, 26 May 2001 12:31:00 +0000 Subject: [PATCH] "About" window looks nicer --- BasiliskII/src/BeOS/Makefile | 2 +- BasiliskII/src/BeOS/about_window.cpp | 59 +++++++++++++++++++++++ BasiliskII/src/BeOS/about_window.h | 27 +++++++++++ BasiliskII/src/BeOS/prefs_editor_beos.cpp | 9 +--- BasiliskII/src/BeOS/video_beos.cpp | 9 +--- 5 files changed, 91 insertions(+), 15 deletions(-) create mode 100644 BasiliskII/src/BeOS/about_window.cpp create mode 100644 BasiliskII/src/BeOS/about_window.h diff --git a/BasiliskII/src/BeOS/Makefile b/BasiliskII/src/BeOS/Makefile index 15672c59..2d0f7acc 100644 --- a/BasiliskII/src/BeOS/Makefile +++ b/BasiliskII/src/BeOS/Makefile @@ -46,7 +46,7 @@ SRCS = ../main.cpp main_beos.cpp ../prefs.cpp ../prefs_items.cpp prefs_beos.cpp ../serial.cpp serial_beos.cpp ../ether.cpp ether_beos.cpp ../sony.cpp \ ../disk.cpp ../cdrom.cpp ../scsi.cpp scsi_beos.cpp ../video.cpp \ video_beos.cpp ../audio.cpp audio_beos.cpp ../extfs.cpp extfs_beos.cpp \ - ../user_strings.cpp user_strings_beos.cpp \ + ../user_strings.cpp user_strings_beos.cpp about_window.cpp \ $(CPUSRCS) # specify the resource files to use diff --git a/BasiliskII/src/BeOS/about_window.cpp b/BasiliskII/src/BeOS/about_window.cpp new file mode 100644 index 00000000..be00d710 --- /dev/null +++ b/BasiliskII/src/BeOS/about_window.cpp @@ -0,0 +1,59 @@ +/* + * about_window.cpp - "About" window + * + * Basilisk II (C) 1997-2001 Christian Bauer + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#include +#include + +#include "sysdeps.h" +#include "version.h" +#include "user_strings.h" + +/* + * Display "About" window + */ + +void ShowAboutWindow(void) +{ + char str[512]; + sprintf(str, + "Basilisk II\nVersion %d.%d\n\n" + "Copyright " B_UTF8_COPYRIGHT " 1997-2001 Christian Bauer et al.\n" + "E-mail: Christian.Bauer@uni-mainz.de\n" + "http://www.uni-mainz.de/~bauec002/B2Main.html\n\n" + "Basilisk II comes with ABSOLUTELY NO\n" + "WARRANTY. This is free software, and\n" + "you are welcome to redistribute it\n" + "under the terms of the GNU General\n" + "Public License.\n", + VERSION_MAJOR, VERSION_MINOR + ); + BAlert *about = new BAlert("", str, GetString(STR_OK_BUTTON), NULL, NULL, B_WIDTH_FROM_LABEL); + BTextView *theText = about->TextView(); + if (theText) { + theText->SetStylable(true); + theText->Select(0, 11); + BFont ourFont; + theText->SetFontAndColor(be_bold_font); + theText->GetFontAndColor(2, &ourFont, NULL); + ourFont.SetSize(24); + theText->SetFontAndColor(&ourFont); + } + about->Go(); +} diff --git a/BasiliskII/src/BeOS/about_window.h b/BasiliskII/src/BeOS/about_window.h new file mode 100644 index 00000000..4b5bdd73 --- /dev/null +++ b/BasiliskII/src/BeOS/about_window.h @@ -0,0 +1,27 @@ +/* + * about_window.h - "About" window + * + * Basilisk II (C) 1997-2001 Christian Bauer + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program; if not, write to the Free Software + * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + */ + +#ifndef ABOUT_WINDOW_H +#define ABOUT_WINDOW_H + +// Display "About" window +extern void ShowAboutWindow(void); + +#endif diff --git a/BasiliskII/src/BeOS/prefs_editor_beos.cpp b/BasiliskII/src/BeOS/prefs_editor_beos.cpp index 88ccab65..5c8c8085 100644 --- a/BasiliskII/src/BeOS/prefs_editor_beos.cpp +++ b/BasiliskII/src/BeOS/prefs_editor_beos.cpp @@ -33,7 +33,7 @@ #include "cdrom.h" #include "xpram.h" #include "prefs.h" -#include "version.h" +#include "about_window.h" #include "user_strings.h" #include "prefs_editor.h" @@ -767,12 +767,7 @@ void PrefsWindow::MessageReceived(BMessage *msg) break; case B_ABOUT_REQUESTED: { // "About" menu item selected - char str[256]; - sprintf(str, GetString(STR_ABOUT_TEXT1), VERSION_MAJOR, VERSION_MINOR); - strcat(str, " "); - strcat(str, GetString(STR_ABOUT_TEXT2)); - BAlert *about = new BAlert(GetString(STR_WINDOW_TITLE), str, GetString(STR_OK_BUTTON)); - about->Go(); + ShowAboutWindow(); break; } diff --git a/BasiliskII/src/BeOS/video_beos.cpp b/BasiliskII/src/BeOS/video_beos.cpp index cebd5ade..14917a3d 100644 --- a/BasiliskII/src/BeOS/video_beos.cpp +++ b/BasiliskII/src/BeOS/video_beos.cpp @@ -34,7 +34,7 @@ #include "adb.h" #include "prefs.h" #include "user_strings.h" -#include "version.h" +#include "about_window.h" #include "video.h" #include "m68k.h" @@ -619,12 +619,7 @@ void MacWindow::MessageReceived(BMessage *msg) } case MSG_ABOUT_REQUESTED: { - char str[256]; - sprintf(str, GetString(STR_ABOUT_TEXT1), VERSION_MAJOR, VERSION_MINOR); - strcat(str, " "); - strcat(str, GetString(STR_ABOUT_TEXT2)); - BAlert *about = new BAlert(GetString(STR_WINDOW_TITLE), str, GetString(STR_OK_BUTTON)); - about->Go(); + ShowAboutWindow(); break; }