|
From: <ufo...@li...> - 2010-05-22 19:18:01
|
Revision: 1134
http://ufo2000.svn.sourceforge.net/ufo2000/?rev=1134&view=rev
Author: ssvb
Date: 2010-05-22 19:17:55 +0000 (Sat, 22 May 2010)
Log Message:
-----------
Function 'show_help' moved to text.cpp for future reuse.
From: Siarhei Siamashka <sia...@gm...>
Modified Paths:
--------------
trunk/src/server_gui.cpp
trunk/src/text.cpp
trunk/src/text.h
Modified: trunk/src/server_gui.cpp
===================================================================
--- trunk/src/server_gui.cpp 2010-05-22 17:52:30 UTC (rev 1133)
+++ trunk/src/server_gui.cpp 2010-05-22 19:17:55 UTC (rev 1134)
@@ -307,26 +307,6 @@
bool set_autologin_on = false;
-static void show_help(const char *text)
-{
- int w = SCREEN_W * 3 / 4;
- int h = SCREEN_H * 3 / 4;
- DIALOG help_dialog[] = {
- //(dialog proc) (x) (y) (w) (h) (fg)(bg) (key) (flags) (d1) (d2) (dp) (dp2) (dp3)
- { d_agup_shadow_box_proc, 0, 0, w, h, 0, 1, 0, 0, 0, 0, NULL, NULL, NULL },
- { d_agup_textbox_proc, 10, 10, w - 20, h - 40, 0, 1, 0, 0, 0, 0, (void *)text, NULL, NULL },
- { d_agup_button_proc, w - 70, h - 25, 60, 18, 0, 1, 13, D_EXIT, 0, 0, (void *)_("OK"), NULL, NULL },
- { d_yield_proc, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL, NULL, NULL},
- { NULL }
- };
- FONT *old_font = font;
- font = large;
- centre_dialog(help_dialog);
- set_dialog_color(help_dialog, COLOR_BLACK1, COLOR_WHITE);
- popup_dialog(help_dialog, 2);
- font = old_font;
-}
-
static int help_button_proc(
int msg, DIALOG *d, int c)
{
Modified: trunk/src/text.cpp
===================================================================
--- trunk/src/text.cpp 2010-05-22 17:52:30 UTC (rev 1133)
+++ trunk/src/text.cpp 2010-05-22 19:17:55 UTC (rev 1134)
@@ -1026,3 +1026,26 @@
}
END_OF_FUNCTION(help);
+/**
+ * Show a large dialog with formatted text. It is useful for showing help
+ * pages with long descriptions of something.
+ */
+void show_help(const char *text)
+{
+ int w = SCREEN_W * 3 / 4;
+ int h = SCREEN_H * 3 / 4;
+ DIALOG help_dialog[] = {
+ //(dialog proc) (x) (y) (w) (h) (fg)(bg) (key) (flags) (d1) (d2) (dp) (dp2) (dp3)
+ { d_agup_shadow_box_proc, 0, 0, w, h, 0, 1, 0, 0, 0, 0, NULL, NULL, NULL },
+ { d_agup_textbox_proc, 10, 10, w - 20, h - 40, 0, 1, 0, 0, 0, 0, (void *)text, NULL, NULL },
+ { d_agup_button_proc, w - 70, h - 25, 60, 18, 0, 1, 13, D_EXIT, 0, 0, (void *)_("OK"), NULL, NULL },
+ { d_yield_proc, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, NULL, NULL, NULL},
+ { NULL }
+ };
+ FONT *old_font = font;
+ font = large;
+ centre_dialog(help_dialog);
+ set_dialog_color(help_dialog, COLOR_BLACK1, COLOR_WHITE);
+ popup_dialog(help_dialog, 2);
+ font = old_font;
+}
Modified: trunk/src/text.h
===================================================================
--- trunk/src/text.h 2010-05-22 17:52:30 UTC (rev 1133)
+++ trunk/src/text.h 2010-05-22 19:17:55 UTC (rev 1134)
@@ -74,5 +74,8 @@
//! Simple help, using alert3().
void help( const int helppage );
+//! Show a large dialog with formatted text.
+void show_help(const char *text);
+
#endif
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|