Main Page | Alphabetical List | Data Structures | Directories | File List | Data Fields | Globals

nanomud-about.c File Reference

#include <stdio.h>
#include <string.h>
#include <stdlib.h>
#include <time.h>
#include <windows.h>
#include <winsock.h>
#include <richedit.h>
#include "NanoMud.h"

Include dependency graph for nanomud-about.c:

Include dependency graph

Go to the source code of this file.

Functions

LRESULT CALLBACK AboutProcedure (HWND hwnd, UINT message, WPARAM wParam, LPARAM lParam)
void CreateAboutBox (void)
void FormatText (HWND hwnd)

Variables

char Copy_Right []
const char GNU_License_Char []
HFONT hf


Function Documentation

LRESULT CALLBACK AboutProcedure HWND  hwnd,
UINT  message,
WPARAM  wParam,
LPARAM  lParam
 

Definition at line 343 of file nanomud-about.c.

References Copy_Right, FormatText(), g_hInst, GNU_License_Char, ID_ABOUT_OK_BUTTON, and MudAbout.

Referenced by CreateAboutBox().

00344 {
00345     switch (message) 
00346     {
00347         case WM_CREATE:
00348         {
00349             HWND About_Ok_Button;
00350             HWND About_License_Edit;
00351             HWND About_About;
00352             RECT aboutrect;
00353             
00354             GetClientRect(MudAbout, &aboutrect);            
00355             About_License_Edit = CreateWindowEx(WS_EX_CLIENTEDGE, "RICHEDIT","",
00356                 WS_CHILD|WS_VISIBLE|WS_VSCROLL|ES_MULTILINE|ES_READONLY|ES_CENTER,0,200,600,200,hwnd, NULL,g_hInst,0);                
00357             ShowWindow(About_License_Edit,SW_SHOW);
00358             
00359             FormatText(About_License_Edit);
00360               int len= SendMessage(About_License_Edit,WM_GETTEXTLENGTH,0,0);
00361             SendMessage(About_License_Edit,EM_SETSEL,len,len);
00362             SendMessage(About_License_Edit,EM_REPLACESEL,strlen(GNU_License_Char),(LPARAM)(LPCSTR)GNU_License_Char);
00363             About_About = CreateWindowEx(WS_EX_CLIENTEDGE, "STATIC","",
00364                 WS_CHILD|SS_CENTER, 2,2, 596,196, hwnd,NULL, g_hInst,0);
00365             ShowWindow(About_About, SW_SHOW);
00366 
00367             
00368             About_Ok_Button = CreateWindowEx(WS_EX_CLIENTEDGE, "BUTTON", "",
00369                 BS_TEXT|WS_CHILD,  520,176,70,20,hwnd,(HMENU)ID_ABOUT_OK_BUTTON,g_hInst,0);
00370             SendMessage(About_Ok_Button, WM_SETTEXT, strlen("Ok"), (LPARAM)(LPCSTR)"Ok");
00371             ShowWindow(About_Ok_Button,SW_SHOW);            
00372             SendMessage(About_About, WM_SETTEXT, strlen(Copy_Right), (LPARAM)(LPCSTR)Copy_Right);
00373             
00374 
00375             
00376                         
00377         }
00378         break;
00379         case WM_COMMAND:
00380             switch(LOWORD(wParam))
00381             {
00382                 case ID_ABOUT_OK_BUTTON:
00383                     DestroyWindow(MudAbout);
00384                     break;
00385             }
00386             break;
00387        
00388         
00389         default:                
00390             return DefWindowProc (hwnd, message, wParam, lParam);
00391     }
00392 
00393     return 0;
00394 }

Here is the call graph for this function:

void CreateAboutBox void   ) 
 

Definition at line 327 of file nanomud-about.c.

References AboutProc, AboutProcedure(), g_hInst, GiveError(), and MudAbout.

Referenced by WindowProcedure().

00328 {
00329     if (IsWindow(MudAbout))
00330         return;
00331     MudAbout = CreateWindowEx(WS_EX_TOPMOST ,"About","NanoMud About", DS_3DLOOK |WS_POPUP  | WS_SYSMENU,
00332         200,200,600,400,0,0,g_hInst,0);
00333     AboutProc = (WNDPROC) SetWindowLong(MudAbout, GWL_WNDPROC, (LONG)AboutProcedure); 
00334     ShowWindow(MudAbout, SW_SHOW);
00335     if (!IsWindow(MudAbout))
00336     {
00337         GiveError("Unable to create about dialog box.",0);
00338         return;
00339     }
00340     return;
00341 }

Here is the call graph for this function:

void FormatText HWND  hwnd  ) 
 

Definition at line 395 of file nanomud-about.c.

Referenced by AboutProcedure(), CreditProcedure(), WindowProcedure(), and WinMain().

00396 {
00397         CHARFORMAT m;
00398                 
00399         
00400         m.cbSize = sizeof(CHARFORMAT);
00401         m.dwMask = CFM_BOLD | CFM_COLOR | CFM_FACE |
00402                 CFM_ITALIC | CFM_SIZE | CFM_UNDERLINE; 
00403     m.dwEffects = FW_NORMAL;
00404         m.yHeight = 190;
00405         m.crTextColor = RGB(0,0,0);
00406     strcpy(m.szFaceName, "Courier New");
00407 
00408         SendMessage(hwnd, EM_SETCHARFORMAT, SCF_SELECTION,
00409           (LPARAM) &m);
00410         
00411 }


Variable Documentation

char Copy_Right[]
 

Initial value:

"NanoMud Version 1.0\nCopyright 2003, Michael D. Hayes.\n"
"This program is free software; you can redistribute it and/or\n"
"modify it under the terms of the GNU General Public License\n"
"as published by the Free Software Foundation; either version 2\n"
"of the License, or (at your option) any later version.\n\n" 
"This program is distributed in the hope that it will be useful,\n"
"but WITHOUT ANY WARRANTY; without even the implied warranty of\n"
"MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n"
"GNU General Public License for more details.\n"

Definition at line 31 of file nanomud-about.c.

Referenced by AboutProcedure().

const char GNU_License_Char[]
 

Definition at line 41 of file nanomud-about.c.

Referenced by AboutProcedure().

HFONT hf
 

Definition at line 239 of file nanomud.h.

Referenced by ClearTerminal(), FlushBuffer(), term_test_2(), and WinMain().


Generated on Sat May 14 02:47:18 2005 for Nanomud by  doxygen 1.3.9.1