Initial full mirror of c:\VWE (source + assets + toolchain + outputs) via Git LFS

Complete disaster-recovery snapshot: engine/game source, game data assets,
VC6 toolchain + DX SDKs, build outputs, deployed game, and _UNUSED archive.
Large binaries in Git LFS; text preserved byte-for-byte (core.autocrlf=false,
no eol attributes). See RECOVERY.md for the one-clone rebuild procedure.
This commit is contained in:
Cyd
2026-06-24 21:28:16 -05:00
commit 2b8ca921cb
66341 changed files with 7923174 additions and 0 deletions
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,227 @@
#include <GOSScript\GOSScriptHeaders.hpp>
#include <GameOS\ToolOS.hpp>
#include "FileDialog.hpp"
#include "PopUp.hpp"
#include <stdio.h>
#include <string.h>
char * GafToPlay = NULL;
char * dst;
char * last_dir[1024];
gosScript::FileDialog * fd = NULL;
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
void _stdcall InitializeGameEngine()
{
//
//---------------------------
// Start the Script Processor
//---------------------------
//
gosScript_InitializeProcessor();
dst = (char *) gos_Malloc(1024);
gosScript_RegisterVariable("GafToPlay",&GafToPlay,GOSVAR_STRING,0);
DWORD size = 1024;
strcpy((char *)last_dir, ".\\");
gos_LoadDataFromRegistry( "StartFolder", last_dir, &size );
}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
void _stdcall DoGameLogic()
{
//
// first, let the user select a file
//
char filename[1024];
char encoded_filename[1024];
fd = new gosScript::FileDialog("Select first bitmap in series","All Valid File Types",(char *)last_dir);
char * file = fd->Execute();
strcpy((char *)last_dir, fd->GetDirectory());
SPEW((0,"Filedialog returned '%s'",file));
SPEW((0,"The Directory was '%s'",last_dir));
if (file == NULL || !strlen(file))
{
//
// if nothing is selected (they pressed cancel), terminate
//
delete fd;
fd = NULL;
gos_TerminateApplication();
return;
}
else
{
//
// a file was selected, process the file name to find out more info about it....
//
strcpy(filename, file);
strcpy(dst, file);
// count the number of digits!
int digit_count = 1;
bool is_zero = false;
char * tmp = &dst[strlen(filename)];
while(tmp != dst && !(*tmp >= '0' && *tmp <= '9')) tmp--;
if (tmp == dst)
{
// do a modal error...
// but for now, stop
STOP(("That's a bad filename!"));
}
if (*tmp == '0')
is_zero = true;
tmp--;
while(tmp != dst && *tmp >= '0' && *tmp <= '9')
{
digit_count++;
if (*tmp == '0')
is_zero = true;
tmp--;
}
tmp++;
if (is_zero && digit_count > 1)
{
// enumeration uses leading zeros!
char enc[10];
strncpy(encoded_filename, filename, tmp-dst);
strncpy(dst, filename, tmp-dst);
dst[tmp-dst] = 0;
encoded_filename[tmp-dst] = 0;
sprintf(enc,"%s%d%s","%0",digit_count,"d");
strcat(encoded_filename,enc);
strcat(encoded_filename,tmp+digit_count);
}
else
{
// enumeration doesn't use leading zeros!
char enc[10];
strncpy(encoded_filename, filename, tmp-dst);
strncpy(dst, filename, tmp-dst);
dst[tmp-dst] = 0;
encoded_filename[tmp-dst] = 0;
sprintf(enc,"%s","%d");
strcat(encoded_filename,enc);
strcat(encoded_filename,tmp+digit_count);
}
strcat(dst,".gaf");
//
// then, gaf the puppy up! alpha channels are detected automatically
//
int ret = gosScript_BuildGAFResource(encoded_filename,dst,gosGAF_DeltaFromFirst);
//
// release the instance of the file dialog!
//
delete fd;
fd = NULL;
switch(ret)
{
case 0: // no error
GafToPlay = dst;
break;
case -1: // odd width!
gosScript::PopUp * pu = new gosScript::PopUp("GafCompressor", "Bad Source File: Width must be divisible by 2.");
pu->Execute();
delete pu;
if (GafToPlay)
{
gos_Free(GafToPlay);
}
GafToPlay = NULL;
break;
}
}
}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
void _stdcall UpdateDisplay()
{
// nothing to do!
}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
void _stdcall TerminateGameEngine()
{
//
//--------------------------
// Stop the Script Processor
//--------------------------
//
if (fd)
{
delete fd;
fd = NULL;
}
gos_SaveDataToRegistry( "StartFolder", (void *)&last_dir[0], strlen((char *)last_dir) );
gos_Free(dst);
gosScript_ShutdownProcessor();
}
//~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
//
void _stdcall GetGameOSEnvironment(char* CommandLine)
{
CommandLine = CommandLine;
Environment.applicationName = "GAF Compressor";
Environment.screenWidth = 640;
Environment.screenHeight = 480;
Environment.fullScreen = false;
Environment.bitDepth = 16;
Environment.debugLog = "";
Environment.spew = "GameOS_GAF";
Environment.memoryTraceLevel = 5;
Environment.TimeStampSpew = false;
Environment.UpdateRenderers = UpdateDisplay;
Environment.DoGameLogic = DoGameLogic;
Environment.InitializeGameEngine = InitializeGameEngine;
Environment.TerminateGameEngine = TerminateGameEngine;
Environment.soundChannels = 16;
Environment.Renderer = 0;
Environment.FullScreenDevice = 0;
Environment.AntiAlias = 0; // true/false - Enable full screen antialiasing
//
// Texture infomation
//
Environment.Texture_S_256 = 16;
Environment.Texture_S_128 = 16;
Environment.Texture_S_64 = 16;
Environment.Texture_S_32 = 32;
Environment.Texture_S_16 = 16;
Environment.Texture_K_256 = 1;
Environment.Texture_K_128 = 1;
Environment.Texture_K_64 = 0;
Environment.Texture_K_32 = 0;
Environment.Texture_K_16 = 0;
Environment.Texture_A_256 = 8;
Environment.Texture_A_128 = 8;
Environment.Texture_A_64 = 8;
Environment.Texture_A_32 = 8;
Environment.Texture_A_16 = 0;
}
@@ -0,0 +1,349 @@
# Microsoft Developer Studio Project File - Name="GafCompressor" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Application" 0x0101
CFG=GafCompressor - Win32 Debug
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!MESSAGE
!MESSAGE NMAKE /f "GafCompressor.mak".
!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "GafCompressor.mak" CFG="GafCompressor - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "GafCompressor - Win32 Release" (based on "Win32 (x86) Application")
!MESSAGE "GafCompressor - Win32 Profile" (based on "Win32 (x86) Application")
!MESSAGE "GafCompressor - Win32 Armor" (based on "Win32 (x86) Application")
!MESSAGE "GafCompressor - Win32 Debug" (based on "Win32 (x86) Application")
!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
CPP=cl.exe
MTL=midl.exe
RSC=rc.exe
!IF "$(CFG)" == "GafCompressor - Win32 Release"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "Release"
# PROP BASE Intermediate_Dir "Release"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "../../../rel.bin"
# PROP Intermediate_Dir "Release"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
# ADD CPP /nologo /G6 /Zp4 /MD /W4 /GR /Zi /Ox /Ot /Oa /Og /Oi /Gf /Gy /I "..\..\Libraries" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386
# ADD LINK32 /nologo /subsystem:windows /debug /machine:I386 /fixed:no
# SUBTRACT LINK32 /pdb:none
!ELSEIF "$(CFG)" == "GafCompressor - Win32 Profile"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "Profile"
# PROP BASE Intermediate_Dir "Profile"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "../../../pro.bin"
# PROP Intermediate_Dir "Profile"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
# ADD CPP /nologo /G6 /Zp4 /MD /W4 /GR /Zi /Ox /Ot /Oa /Og /Oi /Gf /Gy /I "..\..\Libraries" /D "PROFILE" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "LAB_ONLY" /YX /FD /c
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386
# ADD LINK32 /nologo /subsystem:windows /debug /machine:I386 /fixed:no
# SUBTRACT LINK32 /pdb:none
!ELSEIF "$(CFG)" == "GafCompressor - Win32 Armor"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "Armor"
# PROP BASE Intermediate_Dir "Armor"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "../../../arm.bin"
# PROP Intermediate_Dir "Armor"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /YX /FD /c
# ADD CPP /nologo /G6 /Zp4 /MD /W4 /GR /Zi /Ox /Ot /Oa /Og /Oi /Gf /Gy /I "..\..\Libraries" /D "_ARMOR" /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "LAB_ONLY" /YX /FD /c
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /o "NUL" /win32
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386
# ADD LINK32 /nologo /subsystem:windows /debug /machine:I386 /fixed:no
# SUBTRACT LINK32 /pdb:none
!ELSEIF "$(CFG)" == "GafCompressor - Win32 Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "Debug"
# PROP BASE Intermediate_Dir "Debug"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "../../../dbg.bin"
# PROP Intermediate_Dir "Debug"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /GX /Zi /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /YX /FD /c
# ADD CPP /nologo /G6 /Zp4 /MDd /W4 /GR /Zi /Od /I "..\..\Libraries" /D "_DEBUG" /D "_ARMOR" /D "LAB_ONLY" /D "NDEBUG" /D "MULTI_PLAYER" /D "STRICT" /D TEST_CLASS=50 /D "_WINDOWS" /D "WIN32" /D "USE_PROTOTYPES" /YX /FD /c
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /o "NUL" /win32
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /d "_DEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
# ADD LINK32 /nologo /subsystem:windows /debug /machine:I386 /fixed:no
# SUBTRACT LINK32 /pdb:none /map
!ENDIF
# Begin Target
# Name "GafCompressor - Win32 Release"
# Name "GafCompressor - Win32 Profile"
# Name "GafCompressor - Win32 Armor"
# Name "GafCompressor - Win32 Debug"
# Begin Group "Assets"
# PROP Default_Filter ""
# Begin Group "Graphics"
# PROP Default_Filter ""
# Begin Source File
SOURCE=.\Assets\Graphics\arial8.tga
# End Source File
# Begin Source File
SOURCE=.\Assets\Graphics\cancel.tga
# End Source File
# Begin Source File
SOURCE=.\Assets\Graphics\checkbox_false_free.tga
# End Source File
# Begin Source File
SOURCE=.\Assets\Graphics\down_arrow_free.tga
# End Source File
# Begin Source File
SOURCE=.\Assets\Graphics\down_arrow_pressed.tga
# End Source File
# Begin Source File
SOURCE=.\Assets\Graphics\fileattr.tga
# End Source File
# Begin Source File
SOURCE=.\Assets\Graphics\filedialog.png
# End Source File
# Begin Source File
SOURCE=.\Assets\Graphics\filenames.tga
# End Source File
# Begin Source File
SOURCE=.\Assets\Graphics\folder.tga
# End Source File
# Begin Source File
SOURCE=.\Assets\Graphics\font.tga
# End Source File
# Begin Source File
SOURCE=.\Assets\Graphics\Gos_0000.jpg
# End Source File
# Begin Source File
SOURCE=.\Assets\Graphics\l_arrow.tga
# End Source File
# Begin Source File
SOURCE=.\Assets\Graphics\l_arrow_free.tga
# End Source File
# Begin Source File
SOURCE=.\Assets\Graphics\l_arrow_pressed.tga
# End Source File
# Begin Source File
SOURCE=.\Assets\Graphics\mouse_pointer.gaf
# End Source File
# Begin Source File
SOURCE=.\Assets\Graphics\mouse_pointer00.tga
# End Source File
# Begin Source File
SOURCE=.\Assets\Graphics\mouse_pointer01.tga
# End Source File
# Begin Source File
SOURCE=.\Assets\Graphics\mouse_pointer02.tga
# End Source File
# Begin Source File
SOURCE=.\Assets\Graphics\mouse_pointer03.tga
# End Source File
# Begin Source File
SOURCE=.\Assets\Graphics\mouse_pointer04.tga
# End Source File
# Begin Source File
SOURCE=.\Assets\Graphics\mouse_pointer05.tga
# End Source File
# Begin Source File
SOURCE=.\Assets\Graphics\mouse_pointer06.tga
# End Source File
# Begin Source File
SOURCE=.\Assets\Graphics\mouse_pointer07.tga
# End Source File
# Begin Source File
SOURCE=.\Assets\Graphics\mouse_pointer08.tga
# End Source File
# Begin Source File
SOURCE=.\Assets\Graphics\mouse_pointer09.tga
# End Source File
# Begin Source File
SOURCE=.\Assets\Graphics\mouse_pointer10.tga
# End Source File
# Begin Source File
SOURCE=.\Assets\Graphics\mouse_pointer11.tga
# End Source File
# Begin Source File
SOURCE=.\Assets\Graphics\mouse_pointer12.tga
# End Source File
# Begin Source File
SOURCE=.\Assets\Graphics\newfolder.tga
# End Source File
# Begin Source File
SOURCE=.\Assets\Graphics\okay.tga
# End Source File
# Begin Source File
SOURCE=.\Assets\Graphics\r_arrow.tga
# End Source File
# Begin Source File
SOURCE=.\Assets\Graphics\r_arrow_free.tga
# End Source File
# Begin Source File
SOURCE=.\Assets\Graphics\r_arrow_pressed.tga
# End Source File
# Begin Source File
SOURCE=.\Assets\Graphics\scrollbar_horiz.tga
# End Source File
# Begin Source File
SOURCE=.\Assets\Graphics\updir.tga
# End Source File
# End Group
# Begin Group "Sounds"
# PROP Default_Filter ""
# End Group
# Begin Group "Scripts"
# PROP Default_Filter ""
# Begin Source File
SOURCE=.\Assets\Scripts\filedialog.script
# End Source File
# Begin Source File
SOURCE=.\Assets\Scripts\PopUp.script
# End Source File
# Begin Source File
SOURCE=.\Assets\Scripts\std_button.script
# End Source File
# Begin Source File
SOURCE=.\Assets\Scripts\std_checkbox.script
# End Source File
# Begin Source File
SOURCE=.\Assets\Scripts\std_cursor.script
# End Source File
# Begin Source File
SOURCE=.\Assets\Scripts\std_dropdown.script
# End Source File
# End Group
# End Group
# Begin Source File
SOURCE=.\filedialog.cpp
# End Source File
# Begin Source File
SOURCE=.\filedialog.hpp
# End Source File
# Begin Source File
SOURCE=".\GafCompressor.cpp"
# End Source File
# Begin Source File
SOURCE=.\PopUp.cpp
# End Source File
# Begin Source File
SOURCE=.\PopUp.hpp
# End Source File
# End Target
# End Project
@@ -0,0 +1,77 @@
Microsoft Developer Studio Workspace File, Format Version 6.00
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
###############################################################################
Project: "GOSScript"=..\..\Libraries\GOSScript\GOSScript.dsp - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
###############################################################################
Project: "GafCompressor"=.\GafCompressor.dsp - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
Begin Project Dependency
Project_Dep_Name GameOS
End Project Dependency
Begin Project Dependency
Project_Dep_Name GOSPlatform
End Project Dependency
Begin Project Dependency
Project_Dep_Name GOSScript
End Project Dependency
Begin Project Dependency
Project_Dep_Name GamePlatform
End Project Dependency
}}}
###############################################################################
Project: "GameOS"=..\..\Libraries\GameOS\GameOS.dsp - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
###############################################################################
Project: "GamePlatform"=..\..\Libraries\GamePlatform\GamePlatform.dsp - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
###############################################################################
Global:
Package=<5>
{{{
}}}
Package=<3>
{{{
}}}
###############################################################################
@@ -0,0 +1,36 @@
#include <GOSScript\GOSScriptHeaders.hpp>
#include <GameOS\ToolOS.hpp>
#include "PopUp.hpp"
#include <string.h>
namespace gosScript
{
PopUp::PopUp(char * boxtitle,char * msg)
{
m_boxtitle = (char *)gos_Malloc(strlen(boxtitle)+1);
m_boxtitle[0] = 0;
strcpy(m_boxtitle,boxtitle);
m_message = (char *)gos_Malloc(strlen(msg)+1);
m_message[0] = 0;
strcpy(m_message,msg);
gosScript_RegisterVariable("boxtitle",&m_boxtitle,GOSVAR_STRING,0, NULL);
gosScript_RegisterVariable("boxmessage",&m_message,GOSVAR_STRING,0, NULL);
}
PopUp::~PopUp()
{
gosScript_UnregisterVariable("boxtitle");
gosScript_UnregisterVariable("boxmessage");
gos_Free(m_boxtitle);
gos_Free(m_message);
}
void PopUp::Execute()
{
gosScript_ExecuteScript("assets\\scripts\\popup.script",0x2000,NULL);
}
} // namespace gosScript
@@ -0,0 +1,15 @@
namespace gosScript
{
class PopUp
{
public:
char * m_message;
char * m_boxtitle;
PopUp(char * title, char * msg);
~PopUp();
void Execute();
};
};
@@ -0,0 +1,377 @@
#include <GOSScript\GOSScriptHeaders.hpp>
#include <GameOS\ToolOS.hpp>
#include "FileDialog.hpp"
#include <string.h>
#include <stdlib.h>
namespace gosScript
{
char * FileDialog::src_dir = 0;
char * FileDialog::search_string = 0;
char * FileDialog::dialog_name = 0;
char * FileDialog::indicated_file = 0;
char * FileDialog::full_path = 0;
char * FileDialog::this_dir = 0;
const char * FileDialog::valid_drives = 0;
int FileDialog::selected_drive = 0;
int FileDialog::number_files = 0;
int FileDialog::number_drives = 0;
int FileDialog::number_directories = 0;
int FileDialog::max_filename_length = 256;
char ** FileDialog::filenames = 0;
char ** FileDialog::drivenames = 0;
int FileDialog::lit = -1;
int FileDialog::hscroll_pos = 0;
FileDialog::FileDialog(char * name, char * search, char * dir)
{
name = name;
dialog_name = (char *) gos_Malloc(256);
search_string = (char *) gos_Malloc(256);
strcpy(search_string,search);
strcpy(dialog_name,"Pick Images");
src_dir = (char *) gos_Malloc(256);
this_dir = (char *) gos_Malloc(256);
indicated_file = 0;
full_path = (char *) gos_Malloc(256);
src_dir[0] = '.';
src_dir[1] = '\\';
src_dir[2] = 0;
strcpy(src_dir,dir);
filenames = NULL;
drivenames = NULL;
lit = -1;
// *indicated_file=0;
hscroll_pos = 0;
gosScript_RegisterVariable("selected_drive",&selected_drive,GOSVAR_INT,0, NULL);
gosScript_RegisterVariable("lit",&lit,GOSVAR_INT,0, NULL);
gosScript_RegisterVariable("search_string",&search_string,GOSVAR_STRING,0, NULL);
gosScript_RegisterVariable("dialog_name",&dialog_name,GOSVAR_STRING,0, NULL);
gosScript_RegisterVariable("hscroll_pos",&hscroll_pos,GOSVAR_INT,0, NULL);
gosScript_RegisterVariable("indicated_file",&indicated_file,GOSVAR_STRING,0, NULL);
gosScript_RegisterVariable("valid_drives",&filenames,GOSVAR_STRING,26, NULL);
gosScript_RegisterVariable("drivenames",&drivenames,GOSVAR_STRING,32, NULL);
gosScript_RegisterVariable("filenames",&filenames,GOSVAR_STRING,1024, NULL);
gosScript_RegisterVariable("src_dir",&src_dir,GOSVAR_STRING,0, NULL);
gosScript_RegisterVariable("this_dir",&this_dir,GOSVAR_STRING,0, NULL);
gosScript_RegisterCallback("ChangeDrive",&ChangeDrive,GOSVAR_INT,0, NULL);
gosScript_RegisterCallback("InitializeFileDialog",&InitializeFileDialog,GOSVAR_INT,0, NULL);
gosScript_RegisterCallback("ReceivedFileFromDialog",&ReceivedFileFromDialog,GOSVAR_INT,0, NULL);
gosScript_RegisterVariable("number_files",&number_files,GOSVAR_INT,0, NULL);
gosScript_RegisterVariable("number_drives",&number_drives,GOSVAR_INT,0, NULL);
gosScript_RegisterVariable("number_directories",&number_directories,GOSVAR_INT,0, NULL);
gosScript_RegisterVariable("max_filename_length",&max_filename_length,GOSVAR_INT,0, NULL);
}
FileDialog::~FileDialog()
{
gosScript_UnregisterVariable("selected_drive");
gosScript_UnregisterVariable("lit");
gosScript_UnregisterVariable("search_string");
gosScript_UnregisterVariable("dialog_name");
gosScript_UnregisterVariable("hscroll_pos");
gosScript_UnregisterVariable("indicated_file");
gosScript_UnregisterVariable("valid_drives");
gosScript_UnregisterVariable("drivenames");
gosScript_UnregisterVariable("filenames");
gosScript_UnregisterVariable("src_dir");
gosScript_UnregisterVariable("this_dir");
gosScript_UnregisterVariable("ChangeDrive");
gosScript_UnregisterVariable("InitializeFileDialog");
gosScript_UnregisterVariable("receivedFileFromDialog");
gosScript_UnregisterVariable("number_files");
gosScript_UnregisterVariable("number_drives");
gosScript_UnregisterVariable("number_directories");
gosScript_UnregisterVariable("max_filename_length");
gos_Free(dialog_name);
gos_Free(search_string);
gos_Free(src_dir);
gos_Free(this_dir);
if( indicated_file )
gos_Free(indicated_file);
gos_Free(full_path);
if (filenames)
{
for(int i=0; i < number_files; i++)
{
gos_Free((char *)filenames[i]);
}
gos_Free(filenames);
}
if (drivenames)
{
for(int i=0; i < number_drives; i++)
{
gos_Free((char *)drivenames[i]);
}
gos_Free(drivenames);
}
}
char * FileDialog::Execute()
{
gosScript_ExecuteScript("assets\\scripts\\filedialog.script",0x2000,0);
if (indicated_file == 0 || !strlen(indicated_file))
return 0;
else
{
strcpy(full_path,src_dir);
strcat(full_path,indicated_file);
return full_path;
}
}
int _stdcall FileDialog::InitializeFileDialog(void * instance, int, void *[])
{
instance = instance;
if (filenames)
{
for(int i=0; i < number_files; i++)
{
gos_Free((char *)filenames[i]);
}
gos_Free(filenames);
}
filenames = (char **) gos_Malloc(1024*sizeof(char *));
if (drivenames)
{
for(int i=0; i < number_drives; i++)
{
gos_Free((char *)drivenames[i]);
}
gos_Free(drivenames);
}
char drives[256];
number_drives = gos_GetValidDrives( drives, 256 ) / 4;
drivenames = (char **) gos_Malloc(sizeof(char *) * number_drives);
for(int i=0; i < number_drives; i++)
{
drivenames[i] = (char *) gos_Malloc(sizeof(char) * 4);
strcpy(drivenames[i],&drives[i*4]);
}
char cur_dir[256];
strcpy(cur_dir,src_dir);
strcat(cur_dir,"*.*");
number_files = number_directories = 0;
char * tmp = gos_FindDirectories(cur_dir);
gos_GetFullPathName(src_dir,src_dir);
// strip all but last directory
char * handy = &src_dir[strlen(src_dir)-2];
while(handy != src_dir)
{
if (*handy != '\\')
handy--;
else
{
handy++;
break;
}
}
strcpy(this_dir,handy);
if (this_dir[strlen(this_dir)-1] == '\\')
this_dir[strlen(this_dir)-1] = 0;
SPEW((0,"this_dir = %s",this_dir));
if (src_dir[strlen(src_dir)-1] !='\\')
{
strcat(src_dir,"\\");
}
while (tmp)
{
filenames[number_files] = (char *) gos_Malloc(strlen(tmp)+1);
strcpy(filenames[number_files],tmp);
number_files++;
number_directories++;
tmp = gos_FindDirectoriesNext();
}
gos_FindDirectoriesClose();
qsort( filenames, number_files, sizeof(char *), SortString );
if (strcmp(search_string, "All Valid File Types") != 0)
{
//
// do user's file filter
//
strcpy(cur_dir,src_dir);
strcat(cur_dir,search_string);
tmp = gos_FindFiles(cur_dir);
while (tmp)
{
filenames[number_files] = (char *) gos_Malloc(strlen(tmp)+1);
strcpy(filenames[number_files],tmp);
number_files++;
tmp = gos_FindFilesNext();
}
gos_FindFilesClose();
}
else
{
//
// do .bmp's
//
strcpy(cur_dir,src_dir);
strcat(cur_dir,"*.bmp");
tmp = gos_FindFiles(cur_dir);
while (tmp)
{
filenames[number_files] = (char *) gos_Malloc(strlen(tmp)+1);
strcpy(filenames[number_files],tmp);
number_files++;
tmp = gos_FindFilesNext();
}
gos_FindFilesClose();
//
// do .tga's
//
strcpy(cur_dir,src_dir);
strcat(cur_dir,"*.tga");
tmp = gos_FindFiles(cur_dir);
while (tmp)
{
filenames[number_files] = (char *) gos_Malloc(strlen(tmp)+1);
strcpy(filenames[number_files],tmp);
number_files++;
tmp = gos_FindFilesNext();
}
gos_FindFilesClose();
//
// do .png's
//
strcpy(cur_dir,src_dir);
strcat(cur_dir,"*.png");
tmp = gos_FindFiles(cur_dir);
while (tmp)
{
filenames[number_files] = (char *) gos_Malloc(strlen(tmp)+1);
strcpy(filenames[number_files],tmp);
number_files++;
tmp = gos_FindFilesNext();
}
gos_FindFilesClose();
//
// do .jpg's
//
strcpy(cur_dir,src_dir);
strcat(cur_dir,"*.jpg");
tmp = gos_FindFiles(cur_dir);
while (tmp)
{
filenames[number_files] = (char *) gos_Malloc(strlen(tmp)+1);
strcpy(filenames[number_files],tmp);
number_files++;
tmp = gos_FindFilesNext();
}
gos_FindFilesClose();
}
qsort( &filenames[number_directories], number_files-number_directories, sizeof(char *), SortString );
// what drive are we currently on?
for(i=0; i < number_drives; i++)
{
if (strnicmp(drivenames[i], cur_dir,3) == 0)
{
selected_drive = i;
break;
}
}
return true;
}
int _stdcall FileDialog::ReceivedFileFromDialog(void * instance, int, void *[])
{
instance = instance;
if (lit == -10)
{
if (src_dir[strlen(src_dir)-1] != '\\')
strcat(src_dir,"\\");
strcat(src_dir,"..");// change directories
strcat(src_dir,"\\");
lit = -1;
return 0;
}
if (lit > -1 && lit < number_directories)
{
if (src_dir[strlen(src_dir)-1] != '\\')
strcat(src_dir,"\\");
strcat(src_dir,indicated_file);// change directories
strcat(src_dir,"\\");
lit = -1;
return 0;
}
else
{
if (strrchr(indicated_file,'*'))
{
strcpy(search_string,indicated_file);
InitializeFileDialog(NULL,0,NULL);
return 0;
}
SPEW((0,"TIME TO LOAD \"%s%s\"",src_dir, indicated_file));
char tmp[1024];
strcpy(tmp,src_dir);
strcat(tmp,indicated_file);
if (!gos_DoesFileExist(tmp))
{
// no file by that name!
return 0;
}
else
{
// load the file!
return 1;
}
}
}
//-----------------------------------------
// Compare two strings for ascending order
//-----------------------------------------
int FileDialog::SortString( const void* arg1, const void *arg2 )
{
char * str1 =(char *) ((int *)arg1)[0];
char * str2 =(char *) ((int *)arg2)[0];
return stricmp(str1,str2);
}
char * FileDialog::GetDirectory()
{
return FileDialog::src_dir;
}
int _stdcall FileDialog::ChangeDrive(void * instance, int, void *[])
{
strcpy(src_dir,drivenames[selected_drive]);
InitializeFileDialog(instance,0,NULL);
return 1;
}
}
@@ -0,0 +1,45 @@
namespace gosScript
{
class FileDialog
{
public:
static char * src_dir;
static char * search_string;
static char * dialog_name;
static char * indicated_file;
static char * full_path;
static char * this_dir;
static const char * valid_drives;
static int number_files;
static int number_drives;
static int number_directories;
static int max_filename_length;
static char ** filenames;
static char ** drivenames;
static int selected_drive;
static int lit;
static int hscroll_pos;
public:
FileDialog(char * name, char * search, char * dir);
~FileDialog();
char * Execute();
Shutdown();
//////////////////////
// helpers & callbacks
//////////////////////
static int _stdcall InitializeFileDialog(void * instance, int, void *[]);
static int _stdcall ReceivedFileFromDialog(void * instance, int, void *[]);
static int SortString( const void* arg1, const void *arg2 );
static char * GetDirectory();
static int _stdcall FileDialog::ChangeDrive(void * instance, int, void *[]);
};
};
@@ -0,0 +1,105 @@
# Microsoft Developer Studio Project File - Name="Gos2Light" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Application" 0x0101
CFG=Gos2Light - Win32 Debug
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!MESSAGE
!MESSAGE NMAKE /f "Gos2Light.mak".
!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "Gos2Light.mak" CFG="Gos2Light - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "Gos2Light - Win32 Release" (based on "Win32 (x86) Application")
!MESSAGE "Gos2Light - Win32 Debug" (based on "Win32 (x86) Application")
!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
CPP=cl.exe
MTL=midl.exe
RSC=rc.exe
!IF "$(CFG)" == "Gos2Light - Win32 Release"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "Release"
# PROP BASE Intermediate_Dir "Release"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "../../../rel.bin"
# PROP Intermediate_Dir "Release"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c
# ADD CPP /nologo /G6 /Gz /Zp4 /MD /W3 /GX /O2 /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "UNICODE" /D "_UNICODE" /YX /FD /c
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /d "NDEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386
!ELSEIF "$(CFG)" == "Gos2Light - Win32 Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "Debug"
# PROP BASE Intermediate_Dir "Debug"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "../../../dbg.bin"
# PROP Intermediate_Dir "Debug"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /GZ /c
# ADD CPP /nologo /G6 /Gz /Zp4 /MDd /W3 /Gm /GX /ZI /Od /I "..\..\Libraries" /I "..\..\..\CoreTech\Libraries" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "_MBCS" /D "UNICODE" /D "_UNICODE" /YX /FD /GZ /c
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /i "..\..\Libraries\Gos2" /d "_DEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib d3d8.lib d3dx8.lib dinput8.lib dxguid.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
!ENDIF
# Begin Target
# Name "Gos2Light - Win32 Release"
# Name "Gos2Light - Win32 Debug"
# Begin Group "Source Files"
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
# Begin Source File
SOURCE=.\Light.cpp
# End Source File
# End Group
# Begin Group "Header Files"
# PROP Default_Filter "h;hpp;hxx;hm;inl"
# End Group
# Begin Group "Resource Files"
# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
# End Group
# End Target
# End Project
@@ -0,0 +1,44 @@
Microsoft Developer Studio Workspace File, Format Version 6.00
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
###############################################################################
Project: "Gos2"=..\..\Libraries\Gos2\Gos2.dsp - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
###############################################################################
Project: "Gos2Light"=.\Gos2Light.dsp - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
Begin Project Dependency
Project_Dep_Name Gos2
End Project Dependency
}}}
###############################################################################
Global:
Package=<5>
{{{
}}}
Package=<3>
{{{
}}}
###############################################################################
@@ -0,0 +1,171 @@
#include <Gos2\Gos.h>
#include "d3dx8.h"
static const vertPairs = 50;
struct MyVertex // the kind of vertex this app uses
{
D3DXVECTOR3 position;
D3DXVECTOR3 normal;
float u,v;
enum { VertexType = D3DFVF_XYZ | D3DFVF_NORMAL | D3DFVF_TEX1 };
};
class LightApp : public GosApp
{
public:
// Functions which the app must provide
virtual bool Initialize( _TCHAR *pCommandLine ); // Initialize the application's state
virtual void Render(); // Render a single frame
virtual bool Step(); // Move the scene forward one frame
virtual void Shutdown(); // Called at game shutdown time
virtual TCHAR *Name(); // Name of the game
virtual void PreferredDisplay( int &Windowed, unsigned int &Width, unsigned int &Height, D3DFORMAT &Format );
// The following is specific to this app
D3DMATERIAL8 m_Material;
D3DLIGHT8 m_Light;
D3DXMATRIX m_WorldMatrix;
D3DXMATRIX m_ViewMatrix;
D3DXMATRIX m_ProjectionMatrix;
MyVertex m_aVertex[vertPairs*2];
GosTexture * m_pTexture;
GosVertexBuffer*m_pVertexBuffer;
GosSurface * m_pCursorImage;
DWORD m_bgColor;
};
LightApp myApp; // *The* Application
void LightApp::PreferredDisplay( int &Windowed, unsigned int &Width, unsigned int &Height, D3DFORMAT &Format )
{
#if 0
Windowed = false;
#else
Windowed = true;
#endif
Width = 640;
Height = 480;
}
bool LightApp::Initialize( _TCHAR *pCommandLine )
{
// Set up a material to use
D3DCOLORVALUE yellow = { 1.f, 1.f, 0.f, 1.f };
ZeroMemory( &m_Material, sizeof(m_Material) );
m_Material.Diffuse = yellow;
m_Material.Ambient = yellow;
// Set up a directional light
D3DCOLORVALUE white = { 1.f, 1.f, 1.f, 1.f };
ZeroMemory( &m_Light, sizeof(m_Light) );
m_Light.Type = D3DLIGHT_DIRECTIONAL;
m_Light.Diffuse = white;
m_Light.Range = 1000.f;
// Initialize matrices ( m_WorldMatrix is set each frame )
D3DXMatrixLookAtLH( &m_ViewMatrix, &D3DXVECTOR3( 0.f, 3.f, -5.f ),
&D3DXVECTOR3( 0.f, 0.f, 0.f ), &D3DXVECTOR3( 0.f, 1.f, 0.f ) );
D3DXMatrixPerspectiveFovLH( &m_ProjectionMatrix, D3DX_PI/4, 1.f, 1.f, 100.f );
// Initialize the vertices
for( int pair = 0; pair < vertPairs; pair++ )
{
float sinVal = sinf(( 2.f * D3DX_PI * pair ) / ( vertPairs - 1 ));
float cosVal = cosf(( 2.f * D3DX_PI * pair ) / ( vertPairs - 1 ));
m_aVertex[pair*2].position = D3DXVECTOR3( sinVal, -1.f, cosVal );
m_aVertex[pair*2].normal = D3DXVECTOR3( sinVal, 0, cosVal );
m_aVertex[pair*2].u = (float)pair / (float)(vertPairs-1);
m_aVertex[pair*2].v = 0.f;
m_aVertex[pair*2+1].position = D3DXVECTOR3( sinVal, 1.f, cosVal );
m_aVertex[pair*2+1].normal = D3DXVECTOR3( sinVal, 0, cosVal );
m_aVertex[pair*2+1].u = (float)pair / (float)(vertPairs-1);
m_aVertex[pair*2+1].v = 1.f;
}
// Create a vertex buffer
m_pVertexBuffer = GosVertexBuffer::CreateFromMemory(m_aVertex,sizeof(m_aVertex),MyVertex::VertexType,0);
// Load a texture from a disk file
m_pTexture = GosTexture::CreateFromFile( _T("assets\\Graphics\\wall.bmp") );
// Set up an image for a cursor
m_pCursorImage = GosSurface::CreateEmpty(64,64,D3DFMT_A8R8G8B8);
m_pCursorImage->LoadFromFile( _T("assets\\Graphics\\ActivePointer.TGA") );
Gos3D::SetCursorProperties( 0, 0, m_pCursorImage );
Gos3D::ShowCursor( true );
return true; // true means the initialize succeeded
}
bool LightApp::Step()
{
float rotation = GosUtil::Time_mS() / 300.f;
// Set the light direction & world rotation
m_Light.Direction.x = sinf(rotation);
m_Light.Direction.z = cosf(rotation);
D3DXMatrixIdentity( &m_WorldMatrix );
D3DXMatrixRotationX( &m_WorldMatrix, rotation );
// Gos3D::SetCursorPosition( (int)(sinf(rotation*2) * 300.f + 350.f), (int)(cosf(rotation) * 300.f + 350.f), 0 );
long x,y;
DWORD buttons;
GosUser::GetStatus( &buttons, &x, &y );
Gos3D::SetCursorPosition( (x*Gos3D::Width())>>16, (y*Gos3D::Height())>>16, 0 );
m_bgColor = 0;
m_bgColor |= ( ( buttons >> 0 ) & 0x000f ) << 4;
m_bgColor |= ( ( buttons >> 4 ) & 0x000f ) << 12;
m_bgColor |= ( ( buttons >> 8 ) & 0x000f ) << 20;
return true; // true means keep going
}
void LightApp::Render()
{
// Clear the background to blue and begin the scene
Gos3D::Clear( 0, NULL, D3DCLEAR_TARGET|D3DCLEAR_ZBUFFER, m_bgColor, 1.0f, 0L );
Gos3D::BeginScene();
// Set material, lighting, and rendering conditions
Gos3D::SetMaterial( &m_Material );
Gos3D::SetLight( 0, &m_Light );
Gos3D::LightEnable( 0, true );
Gos3D::SetRenderState( D3DRS_LIGHTING, true );
Gos3D::SetRenderState( D3DRS_AMBIENT, 0x00202020 );
Gos3D::SetRenderState( D3DRS_CULLMODE, D3DCULL_NONE );
Gos3D::SetRenderState( D3DRS_ZENABLE, true );
// Set texturing
Gos3D::SetTexture( 0, m_pTexture );
Gos3D::SetTextureStageState( 0, D3DTSS_MAGFILTER, D3DTEXF_LINEAR );
// Set matrices
Gos3D::SetTransform( D3DTS_VIEW, &m_ViewMatrix );
Gos3D::SetTransform( D3DTS_WORLD, &m_WorldMatrix );
Gos3D::SetTransform( D3DTS_PROJECTION, &m_ProjectionMatrix );
// Draw the object
Gos3D::SetFVFShader( MyVertex.VertexType );
// Gos3D::DrawPrimitiveUP( D3DPT_TRIANGLESTRIP, 2*vertPairs-2, (void *)m_aVertex, sizeof(MyVertex) );
Gos3D::SetStreamSource(0,m_pVertexBuffer,sizeof(MyVertex));
Gos3D::DrawPrimitive(D3DPT_TRIANGLESTRIP,0,2*vertPairs-2);
// Done rendering, end the scene
Gos3D::EndScene();
}
void LightApp::Shutdown()
{
delete m_pTexture;
delete m_pVertexBuffer;
delete m_pCursorImage;
}
TCHAR *LightApp::Name()
{
return _T("Light Application");
}
Binary file not shown.
@@ -0,0 +1,105 @@
# Microsoft Developer Studio Project File - Name="Gos2Text" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Application" 0x0101
CFG=Gos2Text - Win32 Debug
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!MESSAGE
!MESSAGE NMAKE /f "Gos2Text.mak".
!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "Gos2Text.mak" CFG="Gos2Text - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "Gos2Text - Win32 Release" (based on "Win32 (x86) Application")
!MESSAGE "Gos2Text - Win32 Debug" (based on "Win32 (x86) Application")
!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
CPP=cl.exe
MTL=midl.exe
RSC=rc.exe
!IF "$(CFG)" == "Gos2Text - Win32 Release"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "Release"
# PROP BASE Intermediate_Dir "Release"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "../../../rel.bin"
# PROP Intermediate_Dir "Release"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /c
# ADD CPP /nologo /G6 /Gz /Zp4 /MD /W3 /GX /O2 /D "NDEBUG" /D "WIN32" /D "_WINDOWS" /D "UNICODE" /D "_UNICODE" /YX /FD /c
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x409 /d "NDEBUG"
# ADD RSC /l 0x409 /i "..\..\Libraries\Gos2" /d "NDEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /machine:I386
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib d3d8.lib d3dx8.lib dinput8.lib dxguid.lib /nologo /subsystem:windows /machine:I386
!ELSEIF "$(CFG)" == "Gos2Text - Win32 Debug"
# PROP BASE Use_MFC 0
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "Debug"
# PROP BASE Intermediate_Dir "Debug"
# PROP BASE Target_Dir ""
# PROP Use_MFC 0
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "../../../dbg.bin"
# PROP Intermediate_Dir "Debug"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_MBCS" /YX /FD /GZ /c
# ADD CPP /nologo /G6 /Gz /Zp4 /MDd /W3 /Gm /GX /ZI /Od /I "..\..\Libraries" /I "..\..\..\CoreTech\Libraries" /D "_DEBUG" /D "WIN32" /D "_WINDOWS" /D "UNICODE" /D "_UNICODE" /YX /FD /GZ /c
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x409 /d "_DEBUG"
# ADD RSC /l 0x409 /i "..\..\Libraries\Gos2" /d "_DEBUG"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib d3d8.lib d3dx8.lib dinput8.lib dxguid.lib /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
!ENDIF
# Begin Target
# Name "Gos2Text - Win32 Release"
# Name "Gos2Text - Win32 Debug"
# Begin Group "Source Files"
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
# Begin Source File
SOURCE=.\Text.cpp
# End Source File
# End Group
# Begin Group "Header Files"
# PROP Default_Filter "h;hpp;hxx;hm;inl"
# End Group
# Begin Group "Resource Files"
# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
# End Group
# End Target
# End Project
@@ -0,0 +1,44 @@
Microsoft Developer Studio Workspace File, Format Version 6.00
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
###############################################################################
Project: "Gos2"=..\..\Libraries\Gos2\Gos2.dsp - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
###############################################################################
Project: "Gos2Text"=.\Gos2Text.dsp - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
Begin Project Dependency
Project_Dep_Name Gos2
End Project Dependency
}}}
###############################################################################
Global:
Package=<5>
{{{
}}}
Package=<3>
{{{
}}}
###############################################################################
@@ -0,0 +1,292 @@
#include <Gos2\Gos.h>
#include "d3dx8.h"
_TCHAR *sz_1 = _T("Non-wrapping text scrolled using XPosition");
_TCHAR *sz_2TL = _T("Top/Left alignment");
_TCHAR *sz_2CC = _T("Center/Center alignment");
_TCHAR *sz_2BR = _T("Bottom/Right alignment");
_TCHAR *sz_R = _T("Text follows region");
_TCHAR *sz_B = _T("A long string that is top aligned and will be bottom clipped as it exceeds the bounds");
_TCHAR *sz_G = _T("Scaling up and down");
class TextApp : public GosApp
{
public:
// Functions which the app must provide
virtual bool Initialize( _TCHAR *pCommandLine ); // Initialize the application's state
virtual void Render(); // Render a single frame
virtual bool Step(); // Move the scene forward one frame
virtual void Shutdown(); // Called at game shutdown time
virtual TCHAR *Name(); // Name of the game
virtual void PreferredDisplay( int &Windowed, unsigned int &Width, unsigned int &Height, D3DFORMAT &Format );
// The following is specific to this app
DWORD m_bgColor;
GosFont3D * m_pOneFont;
GosFont3D * m_pTwoFont;
GosFont3D * m_pRedFont;
GosFont3D * m_pBluFont;
GosFont3D * m_pGrnFont;
GosHeap * m_pDefHeap;
int m_OneFontX;
int m_OneFontY;
int m_TwoFontX;
int m_TwoFontY;
int m_RedFontX;
int m_RedFontY;
int m_BluFontX;
int m_BluFontY;
int m_GrnFontX;
int m_GrnFontY;
RECT m_OneRect;
RECT m_TwoRect;
RECT m_RedRect;
RECT m_BluRect;
RECT m_GrnRect;
DWORD m_OneFG;
DWORD m_TwoFG;
DWORD m_RedFG;
DWORD m_BluFG;
DWORD m_GrnFG;
DWORD m_OneBG;
DWORD m_TwoBG;
DWORD m_RedBG;
DWORD m_BluBG;
DWORD m_GrnBG;
DWORD m_OneAlign;
DWORD m_TwoAlign;
DWORD m_RedAlign;
DWORD m_BluAlign;
DWORD m_GrnAlign;
float m_GrnScale;
DWORD m_RedY;
DWORD m_OneWidth;
DWORD m_OneHeight;
};
TextApp myApp; // *The* Application
void TextApp::PreferredDisplay( int &Windowed, unsigned int &Width, unsigned int &Height, D3DFORMAT &Format )
{
#if 0
Windowed = false;
#else
Windowed = true;
#endif
Width = 640;
Height = 480;
}
bool TextApp::Initialize( _TCHAR *pCommandLine )
{
//create a heap
m_pDefHeap = GosHeap::Create(_T("DefHeap"),64000000);
GosHeap::PushCurrent(m_pDefHeap);
m_pOneFont = GosFont3D::CreateFromFile( _T("assets\\graphics\\arial black.ttf"), 0 );
m_pTwoFont = GosFont3D::CreateFromFile( _T("assets\\graphics\\comic.d3f"), 0 );
m_pRedFont = GosFont3D::CreateFromFile( _T("assets\\graphics\\Courier New.ttf"), 0 );
m_pBluFont = GosFont3D::CreateFromFile( _T("assets\\graphics\\times new roman.ttf"), 0 );
m_pGrnFont = GosFont3D::CreateFromFile( _T("assets\\graphics\\treb.d3f"), 0 );
m_OneFontX = 0;
m_OneFontY = 0;
m_TwoFontX = 0;
m_TwoFontY = 0;
m_RedFontX = 0;
m_RedFontY = 0;
m_BluFontX = 0;
m_BluFontY = 0;
m_GrnFontX = 0;
m_GrnFontY = 0;
m_OneFG = 0xffffff00;
m_TwoFG = 0xff00ffff;
m_RedFG = 0xffff0000;
m_BluFG = 0xff8080ff;
m_GrnFG = 0xff00ff00;
m_OneBG = 0x80f0f000;
m_TwoBG = 0x80008080;
m_RedBG = 0x80800000;
m_BluBG = 0x80000080;
m_GrnBG = 0x80008000;
m_OneRect.left = 20;
m_OneRect.right = 620;
m_OneRect.top = 20;
m_OneRect.bottom = 60;
m_TwoRect.left = 330;
m_TwoRect.right = 620;
m_TwoRect.top = 80;
m_TwoRect.bottom = 460;
m_RedRect.left = 20;
m_RedRect.right = 310;
m_RedRect.top = 220;
m_RedRect.bottom = 260;
m_BluRect.left = 20;
m_BluRect.right = 310;
m_BluRect.top = 80;
m_BluRect.bottom = 200;
m_GrnRect.left = 20;
m_GrnRect.right = 310;
m_GrnRect.top = 340;
m_GrnRect.bottom = 460;
m_OneAlign = 0x00010002;
m_RedAlign = 0x00010001;
m_BluAlign = 0x00000000;
m_GrnAlign = 0x00010002;
m_bgColor = 0xff000000;
GosText::Set(GosText::Size,1.f);
GosText::SetAttributes( m_pOneFont, m_OneFG, -24, false, true, true, false, m_OneAlign);
GosText::StringLength( &m_OneWidth, &m_OneHeight, sz_1 );
GosText::Set(GosText::Size,1.f);
m_GrnScale = .5f;
m_RedY = m_RedRect.top;
return true; // true means the initialize succeeded
}
bool TextApp::Step()
{
static long lastTime = GosUtil::Time_mS();
long time = GosUtil::Time_mS();
if( time-lastTime > 50 )
{
static float scaleStep = .5f;
static int yStep = 2;
m_GrnScale += scaleStep;
if( m_GrnScale > 2.f )
{
m_GrnScale = 2.f;
scaleStep = -.1f;
}
else if( m_GrnScale < .5f )
{
m_GrnScale = .5f;
scaleStep = .1f;
}
m_RedY += yStep;
if( m_RedY >= 300 )
{
yStep = -2;
}
else if( m_RedY <= 200 )
{
yStep = 2;
}
m_RedRect.top = m_RedY;
m_RedRect.bottom = m_RedY+40;
m_OneFontX -=4;
if((-(int)m_OneFontX) > (m_OneRect.right - m_OneRect.left))
m_OneFontX = m_OneWidth;
lastTime = time;
}
return true; // true means keep going
}
void TextApp::Render()
{
float savedSize;
// Clear the background to blue and begin the scene
Gos3D::Clear( 0, NULL, D3DCLEAR_TARGET|D3DCLEAR_ZBUFFER, m_bgColor, 1.0f, 0L );
Gos3D::BeginScene();
GosText::SetRegion( m_OneRect.left, m_OneRect.top, m_OneRect.right, m_OneRect.bottom);
GosText::DrawBackground(0,0,1000,1000,m_OneBG);
GosText::Get(GosText::Size,&savedSize);
GosText::Set(GosText::Position, m_OneFontX, m_OneFontY);
GosText::SetAttributes( m_pOneFont, m_OneFG, -24, false, false, false, false, m_OneAlign);
GosText::Draw(sz_1);
GosText::Set(GosText::Size,savedSize);
GosText::SetRegion( m_TwoRect.left, m_TwoRect.top, m_TwoRect.right, m_TwoRect.bottom);
GosText::DrawBackground(0,0,1000,1000,m_TwoBG);
GosText::Get(GosText::Size,&savedSize);
GosText::Set(GosText::Position, m_TwoFontX, m_TwoFontX);
GosText::SetAttributes( m_pTwoFont, m_TwoFG, -18, true, true, true, false, 0x00000000);
GosText::Draw(sz_2TL);
GosText::Set(GosText::Alignment, 0x00010001);
GosText::Draw(sz_2CC);
GosText::Set(GosText::Alignment, 0x00020002);
GosText::Draw(sz_2BR);
GosText::Set(GosText::Size,savedSize);
GosText::SetRegion( m_RedRect.left, m_RedRect.top, m_RedRect.right, m_RedRect.bottom);
GosText::DrawBackground(0,0,1000,1000,m_RedBG);
GosText::Get(GosText::Size,&savedSize);
GosText::Set(GosText::Position, m_RedFontX, m_RedFontY);
GosText::SetAttributes( m_pRedFont, m_RedFG, -18, true, true, true, false, m_RedAlign);
GosText::Draw(sz_R);
GosText::Set(GosText::Size,savedSize);
GosText::SetRegion( m_BluRect.left, m_BluRect.top, m_BluRect.right, m_BluRect.bottom);
GosText::DrawBackground(0,0,1000,1000,m_BluBG);
GosText::Get(GosText::Size,&savedSize);
GosText::Set(GosText::Position, m_BluFontX, m_BluFontY);
GosText::SetAttributes( m_pBluFont, m_BluFG, -24, true, true, true, false, m_BluAlign);
GosText::Draw(sz_B);
GosText::Set(GosText::Size,savedSize);
GosText::SetRegion( m_GrnRect.left, m_GrnRect.top, m_GrnRect.right, m_GrnRect.bottom);
GosText::DrawBackground(0,0,1000,1000,m_GrnBG);
GosText::Get(GosText::Size,&savedSize);
GosText::Set(GosText::Position, m_GrnFontX, m_GrnFontY);
GosText::SetAttributes( m_pGrnFont, m_GrnFG, m_GrnScale, true, true, true, false, m_GrnAlign);
GosText::Draw(sz_G);
GosText::Set(GosText::Size,savedSize);
// Done rendering, end the scene
Gos3D::EndScene();
}
void TextApp::Shutdown()
{
if(m_pOneFont)
delete m_pOneFont;
if(m_pTwoFont)
delete m_pTwoFont;
if(m_pRedFont)
delete m_pRedFont;
if(m_pBluFont)
delete m_pBluFont;
if(m_pGrnFont)
delete m_pGrnFont;
}
TCHAR *TextApp::Name()
{
return _T("Text Application");
}
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,79 @@
// ChildFrm.cpp : implementation of the CChildFrame class
//
#include "stdafx.h"
#include "GosView.h"
#include "ChildFrm.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CChildFrame
IMPLEMENT_DYNCREATE(CChildFrame, CMDIChildWnd)
BEGIN_MESSAGE_MAP(CChildFrame, CMDIChildWnd)
//{{AFX_MSG_MAP(CChildFrame)
// NOTE - the ClassWizard will add and remove mapping macros here.
// DO NOT EDIT what you see in these blocks of generated code !
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CChildFrame construction/destruction
CChildFrame::CChildFrame()
{
// TODO: add member initialization code here
}
CChildFrame::~CChildFrame()
{
}
BOOL CChildFrame::OnCreateClient( LPCREATESTRUCT /*lpcs*/,
CCreateContext* pContext)
{
return m_wndSplitter.Create( this,
2, 2, // TODO: adjust the number of rows, columns
CSize( 10, 10 ), // TODO: adjust the minimum pane size
pContext );
}
BOOL CChildFrame::PreCreateWindow(CREATESTRUCT& cs)
{
// TODO: Modify the Window class or styles here by modifying
// the CREATESTRUCT cs
if( !CMDIChildWnd::PreCreateWindow(cs) )
return FALSE;
return TRUE;
}
/////////////////////////////////////////////////////////////////////////////
// CChildFrame diagnostics
#ifdef _DEBUG
void CChildFrame::AssertValid() const
{
CMDIChildWnd::AssertValid();
}
void CChildFrame::Dump(CDumpContext& dc) const
{
CMDIChildWnd::Dump(dc);
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CChildFrame message handlers
@@ -0,0 +1,57 @@
// ChildFrm.h : interface of the CChildFrame class
//
/////////////////////////////////////////////////////////////////////////////
#if !defined(AFX_CHILDFRM_H__C60F119E_A4C3_447A_A2E5_A62CE4772719__INCLUDED_)
#define AFX_CHILDFRM_H__C60F119E_A4C3_447A_A2E5_A62CE4772719__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
class CChildFrame : public CMDIChildWnd
{
DECLARE_DYNCREATE(CChildFrame)
public:
CChildFrame();
// Attributes
protected:
CSplitterWnd m_wndSplitter;
public:
// Operations
public:
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CChildFrame)
public:
virtual BOOL OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext);
virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
//}}AFX_VIRTUAL
// Implementation
public:
virtual ~CChildFrame();
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
// Generated message map functions
protected:
//{{AFX_MSG(CChildFrame)
// NOTE - the ClassWizard will add and remove member functions here.
// DO NOT EDIT what you see in these blocks of generated code!
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_CHILDFRM_H__C60F119E_A4C3_447A_A2E5_A62CE4772719__INCLUDED_)
@@ -0,0 +1,193 @@
// GosEventIdPane.cpp : implementation file
//
#include "stdafx.h"
#include "gosview.h"
#include "GosEventIdPane.h"
#include "GosViewDoc.h"
#include "TimeFrame.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CGosEventIdPane
IMPLEMENT_DYNCREATE(CGosEventIdPane, CView)
CGosEventIdPane::CGosEventIdPane()
{
}
CGosEventIdPane::~CGosEventIdPane()
{
}
BEGIN_MESSAGE_MAP(CGosEventIdPane, CView)
//{{AFX_MSG_MAP(CGosEventIdPane)
ON_WM_ERASEBKGND()
ON_WM_VSCROLL()
ON_WM_LBUTTONDOWN()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CGosEventIdPane drawing
void CGosEventIdPane::OnDraw(CDC* pDC)
{
CGosViewDoc *pDoc = (CGosViewDoc *)GetDocument();
CTimeFrame *pFrame = m_pParentFrame;
CTimeFrame::TagNode *pNode;
SCROLLINFO si;
GetScrollBarCtrl(SB_VERT)->GetScrollInfo( &si, SIF_ALL );
int topRow = si.nPos;
int numRows = si.nPage;
if( pDoc->m_pFont )
pDC->SelectObject( pDoc->m_pFont );
else
pDC->SelectStockObject( ANSI_FIXED_FONT );
TEXTMETRIC tm;
pDC->GetTextMetrics(&tm);
pDC->SelectStockObject( BLACK_PEN );
pDC->SelectStockObject( NULL_BRUSH );
pDC->SetBkMode( TRANSPARENT );
for( DWORD id = pFrame->m_FirstID; id; id = pNode->idNextEnabled )
{
pNode = pFrame->AnyIDToTag(id);
if( !pNode->independent )
continue;
if( pNode->onScreen )
{
char *pName = pFrame->AnyIDToName(pNode->id);
if( m_pParentFrame->m_fFullNames )
{
pDC->TextOut( pNode->indent * 10 + 15, pNode->screenY - ( tm.tmHeight >> 1 ), pName );
}
else
{
char *pNameStart = pName;
for( char *ptr = pName; *ptr; ptr++ )
{
if( *ptr == '\\' )
pNameStart = ptr;
if( ( ptr[0] == ':' ) && ( ptr[1] == ':' ) )
pNameStart = ptr;
}
pDC->TextOut( pNode->indent * 10 + 15, pNode->screenY - ( tm.tmHeight >> 1 ), pNameStart );
}
if( pNode->idChild )
{
int x = pNode->indent * 10 + 8;
int y = pNode->screenY;
// draw a box
pDC->Rectangle( x-5, y-5, x+6, y+6 );
if( pNode->expand )
{
// draw a '-' symbol
pDC->MoveTo( x-3, y );
pDC->LineTo( x+4, y );
}
else
{
// draw a '+' symbol
pDC->MoveTo( x-3, y );
pDC->LineTo( x+4, y );
pDC->MoveTo( x, y-3 );
pDC->LineTo( x, y+4 );
}
}
}
}
pDC->SelectStockObject( ANSI_FIXED_FONT );
}
/////////////////////////////////////////////////////////////////////////////
// CGosEventIdPane diagnostics
#ifdef _DEBUG
void CGosEventIdPane::AssertValid() const
{
CView::AssertValid();
}
void CGosEventIdPane::Dump(CDumpContext& dc) const
{
CView::Dump(dc);
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CGosEventIdPane message handlers
BOOL CGosEventIdPane::OnEraseBkgnd(CDC* pDC)
{
// TODO: Add your message handler code here and/or call default
return CGosEventPane::OnEraseBkgnd(pDC);
}
void CGosEventIdPane::OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar)
{
// TODO: Add your message handler code here and/or call default
CGosEventPane::OnVScroll(nSBCode, nPos, pScrollBar);
// Invalidate();
}
void CGosEventIdPane::OnUpdate(CView* pSender, LPARAM lHint, CObject* pHint)
{
Invalidate(true);
}
void CGosEventIdPane::OnLButtonDown(UINT nFlags, CPoint point)
{
// just see if we clicked in/near the '+/-' expand box
CGosViewDoc *pDoc = (CGosViewDoc *)GetDocument();
CTimeFrame *pFrame = m_pParentFrame;
CTimeFrame::TagNode *pNode;
for( DWORD id = pFrame->m_FirstID; id; id = pNode->idNextEnabled )
{
pNode = pFrame->AnyIDToTag(id);
if( !pNode->idChild || !pNode->onScreen )
continue;
if( ( point.y < pNode->screenY - 6 ) ||
( point.y > pNode->screenY + 6 ) ||
( point.x < pNode->indent * 10 + 8 - 6 ) ||
( point.x > pNode->indent * 10 + 8 + 6 ) )
continue;
pNode->expand = !pNode->expand;
break;
}
if( id )
{
// we expanded/contracted something
pFrame->AnalyzeTagNodes();
pDoc->UpdateAllViews(NULL,0,NULL);
}
}
@@ -0,0 +1,59 @@
#if !defined(AFX_GOSEVENTIDPANE_H__A1627A57_BFA4_4AA3_8102_46D6DBA87773__INCLUDED_)
#define AFX_GOSEVENTIDPANE_H__A1627A57_BFA4_4AA3_8102_46D6DBA87773__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// GosEventIdPane.h : header file
//
#include "GosEventPane.h"
/////////////////////////////////////////////////////////////////////////////
// CGosEventIdPane view
class CGosEventIdPane : public CGosEventPane
{
protected:
CGosEventIdPane(); // protected constructor used by dynamic creation
DECLARE_DYNCREATE(CGosEventIdPane)
// Attributes
public:
// Operations
public:
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CGosEventIdPane)
protected:
virtual void OnDraw(CDC* pDC); // overridden to draw this view
virtual void OnUpdate(CView* pSender, LPARAM lHint, CObject* pHint);
//}}AFX_VIRTUAL
// Implementation
protected:
virtual ~CGosEventIdPane();
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
// Generated message map functions
protected:
//{{AFX_MSG(CGosEventIdPane)
afx_msg BOOL OnEraseBkgnd(CDC* pDC);
afx_msg void OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_GOSEVENTIDPANE_H__A1627A57_BFA4_4AA3_8102_46D6DBA87773__INCLUDED_)
@@ -0,0 +1,154 @@
// GosEventPane.cpp : implementation file
//
#include "stdafx.h"
#include "GosView.h"
#include "GosEventPane.h"
#include "GosViewDoc.h"
#include "TimeFrame.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
char CGosEventPane::dbgmsg[4][256];
CView *CGosEventPane::pDebugView = NULL;
/////////////////////////////////////////////////////////////////////////////
// CGosEventPane
IMPLEMENT_DYNCREATE(CGosEventPane, CView)
CGosEventPane::CGosEventPane()
{
m_fReady = false;
for(int i=0; i<4; i++ )
dbgmsg[i][0] = '\0';
}
CGosEventPane::~CGosEventPane()
{
}
BEGIN_MESSAGE_MAP(CGosEventPane, CView)
//{{AFX_MSG_MAP(CGosEventPane)
ON_WM_ERASEBKGND()
ON_WM_VSCROLL()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CGosEventPane drawing
void CGosEventPane::OnDraw(CDC* pDC)
{
CGosViewDoc* pDoc = (CGosViewDoc *)GetDocument();
// TODO: add draw code here
SCROLLINFO si;
GetScrollBarCtrl(SB_VERT)->GetScrollInfo( &si, SIF_ALL );
int topRow = si.nPos;
int numRows = si.nPage;
int i;
for( i=0; i<4; i++ )
{
pDC->TextOut( 0, i*20, dbgmsg[i] );
}
pDebugView = this;
// TODO: add draw code here
/*
for( int i=0; i<numRows; i++ )
{
// char *pName = pDoc->m_EventTree.EventName(i+topRow);
pDC->SetBkMode( TRANSPARENT );
pDC->TextOut( 0, i * m_pParentFrame->m_nRowHeight, "test" );
}
*/
/* for( int i=0; i<numRows; i++ )
{
char *pName = pDoc->m_EventTree.EventName(i+topRow);
pDC->SetBkMode( TRANSPARENT );
pDC->TextOut( 0, i * m_pParentFrame->m_nRowHeight, pName );
}
*/
}
/////////////////////////////////////////////////////////////////////////////
// CGosEventPane diagnostics
#ifdef _DEBUG
void CGosEventPane::AssertValid() const
{
CView::AssertValid();
}
void CGosEventPane::Dump(CDumpContext& dc) const
{
CView::Dump(dc);
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CGosEventPane message handlers
BOOL CGosEventPane::OnEraseBkgnd(CDC* pDC)
{
if( !m_fReady )
return FALSE;
SCROLLINFO si;
GetScrollBarCtrl(SB_VERT)->GetScrollInfo( &si, SIF_ALL );
int topRow = si.nPos;
int numRows = si.nPage;
RECT rect;
GetClientRect(&rect);
int row;
for( row=0; row<numRows ; row++ )
{
int bandMod = ( si.nPos + row ) % m_pParentFrame->m_nNumBandColors;
rect.top = (int)((double)row * m_pParentFrame->m_rRowHeight);
rect.bottom = rect.top + (int)(m_pParentFrame->m_rRowHeight + 1.0);
pDC->FillRect( &rect, &m_pParentFrame->m_pBandColor[bandMod] );
}
return TRUE;
}
void CGosEventPane::OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar)
{
//CView::OnVScroll(nSBCode, nPos, pScrollBar);
SetScrollPos( SB_VERT, m_pParentFrame->m_VScrollPos );
Invalidate();
}
BOOL CGosEventPane::Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CCreateContext* pContext)
{
m_pParentFrame = (CTimeFrame *)(pContext->m_pCurrentFrame);
BOOL rc = CWnd::Create(lpszClassName, lpszWindowName, dwStyle, rect, pParentWnd, nID, pContext);
m_fReady = true;
return rc;
}
void CGosEventPane::OnUpdate(CView* pSender, LPARAM lHint, CObject* pHint)
{
// TODO: Add your specialized code here and/or call the base class
Invalidate(true);
}
@@ -0,0 +1,66 @@
#if !defined(AFX_GOSEVENTPANE_H__66ACA559_4F3A_4DFA_BA96_450265188EA9__INCLUDED_)
#define AFX_GOSEVENTPANE_H__66ACA559_4F3A_4DFA_BA96_450265188EA9__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// GosEventPane.h : header file
class CTimeFrame;
//
/////////////////////////////////////////////////////////////////////////////
// CGosEventPane view
class CGosEventPane : public CView
{
protected:
CGosEventPane(); // protected constructor used by dynamic creation
DECLARE_DYNCREATE(CGosEventPane)
// Attributes
public:
CTimeFrame *m_pParentFrame;
bool m_fReady;
static char dbgmsg[4][256];
static CView *pDebugView;
static void SetDbgMsg(int msgno, char *msg ) { strcpy( dbgmsg[msgno], msg ); if( pDebugView ) pDebugView->Invalidate(); }
// Operations
public:
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CGosEventPane)
public:
virtual BOOL Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CCreateContext* pContext = NULL);
protected:
virtual void OnDraw(CDC* pDC); // overridden to draw this view
virtual void OnUpdate(CView* pSender, LPARAM lHint, CObject* pHint);
//}}AFX_VIRTUAL
// Implementation
protected:
virtual ~CGosEventPane();
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
// Generated message map functions
protected:
//{{AFX_MSG(CGosEventPane)
afx_msg BOOL OnEraseBkgnd(CDC* pDC);
afx_msg void OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_GOSEVENTPANE_H__66ACA559_4F3A_4DFA_BA96_450265188EA9__INCLUDED_)
@@ -0,0 +1,104 @@
// GosEventView.cpp : implementation of the CGosEventView class
//
#include "stdafx.h"
#include "GosView.h"
#include "GosViewDoc.h"
#include "GosEventView.h"
#include "TimeFrame.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CGosEventView
IMPLEMENT_DYNCREATE(CGosEventView, CView)
BEGIN_MESSAGE_MAP(CGosEventView, CView)
//{{AFX_MSG_MAP(CGosEventView)
// NOTE - the ClassWizard will add and remove mapping macros here.
// DO NOT EDIT what you see in these blocks of generated code!
//}}AFX_MSG_MAP
// Standard printing commands
ON_COMMAND(ID_FILE_PRINT, CView::OnFilePrint)
ON_COMMAND(ID_FILE_PRINT_DIRECT, CView::OnFilePrint)
ON_COMMAND(ID_FILE_PRINT_PREVIEW, CView::OnFilePrintPreview)
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CGosEventView construction/destruction
CGosEventView::CGosEventView()
{
}
CGosEventView::~CGosEventView()
{
}
BOOL CGosEventView::PreCreateWindow(CREATESTRUCT& cs)
{
// TODO: Modify the Window class or styles here by modifying
// the CREATESTRUCT cs
return CView::PreCreateWindow(cs);
}
/////////////////////////////////////////////////////////////////////////////
// CGosEventView drawing
void CGosEventView::OnDraw(CDC* pDC)
{
CGosViewDoc* pDoc = GetDocument();
ASSERT_VALID(pDoc);
// TODO: add draw code for native data here
}
/////////////////////////////////////////////////////////////////////////////
// CGosEventView printing
BOOL CGosEventView::OnPreparePrinting(CPrintInfo* pInfo)
{
// default preparation
return DoPreparePrinting(pInfo);
}
void CGosEventView::OnBeginPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
// TODO: add extra initialization before printing
}
void CGosEventView::OnEndPrinting(CDC* /*pDC*/, CPrintInfo* /*pInfo*/)
{
// TODO: add cleanup after printing
}
/////////////////////////////////////////////////////////////////////////////
// CGosEventView diagnostics
#ifdef _DEBUG
void CGosEventView::AssertValid() const
{
CView::AssertValid();
}
void CGosEventView::Dump(CDumpContext& dc) const
{
CView::Dump(dc);
}
CGosViewDoc* CGosEventView::GetDocument() // non-debug version is inline
{
ASSERT(m_pDocument->IsKindOf(RUNTIME_CLASS(CGosViewDoc)));
return (CGosViewDoc*)m_pDocument;
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CGosEventView message handlers
@@ -0,0 +1,67 @@
// GosEventView.h : interface of the CGosEventView class
//
/////////////////////////////////////////////////////////////////////////////
#if !defined(AFX_GOSEVENTVIEW_H__BF891832_039A_46F2_9AD2_466B0AC3519C__INCLUDED_)
#define AFX_GOSEVENTVIEW_H__BF891832_039A_46F2_9AD2_466B0AC3519C__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
class CGosEventView : public CView
{
protected: // create from serialization only
CGosEventView();
DECLARE_DYNCREATE(CGosEventView)
// Attributes
public:
CGosViewDoc* GetDocument();
// Operations
public:
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CGosEventView)
public:
virtual void OnDraw(CDC* pDC); // overridden to draw this view
virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
protected:
virtual BOOL OnPreparePrinting(CPrintInfo* pInfo);
virtual void OnBeginPrinting(CDC* pDC, CPrintInfo* pInfo);
virtual void OnEndPrinting(CDC* pDC, CPrintInfo* pInfo);
//}}AFX_VIRTUAL
// Implementation
public:
virtual ~CGosEventView();
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
protected:
// Generated message map functions
protected:
//{{AFX_MSG(CGosEventView)
// NOTE - the ClassWizard will add and remove member functions here.
// DO NOT EDIT what you see in these blocks of generated code !
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
#ifndef _DEBUG // debug version in GosEventView.cpp
inline CGosViewDoc* CGosEventView::GetDocument()
{ return (CGosViewDoc*)m_pDocument; }
#endif
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_GOSEVENTVIEW_H__BF891832_039A_46F2_9AD2_466B0AC3519C__INCLUDED_)
@@ -0,0 +1,35 @@
// GosObjFrame.cpp : implementation file
//
#include "stdafx.h"
#include "gosview.h"
#include "GosObjFrame.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CGosObjFrame
IMPLEMENT_DYNCREATE(CGosObjFrame, CMDIChildWnd)
CGosObjFrame::CGosObjFrame()
{
}
CGosObjFrame::~CGosObjFrame()
{
}
BEGIN_MESSAGE_MAP(CGosObjFrame, CMDIChildWnd)
//{{AFX_MSG_MAP(CGosObjFrame)
// NOTE - the ClassWizard will add and remove mapping macros here.
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CGosObjFrame message handlers
@@ -0,0 +1,46 @@
#if !defined(AFX_GOSOBJFRAME_H__046075E2_B49D_44A2_8C86_069E567B4A72__INCLUDED_)
#define AFX_GOSOBJFRAME_H__046075E2_B49D_44A2_8C86_069E567B4A72__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// GosObjFrame.h : header file
//
/////////////////////////////////////////////////////////////////////////////
// CGosObjFrame frame
class CGosObjFrame : public CMDIChildWnd
{
DECLARE_DYNCREATE(CGosObjFrame)
protected:
CGosObjFrame(); // protected constructor used by dynamic creation
// Attributes
public:
// Operations
public:
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CGosObjFrame)
//}}AFX_VIRTUAL
// Implementation
protected:
virtual ~CGosObjFrame();
// Generated message map functions
//{{AFX_MSG(CGosObjFrame)
// NOTE - the ClassWizard will add and remove member functions here.
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_GOSOBJFRAME_H__046075E2_B49D_44A2_8C86_069E567B4A72__INCLUDED_)
@@ -0,0 +1,59 @@
// GosObjListPane.cpp : implementation file
//
#include "stdafx.h"
#include "gosview.h"
#include "GosObjListPane.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CGosObjListPane
IMPLEMENT_DYNCREATE(CGosObjListPane, CView)
CGosObjListPane::CGosObjListPane()
{
}
CGosObjListPane::~CGosObjListPane()
{
}
BEGIN_MESSAGE_MAP(CGosObjListPane, CView)
//{{AFX_MSG_MAP(CGosObjListPane)
// NOTE - the ClassWizard will add and remove mapping macros here.
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CGosObjListPane drawing
void CGosObjListPane::OnDraw(CDC* pDC)
{
CDocument* pDoc = GetDocument();
// TODO: add draw code here
}
/////////////////////////////////////////////////////////////////////////////
// CGosObjListPane diagnostics
#ifdef _DEBUG
void CGosObjListPane::AssertValid() const
{
CView::AssertValid();
}
void CGosObjListPane::Dump(CDumpContext& dc) const
{
CView::Dump(dc);
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CGosObjListPane message handlers
@@ -0,0 +1,53 @@
#if !defined(AFX_GOSOBJLISTPANE_H__9E47210D_0A29_4182_AB8E_EBC86083B17B__INCLUDED_)
#define AFX_GOSOBJLISTPANE_H__9E47210D_0A29_4182_AB8E_EBC86083B17B__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// GosObjListPane.h : header file
//
/////////////////////////////////////////////////////////////////////////////
// CGosObjListPane view
class CGosObjListPane : public CView
{
protected:
CGosObjListPane(); // protected constructor used by dynamic creation
DECLARE_DYNCREATE(CGosObjListPane)
// Attributes
public:
// Operations
public:
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CGosObjListPane)
protected:
virtual void OnDraw(CDC* pDC); // overridden to draw this view
//}}AFX_VIRTUAL
// Implementation
protected:
virtual ~CGosObjListPane();
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
// Generated message map functions
protected:
//{{AFX_MSG(CGosObjListPane)
// NOTE - the ClassWizard will add and remove member functions here.
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_GOSOBJLISTPANE_H__9E47210D_0A29_4182_AB8E_EBC86083B17B__INCLUDED_)
@@ -0,0 +1,241 @@
// GosStatPane.cpp : implementation file
//
#include "stdafx.h"
#include "GosView.h"
#include "GosStatPane.h"
#include "GosViewDoc.h"
#include "TimeFrame.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
extern char *TimeToString( double secs );
/////////////////////////////////////////////////////////////////////////////
// CGosStatPane
IMPLEMENT_DYNCREATE(CGosStatPane, CView)
CGosStatPane::CGosStatPane()
{
}
CGosStatPane::~CGosStatPane()
{
}
BEGIN_MESSAGE_MAP(CGosStatPane, CView)
//{{AFX_MSG_MAP(CGosStatPane)
ON_WM_ERASEBKGND()
ON_WM_VSCROLL()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CGosStatPane drawing
void CGosStatPane::OnDraw(CDC* pDC)
{
CGosViewDoc* pDoc = (CGosViewDoc *)GetDocument();
CTimeFrame *pFrame = m_pParentFrame;
CTimeFrame::TagNode *pNode;
DWORD id;
if( !pDoc->TraceReady() )
return;
if( pDoc->m_pFont )
pDC->SelectObject( pDoc->m_pFont );
else
pDC->SelectStockObject( ANSI_FIXED_FONT );
/*
switch( m_eStatMode )
{
case StatModeView:
RecalcStats( m_pParentFrame->
}
*/
_int64 tStart;
_int64 tEnd;
if( 0 )
{
tStart = pDoc->TLogStart();
tEnd = pDoc->TLogEnd();
}
else
{
tStart = m_pParentFrame->m_tVisibleStart;
tEnd = m_pParentFrame->m_tVisibleEnd;
}
RecalcStats( tStart, tEnd );
TEXTMETRIC tm;
pDC->GetTextMetrics(&tm);
char stats1[15];
char stats2[8];
char stats3[15];
pDC->SetBkMode( TRANSPARENT );
UINT oldAlign = pDC->SetTextAlign(TA_RIGHT);
for( id = pFrame->m_FirstID; id; id = pNode->idNextEnabled )
{
pNode = pFrame->AnyIDToTag(id);
if( !pNode->independent )
continue;
if( pNode->onScreen )
{
int y = pNode->screenY - ( tm.tmHeight >> 1 );
sprintf(stats1, "%8s",
TimeToString((double)(pNode->sumTicks)/(double)pDoc->m_nFreq) );
sprintf(stats2, "%%%.2lf",
100.0 * (double)pNode->sumTicks / (double)(tEnd-tStart) );
sprintf(stats3, "%3d",
pNode->countEntry );
pDC->TextOut( tm.tmAveCharWidth * 12, y, stats1 );
pDC->TextOut( tm.tmAveCharWidth * 20, y, stats2 );
pDC->TextOut( tm.tmAveCharWidth * 28, y, stats3 );
}
}
pDC->SetTextAlign(oldAlign);
pDC->SelectStockObject( ANSI_FIXED_FONT );
}
/////////////////////////////////////////////////////////////////////////////
// CGosStatPane diagnostics
#ifdef _DEBUG
void CGosStatPane::AssertValid() const
{
CView::AssertValid();
}
void CGosStatPane::Dump(CDumpContext& dc) const
{
CView::Dump(dc);
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CGosStatPane message handlers
BOOL CGosStatPane::Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CCreateContext* pContext)
{
// TODO: Add your specialized code here and/or call the base class
//GetScrollBarCtrl(SB_HORZ)->ShowScrollBar(FALSE); // hide the scroll bar!
return CGosEventPane::Create(lpszClassName, lpszWindowName, dwStyle, rect, pParentWnd, nID, pContext);
}
void CGosStatPane::OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar)
{
// TODO: Add your message handler code here and/or call default
CGosEventPane::OnVScroll(nSBCode, nPos, pScrollBar);
// Invalidate();
}
BOOL CGosStatPane::OnEraseBkgnd(CDC* pDC)
{
// TODO: Add your message handler code here and/or call default
return CGosEventPane::OnEraseBkgnd(pDC);
}
void CGosStatPane::RecalcStats( _int64 tStart, _int64 tEnd )
{
CGosViewDoc* pDoc = (CGosViewDoc *)GetDocument();
DWORD *pLogEntry;
DWORD newTag;
DWORD tag;
DWORD time;
DWORD oldTime; // so tDiff = 0 first time
DWORD tDiff;
int left = 0;
int right = 0;
_int64 tRight = pDoc->TLogStart();
_int64 tLeft;
pLogEntry = pDoc->m_pLog;
tag = *pLogEntry++;
oldTime = *pLogEntry++;
CTimeFrame::TagNode *pNode;
for( pNode = m_pParentFrame->m_TagList.First();
pNode;
pNode = m_pParentFrame->m_TagList.Next(pNode) )
{
pNode->sumTicks = 0;
pNode->countEntry = 0;
}
for( pNode = m_pParentFrame->m_ParentList.First();
pNode;
pNode = m_pParentFrame->m_ParentList.Next(pNode) )
{
pNode->sumTicks = 0;
pNode->countEntry = 0;
}
for( ; pLogEntry < pDoc->m_pLogEnd; oldTime = time, tag = newTag )
{
newTag = *pLogEntry++;
time = *pLogEntry++;
tDiff = time - oldTime;
tLeft = tRight;
tRight += tDiff;
if( tRight < tStart ) // entirely left of the valid range
continue;
if( tLeft < tStart )
{
// this entry straddles left of view
tLeft = tStart;
tag |= 0x00100000; // make sure the entry isn't counted
}
CTimeFrame::TagNode *pNode = m_pParentFrame->m_TagList.Find(tag);
if( pNode && pNode->pAssignTo )
{
if( !( tag & 0x00100000 ) ) // don't count if it was a return-to-tag entry
pNode->pAssignTo->countEntry++;
if( tRight > tEnd )
{
pNode->pAssignTo->sumTicks += ( tEnd - tLeft );
break;
}
pNode->pAssignTo->sumTicks += ( tRight - tLeft );
}
else
{
if( tRight > tEnd )
break;
}
}
}
@@ -0,0 +1,61 @@
#if !defined(AFX_GOSSTATPANE_H__71AB88BE_FC36_437A_A24E_F98FA34D4C40__INCLUDED_)
#define AFX_GOSSTATPANE_H__71AB88BE_FC36_437A_A24E_F98FA34D4C40__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// GosStatPane.h : header file
#include "GosEventPane.h"
//
/////////////////////////////////////////////////////////////////////////////
// CGosStatPane view
class CGosStatPane : public CGosEventPane
{
protected:
CGosStatPane(); // protected constructor used by dynamic creation
DECLARE_DYNCREATE(CGosStatPane)
void RecalcStats( _int64 startTick, _int64 endTick );
// Attributes
public:
// Operations
public:
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CGosStatPane)
public:
virtual BOOL Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CCreateContext* pContext = NULL);
protected:
virtual void OnDraw(CDC* pDC); // overridden to draw this view
//}}AFX_VIRTUAL
// Implementation
protected:
virtual ~CGosStatPane();
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
// Generated message map functions
protected:
//{{AFX_MSG(CGosStatPane)
afx_msg BOOL OnEraseBkgnd(CDC* pDC);
afx_msg void OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_GOSSTATPANE_H__71AB88BE_FC36_437A_A24E_F98FA34D4C40__INCLUDED_)
@@ -0,0 +1,713 @@
// GosTracePane.cpp : implementation file
//
#include "stdafx.h"
#include "gosview.h"
#include "GosTracePane.h"
#include "GosViewDoc.h"
#include "TimeFrame.h"
#include "ZoomDialog.h"
#include "math.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CGosTracePane
IMPLEMENT_DYNCREATE(CGosTracePane, CView)
CGosTracePane::CGosTracePane()
{
m_rSecPerPixel = 1.0E-3; // 10^-9 ..10^+3
m_tCPUFreq = 731000000;
m_rPixelPerDiv = 10.0; // 10 .. 75
m_rSecPerDiv = m_rSecPerPixel * m_rPixelPerDiv; // 10^-8 .. 10^+4
m_tViewStartTick = 0;
m_tViewStartOffTick = 0;
m_tDiv0StartTick = 0;
m_nScrollShift = 0;
m_fSelectRect = false;
m_fDisplaySelectRect = false;
m_fShowEntry = false;
m_fAlreadyUpdating = false;
m_nLineThickness = 1;
}
CGosTracePane::~CGosTracePane()
{
}
BEGIN_MESSAGE_MAP(CGosTracePane, CView)
//{{AFX_MSG_MAP(CGosTracePane)
ON_WM_ERASEBKGND()
ON_WM_CREATE()
ON_WM_SIZE()
ON_WM_HSCROLL()
ON_WM_VSCROLL()
ON_WM_LBUTTONDOWN()
ON_WM_LBUTTONUP()
ON_WM_MOUSEMOVE()
ON_COMMAND(ID_SHOWENTRYOFF, OnShowentryoff)
ON_UPDATE_COMMAND_UI(ID_SHOWENTRYOFF, OnUpdateShowentryoff)
ON_COMMAND(ID_SHOWENTRYON, OnShowentryon)
ON_UPDATE_COMMAND_UI(ID_SHOWENTRYON, OnUpdateShowentryon)
ON_COMMAND(ID_SINGLE_THICK, OnSingleThick)
ON_UPDATE_COMMAND_UI(ID_SINGLE_THICK, OnUpdateSingleThick)
ON_COMMAND(ID_TRIPLE_THICK, OnTripleThick)
ON_UPDATE_COMMAND_UI(ID_TRIPLE_THICK, OnUpdateTripleThick)
ON_COMMAND(ID_DOUBLE_THICK, OnDoubleThick)
ON_UPDATE_COMMAND_UI(ID_DOUBLE_THICK, OnUpdateDoubleThick)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CGosTracePane drawing
void CGosTracePane::QueryZoom()
{
if( !m_pParentFrame->ZoomDialog()->Ready() )
return;
CGosViewDoc* pDoc = (CGosViewDoc *)GetDocument();
m_tCPUFreq = pDoc->m_nFreq;
// get the time info from the zoom control
m_rSecPerPixel = m_pParentFrame->ZoomDialog()->SecPerPixel();
m_rPixelPerDiv = m_pParentFrame->ZoomDialog()->PixelPerDiv();
m_rSecPerDiv = m_pParentFrame->ZoomDialog()->SecPerDiv();
m_tTicksPerDiv = (_int64)(double(m_tCPUFreq) * m_rSecPerDiv);
m_rTicksPerPixel = double(m_tCPUFreq) * m_rSecPerPixel;
}
char *TimeToString( double secs )
{
static char TimeStr[20];
if( secs == 0.0f )
{
sprintf(TimeStr,"0S");
}
if( secs >= 1.0f )
{
sprintf(TimeStr,"%.2f S", secs);
}
else
if( secs*1000.f >= 1.0f )
{
sprintf(TimeStr,"%.2f mS", secs*1000.f);
}
else
if( secs*1000000.f >= 1.0f )
{
sprintf(TimeStr,"%.2f µS", secs*1000000.f);
}
else
{
sprintf(TimeStr,"%.0f nS", secs*1000000000.f);
}
return TimeStr;
}
void CGosTracePane::OnDraw(CDC* pDC)
{
CGosViewDoc* pDoc = (CGosViewDoc *)GetDocument();
// Draw the vertical divisions
if( !m_pParentFrame->ZoomDialog()->Ready() )
return;
QueryZoom();
// find how many ticks into the first visible division the left of the view is
_int64 leftTickInDiv = ( m_tViewStartOffTick - m_tDiv0StartTick ) % m_tTicksPerDiv;
// handle -ve mod problem
if( m_tViewStartOffTick < m_tDiv0StartTick )
leftTickInDiv += m_tTicksPerDiv;
RECT rect;
GetClientRect(&rect);
double pixno;
double viewWidth = double(rect.right-rect.left);
pDC->SelectStockObject( WHITE_PEN );
for( pixno = (double)(m_tTicksPerDiv - leftTickInDiv) / m_rTicksPerPixel; pixno < viewWidth; pixno += m_rPixelPerDiv )
{
pDC->MoveTo( (int)pixno, 0 );
pDC->LineTo( (int)pixno, rect.bottom - rect.top );
}
// Now draw the actual trace
if( !pDoc->TraceReady() )
return;
pDC->SelectStockObject( BLACK_PEN );
bool independent = true;
DWORD *pLogEntry;
DWORD tag = pDoc->m_pLog[0];
DWORD time;
DWORD oldTime = pDoc->m_pLog[1]; // so tDiff = 0 first time
DWORD tDiff;
int left = 0;
int right = 0;
int y = 0;
DWORD curTag;
_int64 tRight = pDoc->TLogStart();
_int64 tLeft;
_int64 endViewTick = m_tViewStartTick + (_int64)((double)(rect.right-rect.left) * m_rTicksPerPixel);
CTimeFrame::TagNode dummyNode;
dummyNode.onScreen = false;
CTimeFrame::TagNode *pNode = &dummyNode;
CPen greyPen( PS_SOLID, 1, RGB(128,128,128) ); // thin grey pen
int lastXforY[2048];
int i;
for( i=0; i<2048; i++ )
lastXforY[i] = 0;
pLogEntry = pDoc->m_pLog;
unsigned long startLogLo = (unsigned long)m_tViewStartTick;
if( ( ( pDoc->m_tLogStart ^ pDoc->m_tLogEnd ) >> 31 ) == 0 ) // check that start & end could be compared directly
{
// Quick scan forward to avoid some of the stuff to the left of the visible region
unsigned int qOff = 0;
unsigned int qChg = ( (unsigned long)pDoc->m_pLogEnd - (unsigned long)pDoc->m_pLog ) >> 3; // '1/2 of the whole log
while( qChg > 64 )
{
qChg &= 0xfffffff0;
if( pLogEntry[qOff+qChg+1] < startLogLo )
qOff += qChg;
qChg >>= 1;
}
if( qOff > 32 )
pLogEntry += (qOff-4);
}
for( ; pLogEntry < pDoc->m_pLogEnd; oldTime = time )
{
curTag = tag;
tag = *pLogEntry++;
time = *pLogEntry++;
tDiff = time - oldTime;
tLeft = tRight;
tRight += tDiff;
if( tRight > endViewTick )
{
if( pNode->onScreen )
{
if( m_fShowEntry && !(curTag & 0x100000) )
{
pDC->SetPixel( left, pNode->screenY-1, 0x0000FF );
}
pDC->MoveTo( left, pNode->screenY );
pDC->LineTo( rect.right, pNode->screenY );
if( m_nLineThickness > 1 )
{
pDC->MoveTo( left, pNode->screenY+1 );
pDC->LineTo( rect.right, pNode->screenY+1 );
}
if( m_nLineThickness > 2 )
{
pDC->MoveTo( left, pNode->screenY-1 );
pDC->LineTo( rect.right, pNode->screenY-1 );
}
}
break;
}
if( tRight >= m_tViewStartTick )
{
right = TimeToXCoord( tRight );
if( right > 0 )
{
if( pNode->onScreen )
{
if( m_fShowEntry && !(curTag & 0x100000) )
{
pDC->SetPixel( left, pNode->screenY-3, 0x0000FF );
pDC->SetPixel( left, pNode->screenY-2, 0x0000FF );
if( m_nLineThickness > 1 )
{
pDC->SetPixel( left+1, pNode->screenY-3, 0x0000FF );
pDC->SetPixel( left+1, pNode->screenY-2, 0x0000FF );
}
}
if( lastXforY[pNode->screenY] < right )
{
lastXforY[pNode->screenY] = right;
pDC->MoveTo( left, pNode->screenY );
pDC->LineTo( right+1, pNode->screenY );
if( m_nLineThickness > 1 )
{
pDC->MoveTo( left, pNode->screenY+1 );
pDC->LineTo( right+1, pNode->screenY+1 );
}
if( m_nLineThickness > 2 )
{
pDC->MoveTo( left, pNode->screenY+2 );
pDC->LineTo( right+1, pNode->screenY+2 );
}
}
}
}
left = right;
}
pNode = m_pParentFrame->AnyIDToTag(tag);
if( pNode->onScreen )
{
if( independent != pNode->independent )
{
independent = pNode->independent;
if( independent )
pDC->SelectStockObject( BLACK_PEN );
else
pDC->SelectObject( greyPen );
}
}
}
if( !independent )
pDC->SelectStockObject( BLACK_PEN ); // so it is safe to delete greyPen
if( m_fDisplaySelectRect )
{
RECT rect;
GetClientRect(&rect);
CPen pen( PS_SOLID, 1, RGB(255,0,0) ); // thin red pen
CPen *pOldPen = pDC->SelectObject(&pen);
pDC->SelectStockObject( NULL_BRUSH );
pDC->Rectangle(m_nSelectRectStart,0,m_nSelectRectEnd,rect.bottom-rect.top);
pDC->SelectObject(pOldPen);
COLORREF oldColor = pDC->SetTextColor(0x000000FF);
pDC->SetBkMode( TRANSPARENT );
pDC->TextOut(0,0,TimeToString( fabs(m_rSecPerPixel*(double)(m_nSelectRectEnd-m_nSelectRectStart)) ));
pDC->SetTextColor(oldColor);
}
}
/////////////////////////////////////////////////////////////////////////////
// CGosTracePane diagnostics
#ifdef _DEBUG
void CGosTracePane::AssertValid() const
{
CView::AssertValid();
}
void CGosTracePane::Dump(CDumpContext& dc) const
{
CView::Dump(dc);
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CGosTracePane message handlers
void CGosTracePane::CalcScrollRange()
{
QueryZoom();
CGosViewDoc* pDoc = (CGosViewDoc *)GetDocument();
_int64 tDiff = pDoc->TLogEnd() - pDoc->TLogStart();
int oldScrollShift = m_nScrollShift;
// if we have a long log (e.g. more than 4 Sec on a 1GHz machine) we'll need to scale the scrollbar values
for( m_nScrollShift=0; (((_int64)(1<<30))<<m_nScrollShift) < tDiff; m_nScrollShift++ )
{;}
SCROLLINFO info;
info.cbSize = sizeof(SCROLLINFO);
GetScrollBarCtrl(SB_HORZ)->GetScrollInfo(&info, SIF_PAGE | SIF_RANGE | SIF_POS);
info.fMask = SIF_RANGE | SIF_POS;
info.nMin = 0;
info.nMax = (DWORD)( tDiff >> m_nScrollShift );
// adjust the current position based on any change in scroll shift
if( m_nScrollShift < oldScrollShift )
info.nPos <<= ( oldScrollShift - m_nScrollShift );
else if( m_nScrollShift > oldScrollShift )
info.nPos >>= ( m_nScrollShift - oldScrollShift );
// clamp the current position to the limits
if( info.nPos < info.nMin )
info.nPos = info.nMin;
if( info.nPos > info.nMax )
info.nPos = info.nMax;
GetScrollBarCtrl(SB_HORZ)->SetScrollRange(info.nMin,info.nMax);
CalcScrollPage();
}
void CGosTracePane::OnUpdate(CView* pSender, LPARAM lHint, CObject* pHint)
{
if( !m_fAlreadyUpdating )
{
m_fAlreadyUpdating = true;
CGosViewDoc* pDoc = (CGosViewDoc *)GetDocument();
// Recalculate the limits for the scrollbar if the zoom dialog and the new trace are ready
if( m_pParentFrame->ZoomDialog()->Ready() && pDoc->TraceReady() )
{
CalcScrollRange();
}
Invalidate(true);
m_fAlreadyUpdating = false;
}
}
BOOL CGosTracePane::OnEraseBkgnd(CDC* pDC)
{
if( !CGosEventPane::OnEraseBkgnd(pDC) )
return false;
return true;
}
int CGosTracePane::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CView::OnCreate(lpCreateStruct) == -1)
return -1;
return 0;
}
BOOL CGosTracePane::Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CCreateContext* pContext)
{
((CTimeFrame *)(pContext->m_pCurrentFrame))->ZoomDialog()->SetTracePane( this );
return CGosEventPane::Create(lpszClassName, lpszWindowName, dwStyle, rect, pParentWnd, nID, pContext);
}
void CGosTracePane::OnSize(UINT nType, int cx, int cy)
{
CView::OnSize(nType, cx, cy);
CalcScrollPage();
}
void CGosTracePane::CalcScrollPage()
{
CGosViewDoc* pDoc = (CGosViewDoc *)GetDocument();
// Recalculate the page size for the scrollbar
if( m_pParentFrame->ZoomDialog()->Ready() && pDoc->TraceReady() )
{
double rtDiffLog = (double)(pDoc->TLogEnd() - pDoc->TLogStart());
RECT rect;
GetClientRect(&rect);
double rtSizeView = m_rTicksPerPixel * (double)(rect.right-rect.left);
SCROLLINFO info;
info.cbSize = sizeof(SCROLLINFO);
GetScrollBarCtrl(SB_HORZ)->GetScrollInfo(&info, SIF_PAGE | SIF_RANGE | SIF_POS);
info.fMask = SIF_PAGE;
if( rtSizeView >= rtDiffLog )
info.nPage = info.nMax - info.nMin;
else
info.nPage = (int)(rtSizeView/rtDiffLog*(double)(info.nMax - info.nMin ));
GetScrollBarCtrl(SB_HORZ)->SetScrollInfo(&info);
ScrollToRange(info.nPos);
}
}
void CGosTracePane::ScrollToRange(int curpos)
{
_int64 tOff = (_int64)curpos;
tOff <<= m_nScrollShift;
m_tViewStartOffTick = tOff;
m_tViewStartTick = ((CGosViewDoc *)GetDocument())->TLogStart() + m_tViewStartOffTick;
// set range so stats pane can limit scope
RECT rect;
GetClientRect(&rect);
double rtSizeView = m_rTicksPerPixel * (double)(rect.right-rect.left);
m_pParentFrame->m_tVisibleStart = m_tViewStartTick;
m_pParentFrame->m_tVisibleEnd = m_tViewStartTick + (_int64)rtSizeView;
GetDocument()->UpdateAllViews(this,0,NULL); // update the other views
Invalidate();
}
void CGosTracePane::OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar)
{
// Get the minimum and maximum scroll-bar positions.
SCROLLINFO info;
info.cbSize = sizeof(SCROLLINFO);
pScrollBar->GetScrollInfo( &info, SIF_ALL);
int minpos = info.nMin;
int maxpos = info.nMax;
int curpos = info.nPos;
// Determine the new position of scroll box.
switch (nSBCode)
{
case SB_LEFT: // Scroll to far left.
curpos = minpos;
break;
case SB_RIGHT: // Scroll to far right.
curpos = maxpos;
break;
case SB_ENDSCROLL: // End scroll.
return;
//break;
case SB_LINELEFT: // Scroll left.
curpos = max(minpos, curpos - (int) ( info.nPage >> 4 ) );
break;
case SB_LINERIGHT: // Scroll right.
curpos = min(maxpos, curpos + (int) ( info.nPage >> 4 ) );
break;
case SB_PAGELEFT: // Scroll one page left.
curpos = max(minpos, curpos - (int) info.nPage);
break;
case SB_PAGERIGHT: // Scroll one page right.
curpos = min(maxpos, curpos + (int) info.nPage);
break;
case SB_THUMBPOSITION: // Scroll to absolute position. nPos is the position
curpos = info.nTrackPos; // of the scroll box at the end of the drag operation.
break;
case SB_THUMBTRACK: // Drag scroll box to specified position. nPos is the
curpos = info.nTrackPos; // position that the scroll box has been dragged to.
break;
default:
return;
}
// Set the new position of the thumb (scroll box).
pScrollBar->SetScrollPos(curpos);
ScrollToRange(curpos);
}
void CGosTracePane::OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar)
{
SCROLLINFO info;
info.cbSize = sizeof(SCROLLINFO);
pScrollBar->GetScrollInfo( &info, SIF_ALL);
switch( nSBCode & 0x0000ffff )
{
case SB_PAGEUP:
info.nPos = ((unsigned)info.nPos>info.nPage)?(info.nPos-info.nPage):0;
break;
case SB_PAGEDOWN:
info.nPos = ((unsigned)info.nPos+info.nPage>(unsigned)info.nMax)?info.nMax:(info.nPos+info.nPage);
break;
case SB_LINEUP:
info.nPos = (info.nPos>0)?(info.nPos-1):0;
break;
case SB_LINEDOWN:
info.nPos = (info.nPos+1>info.nMax)?info.nMax:(info.nPos+1);
break;
case SB_THUMBTRACK:
info.nPos = nPos;
break;
default:
return;
}
m_pParentFrame->m_VScrollPos = info.nPos;
CGosEventPane::OnVScroll(nSBCode, nPos, pScrollBar);
m_pParentFrame->DetermineVisibleTags();
}
void CGosTracePane::ZoomViewTo( _int64 startTick, _int64 endTick )
{
RECT rect;
GetClientRect(&rect);
// first change the scale
m_pParentFrame->ZoomDialog()->ZoomToSecPerPixel(
(double)( endTick - startTick ) / (double)m_tCPUFreq / (double)(rect.right-rect.left) );
// recalculate the scrollbar limits and page size now
// CalcScrollRange();
/*
SCROLLINFO info;
info.cbSize = sizeof(SCROLLINFO);
GetScrollBarCtrl(SB_HORZ)->GetScrollInfo(&info, SIF_PAGE | SIF_RANGE | SIF_POS);
info.nPos = (int)((startTick - ((CGosViewDoc *)GetDocument())->TLogStart()) >> m_nScrollShift);
info.fMask = SIF_POS;
*/
int newPos = (int)((startTick - ((CGosViewDoc *)GetDocument())->TLogStart()) >> m_nScrollShift);
GetScrollBarCtrl(SB_HORZ)->SetScrollPos(newPos);
// convert the actual scrolled values back to start/end times
ScrollToRange(newPos);
}
void CGosTracePane::OnLButtonDown(UINT nFlags, CPoint point)
{
if( m_fDisplaySelectRect )
{
m_fDisplaySelectRect = false;
if( !( point.x <= m_nSelectRectStart && point.x <= m_nSelectRectEnd ) &&
!( point.x >= m_nSelectRectStart && point.x >= m_nSelectRectEnd ) )
{
// we clicked inside the selected rectangle so zoom the time scale to the range selected
int left,right;
if( m_nSelectRectStart < m_nSelectRectEnd )
{
left = m_nSelectRectStart;
right = m_nSelectRectEnd;
}
else
{
left = m_nSelectRectEnd;
right = m_nSelectRectStart;
}
ZoomViewTo( ViewXToTick(left), ViewXToTick(right) );
}
}
else
{
m_fSelectRect = true;
m_nSelectRectStart = point.x;
m_nSelectRectEnd = point.x;
m_fDisplaySelectRect = true;
SetCapture();
}
Invalidate();
// CView::OnLButtonDown(nFlags, point);
}
void CGosTracePane::OnLButtonUp(UINT nFlags, CPoint point)
{
if( m_fSelectRect )
{
m_fSelectRect = false;
::ReleaseCapture();
Invalidate();
}
// CView::OnLButtonUp(nFlags, point);
}
void CGosTracePane::OnMouseMove(UINT nFlags, CPoint point)
{
// TODO: Add your message handler code here and/or call default
if( m_fSelectRect )
{
m_nSelectRectEnd = point.x;
Invalidate();
}
CView::OnMouseMove(nFlags, point);
}
void CGosTracePane::OnShowentryoff()
{
m_fShowEntry = false;
Invalidate();
}
void CGosTracePane::OnUpdateShowentryoff(CCmdUI* pCmdUI)
{
pCmdUI->Enable( m_fShowEntry );
}
void CGosTracePane::OnShowentryon()
{
m_fShowEntry = true;
Invalidate();
}
void CGosTracePane::OnUpdateShowentryon(CCmdUI* pCmdUI)
{
pCmdUI->Enable( !m_fShowEntry );
}
void CGosTracePane::OnInitialUpdate()
{
CGosViewDoc* pDoc = (CGosViewDoc *)GetDocument();
CView::OnInitialUpdate();
if( pDoc->TraceReady() )
{
m_pParentFrame->SetDocument(pDoc);
m_pParentFrame->UpdateAllIds();
m_pParentFrame->ProcessNewLog();
}
}
void CGosTracePane::OnSingleThick()
{
m_nLineThickness = 1;
Invalidate();
}
void CGosTracePane::OnUpdateSingleThick(CCmdUI* pCmdUI)
{
pCmdUI->Enable( m_nLineThickness != 1 );
}
void CGosTracePane::OnTripleThick()
{
m_nLineThickness = 3;
Invalidate();
}
void CGosTracePane::OnUpdateTripleThick(CCmdUI* pCmdUI)
{
pCmdUI->Enable( m_nLineThickness != 3 );
}
void CGosTracePane::OnDoubleThick()
{
m_nLineThickness = 2;
Invalidate();
}
void CGosTracePane::OnUpdateDoubleThick(CCmdUI* pCmdUI)
{
pCmdUI->Enable( m_nLineThickness != 2 );
}
@@ -0,0 +1,120 @@
#if !defined(AFX_GOSTRACEPANE_H__CE9A9043_8848_4521_874E_EB8726EC15EE__INCLUDED_)
#define AFX_GOSTRACEPANE_H__CE9A9043_8848_4521_874E_EB8726EC15EE__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// GosTracePane.h : header file
//
#include "GosEventPane.h"
#include "ZoomDialog.h"
#include "TimeFrame.h"
/////////////////////////////////////////////////////////////////////////////
// CGosTracePane view
class CGosTracePane : public CGosEventPane
{
friend CZoomDialog; // so it can call OnUpdate
protected:
CGosTracePane(); // protected constructor used by dynamic creation
DECLARE_DYNCREATE(CGosTracePane)
bool m_fSelectRect; // are we selecting a time range using the mouse?
bool m_fDisplaySelectRect; // are we displaying a time range using the mouse?
int m_nSelectRectStart; // start x position of time range
int m_nSelectRectEnd; // end x position of time range
bool m_fShowEntry; // show function entry as a colored dot
bool m_fAlreadyUpdating; // avoid infinite nest
double m_rSecPerPixel; // 10^-9 ..10^+3
double m_rPixelPerDiv; // 10 .. 75
double m_rSecPerDiv; // 10^-8 .. 10^+4
double m_rTicksPerPixel; // 0.1 .. 10^11
_int64 m_tViewStartOffTick; // offset into log of left of view
_int64 m_tViewStartTick; // absolute time of left of view
_int64 m_tDiv0StartTick; // could be 0, start of log, or time of some event
_int64 m_tCPUFreq; // ticks per second
_int64 m_tTicksPerDiv;
int m_nScrollShift; // the shift to apply to the horizontal scrollbar
void CalcScrollPage();
void ScrollToRange(int curpos);
int TimeToXCoord( _int64 tAbs )
{
return (int)( ((double)( tAbs - m_tViewStartTick )) / m_rTicksPerPixel );
}
int TagToYCoord( DWORD tag )
{
return m_pParentFrame->m_TagList.Find(tag)->screenY;
}
inline _int64 CGosTracePane::ViewXToTick( int x ) { return m_tViewStartTick + _int64(m_rTicksPerPixel * (double)x); }
void ZoomViewTo( _int64 startTick, _int64 endTick );
void CalcScrollRange();
void QueryZoom();
int m_nLineThickness;
// Attributes
public:
// Operations
public:
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CGosTracePane)
public:
virtual BOOL Create(LPCTSTR lpszClassName, LPCTSTR lpszWindowName, DWORD dwStyle, const RECT& rect, CWnd* pParentWnd, UINT nID, CCreateContext* pContext = NULL);
virtual void OnInitialUpdate();
protected:
virtual void OnDraw(CDC* pDC); // overridden to draw this view
virtual void OnUpdate(CView* pSender, LPARAM lHint, CObject* pHint);
//}}AFX_VIRTUAL
// Implementation
protected:
virtual ~CGosTracePane();
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
// Generated message map functions
protected:
//{{AFX_MSG(CGosTracePane)
afx_msg BOOL OnEraseBkgnd(CDC* pDC);
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
afx_msg void OnSize(UINT nType, int cx, int cy);
afx_msg void OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
afx_msg void OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
afx_msg void OnLButtonDown(UINT nFlags, CPoint point);
afx_msg void OnLButtonUp(UINT nFlags, CPoint point);
afx_msg void OnMouseMove(UINT nFlags, CPoint point);
afx_msg void OnShowentryoff();
afx_msg void OnUpdateShowentryoff(CCmdUI* pCmdUI);
afx_msg void OnShowentryon();
afx_msg void OnUpdateShowentryon(CCmdUI* pCmdUI);
afx_msg void OnSingleThick();
afx_msg void OnUpdateSingleThick(CCmdUI* pCmdUI);
afx_msg void OnTripleThick();
afx_msg void OnUpdateTripleThick(CCmdUI* pCmdUI);
afx_msg void OnDoubleThick();
afx_msg void OnUpdateDoubleThick(CCmdUI* pCmdUI);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_GOSTRACEPANE_H__CE9A9043_8848_4521_874E_EB8726EC15EE__INCLUDED_)
@@ -0,0 +1,183 @@
// GosView.cpp : Defines the class behaviors for the application.
//
#include "stdafx.h"
#include "GosView.h"
#include "MainFrm.h"
#include "ChildFrm.h"
#include "GosViewDoc.h"
#include "GosEventView.h"
#include "timeframe.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CGosViewApp
BEGIN_MESSAGE_MAP(CGosViewApp, CWinApp)
//{{AFX_MSG_MAP(CGosViewApp)
ON_COMMAND(ID_APP_ABOUT, OnAppAbout)
// NOTE - the ClassWizard will add and remove mapping macros here.
// DO NOT EDIT what you see in these blocks of generated code!
//}}AFX_MSG_MAP
// Standard file based document commands
ON_COMMAND(ID_FILE_NEW, CWinApp::OnFileNew)
ON_COMMAND(ID_FILE_OPEN, CWinApp::OnFileOpen)
// Standard print setup command
ON_COMMAND(ID_FILE_PRINT_SETUP, CWinApp::OnFilePrintSetup)
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CGosViewApp construction
CGosViewApp::CGosViewApp()
{
// TODO: add construction code here,
// Place all significant initialization in InitInstance
}
/////////////////////////////////////////////////////////////////////////////
// The one and only CGosViewApp object
CGosViewApp theApp;
/////////////////////////////////////////////////////////////////////////////
// CGosViewApp initialization
BOOL CGosViewApp::InitInstance()
{
if (!AfxSocketInit())
{
AfxMessageBox(IDP_SOCKETS_INIT_FAILED);
return FALSE;
}
AfxEnableControlContainer();
// Standard initialization
// If you are not using these features and wish to reduce the size
// of your final executable, you should remove from the following
// the specific initialization routines you do not need.
#ifdef _AFXDLL
Enable3dControls(); // Call this when using MFC in a shared DLL
#else
Enable3dControlsStatic(); // Call this when linking to MFC statically
#endif
// Change the registry key under which our settings are stored.
// TODO: You should modify this string to be something appropriate
// such as the name of your company or organization.
SetRegistryKey(_T("Local AppWizard-Generated Applications"));
LoadStdProfileSettings(); // Load standard INI file options (including MRU)
// Register the application's document templates. Document templates
// serve as the connection between documents, frame windows and views.
/*
CMultiDocTemplate* pDocTemplate;
pDocTemplate = new CMultiDocTemplate(
IDR_GOSTYPE,
RUNTIME_CLASS(CGosViewDoc),
RUNTIME_CLASS(CChildFrame), // custom MDI child frame
RUNTIME_CLASS(CGosEventView));
AddDocTemplate(pDocTemplate);
*/
m_ptTimeFrame = new CMultiDocTemplate(
IDR_GOSTYPE,
RUNTIME_CLASS(CGosViewDoc),
RUNTIME_CLASS(CTimeFrame), // custom MDI child frame
NULL);
AddDocTemplate(m_ptTimeFrame);
// create main MDI Frame window
CMainFrame* pMainFrame = new CMainFrame;
if (!pMainFrame->LoadFrame(IDR_MAINFRAME))
return FALSE;
m_pMainWnd = pMainFrame;
// Enable drag/drop open
m_pMainWnd->DragAcceptFiles();
// Enable DDE Execute open
EnableShellOpen();
RegisterShellFileTypes(TRUE);
// Parse command line for standard shell commands, DDE, file open
CCommandLineInfo cmdInfo;
ParseCommandLine(cmdInfo);
// Dispatch commands specified on the command line
if (!ProcessShellCommand(cmdInfo))
return FALSE;
// The main window has been initialized, so show and update it.
pMainFrame->ShowWindow(m_nCmdShow);
pMainFrame->UpdateWindow();
return TRUE;
}
/////////////////////////////////////////////////////////////////////////////
// CAboutDlg dialog used for App About
class CAboutDlg : public CDialog
{
public:
CAboutDlg();
// Dialog Data
//{{AFX_DATA(CAboutDlg)
enum { IDD = IDD_ABOUTBOX };
//}}AFX_DATA
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CAboutDlg)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
//{{AFX_MSG(CAboutDlg)
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD)
{
//{{AFX_DATA_INIT(CAboutDlg)
//}}AFX_DATA_INIT
}
void CAboutDlg::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CAboutDlg)
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
//{{AFX_MSG_MAP(CAboutDlg)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
// App command to run the dialog
void CGosViewApp::OnAppAbout()
{
CAboutDlg aboutDlg;
aboutDlg.DoModal();
}
/////////////////////////////////////////////////////////////////////////////
// CGosViewApp message handlers
@@ -0,0 +1,502 @@
# Microsoft Developer Studio Project File - Name="GosView" - Package Owner=<4>
# Microsoft Developer Studio Generated Build File, Format Version 6.00
# ** DO NOT EDIT **
# TARGTYPE "Win32 (x86) Application" 0x0101
CFG=GosView - Win32 Debug
!MESSAGE This is not a valid makefile. To build this project using NMAKE,
!MESSAGE use the Export Makefile command and run
!MESSAGE
!MESSAGE NMAKE /f "GosView.mak".
!MESSAGE
!MESSAGE You can specify a configuration when running NMAKE
!MESSAGE by defining the macro CFG on the command line. For example:
!MESSAGE
!MESSAGE NMAKE /f "GosView.mak" CFG="GosView - Win32 Debug"
!MESSAGE
!MESSAGE Possible choices for configuration are:
!MESSAGE
!MESSAGE "GosView - Win32 Release" (based on "Win32 (x86) Application")
!MESSAGE "GosView - Win32 Debug" (based on "Win32 (x86) Application")
!MESSAGE
# Begin Project
# PROP AllowPerConfigDependencies 0
CPP=cl.exe
MTL=midl.exe
RSC=rc.exe
!IF "$(CFG)" == "GosView - Win32 Release"
# PROP BASE Use_MFC 6
# PROP BASE Use_Debug_Libraries 0
# PROP BASE Output_Dir "Release"
# PROP BASE Intermediate_Dir "Release"
# PROP BASE Target_Dir ""
# PROP Use_MFC 6
# PROP Use_Debug_Libraries 0
# PROP Output_Dir "Release"
# PROP Intermediate_Dir "Release"
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_AFXDLL" /Yu"stdafx.h" /FD /c
# ADD CPP /nologo /MD /W3 /GX /O2 /D "WIN32" /D "NDEBUG" /D "_WINDOWS" /D "_AFXDLL" /D "_MBCS" /Yu"stdafx.h" /FD /c
# ADD BASE MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "NDEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x409 /d "NDEBUG" /d "_AFXDLL"
# ADD RSC /l 0x409 /d "NDEBUG" /d "_AFXDLL"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 /nologo /subsystem:windows /machine:I386
# ADD LINK32 /nologo /subsystem:windows /machine:I386
!ELSEIF "$(CFG)" == "GosView - Win32 Debug"
# PROP BASE Use_MFC 6
# PROP BASE Use_Debug_Libraries 1
# PROP BASE Output_Dir "Debug"
# PROP BASE Intermediate_Dir "Debug"
# PROP BASE Target_Dir ""
# PROP Use_MFC 6
# PROP Use_Debug_Libraries 1
# PROP Output_Dir "Debug"
# PROP Intermediate_Dir "Debug"
# PROP Ignore_Export_Lib 0
# PROP Target_Dir ""
# ADD BASE CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_AFXDLL" /Yu"stdafx.h" /FD /GZ /c
# ADD CPP /nologo /MDd /W3 /Gm /GX /ZI /Od /D "WIN32" /D "_DEBUG" /D "_WINDOWS" /D "_AFXDLL" /D "_MBCS" /FR /Yu"stdafx.h" /FD /GZ /c
# ADD BASE MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD MTL /nologo /D "_DEBUG" /mktyplib203 /win32
# ADD BASE RSC /l 0x409 /d "_DEBUG" /d "_AFXDLL"
# ADD RSC /l 0x409 /d "_DEBUG" /d "_AFXDLL"
BSC32=bscmake.exe
# ADD BASE BSC32 /nologo
# ADD BSC32 /nologo
LINK32=link.exe
# ADD BASE LINK32 /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
# ADD LINK32 /nologo /subsystem:windows /debug /machine:I386 /pdbtype:sept
!ENDIF
# Begin Target
# Name "GosView - Win32 Release"
# Name "GosView - Win32 Debug"
# Begin Group "Source Files"
# PROP Default_Filter "cpp;c;cxx;rc;def;r;odl;idl;hpj;bat"
# Begin Source File
SOURCE=.\ChildFrm.cpp
# End Source File
# Begin Source File
SOURCE=.\GosEventIdPane.cpp
# End Source File
# Begin Source File
SOURCE=.\GosEventPane.cpp
# End Source File
# Begin Source File
SOURCE=.\GosEventView.cpp
# End Source File
# Begin Source File
SOURCE=.\GosStatPane.cpp
# End Source File
# Begin Source File
SOURCE=.\GosTracePane.cpp
# End Source File
# Begin Source File
SOURCE=.\GosView.cpp
# End Source File
# Begin Source File
SOURCE=.\hlp\GosView.hpj
!IF "$(CFG)" == "GosView - Win32 Release"
# PROP Ignore_Default_Tool 1
USERDEP__GOSVI="hlp\AfxCore.rtf" "hlp\AfxPrint.rtf" "hlp\$(TargetName).hm"
# Begin Custom Build - Making help file...
OutDir=.\Release
TargetName=GosView
InputPath=.\hlp\GosView.hpj
InputName=GosView
"$(OutDir)\$(InputName).hlp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
start /wait hcw /C /E /M "hlp\$(InputName).hpj"
if errorlevel 1 goto :Error
if not exist "hlp\$(InputName).hlp" goto :Error
copy "hlp\$(InputName).hlp" $(OutDir)
goto :done
:Error
echo hlp\$(InputName).hpj(1) : error:
type "hlp\$(InputName).log"
:done
# End Custom Build
!ELSEIF "$(CFG)" == "GosView - Win32 Debug"
# PROP Ignore_Default_Tool 1
USERDEP__GOSVI="hlp\AfxCore.rtf" "hlp\AfxPrint.rtf" "hlp\$(TargetName).hm"
# Begin Custom Build - Making help file...
OutDir=.\Debug
TargetName=GosView
InputPath=.\hlp\GosView.hpj
InputName=GosView
"$(OutDir)\$(InputName).hlp" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
start /wait hcw /C /E /M "hlp\$(InputName).hpj"
if errorlevel 1 goto :Error
if not exist "hlp\$(InputName).hlp" goto :Error
copy "hlp\$(InputName).hlp" $(OutDir)
goto :done
:Error
echo hlp\$(InputName).hpj(1) : error:
type "hlp\$(InputName).log"
:done
# End Custom Build
!ENDIF
# End Source File
# Begin Source File
SOURCE=.\GosView.rc
# End Source File
# Begin Source File
SOURCE=.\GosViewDoc.cpp
# End Source File
# Begin Source File
SOURCE=.\MainFrm.cpp
# End Source File
# Begin Source File
SOURCE=.\Session.cpp
# End Source File
# Begin Source File
SOURCE=.\StdAfx.cpp
# ADD CPP /Yc"stdafx.h"
# End Source File
# Begin Source File
SOURCE=.\TargetDialog.cpp
# End Source File
# Begin Source File
SOURCE=.\TimeFrame.cpp
# End Source File
# Begin Source File
SOURCE=.\TimeToolBar.cpp
# End Source File
# Begin Source File
SOURCE=.\ZoomDialog.cpp
# End Source File
# End Group
# Begin Group "Header Files"
# PROP Default_Filter "h;hpp;hxx;hm;inl"
# Begin Source File
SOURCE=.\ChildFrm.h
# End Source File
# Begin Source File
SOURCE=.\GosEventIdPane.h
# End Source File
# Begin Source File
SOURCE=.\GosEventPane.h
# End Source File
# Begin Source File
SOURCE=.\GosEventView.h
# End Source File
# Begin Source File
SOURCE=.\GosStatPane.h
# End Source File
# Begin Source File
SOURCE=.\GosTracePane.h
# End Source File
# Begin Source File
SOURCE=.\GosView.h
# End Source File
# Begin Source File
SOURCE=.\GosViewDoc.h
# End Source File
# Begin Source File
SOURCE=.\IDContainer.h
# End Source File
# Begin Source File
SOURCE=.\MainFrm.h
# End Source File
# Begin Source File
SOURCE=.\Resource.h
!IF "$(CFG)" == "GosView - Win32 Release"
# PROP Ignore_Default_Tool 1
# Begin Custom Build - Making help include file...
TargetName=GosView
InputPath=.\Resource.h
"hlp\$(TargetName).hm" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
echo. >"hlp\$(TargetName).hm"
echo // Commands (ID_* and IDM_*) >>"hlp\$(TargetName).hm"
makehm ID_,HID_,0x10000 IDM_,HIDM_,0x10000 resource.h >>"hlp\$(TargetName).hm"
echo. >>"hlp\$(TargetName).hm"
echo // Prompts (IDP_*) >>"hlp\$(TargetName).hm"
makehm IDP_,HIDP_,0x30000 resource.h >>"hlp\$(TargetName).hm"
echo. >>"hlp\$(TargetName).hm"
echo // Resources (IDR_*) >>"hlp\$(TargetName).hm"
makehm IDR_,HIDR_,0x20000 resource.h >>"hlp\$(TargetName).hm"
echo. >>"hlp\$(TargetName).hm"
echo // Dialogs (IDD_*) >>"hlp\$(TargetName).hm"
makehm IDD_,HIDD_,0x20000 resource.h >>"hlp\$(TargetName).hm"
echo. >>"hlp\$(TargetName).hm"
echo // Frame Controls (IDW_*) >>"hlp\$(TargetName).hm"
makehm IDW_,HIDW_,0x50000 resource.h >>"hlp\$(TargetName).hm"
# End Custom Build
!ELSEIF "$(CFG)" == "GosView - Win32 Debug"
# PROP Ignore_Default_Tool 1
# Begin Custom Build - Making help include file...
TargetName=GosView
InputPath=.\Resource.h
"hlp\$(TargetName).hm" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
echo. >"hlp\$(TargetName).hm"
echo // Commands (ID_* and IDM_*) >>"hlp\$(TargetName).hm"
makehm ID_,HID_,0x10000 IDM_,HIDM_,0x10000 resource.h >>"hlp\$(TargetName).hm"
echo. >>"hlp\$(TargetName).hm"
echo // Prompts (IDP_*) >>"hlp\$(TargetName).hm"
makehm IDP_,HIDP_,0x30000 resource.h >>"hlp\$(TargetName).hm"
echo. >>"hlp\$(TargetName).hm"
echo // Resources (IDR_*) >>"hlp\$(TargetName).hm"
makehm IDR_,HIDR_,0x20000 resource.h >>"hlp\$(TargetName).hm"
echo. >>"hlp\$(TargetName).hm"
echo // Dialogs (IDD_*) >>"hlp\$(TargetName).hm"
makehm IDD_,HIDD_,0x20000 resource.h >>"hlp\$(TargetName).hm"
echo. >>"hlp\$(TargetName).hm"
echo // Frame Controls (IDW_*) >>"hlp\$(TargetName).hm"
makehm IDW_,HIDW_,0x50000 resource.h >>"hlp\$(TargetName).hm"
# End Custom Build
!ENDIF
# End Source File
# Begin Source File
SOURCE=.\Session.h
# End Source File
# Begin Source File
SOURCE=.\StdAfx.h
# End Source File
# Begin Source File
SOURCE=.\TargetDialog.h
# End Source File
# Begin Source File
SOURCE=.\TimeFrame.h
# End Source File
# Begin Source File
SOURCE=.\TimeToolBar.h
# End Source File
# Begin Source File
SOURCE=.\ZoomDialog.h
# End Source File
# End Group
# Begin Group "Resource Files"
# PROP Default_Filter "ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe"
# Begin Source File
SOURCE=.\res\GosView.ico
# End Source File
# Begin Source File
SOURCE=.\res\GosView.rc2
# End Source File
# Begin Source File
SOURCE=.\res\GosViewDoc.ico
# End Source File
# Begin Source File
SOURCE=.\res\Toolbar.bmp
# End Source File
# Begin Source File
SOURCE=.\res\toolbar1.bmp
# End Source File
# End Group
# Begin Group "Help Files"
# PROP Default_Filter "cnt;rtf"
# Begin Source File
SOURCE=.\hlp\AfxCore.rtf
# End Source File
# Begin Source File
SOURCE=.\hlp\AfxPrint.rtf
# End Source File
# Begin Source File
SOURCE=.\hlp\AppExit.bmp
# End Source File
# Begin Source File
SOURCE=.\hlp\Bullet.bmp
# End Source File
# Begin Source File
SOURCE=.\hlp\CurArw2.bmp
# End Source File
# Begin Source File
SOURCE=.\hlp\CurArw4.bmp
# End Source File
# Begin Source File
SOURCE=.\hlp\CurHelp.bmp
# End Source File
# Begin Source File
SOURCE=.\hlp\EditCopy.bmp
# End Source File
# Begin Source File
SOURCE=.\hlp\EditCut.bmp
# End Source File
# Begin Source File
SOURCE=.\hlp\EditPast.bmp
# End Source File
# Begin Source File
SOURCE=.\hlp\EditUndo.bmp
# End Source File
# Begin Source File
SOURCE=.\hlp\FileNew.bmp
# End Source File
# Begin Source File
SOURCE=.\hlp\FileOpen.bmp
# End Source File
# Begin Source File
SOURCE=.\hlp\FilePrnt.bmp
# End Source File
# Begin Source File
SOURCE=.\hlp\FileSave.bmp
# End Source File
# Begin Source File
SOURCE=.\hlp\GosView.cnt
!IF "$(CFG)" == "GosView - Win32 Release"
# PROP Ignore_Default_Tool 1
# Begin Custom Build - Copying contents file...
OutDir=.\Release
InputPath=.\hlp\GosView.cnt
InputName=GosView
"$(OutDir)\$(InputName).cnt" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
copy "hlp\$(InputName).cnt" $(OutDir)
# End Custom Build
!ELSEIF "$(CFG)" == "GosView - Win32 Debug"
# PROP Ignore_Default_Tool 1
# Begin Custom Build - Copying contents file...
OutDir=.\Debug
InputPath=.\hlp\GosView.cnt
InputName=GosView
"$(OutDir)\$(InputName).cnt" : $(SOURCE) "$(INTDIR)" "$(OUTDIR)"
copy "hlp\$(InputName).cnt" $(OutDir)
# End Custom Build
!ENDIF
# End Source File
# Begin Source File
SOURCE=.\hlp\HlpSBar.bmp
# End Source File
# Begin Source File
SOURCE=.\hlp\HlpTBar.bmp
# End Source File
# Begin Source File
SOURCE=.\hlp\RecFirst.bmp
# End Source File
# Begin Source File
SOURCE=.\hlp\RecLast.bmp
# End Source File
# Begin Source File
SOURCE=.\hlp\RecNext.bmp
# End Source File
# Begin Source File
SOURCE=.\hlp\RecPrev.bmp
# End Source File
# Begin Source File
SOURCE=.\hlp\Scmax.bmp
# End Source File
# Begin Source File
SOURCE=.\hlp\ScMenu.bmp
# End Source File
# Begin Source File
SOURCE=.\hlp\Scmin.bmp
# End Source File
# End Group
# Begin Source File
SOURCE=.\GosView.reg
# End Source File
# Begin Source File
SOURCE=.\ReadMe.txt
# End Source File
# End Target
# End Project
@@ -0,0 +1,527 @@
Microsoft Developer Studio Workspace File, Format Version 6.00
# WARNING: DO NOT EDIT OR DELETE THIS WORKSPACE FILE!
###############################################################################
Project: "Blade"=..\..\Libraries\Blade\blade.dsp - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
###############################################################################
Project: "DLLPlatform"=..\..\Libraries\DLLPlatform\DLLPlatform.dsp - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
###############################################################################
Project: "Fontedit"=..\..\Tools\D3FFontEdit\fontedit.dsp - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
###############################################################################
Project: "GOSScript"=..\..\Libraries\GOSScript\GOSScript.dsp - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
###############################################################################
Project: "GafCompressor"=..\GAFCompressor\GafCompressor.dsp - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
Begin Project Dependency
Project_Dep_Name GameOS
End Project Dependency
Begin Project Dependency
Project_Dep_Name GamePlatform
End Project Dependency
Begin Project Dependency
Project_Dep_Name GOSScript
End Project Dependency
}}}
###############################################################################
Project: "GameOS"=..\..\Libraries\GameOS\GameOS.dsp - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
###############################################################################
Project: "GameOSWizard"=..\..\Tools\GameOSWizard\GameOSWizard.dsp - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
###############################################################################
Project: "GamePlatform"=..\..\Libraries\GamePlatform\GamePlatform.dsp - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
###############################################################################
Project: "Gos2"=..\..\Libraries\Gos2\Gos2.dsp - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
###############################################################################
Project: "Gos2Light"=..\Gos2Light\Gos2Light.dsp - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
Begin Project Dependency
Project_Dep_Name Gos2
End Project Dependency
}}}
###############################################################################
Project: "Gos2Text"=..\Gos2Text\Gos2Text.dsp - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
Begin Project Dependency
Project_Dep_Name Gos2
End Project Dependency
}}}
###############################################################################
Project: "Gos2X"=..\..\Libraries\Gos2X\Gos2X.dsp - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
###############################################################################
Project: "HighTide"=..\GOS2HighTide\HighTide.dsp - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
Begin Project Dependency
Project_Dep_Name Gos2
End Project Dependency
}}}
###############################################################################
Project: "Language"=..\..\Libraries\Language\Language.dsp - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
###############################################################################
Project: "MFCPlatform"=..\..\Libraries\MFCPlatform\MFCPlatform.dsp - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
###############################################################################
Project: "Resources"="..\Test Localization\Resources\Resources.dsp" - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
###############################################################################
Project: "RunScript"=..\RunScript\RunScript.dsp - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
Begin Project Dependency
Project_Dep_Name GameOS
End Project Dependency
Begin Project Dependency
Project_Dep_Name GamePlatform
End Project Dependency
Begin Project Dependency
Project_Dep_Name GOSScript
End Project Dependency
}}}
###############################################################################
Project: "Script Repository"="..\Script Repository\Script Repository.dsp" - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
Begin Project Dependency
Project_Dep_Name GameOS
End Project Dependency
Begin Project Dependency
Project_Dep_Name GamePlatform
End Project Dependency
Begin Project Dependency
Project_Dep_Name GOSScript
End Project Dependency
}}}
###############################################################################
Project: "SkunkWorks Jim"="..\SkunkWorks Jim\SkunkWorks Jim.dsp" - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
Begin Project Dependency
Project_Dep_Name GameOS
End Project Dependency
Begin Project Dependency
Project_Dep_Name GamePlatform
End Project Dependency
Begin Project Dependency
Project_Dep_Name GOSScript
End Project Dependency
}}}
###############################################################################
Project: "Test 3D"="..\Test 3D\Test 3D.dsp" - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
Begin Project Dependency
Project_Dep_Name Blade
End Project Dependency
Begin Project Dependency
Project_Dep_Name GameOS
End Project Dependency
Begin Project Dependency
Project_Dep_Name GamePlatform
End Project Dependency
}}}
###############################################################################
Project: "Test Blade"="..\Test Blade\Test Blade.dsp" - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
Begin Project Dependency
Project_Dep_Name Blade
End Project Dependency
Begin Project Dependency
Project_Dep_Name GameOS
End Project Dependency
Begin Project Dependency
Project_Dep_Name GamePlatform
End Project Dependency
}}}
###############################################################################
Project: "Test DLLPlatform"="..\Test DLLPlatform\Test DLLPlatform.dsp" - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
Begin Project Dependency
Project_Dep_Name DLLPlatform
End Project Dependency
Begin Project Dependency
Project_Dep_Name GameOS
End Project Dependency
}}}
###############################################################################
Project: "Test Input"="..\Test Input\Test Input.dsp" - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
Begin Project Dependency
Project_Dep_Name GameOS
End Project Dependency
Begin Project Dependency
Project_Dep_Name GamePlatform
End Project Dependency
}}}
###############################################################################
Project: "Test Localization"="..\Test Localization\Test Localization.dsp" - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
Begin Project Dependency
Project_Dep_Name GameOS
End Project Dependency
Begin Project Dependency
Project_Dep_Name GamePlatform
End Project Dependency
Begin Project Dependency
Project_Dep_Name GOSScript
End Project Dependency
}}}
###############################################################################
Project: "Test MFCPlatform"="..\Test MFCPlatform\Test MFCPlatform.dsp" - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
Begin Project Dependency
Project_Dep_Name GameOS
End Project Dependency
Begin Project Dependency
Project_Dep_Name MFCPlatform
End Project Dependency
}}}
###############################################################################
Project: "Test Memory"="..\Test Memory\Test Memory.dsp" - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
Begin Project Dependency
Project_Dep_Name GameOS
End Project Dependency
Begin Project Dependency
Project_Dep_Name GamePlatform
End Project Dependency
Begin Project Dependency
Project_Dep_Name GOSScript
End Project Dependency
}}}
###############################################################################
Project: "Test Network"="..\Test Network\Test Network.dsp" - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
Begin Project Dependency
Project_Dep_Name GameOS
End Project Dependency
Begin Project Dependency
Project_Dep_Name GamePlatform
End Project Dependency
Begin Project Dependency
Project_Dep_Name GOSScript
End Project Dependency
}}}
###############################################################################
Project: "Test Scripts"="..\Test Scripts\Test Scripts.dsp" - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
Begin Project Dependency
Project_Dep_Name GameOS
End Project Dependency
Begin Project Dependency
Project_Dep_Name GamePlatform
End Project Dependency
Begin Project Dependency
Project_Dep_Name GOSScript
End Project Dependency
}}}
###############################################################################
Project: "Test Sound"="..\Test Sound\Test Sound.dsp" - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
Begin Project Dependency
Project_Dep_Name GameOS
End Project Dependency
Begin Project Dependency
Project_Dep_Name GamePlatform
End Project Dependency
Begin Project Dependency
Project_Dep_Name GOSScript
End Project Dependency
}}}
###############################################################################
Project: "Test gosHelp"="..\Test gosHelp\Test gosHelp.dsp" - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
Begin Project Dependency
Project_Dep_Name GameOS
End Project Dependency
Begin Project Dependency
Project_Dep_Name GamePlatform
End Project Dependency
Begin Project Dependency
Project_Dep_Name gosHelp
End Project Dependency
Begin Project Dependency
Project_Dep_Name GOSScript
End Project Dependency
}}}
###############################################################################
Project: "gosHelp"=..\..\Libraries\gosHelp\gosHelp.dsp - Package Owner=<4>
Package=<5>
{{{
}}}
Package=<4>
{{{
}}}
###############################################################################
Global:
Package=<5>
{{{
}}}
Package=<3>
{{{
}}}
###############################################################################
@@ -0,0 +1,51 @@
// GosView.h : main header file for the GOSVIEW application
//
#if !defined(AFX_GOSVIEW_H__55481178_224B_42E4_96CE_25BE1378D218__INCLUDED_)
#define AFX_GOSVIEW_H__55481178_224B_42E4_96CE_25BE1378D218__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#ifndef __AFXWIN_H__
#error include 'stdafx.h' before including this file for PCH
#endif
#include "resource.h" // main symbols
/////////////////////////////////////////////////////////////////////////////
// CGosViewApp:
// See GosView.cpp for the implementation of this class
//
class CGosViewApp : public CWinApp
{
public:
CGosViewApp();
CMultiDocTemplate * m_ptTimeFrame;
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CGosViewApp)
public:
virtual BOOL InitInstance();
//}}AFX_VIRTUAL
// Implementation
//{{AFX_MSG(CGosViewApp)
afx_msg void OnAppAbout();
// NOTE - the ClassWizard will add and remove member functions here.
// DO NOT EDIT what you see in these blocks of generated code !
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_GOSVIEW_H__55481178_224B_42E4_96CE_25BE1378D218__INCLUDED_)
@@ -0,0 +1,619 @@
//Microsoft Developer Studio generated resource script.
//
#include "resource.h"
#define APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 2 resource.
//
#include "afxres.h"
/////////////////////////////////////////////////////////////////////////////
#undef APSTUDIO_READONLY_SYMBOLS
/////////////////////////////////////////////////////////////////////////////
// English (U.S.) resources
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
#ifdef _WIN32
LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
#pragma code_page(1252)
#endif //_WIN32
#ifdef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// TEXTINCLUDE
//
1 TEXTINCLUDE DISCARDABLE
BEGIN
"resource.h\0"
END
2 TEXTINCLUDE DISCARDABLE
BEGIN
"#include ""afxres.h""\r\n"
"\0"
END
3 TEXTINCLUDE DISCARDABLE
BEGIN
"#define _AFX_NO_OLE_RESOURCES\r\n"
"#define _AFX_NO_TRACKER_RESOURCES\r\n"
"#define _AFX_NO_PROPERTY_RESOURCES\r\n"
"\r\n"
"#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)\r\n"
"#ifdef _WIN32\r\n"
"LANGUAGE 9, 1\r\n"
"#pragma code_page(1252)\r\n"
"#endif //_WIN32\r\n"
"#include ""res\\GosView.rc2"" // non-Microsoft Visual C++ edited resources\r\n"
"#include ""afxres.rc"" // Standard components\r\n"
"#include ""afxprint.rc"" // printing/print preview resources\r\n"
"#endif\r\n"
"\0"
END
#endif // APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Icon
//
// Icon with lowest ID value placed first to ensure application icon
// remains consistent on all systems.
IDR_MAINFRAME ICON DISCARDABLE "res\\GosView.ico"
IDR_GOSTYPE ICON DISCARDABLE "res\\GosViewDoc.ico"
/////////////////////////////////////////////////////////////////////////////
//
// Bitmap
//
IDR_MAINFRAME BITMAP MOVEABLE PURE "res\\Toolbar.bmp"
IDR_TIME_TOOLBAR BITMAP DISCARDABLE "res\\toolbar1.bmp"
/////////////////////////////////////////////////////////////////////////////
//
// Toolbar
//
IDR_MAINFRAME TOOLBAR DISCARDABLE 16, 15
BEGIN
BUTTON ID_FILE_NEW
BUTTON ID_FILE_OPEN
BUTTON ID_FILE_SAVE
SEPARATOR
BUTTON ID_EDIT_CUT
BUTTON ID_EDIT_COPY
BUTTON ID_EDIT_PASTE
SEPARATOR
BUTTON ID_FILE_PRINT
SEPARATOR
BUTTON ID_APP_ABOUT
BUTTON ID_CONTEXT_HELP
SEPARATOR
BUTTON ID_TARGET_BUTTON
BUTTON ID_CONNECT
BUTTON ID_DISCONNECT
SEPARATOR
BUTTON ID_TRACE_ONCE
BUTTON ID_START_TRACE
BUTTON ID_STOP_TRACE
SEPARATOR
BUTTON ID_FONTBUTTON
SEPARATOR
BUTTON ID_SHOWENTRYOFF
BUTTON ID_SHOWENTRYON
SEPARATOR
BUTTON ID_SINGLE_THICK
BUTTON ID_DOUBLE_THICK
BUTTON ID_TRIPLE_THICK
SEPARATOR
BUTTON ID_NUM_SORT
BUTTON ID_ALPHA_SORT
SEPARATOR
BUTTON ID_FULL_NAMES
BUTTON ID_PART_NAMES
END
IDR_TIME_TOOLBAR TOOLBAR DISCARDABLE 16, 15
BEGIN
BUTTON ID_BUTTON32784
BUTTON ID_BUTTON32785
END
/////////////////////////////////////////////////////////////////////////////
//
// Menu
//
IDR_MAINFRAME MENU PRELOAD DISCARDABLE
BEGIN
POPUP "&File"
BEGIN
MENUITEM "&New\tCtrl+N", ID_FILE_NEW
MENUITEM "&Open...\tCtrl+O", ID_FILE_OPEN
MENUITEM SEPARATOR
MENUITEM "P&rint Setup...", ID_FILE_PRINT_SETUP
MENUITEM SEPARATOR
MENUITEM "Recent File", ID_FILE_MRU_FILE1, GRAYED
MENUITEM SEPARATOR
MENUITEM "E&xit", ID_APP_EXIT
END
POPUP "&View"
BEGIN
MENUITEM "&Toolbar", ID_VIEW_TOOLBAR
MENUITEM "&Status Bar", ID_VIEW_STATUS_BAR
END
POPUP "&Help"
BEGIN
MENUITEM "&Help Topics", ID_HELP_FINDER
MENUITEM SEPARATOR
MENUITEM "&About GosView...", ID_APP_ABOUT
END
END
IDR_GOSTYPE MENU PRELOAD DISCARDABLE
BEGIN
POPUP "&File"
BEGIN
MENUITEM "&New\tCtrl+N", ID_FILE_NEW
MENUITEM "&Open...\tCtrl+O", ID_FILE_OPEN
MENUITEM "&Close", ID_FILE_CLOSE
MENUITEM "&Save\tCtrl+S", ID_FILE_SAVE
MENUITEM "Save &As...", ID_FILE_SAVE_AS
MENUITEM SEPARATOR
MENUITEM "&Print...\tCtrl+P", ID_FILE_PRINT
MENUITEM "Print Pre&view", ID_FILE_PRINT_PREVIEW
MENUITEM "P&rint Setup...", ID_FILE_PRINT_SETUP
MENUITEM SEPARATOR
MENUITEM "Recent File", ID_FILE_MRU_FILE1, GRAYED
MENUITEM SEPARATOR
MENUITEM "E&xit", ID_APP_EXIT
END
POPUP "&Edit"
BEGIN
MENUITEM "&Undo\tCtrl+Z", ID_EDIT_UNDO
MENUITEM SEPARATOR
MENUITEM "Cu&t\tCtrl+X", ID_EDIT_CUT
MENUITEM "&Copy\tCtrl+C", ID_EDIT_COPY
MENUITEM "&Paste\tCtrl+V", ID_EDIT_PASTE
END
POPUP "&View"
BEGIN
MENUITEM "&Toolbar", ID_VIEW_TOOLBAR
MENUITEM "&Status Bar", ID_VIEW_STATUS_BAR
END
POPUP "&Window"
BEGIN
MENUITEM "&New Window", ID_WINDOW_NEW
MENUITEM "&Cascade", ID_WINDOW_CASCADE
MENUITEM "&Tile", ID_WINDOW_TILE_HORZ
MENUITEM "&Arrange Icons", ID_WINDOW_ARRANGE
MENUITEM "S&plit", ID_WINDOW_SPLIT
END
POPUP "&Help"
BEGIN
MENUITEM "&Help Topics", ID_HELP_FINDER
MENUITEM SEPARATOR
MENUITEM "&About GosView...", ID_APP_ABOUT
END
END
/////////////////////////////////////////////////////////////////////////////
//
// Accelerator
//
IDR_MAINFRAME ACCELERATORS PRELOAD MOVEABLE PURE
BEGIN
"N", ID_FILE_NEW, VIRTKEY, CONTROL
"O", ID_FILE_OPEN, VIRTKEY, CONTROL
"S", ID_FILE_SAVE, VIRTKEY, CONTROL
"P", ID_FILE_PRINT, VIRTKEY, CONTROL
"Z", ID_EDIT_UNDO, VIRTKEY, CONTROL
"X", ID_EDIT_CUT, VIRTKEY, CONTROL
"C", ID_EDIT_COPY, VIRTKEY, CONTROL
"V", ID_EDIT_PASTE, VIRTKEY, CONTROL
VK_BACK, ID_EDIT_UNDO, VIRTKEY, ALT
VK_DELETE, ID_EDIT_CUT, VIRTKEY, SHIFT
VK_INSERT, ID_EDIT_COPY, VIRTKEY, CONTROL
VK_INSERT, ID_EDIT_PASTE, VIRTKEY, SHIFT
VK_F6, ID_NEXT_PANE, VIRTKEY
VK_F6, ID_PREV_PANE, VIRTKEY, SHIFT
VK_F1, ID_CONTEXT_HELP, VIRTKEY, SHIFT
VK_F1, ID_HELP, VIRTKEY
END
/////////////////////////////////////////////////////////////////////////////
//
// Dialog
//
IDD_ABOUTBOX DIALOG DISCARDABLE 0, 0, 235, 55
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "About GosView"
FONT 8, "MS Sans Serif"
BEGIN
ICON IDR_MAINFRAME,IDC_STATIC,11,17,20,20
LTEXT "GosView Version 1.0",IDC_STATIC,40,10,119,8,SS_NOPREFIX
LTEXT "Copyright (C) 2000",IDC_STATIC,40,25,119,8
DEFPUSHBUTTON "OK",IDOK,178,7,50,14,WS_GROUP
END
IDR_MAINFRAME DIALOG DISCARDABLE 0, 0, 216, 12
STYLE WS_CHILD
FONT 8, "MS Sans Serif"
BEGIN
COMBOBOX IDC_COMBO1,0,0,71,93,CBS_DROPDOWN | CBS_SORT |
WS_VSCROLL | WS_TABSTOP
PUSHBUTTON "Button1",IDC_BUTTON1,70,0,56,12
LTEXT "Uninitialized",IDC_SHOWDOC,126,2,90,9
END
IDD_DIALOG1 DIALOG DISCARDABLE 0, 0, 186, 95
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Dialog"
FONT 8, "MS Sans Serif"
BEGIN
DEFPUSHBUTTON "OK",IDOK,129,7,50,14
PUSHBUTTON "Cancel",IDCANCEL,129,24,50,14
END
IDD_DIALOG_CONNECT DIALOG DISCARDABLE 0, 0, 95, 19
STYLE WS_CHILD
FONT 8, "MS Sans Serif"
BEGIN
COMBOBOX IDC_COMBO1,2,3,93,100,CBS_DROPDOWN | CBS_SORT |
WS_VSCROLL | WS_TABSTOP
END
IDD_DOC_DIALOG DIALOG DISCARDABLE 0, 0, 104, 22
STYLE WS_CHILD | WS_VISIBLE
FONT 8, "MS Sans Serif"
BEGIN
EDITTEXT IDC_EDIT1,5,4,82,15,ES_AUTOHSCROLL
END
IDD_DIALOG2 DIALOG DISCARDABLE 0, 0, 146, 14
STYLE WS_CHILD
FONT 8, "MS Sans Serif"
BEGIN
DEFPUSHBUTTON "OK",IDOK,91,0,50,14
EDITTEXT IDC_EDIT1,8,2,74,12,ES_AUTOHSCROLL
END
IDD_ZOOM_DIALOG DIALOG DISCARDABLE 0, 0, 208, 19
STYLE DS_MODALFRAME | WS_CHILD
FONT 8, "MS Sans Serif"
BEGIN
COMBOBOX IDC_ZOOM_UNITS,3,3,65,150,CBS_DROPDOWNLIST | WS_TABSTOP
CONTROL "Slider1",IDC_ZOOM_SLIDER,"msctls_trackbar32",
TBS_AUTOTICKS | TBS_TOP | WS_TABSTOP,69,0,125,19
END
IDD_TARGET_DIALOG DIALOG DISCARDABLE 0, 0, 186, 95
STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
CAPTION "Dialog"
FONT 8, "MS Sans Serif"
BEGIN
DEFPUSHBUTTON "OK",IDOK,129,53,50,14
PUSHBUTTON "Cancel",IDCANCEL,129,74,50,14
PUSHBUTTON "Local",IDLOCAL,129,7,50,14
EDITTEXT IDC_TARGET_NAME,7,28,172,15,ES_AUTOHSCROLL
END
#ifndef _MAC
/////////////////////////////////////////////////////////////////////////////
//
// Version
//
VS_VERSION_INFO VERSIONINFO
FILEVERSION 1,0,0,1
PRODUCTVERSION 1,0,0,1
FILEFLAGSMASK 0x3fL
#ifdef _DEBUG
FILEFLAGS 0x1L
#else
FILEFLAGS 0x0L
#endif
FILEOS 0x4L
FILETYPE 0x1L
FILESUBTYPE 0x0L
BEGIN
BLOCK "StringFileInfo"
BEGIN
BLOCK "040904b0"
BEGIN
VALUE "Comments", "\0"
VALUE "CompanyName", "Microsoft Corporation\0"
VALUE "FileDescription", "GosView MFC Application\0"
VALUE "FileVersion", "1, 0, 0, 1\0"
VALUE "InternalName", "GosView1\0"
VALUE "LegalCopyright", "Copyright (C) 2000 Microsoft Corporation\0"
VALUE "LegalTrademarks", "\0"
VALUE "OriginalFilename", "GosView.EXE\0"
VALUE "PrivateBuild", "\0"
VALUE "ProductName", "GosView Application\0"
VALUE "ProductVersion", "1, 0, 0, 1\0"
VALUE "SpecialBuild", "\0"
END
END
BLOCK "VarFileInfo"
BEGIN
VALUE "Translation", 0x409, 1200
END
END
#endif // !_MAC
/////////////////////////////////////////////////////////////////////////////
//
// DESIGNINFO
//
#ifdef APSTUDIO_INVOKED
GUIDELINES DESIGNINFO DISCARDABLE
BEGIN
IDD_ABOUTBOX, DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 228
TOPMARGIN, 7
BOTTOMMARGIN, 48
END
IDD_DIALOG1, DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 179
TOPMARGIN, 7
BOTTOMMARGIN, 88
END
IDD_TARGET_DIALOG, DIALOG
BEGIN
LEFTMARGIN, 7
RIGHTMARGIN, 179
TOPMARGIN, 7
BOTTOMMARGIN, 88
END
END
#endif // APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Dialog Info
//
IDD_DIALOG_CONNECT DLGINIT
BEGIN
IDC_COMBO1, 0x403, 8, 0
0x4c3c, 0x636f, 0x6c61, 0x003e,
0
END
IDR_MAINFRAME DLGINIT
BEGIN
IDC_COMBO1, 0x403, 6, 0
0x6f63, 0x6e6e, 0x0031,
IDC_COMBO1, 0x403, 6, 0
0x6f63, 0x6e6e, 0x0032,
IDC_COMBO1, 0x403, 6, 0
0x6f63, 0x6e6e, 0x0033,
IDC_COMBO1, 0x403, 6, 0
0x6f63, 0x6e6e, 0x0034,
0
END
/////////////////////////////////////////////////////////////////////////////
//
// String Table
//
STRINGTABLE DISCARDABLE
BEGIN
ID_CONNECTION_STATUS "Not Connected Yet"
IDP_SOCKETS_INIT_FAILED "Windows sockets initialization failed."
END
STRINGTABLE PRELOAD DISCARDABLE
BEGIN
IDR_MAINFRAME "GosView"
IDR_GOSTYPE "\nGOS\nGosView\nGosView Files (*.gv1)\n.gv1\nGosView\nGOS Document"
END
STRINGTABLE PRELOAD DISCARDABLE
BEGIN
AFX_IDS_APP_TITLE "GosView"
AFX_IDS_IDLEMESSAGE "For Help, press F1"
AFX_IDS_HELPMODEMESSAGE "Select an object on which to get Help"
END
STRINGTABLE DISCARDABLE
BEGIN
ID_INDICATOR_EXT "EXT"
ID_INDICATOR_CAPS "CAP"
ID_INDICATOR_NUM "NUM"
ID_INDICATOR_SCRL "SCRL"
ID_INDICATOR_OVR "OVR"
ID_INDICATOR_REC "REC"
END
STRINGTABLE DISCARDABLE
BEGIN
ID_FILE_NEW "Create a new document\nNew"
ID_FILE_OPEN "Open an existing document\nOpen"
ID_FILE_CLOSE "Close the active document\nClose"
ID_FILE_SAVE "Save the active document\nSave"
ID_FILE_SAVE_AS "Save the active document with a new name\nSave As"
ID_FILE_PAGE_SETUP "Change the printing options\nPage Setup"
ID_FILE_PRINT_SETUP "Change the printer and printing options\nPrint Setup"
ID_FILE_PRINT "Print the active document\nPrint"
ID_FILE_PRINT_PREVIEW "Display full pages\nPrint Preview"
END
STRINGTABLE DISCARDABLE
BEGIN
ID_APP_ABOUT "Display program information, version number and copyright\nAbout"
ID_APP_EXIT "Quit the application; prompts to save documents\nExit"
ID_HELP_INDEX "Opens Help\nHelp Topics"
ID_HELP_FINDER "List Help topics\nHelp Topics"
ID_HELP_USING "Display instructions about how to use help\nHelp"
ID_CONTEXT_HELP "Display help for clicked on buttons, menus and windows\nHelp"
ID_HELP "Display help for current task or command\nHelp"
END
STRINGTABLE DISCARDABLE
BEGIN
ID_FILE_MRU_FILE1 "Open this document"
ID_FILE_MRU_FILE2 "Open this document"
ID_FILE_MRU_FILE3 "Open this document"
ID_FILE_MRU_FILE4 "Open this document"
ID_FILE_MRU_FILE5 "Open this document"
ID_FILE_MRU_FILE6 "Open this document"
ID_FILE_MRU_FILE7 "Open this document"
ID_FILE_MRU_FILE8 "Open this document"
ID_FILE_MRU_FILE9 "Open this document"
ID_FILE_MRU_FILE10 "Open this document"
ID_FILE_MRU_FILE11 "Open this document"
ID_FILE_MRU_FILE12 "Open this document"
ID_FILE_MRU_FILE13 "Open this document"
ID_FILE_MRU_FILE14 "Open this document"
ID_FILE_MRU_FILE15 "Open this document"
ID_FILE_MRU_FILE16 "Open this document"
END
STRINGTABLE DISCARDABLE
BEGIN
ID_NEXT_PANE "Switch to the next window pane\nNext Pane"
ID_PREV_PANE "Switch back to the previous window pane\nPrevious Pane"
END
STRINGTABLE DISCARDABLE
BEGIN
ID_WINDOW_NEW "Open another window for the active document\nNew Window"
ID_WINDOW_ARRANGE "Arrange icons at the bottom of the window\nArrange Icons"
ID_WINDOW_CASCADE "Arrange windows so they overlap\nCascade Windows"
ID_WINDOW_TILE_HORZ "Arrange windows as non-overlapping tiles\nTile Windows"
ID_WINDOW_TILE_VERT "Arrange windows as non-overlapping tiles\nTile Windows"
ID_WINDOW_SPLIT "Split the active window into panes\nSplit"
END
STRINGTABLE DISCARDABLE
BEGIN
ID_EDIT_CLEAR "Erase the selection\nErase"
ID_EDIT_CLEAR_ALL "Erase everything\nErase All"
ID_EDIT_COPY "Copy the selection and put it on the Clipboard\nCopy"
ID_EDIT_CUT "Cut the selection and put it on the Clipboard\nCut"
ID_EDIT_FIND "Find the specified text\nFind"
ID_EDIT_PASTE "Insert Clipboard contents\nPaste"
ID_EDIT_REPEAT "Repeat the last action\nRepeat"
ID_EDIT_REPLACE "Replace specific text with different text\nReplace"
ID_EDIT_SELECT_ALL "Select the entire document\nSelect All"
ID_EDIT_UNDO "Undo the last action\nUndo"
ID_EDIT_REDO "Redo the previously undone action\nRedo"
END
STRINGTABLE DISCARDABLE
BEGIN
ID_VIEW_TOOLBAR "Show or hide the toolbar\nToggle ToolBar"
ID_VIEW_STATUS_BAR "Show or hide the status bar\nToggle StatusBar"
END
STRINGTABLE DISCARDABLE
BEGIN
AFX_IDS_SCSIZE "Change the window size"
AFX_IDS_SCMOVE "Change the window position"
AFX_IDS_SCMINIMIZE "Reduce the window to an icon"
AFX_IDS_SCMAXIMIZE "Enlarge the window to full size"
AFX_IDS_SCNEXTWINDOW "Switch to the next document window"
AFX_IDS_SCPREVWINDOW "Switch to the previous document window"
AFX_IDS_SCCLOSE "Close the active window and prompts to save the documents"
END
STRINGTABLE DISCARDABLE
BEGIN
AFX_IDS_SCRESTORE "Restore the window to normal size"
AFX_IDS_SCTASKLIST "Activate Task List"
AFX_IDS_MDICHILD "Activate this window"
END
STRINGTABLE DISCARDABLE
BEGIN
AFX_IDS_PREVIEW_CLOSE "Close print preview mode\nCancel Preview"
END
STRINGTABLE DISCARDABLE
BEGIN
ID_BUTTON32786 "Connect to GameOS"
ID_BUTTON32787 "Disconnect from GameOS"
IDC_CONNECT "Connect to GameOS"
ID_DISCONNECT "Disconnect from target"
ID_CONNECT "Connect to target"
ID_BUTTON32793 "Start trace"
ID_BUTTON32794 "Stop trace"
ID_BUTTON32795 "Download IDs from target"
ID_BUTTON32796 "Download event log from target"
ID_START_TRACE "Start Trace"
ID_STOP_TRACE "Stop Trace"
ID_GET_IDS "Download Event ID list"
END
STRINGTABLE DISCARDABLE
BEGIN
ID_GET_LOG "Download event log"
ID_TRACE_ONCE "Trace once and get results"
ID_FONTBUTTON "Select the font"
ID_SHOWENTRYOFF "Disable red dots at entry into functions"
ID_SHOWENTRYON "Display red dots on entry into functions"
ID_SINGLE_THICK "Thin Lines on Trace"
ID_DOUBLE_THICK "Medium lines on trace"
ID_TRIPLE_THICK "Very thick lines on trace"
ID_NUM_SORT "Sort By Occurrence"
ID_ALPHA_SORT "Sort By Name"
ID_BUTTON32810 "Leave full heirarchy Names"
ID_BUTTON32811 "Show Child Names Only"
ID_TARGET_BUTTON "Select the target machine"
END
#endif // English (U.S.) resources
/////////////////////////////////////////////////////////////////////////////
#ifndef APSTUDIO_INVOKED
/////////////////////////////////////////////////////////////////////////////
//
// Generated from the TEXTINCLUDE 3 resource.
//
#define _AFX_NO_OLE_RESOURCES
#define _AFX_NO_TRACKER_RESOURCES
#define _AFX_NO_PROPERTY_RESOURCES
#if !defined(AFX_RESOURCE_DLL) || defined(AFX_TARG_ENU)
#ifdef _WIN32
LANGUAGE 9, 1
#pragma code_page(1252)
#endif //_WIN32
#include "res\GosView.rc2" // non-Microsoft Visual C++ edited resources
#include "afxres.rc" // Standard components
#include "afxprint.rc" // printing/print preview resources
#endif
/////////////////////////////////////////////////////////////////////////////
#endif // not APSTUDIO_INVOKED
@@ -0,0 +1,14 @@
REGEDIT
; This .REG file may be used by your SETUP program.
; If a SETUP program is not available, the entries below will be
; registered in your InitInstance automatically with a call to
; CWinApp::RegisterShellFileTypes and COleObjectFactory::UpdateRegistryAll.
HKEY_CLASSES_ROOT\.gv1 = GosView
HKEY_CLASSES_ROOT\GosView\shell\open\command = GOSVIEW.EXE %1
HKEY_CLASSES_ROOT\GosView\shell\open\ddeexec = [open("%1")]
HKEY_CLASSES_ROOT\GosView\shell\open\ddeexec\application = GOSVIEW
; note: the application is optional
; (it defaults to the app name in "command")
HKEY_CLASSES_ROOT\GosView = GOS Document
@@ -0,0 +1,454 @@
// GosViewDoc.cpp : implementation of the CGosViewDoc class
//
#include "stdafx.h"
#include "GosView.h"
#include "GosViewDoc.h"
#include "MainFrm.h"
#include "goseventpane.h"
#include "TimeFrame.h"
#include "TargetDialog.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CGosViewDoc
IMPLEMENT_DYNCREATE(CGosViewDoc, CDocument)
BEGIN_MESSAGE_MAP(CGosViewDoc, CDocument)
//{{AFX_MSG_MAP(CGosViewDoc)
ON_EN_CHANGE(IDC_EDIT1, OnChangeEdit1)
ON_COMMAND(ID_CONNECT, OnConnect)
ON_COMMAND(ID_DISCONNECT, OnDisconnect)
ON_UPDATE_COMMAND_UI(ID_CONNECT, OnUpdateConnect)
ON_UPDATE_COMMAND_UI(ID_DISCONNECT, OnUpdateDisconnect)
ON_COMMAND(ID_START_TRACE, OnStartTrace)
ON_UPDATE_COMMAND_UI(ID_START_TRACE, OnUpdateStartTrace)
ON_COMMAND(ID_STOP_TRACE, OnStopTrace)
ON_UPDATE_COMMAND_UI(ID_STOP_TRACE, OnUpdateStopTrace)
ON_COMMAND(ID_TRACE_ONCE, OnTraceOnce)
ON_UPDATE_COMMAND_UI(ID_TRACE_ONCE, OnUpdateTraceOnce)
ON_UPDATE_COMMAND_UI(ID_FONTBUTTON, OnUpdateFontbutton)
ON_COMMAND(ID_FONTBUTTON, OnFontbutton)
ON_COMMAND(ID_TARGET_BUTTON, OnTargetButton)
//}}AFX_MSG_MAP
ON_UPDATE_COMMAND_UI(ID_CONNECTION_STATUS, OnUpdateConnectionStatus)
ON_UPDATE_COMMAND_UI(IDC_SHOWDOC, OnUpdateDocName )
END_MESSAGE_MAP()
void CGosViewDoc::OnUpdateConnectionStatus(CCmdUI* pCmdUI)
{
/*
CString string;
switch( m_Session.State() )
{
case CSession::NotConnected:
string.Format (_T ("Not Connected"));
break;
case CSession::AwaitingConnection:
string.Format (_T ("Awaiting Connection"));
break;
case CSession::Connected:
string.Format (_T ("Connected"));
break;
case CSession::SessionError:
string.Format (_T ("Error"));
break;
default:
string.Format (_T ("UNKNOWN !"));
}
*/
pCmdUI->Enable (TRUE);
pCmdUI->SetText ( m_Session.StateName() );
}
void CGosViewDoc::OnUpdateDocName(CCmdUI* pCmdUI)
{
// CString string;
// static int cnt=0;
// cnt++;
// string.Format (_T ("Doc %d %s"), cnt, m_ConnName);
// pCmdUI->Enable (TRUE);
// pCmdUI->SetText (string);
}
/////////////////////////////////////////////////////////////////////////////
// CGosViewDoc construction/destruction
CGosViewDoc::CGosViewDoc()
{
m_Session.SetOwningDoc( this );
m_fTracing = false;
m_fTraceReady = false;
gethostname( m_ConnName, 50 );
RECT rect = { 0, 0, 0, 0 };
CMainFrame *pFrame = (CMainFrame *) AfxGetApp()->m_pMainWnd;
m_pLog = NULL;
m_pLogEnd = NULL;
m_pFont = NULL;
m_nFreq = 731000000;
m_Session.Create(NULL,"Session",WS_CHILD, rect, pFrame, ID_SESSION );
}
CGosViewDoc::~CGosViewDoc()
{
if( m_pLog )
free( m_pLog );
}
BOOL CGosViewDoc::OnNewDocument()
{
if (!CDocument::OnNewDocument())
return FALSE;
return TRUE;
}
/////////////////////////////////////////////////////////////////////////////
// CGosViewDoc serialization
void CGosViewDoc::Serialize(CArchive& ar)
{
if (ar.IsStoring())
{
ar << CString("GosView V1.0.0 file");
for( TagInfoEntry *pTIE = m_TagInfo.First(); pTIE; pTIE = m_TagInfo.Next(pTIE) )
{
ar << CString("Tag");
ar << pTIE->id;
ar << CString(pTIE->Name);
}
ar << CString("CPU Freq");
ar.Write( (void *)& m_nFreq, sizeof(m_nFreq) );
ar << CString("TStart");
ar.Write( (void *)& m_tLogStart, sizeof(m_tLogStart) );
ar << CString("TEnd");
ar.Write( (void *)& m_tLogEnd, sizeof(m_tLogEnd) );
ar << CString("LogSize") << (unsigned long)m_pLogEnd - (unsigned long)m_pLog;
ar << CString("LogData");
ar.Write( (void *)m_pLog, (unsigned long)m_pLogEnd - (unsigned long)m_pLog );
ar << CString("EndOfFile");
}
else
{
CString version;
ar >> version;
if( version != CString("GosView V1.0.0 file") )
{
DebugBreak(); // incompatible file version
return;
}
CString lType;
GosLogInfo logInfo;
unsigned long *pNewLog;
for( ar >> lType; lType != CString("EndOfFile"); ar >> lType )
{
if( lType == CString("Tag") )
{
unsigned long id;
CString name;
ar >> id;
ar >> name;
TagInfoEntry *pTIE = m_TagInfo.Allocate(id);
pTIE->id = id;
strcpy( pTIE->Name, name );
}
else if( lType == CString("CPU Freq") )
{
ar.Read( (void *)&m_nFreq, sizeof(m_nFreq) );
}
else if( lType == CString("TStart") )
{
ar.Read( (void *)&logInfo.tLogStart, sizeof(logInfo.tLogStart) );
}
else if( lType == CString("TEnd") )
{
ar.Read( (void *)&logInfo.tLogEnd, sizeof(logInfo.tLogEnd) );
}
else if( lType == CString("LogSize") )
{
ar.Read( (void *)&logInfo.logLength, sizeof(logInfo.logLength) );
}
else if( lType == CString("LogData") )
{
pNewLog = (unsigned long *)malloc(logInfo.logLength);
ar.Read( (void *)pNewLog, logInfo.logLength );
}
else
{
// Error reading log
DebugBreak();
}
}
ParseNewLog( pNewLog, &logInfo );
}
}
/////////////////////////////////////////////////////////////////////////////
// CGosViewDoc diagnostics
#ifdef _DEBUG
void CGosViewDoc::AssertValid() const
{
CDocument::AssertValid();
}
void CGosViewDoc::Dump(CDumpContext& dc) const
{
CDocument::Dump(dc);
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CGosViewDoc commands
void CGosViewDoc::OnChangeEdit1()
{
// TODO: If this is a RICHEDIT control, the control will not
// send this notification unless you override the CDocument::OnInitDialog()
// function and call CRichEditCtrl().SetEventMask()
// with the ENM_CHANGE flag ORed into the mask.
// TODO: Add your control notification handler code here
CMainFrame *pFrame = (CMainFrame *) AfxGetApp()->m_pMainWnd;
CDialogBar *pDialogBar = &(pFrame->m_wndDlgBar2);
CEdit *pEdit = (CEdit *)(pDialogBar->GetDlgItem(IDC_EDIT1));
pEdit->GetLine(0,m_ConnName,250);
}
void CGosViewDoc::SetFocus()
{
/*
CMainFrame *pFrame = (CMainFrame *) AfxGetApp()->m_pMainWnd;
CDialogBar *pDialogBar = &(pFrame->m_wndDlgBar2);
CEdit *pEdit = (CEdit *)(pDialogBar->GetDlgItem(IDC_EDIT1));
pEdit->SetSel(0,-1);
pEdit->ReplaceSel(m_ConnName);
*/
}
void CGosViewDoc::OnConnect()
{
m_Session.Connect( m_ConnName );
}
void CGosViewDoc::OnDisconnect()
{
m_fTracing = false;
m_Session.Disconnect();
}
void CGosViewDoc::OnUpdateConnect(CCmdUI* pCmdUI)
{
pCmdUI->Enable( m_Session.State() == CSession::NotConnected );
}
void CGosViewDoc::OnUpdateDisconnect(CCmdUI* pCmdUI)
{
pCmdUI->Enable( m_Session.State() != CSession::NotConnected );
}
// bool SendCommand( int command, void *pData, void (*pHandler)(void *, int, void *) )
void CGosViewDoc::OnStartTrace()
{
m_fTraceOnce = false;
m_fTracing = true;
m_Session.SendCommand( GVCMD_STARTLOG, 0, NULL );
}
void CGosViewDoc::OnUpdateStartTrace(CCmdUI* pCmdUI)
{
pCmdUI->Enable( false ); // !m_fTracing && ( m_Session.State() == CSession::Connected ) );
}
void CGosViewDoc::OnStopTrace()
{
m_fTracing = false;
m_Session.SendCommand( GVCMD_STOPLOG, 0, NULL );
}
void CGosViewDoc::OnUpdateStopTrace(CCmdUI* pCmdUI)
{
pCmdUI->Enable( m_fTracing && ( m_Session.State() == CSession::Connected ) );
}
void CGosViewDoc::ParseNewLog( DWORD *pLog, GosLogInfo *pLogInfo )
{
// walk through the log looking for new IDs
DWORD *pLogEntry;
DWORD *pLogEnd = (DWORD *)(((char *)pLog)+pLogInfo->logLength);
if( m_fTraceOnce )
m_fTracing = false;
bool NewTags = false;
UpdateTimeFrameList();
DWORD tag;
DWORD time;
for( pLogEntry = pLog; pLogEntry < pLogEnd; )
{
// check if it is a valid entry start
// FOR NOW ASSUME WE ONLY HAVE A VALID LOG START & STOP
tag = *pLogEntry++;
time = *pLogEntry++;
// check if we have this ID already
if( !m_TagInfo.Contains(tag) )
{
// get the details of the new id
GetIDName( tag );
for( POSITION pos = m_TimeFrameList.GetHeadPosition(); pos!=NULL; )
{
CTimeFrame *pFrame = (CTimeFrame *)(m_TimeFrameList.GetNext(pos));
pFrame->AddId( tag );
}
}
}
// Substitute this for the current log
if( m_pLog )
free( m_pLog );
m_pLog = pLog;
m_pLogEnd = pLogEnd;
m_tLogStart = pLogInfo->tLogStart;
m_tLogEnd = pLogInfo->tLogEnd;
m_fTraceReady = true;
// Get each timeframe to update itself
for( POSITION pos = m_TimeFrameList.GetHeadPosition(); pos!=NULL; )
{
CTimeFrame *pFrame = (CTimeFrame *)(m_TimeFrameList.GetNext(pos));
pFrame->SetDocument(this);
pFrame->UpdateAllIds();
pFrame->ProcessNewLog();
}
// now get each view to update itself
UpdateAllViews(NULL);
}
char * CGosViewDoc::GetIDName( DWORD id )
{
TagInfoEntry *pTIE = m_TagInfo.Find(id);
if( !pTIE )
{
m_Session.SendCommand( GVCMD_GETEVENTNAME, 4, (char *)&id );
pTIE = m_TagInfo.Allocate(id);
m_Session.ReceiveData( 255, pTIE->Name );
pTIE->id = id;
}
return pTIE->Name;
};
void CGosViewDoc::OnTraceOnce()
{
m_fTraceOnce = true;
m_fTracing = true;
m_Session.SendCommand( GVCMD_STARTLOGONCE, 0, NULL );
}
void CGosViewDoc::OnUpdateTraceOnce(CCmdUI* pCmdUI)
{
pCmdUI->Enable( !m_fTracing && ( m_Session.State() == CSession::Connected ) );
}
void CGosViewDoc::UpdateTimeFrameList()
{
m_TimeFrameList.RemoveAll();
POSITION pos;
CGosEventPane *pView;
for( pos = GetFirstViewPosition(); pos; )
{
pView = (CGosEventPane *)GetNextView( pos );
if( m_TimeFrameList.Find(pView->m_pParentFrame) == NULL )
m_TimeFrameList.AddTail(pView->m_pParentFrame);
}
}
void CGosViewDoc::OnUpdateFontbutton(CCmdUI* pCmdUI)
{
pCmdUI->Enable();
}
void CGosViewDoc::OnFontbutton()
{
CFontDialog cFontDlg;
if( cFontDlg.DoModal() == IDOK )
{
if( m_pFont )
delete m_pFont;
m_pFont = new CFont();
LOGFONT logFont;
cFontDlg.GetCurrentFont(&logFont);
m_pFont->CreateFontIndirect(&logFont);
UpdateAllViews(NULL);
}
}
void CGosViewDoc::OnTargetButton()
{
CTargetDialog dlg( this );
dlg.DoModal();
}
@@ -0,0 +1,121 @@
// GosViewDoc.h : interface of the CGosViewDoc class
//
/////////////////////////////////////////////////////////////////////////////
#if !defined(AFX_GOSVIEWDOC_H__206C4E6E_8F14_4567_B728_870FD6B7D30B__INCLUDED_)
#define AFX_GOSVIEWDOC_H__206C4E6E_8F14_4567_B728_870FD6B7D30B__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#include "session.h"
#include "IDContainer.h"
#include <afxtempl.h>
class CTimeFrame;
class CGosViewDoc : public CDocument
{
protected: // create from serialization only
CGosViewDoc();
DECLARE_DYNCREATE(CGosViewDoc)
CList<CTimeFrame *,CTimeFrame *>m_TimeFrameList;
// Attributes
public:
// Connection with target
CSession m_Session;
char m_ConnName[256];
void OnUpdateConnectionStatus(CCmdUI* pCmdUI);
void OnUpdateDocName(CCmdUI* pCmdUI);
// Target / Connection Status
bool m_fTracing;
bool m_fTraceReady;
bool m_fTraceOnce;
_int64 m_nFreq;
// Current Log
DWORD *m_pLog; // a currently filled out log
DWORD *m_pLogEnd; // (beyond) end of current log
_int64 m_tLogStart;
_int64 m_tLogEnd;
struct TagInfoEntry
{
DWORD id;
char Name[256];
} ;
IDContainer<TagInfoEntry> m_TagInfo;
void ParseNewLog( DWORD *pLog, GosLogInfo *pLogInfo );
char * GetIDName( DWORD id );
bool TraceReady() { return m_fTraceReady; }
void SetFreq( _int64 freq ) { m_nFreq = freq; }
_int64 TLogStart() { return m_tLogStart; }
_int64 TLogEnd() { return m_tLogEnd; }
// UI for document
void SetFocus();
void UpdateTimeFrameList();
CFont *m_pFont;
// Operations
public:
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CGosViewDoc)
public:
virtual BOOL OnNewDocument();
virtual void Serialize(CArchive& ar);
//}}AFX_VIRTUAL
// Implementation
public:
virtual ~CGosViewDoc();
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
protected:
// Generated message map functions
protected:
//{{AFX_MSG(CGosViewDoc)
afx_msg void OnChangeEdit1();
afx_msg void OnConnect();
afx_msg void OnDisconnect();
afx_msg void OnUpdateConnect(CCmdUI* pCmdUI);
afx_msg void OnUpdateDisconnect(CCmdUI* pCmdUI);
afx_msg void OnStartTrace();
afx_msg void OnUpdateStartTrace(CCmdUI* pCmdUI);
afx_msg void OnStopTrace();
afx_msg void OnUpdateStopTrace(CCmdUI* pCmdUI);
afx_msg void OnTraceOnce();
afx_msg void OnUpdateTraceOnce(CCmdUI* pCmdUI);
afx_msg void OnUpdateFontbutton(CCmdUI* pCmdUI);
afx_msg void OnFontbutton();
afx_msg void OnTargetButton();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_GOSVIEWDOC_H__206C4E6E_8F14_4567_B728_870FD6B7D30B__INCLUDED_)
@@ -0,0 +1,385 @@
#include "stdafx.h"
#include "Hierarchy.h"
static unsigned long NumSubNames( char *pName )
{
int numSub = 1;
char *pC;
for( pC = pName; *pC; pC++ )
{
if( *pC == '\\' )
numSub++;
if( *pC == ':' && pC[1] == ':' )
{
pC++;
numSub++;
}
}
return numSub;
}
static char *SubName( char *pName, int subNameNo )
{
static char subName[256];
char *pC;
char *pCOut;
for( pC = pName; *pC && subNameNo; pC++ )
{
if( *pC == '\\' )
subNameNo--;
if( *pC == ':' && pC[1] == ':' )
{
pC++;
subNameNo--;
}
}
for( pCOut = subName; *pC; pC++ )
{
if( *pC == '\\' )
break;
if( *pC == ':' && pC[1] == ':' )
break;
*pCOut++ = *pC;
}
*pCOut++ = '\0';
return subName;
}
static char *PathName( char *pName, int depth )
{
static char pathName[256];
char *pC;
char *pCOut = pathName;
for( pC = pName; *pC; pC++ )
{
if( *pC == '\\' || ( *pC == ':' && pC[1] == ':' ) )
if( !depth-- )
break;
*pCOut++ = *pC;
}
*pCOut = '\0';
return pathName;
}
unsigned long HierNode::NumSubNames()
{
return ::NumSubNames( m_pFullName );
}
char *HierNode::SubName( int subNameNo )
{
return ::SubName( m_pFullName, subNameNo );
}
HierNode::HierNode( char *pName )
{
m_pSibling = NULL;
m_pChild = NULL;
m_pData = NULL;
m_Flags = HierPresent;
m_pFullName = (char *)malloc( strlen(pName) + 1 );
strcpy( m_pFullName, pName );
m_pBaseName = m_pFullName + strlen(m_pFullName) - 1;
while( m_pBaseName > m_pFullName )
{
if( *(m_pBaseName-1) == '\\' )
break;
if( *(m_pBaseName-1) == ':' )
{
if( ( m_pBaseName > m_pFullName+1 ) && ( *(m_pBaseName-2) == ':' ) )
break;
}
m_pBaseName--;
}
}
HierNode::~HierNode()
{
if( m_pData )
free( m_pData );
free( m_pFullName );
}
char *HierNode::ParentName()
{
static char ParentName[256];
unsigned long len = m_pBaseName - m_pFullName;
if( len >= 255 )
{
len = 255;
}
memcpy( ParentName, m_pFullName, len );
ParentName[len] = '\0';
return ParentName;
}
Hierarchy::Hierarchy()
{
m_nNodes = 0;
m_nVisibleNodes = 0;
m_pFirstNode = NULL;
m_nVisibleNodeTableSize = 0;
m_fVisibleValid = false;
m_pVisibleNode = NULL;
}
Hierarchy::~Hierarchy()
{
DeleteTree( m_pFirstNode );
}
void Hierarchy::DeleteTree( HierNode *pRoot )
{
HierNode *pNode;
while( pRoot )
{
if( pRoot->m_pChild )
DeleteTree(pRoot->m_pChild);
pNode = pRoot;
pRoot = pRoot->m_pSibling;
delete pNode;
m_fVisibleValid = false;
m_nNodes--;
}
}
HierNode *Hierarchy::Find( char *pName )
{
int numLevels = NumSubNames(pName);
int level = 0;
HierNode *pNode = m_pFirstNode;
char *pSubName = SubName(pName,0);
while( pNode )
{
if( strcmp( pNode->BaseName(), pSubName ) == 0 )
{
if( numLevels == level )
return pNode;
if( !pNode->m_pChild )
return NULL;
level++;
pSubName = SubName(pName,level);
pNode = pNode->m_pChild;
}
else
pNode = pNode->m_pSibling;
}
return NULL;
}
HierNode *Hierarchy::FindOrInsertUnder( HierNode **ppNext, char *pName )
{
while( *ppNext )
{
int comp = strcmp( (*ppNext)->m_pFullName, pName );
if( comp == 0 )
return *ppNext;
if( comp > 0 )
break;
ppNext = &((*ppNext)->m_pSibling);
}
// need to insert a new node
HierNode *pNode = new HierNode( pName );
m_fVisibleValid = false;
m_nNodes++;
pNode->m_pSibling = *ppNext;
*ppNext = pNode;
pNode->m_Flags = HierPresent;
return pNode;
}
HierNode *Hierarchy::FindOrCreate( char *pName )
{
int numLevels = NumSubNames(pName);
HierNode **ppNode = &m_pFirstNode;
HierNode *pNode;
for( int level=0; level < numLevels; level++ )
{
pNode = FindOrInsertUnder( ppNode, PathName( pName, level ) );
pNode->m_Flags |= HierPresent;
ppNode = &(pNode->m_pChild);
}
return pNode;
}
HierNode *Hierarchy::VisibleNode( unsigned long LineNo ) // Returns a real or imaginary visible node
{
if( !m_fVisibleValid )
RebuildVisibleNodeTable();
return ( LineNo < m_nVisibleNodes ) ? m_pVisibleNode[LineNo] : NULL;
}
unsigned long Hierarchy::NumVisibleNodes()
{
if( !m_fVisibleValid )
RebuildVisibleNodeTable();
return m_nVisibleNodes;
}
void Hierarchy::AppendVisibleNode( HierNode *pNode )
{
if( m_nVisibleNodes >= m_nVisibleNodeTableSize )
{
m_nVisibleNodeTableSize += 64;
if( m_pVisibleNode )
m_pVisibleNode = (HierNode **)realloc( m_pVisibleNode, m_nVisibleNodeTableSize * sizeof(HierNode *) );
else
m_pVisibleNode = (HierNode **)malloc( m_nVisibleNodeTableSize * sizeof(HierNode *) );
}
m_pVisibleNode[m_nVisibleNodes++] = pNode;
}
void Hierarchy::AccumulateVisible( HierNode *pNode )
{
while( pNode )
{
AppendVisibleNode( pNode );
if( pNode->m_pChild && ( pNode->m_Flags & HierOpen ) )
AccumulateVisible( pNode->m_pChild );
pNode = pNode->m_pSibling;
}
}
void Hierarchy::RebuildVisibleNodeTable()
{
m_nVisibleNodes = 0;
if( m_pFirstNode )
AccumulateVisible( m_pFirstNode );
m_fVisibleValid = true;
}
void Hierarchy::OpenClose( unsigned long LineNo ) // Toggle open/closed state of a visible node by line no
{
if( LineNo < m_nVisibleNodes )
m_pVisibleNode[LineNo]->m_Flags ^= HierOpen;
m_fVisibleValid = false;
}
void Hierarchy::DeleteNonPresentTree( HierNode **ppNext )
{
while( *ppNext )
{
if( (*ppNext)->m_Flags & HierPresent )
{
if( (*ppNext)->m_pChild )
DeleteNonPresentTree( &((*ppNext)->m_pChild) );
ppNext = &((*ppNext)->m_pSibling);
}
else
{
HierNode *pOld = *ppNext;
*ppNext = pOld->m_pSibling;
pOld->m_pSibling = NULL; // so DeleteTree doesn't delete siblings yet
DeleteTree( pOld );
}
}
}
void Hierarchy::DeleteNonPresent()
{
DeleteNonPresentTree( &m_pFirstNode );
}
void Hierarchy::MarkNonPresentTree( HierNode *pRoot )
{
while( pRoot )
{
if( pRoot->m_pChild )
MarkNonPresentTree( pRoot->m_pChild );
pRoot->m_Flags &= ~HierPresent;
pRoot = pRoot->m_pSibling;
}
}
void Hierarchy::RebuildListStart()
{
MarkNonPresentTree( m_pFirstNode );
}
/*
int main(int argc, char* argv[])
{
Hierarchy h;
unsigned long i;
h.RebuildListStart();
h.FindOrCreate("A");
h.FindOrCreate("C");
h.FindOrCreate("Z::Z::ZZTop::Z");
h.FindOrCreate("A::B");
// h.RebuildListStart();
h.FindOrCreate("A::D");
// h.DeleteNonPresent();
printf("At Start");
for( i=0; i<h.NumVisibleNodes(); i++ )
{
printf("%d: '%s'\n", i, h.VisibleNode(i)->FullName() );
}
printf("Opening top...\n");
h.OpenClose(0);
for( i=0; i<h.NumVisibleNodes(); i++ )
{
printf("%d: '%s'\n", i, h.VisibleNode(i)->FullName() );
}
printf("Opening all...\n");
for( i=0; i<h.NumVisibleNodes(); i++ )
{
printf("%d: '%s'\n", i, h.VisibleNode(i)->FullName() );
if( !(h.VisibleNode(i)->IsOpen()) )
h.OpenClose(i);
}
h.RebuildListStart();
h.FindOrCreate("Z::Z::ZZTop");
h.DeleteNonPresent();
printf("Displaying all...\n");
for( i=0; i<h.NumVisibleNodes(); i++ )
{
printf("%d: '%s'\n", i, h.VisibleNode(i)->FullName() );
if( !(h.VisibleNode(i)->IsOpen()) )
h.OpenClose(i);
}
printf("Hello World!\n");
return 0;
}
*/
@@ -0,0 +1,68 @@
#pragma once
class HierNode;
class Hierarchy;
const HierOpen = 1;
const HierReal = 2;
const HierPresent = 4;
const HierVisible = 8;
class HierNode
{
friend class Hierarchy;
HierNode * m_pSibling;
HierNode * m_pChild;
char * m_pFullName;
char * m_pBaseName;
unsigned long m_Flags;
public:
void * m_pData;
HierNode( char *pName );
virtual ~HierNode();
char * FullName() { return m_pFullName; }
char * BaseName() { return m_pBaseName; }
unsigned long NumSubNames();
char * SubName( int subNameNo );
char * ParentName();
bool IsOpen() { return m_Flags & HierOpen; }
};
// Note: once a HierNode is inserted into a Hierarchy, the Hierarchy "owns" it (for deletion purposes)
class Hierarchy
{
unsigned long m_nNodes;
unsigned long m_nVisibleNodes;
HierNode * m_pFirstNode;
HierNode ** m_pVisibleNode;
unsigned long m_nVisibleNodeTableSize;
bool m_fVisibleValid;
void DeleteTree( HierNode *pRoot );
HierNode * FindOrInsertUnder( HierNode **ppNext, char *pName );
void AppendVisibleNode( HierNode *pNode );
void AccumulateVisible( HierNode *pNode );
void RebuildVisibleNodeTable();
void MarkNonPresentTree( HierNode *pRoot );
void DeleteNonPresentTree( HierNode **ppNext );
public:
Hierarchy();
~Hierarchy(); // Deletes all nodes
HierNode * Find( char *pName );
HierNode * FindOrCreate( char *pName );
HierNode * InsertImaginary( char *pName );
void InsertReal( HierNode *pNode ); // Insert a real node, construct imaginary as necessary
unsigned long NumNodes() { return m_nNodes; } // Number of real & imaginary nodes
unsigned long NumVisibleNodes(); // Number of visible real & imaginary nodes
HierNode * VisibleNode( unsigned long LineNo ); // Returns a real or imaginary visible node
void DeleteNonPresent(); // deletes all non-present nodes
void RebuildListStart(); // Marks all as non-present
void OpenClose( unsigned long LineNo ); // Toggle open/closed state of a visible node by line no
};
@@ -0,0 +1,100 @@
#pragma once
class CID
{
public:
DWORD id;
DWORD Index() { return id & 0x000fffff; }
CID( DWORD ID ) { id = ID; }
};
template <class T> class IDContainer
{
struct Entry
{
DWORD id;
DWORD nextIndex;
T Data;
};
Entry* m_pData;
DWORD m_nSize;
DWORD m_nFirstIndex;
DWORD m_nLastIndex;
public:
IDContainer() { m_nSize = 0; m_nFirstIndex = 0; }
void Clear() { m_nFirstIndex = m_nLastIndex = 0; for(DWORD i=0; i<m_nSize; i++ ) m_pData[i].id = 0; }
~IDContainer() { if( m_nSize ) free(m_pData); }
T* Allocate( CID id )
{
DWORD index = id.Index();
if( index >= m_nSize )
{
DWORD oldSize = m_nSize;
m_nSize = ( index + 256 ) & 0x000fff00;
if( m_nFirstIndex == 0 )
{
m_pData = (Entry *)malloc( m_nSize * sizeof(Entry) );
}
else
{
m_pData = (Entry *)realloc( m_pData, m_nSize * sizeof(Entry) );
}
for( ; oldSize < m_nSize; oldSize++ )
m_pData[oldSize].id = 0;
}
if( m_nFirstIndex == 0 )
{
m_nFirstIndex = m_nLastIndex = index;
}
else
{
m_pData[m_nLastIndex].nextIndex = index;
m_nLastIndex = index;
}
m_pData[index].id = id.id;
return &m_pData[index].Data;
}
T* Find( CID id )
{
DWORD index = id.Index();
if( index >= m_nSize )
return NULL;
Entry *ptr = m_pData + index;
if( ptr->id == 0 )
return NULL;
return &(ptr->Data);
}
bool Contains( CID id )
{
return Find(id) != NULL;
}
T* First()
{
if( m_nFirstIndex == 0 )
return NULL;
else
return &m_pData[m_nFirstIndex].Data;
}
T* Last()
{
if( m_nFirstIndex == 0 )
return NULL;
else
return &m_pData[m_nLastIndex].Data;
}
T* Next( T* curr )
{
if( curr == &m_pData[m_nLastIndex].Data )
return NULL;
return &m_pData[ ((DWORD *)curr)[-1] ].Data;
}
};
@@ -0,0 +1,155 @@
// MainFrm.cpp : implementation of the CMainFrame class
//
#include "stdafx.h"
#include "GosView.h"
#include "MainFrm.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CMainFrame
IMPLEMENT_DYNAMIC(CMainFrame, CMDIFrameWnd)
BEGIN_MESSAGE_MAP(CMainFrame, CMDIFrameWnd)
//{{AFX_MSG_MAP(CMainFrame)
// NOTE - the ClassWizard will add and remove mapping macros here.
// DO NOT EDIT what you see in these blocks of generated code !
ON_WM_CREATE()
//}}AFX_MSG_MAP
// Global help commands
ON_COMMAND(ID_HELP_FINDER, CMDIFrameWnd::OnHelpFinder)
ON_COMMAND(ID_HELP, CMDIFrameWnd::OnHelp)
ON_COMMAND(ID_CONTEXT_HELP, CMDIFrameWnd::OnContextHelp)
ON_COMMAND(ID_DEFAULT_HELP, CMDIFrameWnd::OnHelpFinder)
END_MESSAGE_MAP()
static UINT indicators[] =
{
ID_SEPARATOR, // status line indicator
ID_SEPARATOR,
ID_CONNECTION_STATUS,
ID_INDICATOR_CAPS,
ID_INDICATOR_NUM,
ID_INDICATOR_SCRL,
};
/////////////////////////////////////////////////////////////////////////////
// CMainFrame construction/destruction
CMainFrame::CMainFrame()
{
// TODO: add member initialization code here
}
CMainFrame::~CMainFrame()
{
}
int CMainFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CMDIFrameWnd::OnCreate(lpCreateStruct) == -1)
return -1;
if (!m_wndToolBar.CreateEx(this) ||
!m_wndToolBar.LoadToolBar(IDR_MAINFRAME))
{
TRACE0("Failed to create toolbar\n");
return -1; // fail to create
}
/*
if (!m_wndDlgBar.Create(this, IDR_MAINFRAME,
CBRS_ALIGN_TOP, AFX_IDW_DIALOGBAR))
{
TRACE0("Failed to create dialogbar\n");
return -1; // fail to create
}
if (!m_wndDlgBar2.Create(this, IDD_DIALOG2,
CBRS_ALIGN_TOP, AFX_IDW_DIALOGBAR))
{
TRACE0("Failed to create dialogbar\n");
return -1; // fail to create
}
*/
if (!m_wndReBar.Create(this) ||
!m_wndReBar.AddBar(&m_wndToolBar) /* ||
!m_wndReBar.AddBar(&m_wndDlgBar) ||
!m_wndReBar.AddBar(&m_wndDlgBar2) */ )
{
TRACE0("Failed to create rebar\n");
return -1; // fail to create
}
if (!m_wndStatusBar.Create(this) ||
!m_wndStatusBar.SetIndicators(indicators,
sizeof(indicators)/sizeof(UINT)))
{
TRACE0("Failed to create status bar\n");
return -1; // fail to create
}
// TODO: Remove this if you don't want tool tips
m_wndToolBar.SetBarStyle(m_wndToolBar.GetBarStyle() |
CBRS_TOOLTIPS | CBRS_FLYBY);
static int count=0;
count++;
CString string;
string.Format (_T ("Count %d"), count);
// pCmdUI->Enable (TRUE);
//pCmdUI->SetText (string);
DisplayConnectionStatus( string );
return 0;
}
BOOL CMainFrame::PreCreateWindow(CREATESTRUCT& cs)
{
if( !CMDIFrameWnd::PreCreateWindow(cs) )
return FALSE;
// TODO: Modify the Window class or styles here by modifying
// the CREATESTRUCT cs
return TRUE;
}
/////////////////////////////////////////////////////////////////////////////
// CMainFrame diagnostics
#ifdef _DEBUG
void CMainFrame::AssertValid() const
{
CMDIFrameWnd::AssertValid();
}
void CMainFrame::Dump(CDumpContext& dc) const
{
CMDIFrameWnd::Dump(dc);
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CMainFrame message handlers
void CMainFrame::DisplayConnectionStatus( LPCTSTR pStatus )
{
m_wndStatusBar.SetPaneText( 1, pStatus, TRUE );
}
@@ -0,0 +1,67 @@
// MainFrm.h : interface of the CMainFrame class
//
/////////////////////////////////////////////////////////////////////////////
#if !defined(AFX_MAINFRM_H__D3BCF323_F054_46C2_80DC_FDBADBC3650C__INCLUDED_)
#define AFX_MAINFRM_H__D3BCF323_F054_46C2_80DC_FDBADBC3650C__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
class CMainFrame : public CMDIFrameWnd
{
DECLARE_DYNAMIC(CMainFrame)
public:
CMainFrame();
// Attributes
public:
// Operations
public:
void DisplayConnectionStatus( LPCTSTR pStatus );
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CMainFrame)
virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
//}}AFX_VIRTUAL
// Implementation
public:
virtual ~CMainFrame();\
CStatusBar m_wndStatusBar;
CToolBar m_wndToolBar;
CReBar m_wndReBar;
CDialogBar m_wndDlgBar;
CDialogBar m_wndDlgBar2;
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
protected: // control bar embedded members
// Generated message map functions
protected:
//{{AFX_MSG(CMainFrame)
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
// NOTE - the ClassWizard will add and remove member functions here.
// DO NOT EDIT what you see in these blocks of generated code!
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_MAINFRM_H__D3BCF323_F054_46C2_80DC_FDBADBC3650C__INCLUDED_)
@@ -0,0 +1,59 @@
// ObjDetailPane.cpp : implementation file
//
#include "stdafx.h"
#include "gosview.h"
#include "ObjDetailPane.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CObjDetailPane
IMPLEMENT_DYNCREATE(CObjDetailPane, CView)
CObjDetailPane::CObjDetailPane()
{
}
CObjDetailPane::~CObjDetailPane()
{
}
BEGIN_MESSAGE_MAP(CObjDetailPane, CView)
//{{AFX_MSG_MAP(CObjDetailPane)
// NOTE - the ClassWizard will add and remove mapping macros here.
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CObjDetailPane drawing
void CObjDetailPane::OnDraw(CDC* pDC)
{
CDocument* pDoc = GetDocument();
// TODO: add draw code here
}
/////////////////////////////////////////////////////////////////////////////
// CObjDetailPane diagnostics
#ifdef _DEBUG
void CObjDetailPane::AssertValid() const
{
CView::AssertValid();
}
void CObjDetailPane::Dump(CDumpContext& dc) const
{
CView::Dump(dc);
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CObjDetailPane message handlers
@@ -0,0 +1,53 @@
#if !defined(AFX_OBJDETAILPANE_H__C10EDF5B_C9EE_474D_9FFF_F50F159874E3__INCLUDED_)
#define AFX_OBJDETAILPANE_H__C10EDF5B_C9EE_474D_9FFF_F50F159874E3__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// ObjDetailPane.h : header file
//
/////////////////////////////////////////////////////////////////////////////
// CObjDetailPane view
class CObjDetailPane : public CView
{
protected:
CObjDetailPane(); // protected constructor used by dynamic creation
DECLARE_DYNCREATE(CObjDetailPane)
// Attributes
public:
// Operations
public:
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CObjDetailPane)
protected:
virtual void OnDraw(CDC* pDC); // overridden to draw this view
//}}AFX_VIRTUAL
// Implementation
protected:
virtual ~CObjDetailPane();
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
// Generated message map functions
protected:
//{{AFX_MSG(CObjDetailPane)
// NOTE - the ClassWizard will add and remove member functions here.
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_OBJDETAILPANE_H__C10EDF5B_C9EE_474D_9FFF_F50F159874E3__INCLUDED_)
@@ -0,0 +1,59 @@
// ObjListPane.cpp : implementation file
//
#include "stdafx.h"
#include "gosview.h"
#include "ObjListPane.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CObjListPane
IMPLEMENT_DYNCREATE(CObjListPane, CView)
CObjListPane::CObjListPane()
{
}
CObjListPane::~CObjListPane()
{
}
BEGIN_MESSAGE_MAP(CObjListPane, CView)
//{{AFX_MSG_MAP(CObjListPane)
// NOTE - the ClassWizard will add and remove mapping macros here.
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CObjListPane drawing
void CObjListPane::OnDraw(CDC* pDC)
{
CDocument* pDoc = GetDocument();
// TODO: add draw code here
}
/////////////////////////////////////////////////////////////////////////////
// CObjListPane diagnostics
#ifdef _DEBUG
void CObjListPane::AssertValid() const
{
CView::AssertValid();
}
void CObjListPane::Dump(CDumpContext& dc) const
{
CView::Dump(dc);
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CObjListPane message handlers
@@ -0,0 +1,53 @@
#if !defined(AFX_OBJLISTPANE_H__F35B473B_B286_414E_8074_9CBCA598478A__INCLUDED_)
#define AFX_OBJLISTPANE_H__F35B473B_B286_414E_8074_9CBCA598478A__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// ObjListPane.h : header file
//
/////////////////////////////////////////////////////////////////////////////
// CObjListPane view
class CObjListPane : public CView
{
protected:
CObjListPane(); // protected constructor used by dynamic creation
DECLARE_DYNCREATE(CObjListPane)
// Attributes
public:
// Operations
public:
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CObjListPane)
protected:
virtual void OnDraw(CDC* pDC); // overridden to draw this view
//}}AFX_VIRTUAL
// Implementation
protected:
virtual ~CObjListPane();
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
// Generated message map functions
protected:
//{{AFX_MSG(CObjListPane)
// NOTE - the ClassWizard will add and remove member functions here.
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_OBJLISTPANE_H__F35B473B_B286_414E_8074_9CBCA598478A__INCLUDED_)
@@ -0,0 +1,138 @@
========================================================================
MICROSOFT FOUNDATION CLASS LIBRARY : GosView
========================================================================
AppWizard has created this GosView application for you. This application
not only demonstrates the basics of using the Microsoft Foundation classes
but is also a starting point for writing your application.
This file contains a summary of what you will find in each of the files that
make up your GosView application.
GosView.dsp
This file (the project file) contains information at the project level and
is used to build a single project or subproject. Other users can share the
project (.dsp) file, but they should export the makefiles locally.
GosView.h
This is the main header file for the application. It includes other
project specific headers (including Resource.h) and declares the
CGosViewApp application class.
GosView.cpp
This is the main application source file that contains the application
class CGosViewApp.
GosView.rc
This is a listing of all of the Microsoft Windows resources that the
program uses. It includes the icons, bitmaps, and cursors that are stored
in the RES subdirectory. This file can be directly edited in Microsoft
Visual C++.
GosView.clw
This file contains information used by ClassWizard to edit existing
classes or add new classes. ClassWizard also uses this file to store
information needed to create and edit message maps and dialog data
maps and to create prototype member functions.
res\GosView.ico
This is an icon file, which is used as the application's icon. This
icon is included by the main resource file GosView.rc.
res\GosView.rc2
This file contains resources that are not edited by Microsoft
Visual C++. You should place all resources not editable by
the resource editor in this file.
GosView.reg
This is an example .REG file that shows you the kind of registration
settings the framework will set for you. You can use this as a .REG
file to go along with your application or just delete it and rely
on the default RegisterShellFileTypes registration.
/////////////////////////////////////////////////////////////////////////////
For the main frame window:
MainFrm.h, MainFrm.cpp
These files contain the frame class CMainFrame, which is derived from
CMDIFrameWnd and controls all MDI frame features.
res\Toolbar.bmp
This bitmap file is used to create tiled images for the toolbar.
The initial toolbar and status bar are constructed in the CMainFrame
class. Edit this toolbar bitmap using the resource editor, and
update the IDR_MAINFRAME TOOLBAR array in GosView.rc to add
toolbar buttons.
/////////////////////////////////////////////////////////////////////////////
For the child frame window:
ChildFrm.h, ChildFrm.cpp
These files define and implement the CChildFrame class, which
supports the child windows in an MDI application.
/////////////////////////////////////////////////////////////////////////////
AppWizard creates one document type and one view:
GosViewDoc.h, GosViewDoc.cpp - the document
These files contain your CGosViewDoc class. Edit these files to
add your special document data and to implement file saving and loading
(via CGosViewDoc::Serialize).
GosEventView.h, GosEventView.cpp - the view of the document
These files contain your CGosEventView class.
CGosEventView objects are used to view CGosViewDoc objects.
res\GosViewDoc.ico
This is an icon file, which is used as the icon for MDI child windows
for the CGosViewDoc class. This icon is included by the main
resource file GosView.rc.
/////////////////////////////////////////////////////////////////////////////
Help Support:
hlp\GosView.hpj
This file is the Help Project file used by the Help compiler to create
your application's Help file.
hlp\*.bmp
These are bitmap files required by the standard Help file topics for
Microsoft Foundation Class Library standard commands.
hlp\*.rtf
This file contains the standard help topics for standard MFC
commands and screen objects.
/////////////////////////////////////////////////////////////////////////////
Other standard files:
StdAfx.h, StdAfx.cpp
These files are used to build a precompiled header (PCH) file
named GosView.pch and a precompiled types file named StdAfx.obj.
Resource.h
This is the standard header file, which defines new resource IDs.
Microsoft Visual C++ reads and updates this file.
/////////////////////////////////////////////////////////////////////////////
Other notes:
AppWizard uses "TODO:" to indicate parts of the source code you
should add to or customize.
If your application uses MFC in a shared DLL, and your application is
in a language other than the operating system's current language, you
will need to copy the corresponding localized resources MFC42XXX.DLL
from the Microsoft Visual C++ CD-ROM onto the system or system32 directory,
and rename it to be MFCLOC.DLL. ("XXX" stands for the language abbreviation.
For example, MFC42DEU.DLL contains resources translated to German.) If you
don't do this, some of the UI elements of your application will remain in the
language of the operating system.
/////////////////////////////////////////////////////////////////////////////
@@ -0,0 +1,286 @@
// Session.cpp : implementation file
//
#include "stdafx.h"
#include "gosview.h"
#include "Session.h"
#include "gosviewdoc.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
const char *CSession::ConnectStateName[7] =
{
"Not Connected",
"Awaiting Connection",
"Connected",
"Receiving Log Header",
"Receiving Log",
"Processing Log",
"Session Error"
};
/////////////////////////////////////////////////////////////////////////////
// CSession
CSession::CSession()
{
m_eState = NotConnected;
WORD wVersionRequired = MAKEWORD(1,1);
WSADATA wsaData;
if( WSAStartup( wVersionRequired, &wsaData ) )
{
DebugBreak();
}
/*
char hostName[50];
PHOSTENT pHostEnt;
if( ( gethostname( hostName, 50 ) != 0 ) ||
( ( pHostEnt = gethostbyname(hostName)) == NULL ) )
{
DebugBreak();
}
wsprintf( m_IPAddr, "%s", inet_ntoa(*(in_addr *) pHostEnt->h_addr) );
*/
}
CSession::~CSession()
{
KillTimer(1);
Disconnect();
WSACleanup();
}
BEGIN_MESSAGE_MAP(CSession, CWnd)
//{{AFX_MSG_MAP(CSession)
ON_WM_TIMER()
ON_WM_CREATE()
//}}AFX_MSG_MAP
ON_MESSAGE( WM_USER+1 , OnAsyncLog )
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CSession message handlers
void CSession::Connect( char *name )
{
if( m_eState != NotConnected )
return;
// create sockets
m_CommandSocket = socket( AF_INET, SOCK_STREAM, 0 );
if( m_CommandSocket == INVALID_SOCKET )
{
DebugBreak();
}
m_LogSocket = socket( AF_INET, SOCK_STREAM, 0 );
if( m_LogSocket == INVALID_SOCKET )
{
DebugBreak();
}
SOCKADDR_IN addr;
addr.sin_family = AF_INET;
//addr.sin_port = _htons(pservent->s_port);
addr.sin_port = 0;
addr.sin_addr.S_un.S_addr = htonl(INADDR_ANY);
if( bind( m_CommandSocket, (LPSOCKADDR)&addr, sizeof(addr) ) == SOCKET_ERROR )
{
DebugBreak();
}
if( bind( m_LogSocket, (LPSOCKADDR)&addr, sizeof(addr) ) == SOCKET_ERROR )
{
DebugBreak();
}
PHOSTENT pHostEnt;
if( ( pHostEnt = gethostbyname(name)) == NULL )
{
return;
}
wsprintf( m_IPAddr, "%s", inet_ntoa(*(in_addr *) pHostEnt->h_addr) );
// m_hClientThread=CreateThread(NULL, 0, CreateClientThread, (void *)this, 0, &ID );
m_pTargetName = name;
m_eState = AwaitingConnection;
SOCKADDR_IN addrServer;
addrServer.sin_family = AF_INET;
addrServer.sin_port = htons(3002);
addrServer.sin_addr.s_addr = inet_addr( m_IPAddr /* "157.55.22.191" /* m_pTargetName */ );
if( connect(m_CommandSocket,(LPSOCKADDR)&addrServer, sizeof(addrServer) ) == SOCKET_ERROR )
{
int nError = WSAGetLastError();
}
addrServer.sin_family = AF_INET;
addrServer.sin_port = htons(3001);
addrServer.sin_addr.s_addr = inet_addr( m_IPAddr /* "157.55.22.191" /* m_pTargetName */ );
if( WSAAsyncSelect( m_LogSocket, m_hWnd, WM_USER+1, FD_CONNECT|FD_READ|FD_WRITE|FD_CLOSE ) == SOCKET_ERROR )
{
DebugBreak();
}
if( connect(m_LogSocket,(LPSOCKADDR)&addrServer, sizeof(addrServer) ) == SOCKET_ERROR )
{
int nError = WSAGetLastError();
if( nError == WSAEWOULDBLOCK )
{
;
}
else
{
if( nError == WSAECONNREFUSED )
{
m_eState = SessionError;
}
if( nError == WSAETIMEDOUT )
{
m_eState = SessionError;
}
}
}
_int64 freq;
SendCommand( GVCMD_GETFREQ, 0, NULL );
ReceiveData( 8, (char *)&freq );
m_pDoc->SetFreq( freq );
}
void CSession::Disconnect()
{
if( m_eState != NotConnected )
{
m_eState = NotConnected;
if( m_CommandSocket )
SendCommand( GVCMD_CLOSECONNECTIONS, 0, NULL );
if( m_CommandSocket )
closesocket( m_CommandSocket );
if( m_LogSocket )
closesocket( m_LogSocket );
}
}
long CSession::OnAsyncLog( WPARAM wParam, LPARAM lParam )
{
int nBytesReceived;
if( WSAGETSELECTERROR(lParam) != 0 )
{
return 0L;
}
switch( WSAGETSELECTEVENT(lParam) )
{
case FD_CONNECT:
m_eState = Connected;
break;
case FD_READ:
switch( m_eState )
{
case Connected:
m_eState = ReceivingLogHeader;
m_nLogBytesRequired = sizeof( GosLogInfo );
m_pLogReceiveAddr = (char *)&m_IncomingInfo;
case ReceivingLogHeader:
nBytesReceived = recv( m_LogSocket, m_pLogReceiveAddr, m_nLogBytesRequired, 0 );
if( nBytesReceived == SOCKET_ERROR )
{
int m_nLastError = WSAGetLastError();
if( m_nLastError == WSAEWOULDBLOCK )
{
m_eState = Connected;
break;
}
m_eState = SessionError;
break;
}
if( nBytesReceived == 0 )
m_eState = Connected;
m_nLogBytesRequired -= nBytesReceived;
if( m_nLogBytesRequired )
break;
m_eState = ReceivingLog;
m_nLogBytesRequired = m_IncomingInfo.logLength;
m_pIncomingLogBuffer = (unsigned long *)malloc( m_IncomingInfo.logLength );
m_pLogReceiveAddr = (char *)m_pIncomingLogBuffer;
case ReceivingLog:
if( m_nLogBytesRequired )
{
nBytesReceived = recv( m_LogSocket, m_pLogReceiveAddr, m_nLogBytesRequired, 0 );
if( nBytesReceived == SOCKET_ERROR )
{
int m_nLastError = WSAGetLastError();
if( m_nLastError == WSAEWOULDBLOCK )
{
break;
}
m_eState = SessionError;
break;
}
m_nLogBytesRequired -= nBytesReceived;
m_pLogReceiveAddr += nBytesReceived;
if( m_nLogBytesRequired )
break;
}
m_eState = ProcessingLog;
m_pDoc->ParseNewLog( m_pIncomingLogBuffer, &m_IncomingInfo );
m_pIncomingLogBuffer = NULL; // NOTE: CGosViewDoc now owns the log buffer
case ProcessingLog:
m_eState = Connected;
break;
default:
;
}
break;
default:
;
}
return 0;
}
void CSession::OnTimer(UINT nIDEvent)
{
if( m_eState == Connected )
{
SendCommand( GVCMD_HEARTBEAT, 0, NULL );
}
}
int CSession::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CWnd::OnCreate(lpCreateStruct) == -1)
return -1;
SetTimer(1,4000,NULL); // every 4 seconds send a keep-alive heartbeat
return 0;
}
@@ -0,0 +1,179 @@
#if !defined(AFX_SESSION_H__DCDE5891_2351_4322_AA99_C14B49F96DC9__INCLUDED_)
#define AFX_SESSION_H__DCDE5891_2351_4322_AA99_C14B49F96DC9__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// Session.h : header file
//
/////////////////////////////////////////////////////////////////////////////
// CSession window
static const int CommandQueueSize = 12;
class CGosViewDoc;
#define RECV_HEADER_SIZE 4
#define CMD_HEADER_SIZE 8
struct GosLogInfo
{
DWORD logLength; // length of actual log data
DWORD magic; // == GVRESP_EVENTLOG
_int64 tLogStart; // start time when we began collecting log (not necessarily in log)
_int64 tLogEnd; // stop time when we stopped collecting log (probably right after last entry)
};
enum GosViewCommand
{
GVCMD_STARTLOG = 100,
GVCMD_STOPLOG = 101,
GVCMD_GETLOG = 102,
GVCMD_GETEVENTNAME = 103,
GVCMD_STARTLOGONCE = 104,
GVCMD_CLOSECONNECTIONS = 105,
GVCMD_GETFREQ = 106,
GVCMD_HEARTBEAT = 107
};
class CSession : public CWnd
{
private:
SOCKET m_LogSocket;
SOCKET m_CommandSocket;
HANDLE m_hClientThread;
bool m_fKillThread;
char *m_pTargetName;
CGosViewDoc *m_pDoc;
char m_IPAddr[20];
struct CommandPacket
{
unsigned long extLength; // length beyond the first 8 bytes
unsigned long command;
};
public:
enum EConnectState
{
NotConnected,
AwaitingConnection,
Connected,
ReceivingLogHeader,
ReceivingLog,
ProcessingLog,
SessionError
};
GosLogInfo m_IncomingInfo;
char *m_pLogReceiveAddr;
DWORD m_nLogBytesRequired;
unsigned long *m_pIncomingLogBuffer;
static const char *ConnectStateName[7];
LONG OnAsyncLog( WPARAM wParam, LPARAM lParam );
void SetOwningDoc( CGosViewDoc *pDoc ) { m_pDoc = pDoc; }
private:
EConnectState m_eState;
// Construction
public:
CSession();
// Commands:
void Connect( char *name );
void Disconnect();
bool SendCommandData( char *pData, int size )
{
int rc = send( m_CommandSocket, pData, size, 0 );
if( rc == SOCKET_ERROR )
{
return false;
}
return true;
}
bool SendCommand( int command, int extDataSize, char *pExtData )
{
CommandPacket packet;
packet.command = command;
packet.extLength = extDataSize;
SendCommandData( (char *)&packet, sizeof(packet) );
if( extDataSize )
SendCommandData( pExtData, extDataSize );
return m_eState != SessionError;
}
int ReceiveData( DWORD maxSize, char *pData )
{
unsigned long size;
int bytesReceived;
bytesReceived = recv( m_CommandSocket, (char *)&size, 4, 0 );
if( bytesReceived == SOCKET_ERROR )
{
return 0;
}
if( bytesReceived != 4 )
{
return 0;
}
unsigned long remaining = size;
if( size > maxSize )
{
return 0;
}
while( remaining > 0 )
{
bytesReceived = recv( m_CommandSocket, pData, remaining, 0 );
if( bytesReceived == SOCKET_ERROR )
{
return 0;
}
pData += bytesReceived;
remaining -= bytesReceived;
}
return size;
}
const char *StateName() { return ConnectStateName[m_eState]; }
EConnectState State() { return m_eState; }
bool InErrorState() { return m_eState == SessionError; }
// Attributes
public:
// Operations
public:
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CSession)
//}}AFX_VIRTUAL
// Implementation
public:
virtual ~CSession();
// Generated message map functions
protected:
//{{AFX_MSG(CSession)
afx_msg void OnTimer(UINT nIDEvent);
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_SESSION_H__DCDE5891_2351_4322_AA99_C14B49F96DC9__INCLUDED_)
@@ -0,0 +1,8 @@
// stdafx.cpp : source file that includes just the standard includes
// GosView.pch will be the pre-compiled header
// stdafx.obj will contain the pre-compiled type information
#include "stdafx.h"
@@ -0,0 +1,28 @@
// stdafx.h : include file for standard system include files,
// or project specific include files that are used frequently, but
// are changed infrequently
//
#if !defined(AFX_STDAFX_H__FB1FDD89_BB3F_4BC3_BB09_543E24F6E65C__INCLUDED_)
#define AFX_STDAFX_H__FB1FDD89_BB3F_4BC3_BB09_543E24F6E65C__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
#define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers
#include <afxwin.h> // MFC core and standard components
#include <afxext.h> // MFC extensions
#include <afxdisp.h> // MFC Automation classes
#include <afxdtctl.h> // MFC support for Internet Explorer 4 Common Controls
#ifndef _AFX_NO_AFXCMN_SUPPORT
#include <afxcmn.h> // MFC support for Windows Common Controls
#endif // _AFX_NO_AFXCMN_SUPPORT
#include <afxsock.h> // MFC socket extensions
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_STDAFX_H__FB1FDD89_BB3F_4BC3_BB09_543E24F6E65C__INCLUDED_)
@@ -0,0 +1,89 @@
// TargetDialog.cpp : implementation file
//
#include "stdafx.h"
#include "gosview.h"
#include "TargetDialog.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CTargetDialog dialog
CTargetDialog::CTargetDialog( CGosViewDoc *pDoc, CWnd* pParent /*=NULL*/)
: CDialog(CTargetDialog::IDD, pParent)
{
m_pDoc = pDoc;
//{{AFX_DATA_INIT(CTargetDialog)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
}
void CTargetDialog::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CTargetDialog)
// NOTE: the ClassWizard will add DDX and DDV calls here
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CTargetDialog, CDialog)
//{{AFX_MSG_MAP(CTargetDialog)
ON_BN_CLICKED(IDLOCAL, OnLocal)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CTargetDialog message handlers
void CTargetDialog::OnLocal()
{
char buffer[52];
gethostname( buffer, 50 );
CWnd *pEditBox = CWnd::GetDlgItem(IDC_TARGET_NAME);
pEditBox->SetWindowText( buffer );
}
void CTargetDialog::OnOK()
{
CString csStr;
CWnd *pEditBox = CWnd::GetDlgItem(IDC_TARGET_NAME);
pEditBox->GetWindowText( csStr );
strcpy( m_pDoc->m_ConnName, csStr.GetBuffer(50) );
CDialog::OnOK();
}
void CTargetDialog::OnCancel()
{
CDialog::OnCancel();
}
BOOL CTargetDialog::OnInitDialog()
{
CDialog::OnInitDialog();
CWnd *pEditBox = CWnd::GetDlgItem(IDC_TARGET_NAME);
pEditBox->SetWindowText( m_pDoc->m_ConnName );
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
@@ -0,0 +1,53 @@
#if !defined(AFX_TARGETDIALOG_H__9ABADF06_1BED_4D8C_A6C9_CBA56B053CF5__INCLUDED_)
#define AFX_TARGETDIALOG_H__9ABADF06_1BED_4D8C_A6C9_CBA56B053CF5__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// TargetDialog.h : header file
#include "GosViewDoc.h"
//
/////////////////////////////////////////////////////////////////////////////
// CTargetDialog dialog
class CTargetDialog : public CDialog
{
// Construction
public:
CTargetDialog( CGosViewDoc *pDoc, CWnd* pParent = NULL); // standard constructor
// Dialog Data
//{{AFX_DATA(CTargetDialog)
enum { IDD = IDD_TARGET_DIALOG };
// NOTE: the ClassWizard will add data members here
//}}AFX_DATA
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CTargetDialog)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
// Implementation
protected:
CGosViewDoc *m_pDoc;
// Generated message map functions
//{{AFX_MSG(CTargetDialog)
afx_msg void OnLocal();
virtual void OnOK();
virtual void OnCancel();
virtual BOOL OnInitDialog();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_TARGETDIALOG_H__9ABADF06_1BED_4D8C_A6C9_CBA56B053CF5__INCLUDED_)
@@ -0,0 +1,710 @@
// TimeFrame.cpp : implementation file
//
#include "stdafx.h"
#include "GosView.h"
#include "TimeFrame.h"
#include "GosViewDoc.h"
#include "GosEventView.h"
#include "GosEventPane.h"
#include "GosStatPane.h"
#include "GosEventIdPane.h"
#include "GosTracePane.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CTimeFrame
IMPLEMENT_DYNCREATE(CTimeFrame, CMDIChildWnd)
CTimeFrame::CTimeFrame()
{
m_nNumRowsVisible = 0;
m_nTopVisibleRow = 0;
m_rRowHeight = 20.0;
m_nNumBandColors = 4;
m_pBandColor = new CBrush[4];
m_fChildrenReady = false;
m_nNumEnabledBands = 0;
m_FirstID = 0;
m_nNumParentNames = 0;
m_fAlphaSort = false;
m_pBandColor[0].CreateSolidBrush( RGB( 230,230,230 ) );
m_pBandColor[1].CreateSolidBrush( RGB( 210,210,210 ) );
m_pBandColor[2].CreateSolidBrush( RGB( 190,190,190 ) );
m_pBandColor[3].CreateSolidBrush( RGB( 170,170,170 ) );
m_pDoc = NULL;
}
CTimeFrame::~CTimeFrame()
{
delete[] m_pBandColor;
}
BEGIN_MESSAGE_MAP(CTimeFrame, CMDIChildWnd)
//{{AFX_MSG_MAP(CTimeFrame)
ON_WM_CREATE()
ON_WM_SETFOCUS()
ON_WM_SIZE()
ON_WM_HSCROLL()
ON_BN_CLICKED(IDC_BUTTON1, OnButton1)
ON_COMMAND(ID_ALPHA_SORT, OnAlphaSort)
ON_UPDATE_COMMAND_UI(ID_ALPHA_SORT, OnUpdateAlphaSort)
ON_COMMAND(ID_NUM_SORT, OnNumSort)
ON_UPDATE_COMMAND_UI(ID_NUM_SORT, OnUpdateNumSort)
ON_COMMAND(ID_FULL_NAMES, OnFullNames)
ON_UPDATE_COMMAND_UI(ID_FULL_NAMES, OnUpdateFullNames)
ON_COMMAND(ID_PART_NAMES, OnPartNames)
ON_UPDATE_COMMAND_UI(ID_PART_NAMES, OnUpdatePartNames)
ON_WM_VSCROLL()
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CTimeFrame message handlers
int CTimeFrame::OnCreate(LPCREATESTRUCT lpCreateStruct)
{
if (CMDIChildWnd::OnCreate(lpCreateStruct) == -1)
return -1;
/*
if (!m_wndToolBar.Create( this, WS_CHILD|WS_VISIBLE|CBRS_TOP,IDR_TIME_TOOLBAR) ||
!m_wndToolBar.LoadToolBar(IDR_TIME_TOOLBAR))
{
TRACE0("Failed to create toolbar\n");
return -1; // fail to create
}
*/
/*
if (!m_wndDlgBar.Create(IDD_DIALOG_ZOOM,this))
{
TRACE0("Failed to create dialogbar\n");
return -1; // fail to create
}
*/
return 0;
}
BOOL CTimeFrame::OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext)
{
/*
if( !m_wndTimeToolBar.Create( this, WS_CHILD|WS_VISIBLE|CBRS_TOP,IDR_TIME_TOOLBAR) ||
!m_wndTimeToolBar.LoadToolBar( IDR_TIME_TOOLBAR ) )
{
TRACE0("Failed top create new toolbar");
return -1;
}
*/
if (!m_wndReBar.Create(this) )
{
TRACE0("Failed to create rebar\n");
return -1; // fail to create
}
m_wndZoomDialog.Create( IDD_ZOOM_DIALOG, this );
if( !m_wndReBar.AddBar( &m_wndZoomDialog, NULL ) )
{
TRACE0("Failed to add xoom bar to rebar\n");
return -1; // fail to create
}
CRect rect;
GetClientRect( &rect );
CSize size1 = rect.Size();
CSize size2 = rect.Size();
CSize size3 = rect.Size();
size3.cx = 265;
size2.cx = 290;
size1.cx -= ( size2.cx + size3.cx );
if( !m_wndSplitter.CreateStatic( this, 1, 3, WS_CHILD | WS_VISIBLE | WS_VSCROLL | WS_HSCROLL ) )
{
TRACE0( "Failed to create splitter\n" );
return FALSE;
}
CCreateContext localContext = *pContext;
localContext.m_pCurrentFrame = this;
// if( !m_wndSplitter.CreateView( 0, 0, RUNTIME_CLASS( CEventTraceView ), size, pContext ) )
if( ! m_wndSplitter.CreateView( 0, 0, RUNTIME_CLASS( CGosTracePane ), size1, &localContext ) ||
! m_wndSplitter.CreateView( 0, 1, RUNTIME_CLASS( CGosEventIdPane ), size2, &localContext ) ||
/* ! m_wndSplitter.CreateView( 0, 2, RUNTIME_CLASS( CGosEventPane ), size, &localContext ) || */
! m_wndSplitter.CreateView( 0, 2, RUNTIME_CLASS( CGosStatPane ), size3, &localContext ) )
{
TRACE0( "Failed to create view\n" );
return FALSE;
}
SCROLLINFO si = { sizeof(SCROLLINFO), SIF_PAGE | SIF_RANGE /* | SIF_POS */,
0, 40, 30, 0, 0 };
m_wndSplitter.GetPane(0,0)->SetScrollInfo( SB_VERT, &si );
m_fChildrenReady = true;
return CMDIChildWnd::OnCreateClient(lpcs, pContext);
}
void CTimeFrame::OnSetFocus(CWnd* pOldWnd)
{
CMDIChildWnd::OnSetFocus(pOldWnd);
m_pDoc = (CGosViewDoc *)(this->GetActiveDocument());
m_pDoc->SetFocus();
}
void CTimeFrame::AddId( DWORD id )
{
if( !m_pDoc )
return;
TagNode *pPrev = m_TagList.Last();
if( pPrev )
pPrev->idSibling = id;
TagNode *pNew = m_TagList.Allocate(id);
pNew->id = id;
pNew->idChild = 0;
pNew->idSibling = 0;
pNew->idParent = 0;
pNew->expand = true;
pNew->screenY = 0;
}
void CTimeFrame::UpdateAllIds()
{
if( !m_pDoc )
return;
m_TagList.Clear();
for( CGosViewDoc::TagInfoEntry *pTIE = m_pDoc->m_TagInfo.First(); pTIE; pTIE = m_pDoc->m_TagInfo.Next(pTIE) )
AddId(pTIE->id);
if( !m_pDoc )
return;
}
void CTimeFrame::SortAndAddParents()
{
CGosViewDoc::TagInfoEntry *pTIE;
if( !m_pDoc )
return;
for( m_nOldParentNames=0; m_nOldParentNames<m_nNumParentNames; m_nOldParentNames++ )
{
strcpy( m_aOldParentName[m_nOldParentNames], m_aParentName[m_nOldParentNames] );
m_aOldParentExpand[m_nOldParentNames] = m_ParentList.Find(m_aParentID[m_nOldParentNames])->expand;
}
m_nNumParentNames = 0;
m_ParentList.Clear();
m_FirstID = 0;
for( pTIE = m_pDoc->m_TagInfo.First(); pTIE; pTIE = m_pDoc->m_TagInfo.Next(pTIE) )
{
TagNode *pNode = m_TagList.Find(pTIE->id);
pNode->idSibling = 0;
pNode->idChild = 0;
pNode->idParent = 0;
}
char parentName[256];
for( pTIE = m_pDoc->m_TagInfo.First(); pTIE; pTIE = m_pDoc->m_TagInfo.Next(pTIE) )
{
TagNode *pNode = m_TagList.Find(pTIE->id);
int idParent = 0;
int level = 0;
char *pName = pTIE->Name;
for( int nameLen = 1; pTIE->Name[nameLen] != '\0'; nameLen++ )
{
if( ( pTIE->Name[nameLen] == ':' ) && ( pTIE->Name[nameLen+1] == ':' ) )
{
strcpy( parentName, pTIE->Name );
parentName[nameLen] = '\0';
idParent = IDFindOrAddParent( idParent, parentName );
AnyIDToTag(idParent)->indent = level++;
}
if( pTIE->Name[nameLen] == '\\' )
{
strcpy( parentName, pTIE->Name );
parentName[nameLen] = '\0';
idParent = IDFindOrAddParent( idParent, parentName );
AnyIDToTag(idParent)->indent = level++;
}
}
AddToChildrenOf( idParent, pName, pTIE->id, pNode );
pNode->indent = level;
}
int i,j;
for( i=0; i<m_nNumParentNames; i++ )
{
for( j=0; j<m_nOldParentNames; j++ )
{
if( strcmp( m_aOldParentName[j], m_aParentName[i] ) == 0 )
AnyIDToTag(m_aParentID[i])->expand = m_aOldParentExpand[j];
}
}
}
int CTimeFrame::CompareID( char *pName, DWORD id, DWORD oldID )
{
if( m_fAlphaSort )
{
return strcmp( pName, AnyIDToName(oldID) );
}
else
{
return ((int)id) - ((int) oldID );
}
}
void CTimeFrame::AddToChildrenOf( DWORD idParent, char *pName, DWORD id, TagNode *pNode )
{
TagNode *pParentNode;
if( idParent )
pParentNode = AnyIDToTag( idParent );
pNode->idParent = idParent;
if( ( idParent == 0 ) && ( m_FirstID == 0 ) )
{
m_FirstID = id;
}
else if( ( idParent == 0 ) && CompareID( pName, id, m_FirstID ) < 0 )
{
pNode->idSibling = m_FirstID;
m_FirstID = id;
}
else if( ( idParent != 0 ) && ( pParentNode->idChild == 0 ) )
{
pParentNode->idChild = id;
}
else if( ( idParent != 0 ) && ( CompareID( pName, id, pParentNode->idChild ) < 0 ) )
{
pNode->idSibling = pParentNode->idChild;
pParentNode->idChild = id;
}
else
{
DWORD idRightSibling;
DWORD idLeftSibling = idParent?pParentNode->idChild:m_FirstID;
do
{
idRightSibling = AnyIDToTag(idLeftSibling)->idSibling;
if( ( idRightSibling == 0 ) || CompareID( pName, id, idRightSibling ) < 0 )
{
AnyIDToTag(idLeftSibling)->idSibling = id;
pNode->idSibling = idRightSibling;
break;
}
idLeftSibling = idRightSibling;
} while ( 1 );
}
}
char *CTimeFrame::AnyIDToName( DWORD id )
{
if( id == 0 )
{
DebugBreak();
}
if( id & 0x80000000 )
{
for( int i=0; i<m_nNumParentNames; i++ )
{
if( m_aParentID[i] == id )
return m_aParentName[i];
}
DebugBreak(); // shouldn't happen
}
return m_pDoc->m_TagInfo.Find(id)->Name;
}
CTimeFrame::TagNode *CTimeFrame::AnyIDToTag( DWORD id )
{
if( id == 0 )
{
DebugBreak();
}
if( id & 0x80000000 )
{
return m_ParentList.Find(id);
}
else
{
return m_TagList.Find(id);
}
}
// AddToChildrenOf( idParent, pName, pTIE->id, pNode );
DWORD CTimeFrame::IDFindOrAddParent( DWORD idParent, char *pName )
{
DWORD id;
TagNode *pNode;
for( CGosViewDoc::TagInfoEntry *pTIE = m_pDoc->m_TagInfo.First(); pTIE; pTIE = m_pDoc->m_TagInfo.Next(pTIE) )
{
if( strcmp( pTIE->Name, pName ) == 0 )
return pTIE->id;
}
for( int i=0; i<m_nNumParentNames; i++ )
{
if( strcmp( m_aParentName[i], pName ) == 0 )
{
return m_aParentID[i];
}
}
// have to add a new dummy parent
int index = m_nNumParentNames++;
id = m_nNumParentNames + 0x80000001;
strcpy( m_aParentName[index], pName );
m_aParentID[index] = id;
pNode = m_ParentList.Allocate( id );
pNode->id = id;
pNode->idChild = 0;
pNode->idSibling = 0;
pNode->expand = true;
pNode->idNextEnabled = 0;
pNode->sumTicks = 0;
pNode->onScreen = false;
pNode->countEntry = 0;
AddToChildrenOf( idParent, pName, id, pNode );
return id;
}
void CTimeFrame::ProcessNewLog()
{
SortAndAddParents();
AnalyzeTagNodes();
}
void CTimeFrame::AnalyzeTagNodes()
{
// Assumes parent/child/sibling relations are OK, does depth-first scan to determine y-values
TagNode *pNode;
m_nNumEnabledBands = 0;
TagNode *pPrevNode = NULL;
int treeLevel = 0;
bool independent = true;
int topIndependent = 0;
for( pNode = AnyIDToTag(m_FirstID); pNode; )
{
if( pPrevNode )
pPrevNode->idNextEnabled = pNode->id;
pNode->independent = independent;
pPrevNode = pNode;
m_nNumEnabledBands++;
if( pNode->expand && pNode->idChild )
{
treeLevel++;
pNode = AnyIDToTag(pNode->idChild);
}
else if( true && pNode->idChild ) // change true to ("Show children of non-expanded")
{
if( independent )
{
independent = false;
topIndependent = treeLevel;
}
treeLevel++;
pNode = AnyIDToTag(pNode->idChild);
}
else if( pNode->idSibling )
{
pNode = AnyIDToTag(pNode->idSibling);
}
else
{
if( !pNode->idParent )
pNode = NULL;
while( pNode )
{
pNode = AnyIDToTag(pNode->idParent);
treeLevel--;
if( treeLevel == topIndependent )
independent = true;
if( pNode->idSibling )
{
pNode = AnyIDToTag( pNode->idSibling );
break;
}
if( !pNode->idParent )
pNode = NULL;
}
}
}
if( pPrevNode )
pPrevNode->idNextEnabled = 0;
DetermineVisibleTags();
}
void CTimeFrame::DetermineVisibleTags()
{
TagNode *pNode;
DWORD idParent;
SCROLLINFO si;
if( m_fChildrenReady )
{
RECT rect;
m_wndSplitter.GetPane(0,0)->GetWindowRect(&rect);
int childHeight = rect.bottom-rect.top; // test properly!
if( m_nNumEnabledBands == 0 )
{
m_rRowHeight = (double)childHeight;
m_nNumRowsVisible = 1;
}
else if( childHeight < 16 * m_nNumEnabledBands )
{
m_nNumRowsVisible = (int)((double)childHeight/16.0);
m_rRowHeight = (double)childHeight / (double)m_nNumRowsVisible;
}
else
{
m_nNumRowsVisible = m_nNumEnabledBands;
m_rRowHeight = (double)childHeight / (double)m_nNumEnabledBands;
}
m_wndSplitter.GetPane(0,0)->GetScrollBarCtrl(SB_VERT)->GetScrollInfo( &si, SIF_ALL );
// adjust length of thumb
si.nPage = m_nNumRowsVisible;
// if( si.nMax >= m_nNumEnabledBands )
si.nMax = m_nNumEnabledBands-1;
if( si.nPos > si.nMax )
si.nPos = si.nMax;
m_nTopVisibleRow = si.nPos;
{
char msg[256];
sprintf( msg, "TopVisRow=%d", m_nTopVisibleRow );
CGosEventPane::SetDbgMsg(0,msg);
}
for( pNode = m_TagList.First(); pNode; pNode = m_TagList.Next(pNode) )
{
pNode->onScreen = false;
pNode->screenY = -10;
}
for( pNode = m_ParentList.First(); pNode; pNode = m_ParentList.Next(pNode) )
{
pNode->onScreen = false;
pNode->screenY = -10;
}
int rowNo = 0;
for( DWORD id = m_FirstID; id; id = pNode->idNextEnabled, rowNo++ )
{
pNode = AnyIDToTag( id );
if( !pNode->independent )
rowNo--;
if( ( rowNo >= m_nTopVisibleRow ) && ( rowNo < m_nTopVisibleRow + m_nNumRowsVisible ) )
{
pNode->onScreen = true;
pNode->screenY = (int)(((double)( rowNo - m_nTopVisibleRow ) + 0.5 ) * m_rRowHeight);
}
}
// Now handle collapsed tree sections:
for( pNode = m_TagList.First(); pNode; pNode = m_TagList.Next(pNode) )
{
if( pNode->independent )
{
pNode->pAssignTo = pNode;
continue;
}
pNode->pAssignTo = NULL;
for( idParent = pNode->idParent; idParent; idParent = AnyIDToTag(idParent)->idParent )
{
if( AnyIDToTag(idParent)->independent )
{
pNode->pAssignTo = AnyIDToTag(idParent);
break;
}
}
}
m_wndSplitter.GetPane(0,0)->SetScrollInfo( SB_VERT, &si );
}
}
void CTimeFrame::OnSize(UINT nType, int cx, int cy)
{
HWND hWnd = m_wndSplitter.GetSafeHwnd();
if( hWnd == NULL || !::IsWindow( hWnd ) )
return; // the splitter isn't ready yet
if( m_fChildrenReady )
{
int cxCur0, cxCur1, cxCur2, cxMin;
m_wndSplitter.GetColumnInfo( 1, cxCur1, cxMin );
m_wndSplitter.GetColumnInfo( 2, cxCur2, cxMin );
m_wndSplitter.GetColumnInfo( 0, cxCur0, cxMin );
if( cxCur1 + cxCur2 + 34 < cx )
{
m_wndSplitter.SetColumnInfo( 0, cx - cxCur1 - cxCur2 - 34, cxMin );
m_wndSplitter.RecalcLayout();
}
}
CMDIChildWnd::OnSize(nType, cx, cy);
if( m_pDoc && m_fChildrenReady && m_pDoc->TraceReady() )
{
DetermineVisibleTags();
m_pDoc->UpdateAllViews(NULL);
}
}
void CTimeFrame::OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar)
{
// TODO: Add your message handler code here and/or call default
CMDIChildWnd::OnHScroll(nSBCode, nPos, pScrollBar);
}
BOOL CTimeFrame::OnNotify(WPARAM wParam, LPARAM lParam, LRESULT* pResult)
{
// TODO: Add your specialized code here and/or call the base class
int v = 1;
if( wParam == IDC_ZOOM_SLIDER )
{
if( m_fChildrenReady )
{
m_wndSplitter.GetPane(0,0)->Invalidate();
}
}
return CMDIChildWnd::OnNotify(wParam, lParam, pResult);
}
void CTimeFrame::OnButton1()
{
// TODO: Add your control notification handler code here
DebugBreak();
}
void CTimeFrame::OnAlphaSort()
{
m_fAlphaSort = true;
if( m_pDoc && m_pDoc->TraceReady() )
{
ProcessNewLog();
m_pDoc->UpdateAllViews(NULL);
}
}
void CTimeFrame::OnUpdateAlphaSort(CCmdUI* pCmdUI)
{
pCmdUI->Enable( !m_fAlphaSort );
}
void CTimeFrame::OnNumSort()
{
m_fAlphaSort = false;
if( m_pDoc && m_pDoc->TraceReady() )
{
ProcessNewLog();
m_pDoc->UpdateAllViews(NULL);
}
}
void CTimeFrame::OnUpdateNumSort(CCmdUI* pCmdUI)
{
pCmdUI->Enable( m_fAlphaSort );
}
void CTimeFrame::OnFullNames()
{
m_fFullNames = true;
if( m_pDoc )
m_pDoc->UpdateAllViews(NULL);
}
void CTimeFrame::OnUpdateFullNames(CCmdUI* pCmdUI)
{
pCmdUI->Enable( !m_fFullNames );
}
void CTimeFrame::OnPartNames()
{
m_fFullNames = false;
if( m_pDoc )
m_pDoc->UpdateAllViews(NULL);
}
void CTimeFrame::OnUpdatePartNames(CCmdUI* pCmdUI)
{
pCmdUI->Enable( m_fFullNames );
}
void CTimeFrame::OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar)
{
// TODO: Add your message handler code here and/or call default
CMDIChildWnd::OnVScroll(nSBCode, nPos, pScrollBar);
}
@@ -0,0 +1,145 @@
#if !defined(AFX_TIMEFRAME_H__CE016E2E_D389_4C15_8732_8CE58363E9E3__INCLUDED_)
#define AFX_TIMEFRAME_H__CE016E2E_D389_4C15_8732_8CE58363E9E3__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// TimeFrame.h : header file
//
#include "timetoolbar.h"
#include "idcontainer.h"
class CGosViewDoc;
#include "ZoomDialog.h"
/////////////////////////////////////////////////////////////////////////////
// CTimeFrame frame
class CTimeFrame : public CMDIChildWnd
{
DECLARE_DYNCREATE(CTimeFrame)
protected:
CSplitterWnd m_wndSplitter;
CReBar m_wndReBar;
CZoomDialog m_wndZoomDialog;
CComboBox * m_pZoomUnits;
// CSliderCtrl * m_pZoomSlider;
CTimeFrame(); // protected constructor used by dynamic creation
// Attributes
public:
int m_nNumRowsVisible;
int m_nTopVisibleRow;
double m_rRowHeight;
int m_nNumBandColors;
int m_nNumEnabledBands;
CBrush *m_pBandColor;
bool m_fChildrenReady;
CGosViewDoc *m_pDoc;
_int64 m_tVisibleStart;
_int64 m_tVisibleEnd;
bool m_fAlphaSort; // sort by name (not ID)
bool m_fFullNames;
void AddId( DWORD id );
void UpdateAllIds();
CReBar *ReBar() { return &m_wndReBar; }
struct TagNode
{
DWORD id;
DWORD idParent;
DWORD idChild;
DWORD idSibling;
bool expand;
bool onScreen;
bool independent; // false means this is shown in parent's slot
int screenY;
int indent; // 0 = no parents, 1=1 parent,..
DWORD idNextEnabled; // this is the linked list in the order of visibility
// Used for stats:
int countEntry;
_int64 sumTicks;
TagNode *pAssignTo; // pointer to tag to accumulate these events
};
IDContainer<TagNode> m_TagList; // these have 1:1 relationship with Doc's m_TagInfo
IDContainer<TagNode> m_ParentList; // these are for dummy parents created for treeview
DWORD m_FirstID; // id (or 0) of first tag whose parent id is 0
int m_nNumParentNames; // number of entries in m_aParentName
char m_aParentName[400][80];
DWORD m_aParentID[400]; // TBD - fix these consts !!
int m_nOldParentNames;
char m_aOldParentName[400][80];
bool m_aOldParentExpand[400]; // TBD - fix these consts !!
int m_VScrollPos; // VScroll position maintained by trace pane
void ProcessNewLog();
void DetermineVisibleTags();
void AnalyzeTagNodes();
CZoomDialog *ZoomDialog() { return &m_wndZoomDialog; }
void CTimeFrame::SortAndAddParents();
void AddToChildrenOf( DWORD idParent, char *pName, DWORD id, TagNode *pNode );
char *AnyIDToName( DWORD id );
TagNode *AnyIDToTag( DWORD id );
DWORD IDFindOrAddParent( DWORD idParent, char *pName );
void SetDocument( CGosViewDoc *pDoc ) { m_pDoc = pDoc; }
int CompareID( char *pName, DWORD id, DWORD oldID );
// Operations
public:
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CTimeFrame)
protected:
virtual BOOL OnCreateClient(LPCREATESTRUCT lpcs, CCreateContext* pContext);
virtual BOOL OnNotify(WPARAM wParam, LPARAM lParam, LRESULT* pResult);
//}}AFX_VIRTUAL
// Implementation
protected:
virtual ~CTimeFrame();
// Generated message map functions
//{{AFX_MSG(CTimeFrame)
afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
afx_msg void OnSetFocus(CWnd* pOldWnd);
afx_msg void OnSize(UINT nType, int cx, int cy);
afx_msg void OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
afx_msg void OnButton1();
afx_msg void OnAlphaSort();
afx_msg void OnUpdateAlphaSort(CCmdUI* pCmdUI);
afx_msg void OnNumSort();
afx_msg void OnUpdateNumSort(CCmdUI* pCmdUI);
afx_msg void OnFullNames();
afx_msg void OnUpdateFullNames(CCmdUI* pCmdUI);
afx_msg void OnPartNames();
afx_msg void OnUpdatePartNames(CCmdUI* pCmdUI);
afx_msg void OnVScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_TIMEFRAME_H__CE016E2E_D389_4C15_8732_8CE58363E9E3__INCLUDED_)
@@ -0,0 +1,43 @@
// TimeToolBar.cpp : implementation file
//
#include "stdafx.h"
#include "GosView.h"
#include "TimeToolBar.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CTimeToolBar
CTimeToolBar::CTimeToolBar()
{
}
CTimeToolBar::~CTimeToolBar()
{
}
BOOL CTimeToolBar::Create( CWnd* pParentWnd, DWORD dwStyle, UINT nID )
{
if( !CToolBar::Create( pParentWnd, dwStyle, nID ) || !LoadToolBar(IDR_TIME_TOOLBAR) )
return FALSE;
return TRUE;
}
BEGIN_MESSAGE_MAP(CTimeToolBar, CToolBar)
//{{AFX_MSG_MAP(CTimeToolBar)
// NOTE - the ClassWizard will add and remove mapping macros here.
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CTimeToolBar message handlers
@@ -0,0 +1,53 @@
#if !defined(AFX_TIMETOOLBAR_H__E5D97346_4D4C_4F3B_9B9D_51EDF6D14778__INCLUDED_)
#define AFX_TIMETOOLBAR_H__E5D97346_4D4C_4F3B_9B9D_51EDF6D14778__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// TimeToolBar.h : header file
//
/////////////////////////////////////////////////////////////////////////////
// CTimeToolBar window
class CTimeToolBar : public CToolBar
{
// Construction
public:
CTimeToolBar();
// Attributes
public:
// Operations
public:
BOOL Create(
CWnd* pParentWnd,
DWORD dwStyle = WS_CHILD|WS_VISIBLE|CBRS_TOP,
UINT nID = AFX_IDW_TOOLBAR);
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CTimeToolBar)
//}}AFX_VIRTUAL
// Implementation
public:
virtual ~CTimeToolBar();
// Generated message map functions
protected:
//{{AFX_MSG(CTimeToolBar)
// NOTE - the ClassWizard will add and remove member functions here.
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_TIMETOOLBAR_H__E5D97346_4D4C_4F3B_9B9D_51EDF6D14778__INCLUDED_)
@@ -0,0 +1,157 @@
// ZoomDialog.cpp : implementation file
//
#include "stdafx.h"
#include "gosview.h"
#include "ZoomDialog.h"
#include "GosTracePane.h"
#include "math.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
const int numPow10 = 13; // number of powers of ten fully supported
const int startPow10 = 1; // index into DivStrings of first supported power
//const int subPow10 = 8; // number of tics in slider per power of 10
const int subPow10 = 32; // number of tics in slider per power of 10
const double visZoom = 2.3; // pixels/dev range = [ 10^visZoom-1, 10^visZoom )
const char *DivStrings[] =
{
"1nS / div", // 10^-9
"10nS / div", // 10^-8
"100nS / div",
"1µS / div",
"10µS / div",
"100µS / div",
"1mS / div",
"10mS / div",
"100mS / div",
"1S / div",
"10S / div",
"100S / div",
"1000S / div",
"10,000S / div",
"100,000S / div"
};
/////////////////////////////////////////////////////////////////////////////
// CZoomDialog dialog
CZoomDialog::CZoomDialog(CWnd* pParent /*=NULL*/)
: CDialog(CZoomDialog::IDD, pParent)
{
//{{AFX_DATA_INIT(CZoomDialog)
// NOTE: the ClassWizard will add member initialization here
//}}AFX_DATA_INIT
m_fReady = false;
m_pTracePane = NULL;
}
void CZoomDialog::DoDataExchange(CDataExchange* pDX)
{
CDialog::DoDataExchange(pDX);
//{{AFX_DATA_MAP(CZoomDialog)
// NOTE: the ClassWizard will add DDX and DDV calls here
//}}AFX_DATA_MAP
}
BEGIN_MESSAGE_MAP(CZoomDialog, CDialog)
//{{AFX_MSG_MAP(CZoomDialog)
ON_WM_HSCROLL()
ON_CBN_SELCHANGE(IDC_ZOOM_UNITS, OnSelchangeZoomUnits)
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CZoomDialog message handlers
//const int numPow10 = 13; // number of powers of ten fully supported
//const int startPow10 = 1; // index into DivStrings of first supported power
//const int subPow10 = 8; // number of tics in slider per power of 10
void CZoomDialog::ReadZoomSlider()
{
CSliderCtrl *pZoomSlider = (CSliderCtrl *)(GetDlgItem(IDC_ZOOM_SLIDER));
int zoomNum = pZoomSlider->GetPos();
int sliderOff = numPow10*subPow10-zoomNum;
// double m_rSecPerPixel; // 10^-9 ..10^+3
// double m_rPixPerDiv; // 10 .. 75
// double m_rSecPerDiv; // 10^-8 .. 10^+4
double powSecPerPixel = sliderOff/(double)subPow10-10.375+(double)startPow10; // -9.375, -9.25,-9.125, -9, -8.875, -8.75, ..
m_rSecPerPixel = pow( 10.0, powSecPerPixel );
double secDivPow = floor( powSecPerPixel + 20.0 + visZoom ) - 20.0; // the +/-20 stunt avoids problems with floor(-ve)
m_rSecPerDiv = pow( 10.0, secDivPow ); // the visZoom shifts the point where divisions split
m_rPixelPerDiv = m_rSecPerDiv / m_rSecPerPixel;
int selNum = int(9.1+secDivPow) - startPow10;
CComboBox *pZoomUnits = (CComboBox *)(GetDlgItem(IDC_ZOOM_UNITS));
pZoomUnits->SetCurSel(selNum);
m_fReady = true;
if( m_pTracePane )
m_pTracePane->OnUpdate(NULL,0,NULL);
}
void CZoomDialog::OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar)
{
ReadZoomSlider();
CDialog::OnHScroll(nSBCode, nPos, pScrollBar);
}
void CZoomDialog::OnOK()
{
return;
}
BOOL CZoomDialog::OnInitDialog()
{
CDialog::OnInitDialog();
CComboBox *pZoomUnits = (CComboBox *)(GetDlgItem(IDC_ZOOM_UNITS));
CSliderCtrl *pZoomSlider = (CSliderCtrl *)(GetDlgItem(IDC_ZOOM_SLIDER));
int i;
for(i=startPow10; i<=numPow10+startPow10; i++ )
pZoomUnits->AddString(DivStrings[i]);
pZoomSlider->SetRange(0,numPow10*subPow10);
pZoomSlider->SetTicFreq(subPow10);
pZoomSlider->SetPos((numPow10*subPow10)>>1);
ReadZoomSlider();
return TRUE; // return TRUE unless you set the focus to a control
// EXCEPTION: OCX Property Pages should return FALSE
}
void CZoomDialog::OnSelchangeZoomUnits()
{
CComboBox *pZoomUnits = (CComboBox *)(GetDlgItem(IDC_ZOOM_UNITS));
CSliderCtrl *pZoomSlider = (CSliderCtrl *)(GetDlgItem(IDC_ZOOM_SLIDER));
pZoomSlider->SetPos( (numPow10 - pZoomUnits->GetCurSel()) * subPow10 );
ReadZoomSlider();
}
void CZoomDialog::ZoomToSecPerPixel( double newSecPerPixel )
{
CSliderCtrl *pZoomSlider = (CSliderCtrl *)(GetDlgItem(IDC_ZOOM_SLIDER));
pZoomSlider->SetPos( numPow10*subPow10-(int)((log10(newSecPerPixel)+10.375-(double)startPow10) * subPow10) );
// read it back to click to the nearest appropriate setting
ReadZoomSlider();
}
@@ -0,0 +1,69 @@
#if !defined(AFX_ZOOMDIALOG_H__1D1F8976_C03F_4113_B9F9_423B98811353__INCLUDED_)
#define AFX_ZOOMDIALOG_H__1D1F8976_C03F_4113_B9F9_423B98811353__INCLUDED_
#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000
// ZoomDialog.h : header file
//
class CGosTracePane;
/////////////////////////////////////////////////////////////////////////////
// CZoomDialog dialog
class CZoomDialog : public CDialog
{
// Construction
public:
CZoomDialog(CWnd* pParent = NULL); // standard constructor
// Dialog Data
//{{AFX_DATA(CZoomDialog)
enum { IDD = IDD_ZOOM_DIALOG };
// NOTE: the ClassWizard will add data members here
//}}AFX_DATA
double m_rSecPerPixel; // 10^-9 ..10^+3
double m_rPixelPerDiv; // 10 .. 75
double m_rSecPerDiv; // 10^-8 .. 10^+4
// double m_rTicksPerPix; // 0.1 .. 10^11
double SecPerPixel() { return m_rSecPerPixel; }
double PixelPerDiv() { return m_rPixelPerDiv; }
double SecPerDiv() { return m_rSecPerDiv; }
CGosTracePane *m_pTracePane;
bool m_fReady;
bool Ready() { return m_fReady; }
void SetTracePane(CGosTracePane *pPane) { m_pTracePane = pPane; }
void ZoomToSecPerPixel( double newSecPerPixel );
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CZoomDialog)
protected:
virtual void DoDataExchange(CDataExchange* pDX); // DDX/DDV support
//}}AFX_VIRTUAL
virtual void OnOK();
void ReadZoomSlider();
// Implementation
protected:
// Generated message map functions
//{{AFX_MSG(CZoomDialog)
afx_msg void OnHScroll(UINT nSBCode, UINT nPos, CScrollBar* pScrollBar);
virtual BOOL OnInitDialog();
afx_msg void OnSelchangeZoomUnits();
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_ZOOMDIALOG_H__1D1F8976_C03F_4113_B9F9_423B98811353__INCLUDED_)
@@ -0,0 +1,513 @@
{\rtf1\ansi \deff0\deflang1033{\fonttbl{\f0\froman\fcharset0\fprq2 Tms Rmn{\*\falt Times New Roman};}{\f1\froman\fcharset2\fprq2 Symbol;}{\f2\fswiss\fcharset0\fprq2 Helv{\*\falt Helvetica};}
{\f3\fmodern\fcharset0\fprq1 Courier;}{\f4\froman\fcharset0\fprq2 Times New Roman;}{\f5\fswiss\fcharset0\fprq2 Arial;}{\f6\froman\fcharset0\fprq2 MS Serif;}{\f7\fswiss\fcharset0\fprq2 MS Sans Serif;}{\f8\froman\fcharset0\fprq2 Times;}
{\f9\fswiss\fcharset0\fprq2 Helvetica{\*\falt Arial};}{\f10\fswiss\fcharset0\fprq2 System;}{\f11\fmodern\fcharset0\fprq1 Courier New;}{\f12\fswiss\fcharset0\fprq2 AvantGarde;}{\f13\froman\fcharset0\fprq2 ITC Bookman;}
{\f14\fswiss\fcharset0\fprq2 Helvetica-Narrow;}{\f15\froman\fcharset0\fprq2 NewCenturySchlbk;}{\f16\froman\fcharset0\fprq2 Palatino;}{\f17\froman\fcharset0\fprq2 ZapfChancery;}{\f18\fdecor\fcharset2\fprq2 ZapfDingbats;}{\f19\fnil\fcharset2\fprq2 Marlett;}
{\f20\fmodern\fcharset0\fprq1 Lucida Console;}{\f21\fnil\fcharset2\fprq2 Wingdings;}{\f22\fswiss\fcharset0\fprq2 Arial Black;}{\f23\froman\fcharset0\fprq2 Garamond;}{\f24\froman\fcharset0\fprq2 Bookman Old Style;}{\f25\fswiss\fcharset0\fprq2 Tahoma;}
{\f26\fmodern\fcharset2\fprq1 MS LineDraw;}{\f27\fdecor\fcharset0\fprq2 Algerian;}{\f28\fswiss\fcharset0\fprq2 Arial Rounded MT Bold;}{\f29\fdecor\fcharset0\fprq2 Braggadocio;}{\f30\fswiss\fcharset0\fprq2 Britannic Bold;}
{\f31\fscript\fcharset0\fprq2 Brush Script MT;}{\f32\fswiss\fcharset0\fprq2 Century Gothic;}{\f33\fdecor\fcharset0\fprq2 Colonna MT;}{\f34\fdecor\fcharset0\fprq2 Desdemona;}{\f35\froman\fcharset0\fprq2 Footlight MT Light;}
{\f36\fswiss\fcharset0\fprq2 Impact;}{\f37\fdecor\fcharset0\fprq2 Kino MT;}{\f38\froman\fcharset0\fprq2 Wide Latin;}{\f39\fscript\fcharset0\fprq2 Matura MT Script Capitals;}{\f40\fdecor\fcharset0\fprq2 Playbill;}{\f41\fswiss\fcharset0\fprq2 Arial Narrow;}
{\f42\fmodern\fcharset0\fprq1 Lucida Sans Typewriter;}{\f43\fnil\fcharset2\fprq2 MSIcons;}{\f44\fswiss\fcharset0\fprq2 Abadi MT Condensed;}{\f45\froman\fcharset2\fprq2 Wingdings 2;}{\f46\froman\fcharset2\fprq2 Wingdings 3;}
{\f47\fscript\fcharset0\fprq2 Comic Sans MS;}{\f48\fswiss\fcharset0\fprq2 Verdana;}{\f49\froman\fcharset2\fprq2 Webdings;}{\f50\froman\fcharset255\fprq2 Roman;}{\f51\fscript\fcharset255\fprq2 Script;}{\f52\fmodern\fcharset255\fprq2 Modern;}
{\f53\fswiss\fcharset0\fprq1 MS Dialog;}{\f54\froman\fcharset0\fprq2 New York;}{\f55\fswiss\fcharset0\fprq2 Geneva;}{\f56\fmodern\fcharset0\fprq1 Fixedsys;}{\f57\fmodern\fcharset255\fprq1 Terminal;}{\f58\fswiss\fcharset0\fprq2 Small Fonts;}
{\f59\fswiss\fcharset0\fprq2 MS Dialog Light;}{\f60\fswiss\fcharset0\fprq2 MS SystemEx;}}{\colortbl;\red0\green0\blue0;\red0\green0\blue255;\red0\green255\blue255;\red0\green255\blue0;\red255\green0\blue255;\red255\green0\blue0;\red255\green255\blue0;
\red255\green255\blue255;\red0\green0\blue128;\red0\green128\blue128;\red0\green128\blue0;\red128\green0\blue128;\red128\green0\blue0;\red128\green128\blue0;\red128\green128\blue128;\red192\green192\blue192;}{\stylesheet{\nowidctlpar \fs20 \snext0
Normal;}{\s1\sb240\nowidctlpar \b\f2\ul \sbasedon0\snext0 heading 1;}{\s2\sb120\nowidctlpar \b\f2 \sbasedon0\snext0 heading 2;}{\s3\li360\nowidctlpar \b \sbasedon0\snext17 heading 3;}{\s4\li360\nowidctlpar \ul \sbasedon0\snext17 heading 4;}{
\s5\li720\nowidctlpar \b\fs20 \sbasedon0\snext17 heading 5;}{\s6\li720\nowidctlpar \fs20\ul \sbasedon0\snext17 heading 6;}{\s7\li720\nowidctlpar \i\fs20 \sbasedon0\snext17 heading 7;}{\s8\li720\nowidctlpar \i\fs20 \sbasedon0\snext17 heading 8;}{
\s9\li720\nowidctlpar \i\fs20 \sbasedon0\snext17 heading 9;}{\*\cs10 \additive Default Paragraph Font;}{\*\cs15 \additive\f0\fs16\up6\lang1033 \sbasedon10 footnote reference;}{\s16\nowidctlpar \fs20 \sbasedon0\snext16 footnote text;}{
\s17\li720\nowidctlpar \fs20 \sbasedon0\snext17 Normal Indent;}{\s18\fi-240\li480\sb80\nowidctlpar\tx480 \f9 \sbasedon0\snext18 nscba;}{\s19\fi-240\li240\sa20\nowidctlpar \f9 \sbasedon0\snext19 j;}{\s20\li480\sa20\nowidctlpar \f9 \sbasedon0\snext20 ij;}{
\s21\sb80\sa20\nowidctlpar \f9 \sbasedon0\snext21 btb;}{\s22\fi-240\li2400\sb20\sa20\nowidctlpar \f9\fs20 \sbasedon0\snext22 ctcb;}{\s23\fi-240\li480\sa40\nowidctlpar\tx480 \f9 \sbasedon0\snext23 ns;}{\s24\sa120\nowidctlpar \f9\fs28 \sbasedon0\snext24
TT;}{\s25\fi-240\li2400\sa20\nowidctlpar \f9 \sbasedon0\snext25 crtj;}{\s26\fi-240\li480\nowidctlpar\tx480 \f9 \sbasedon0\snext26 nsca;}{\s27\sa20\nowidctlpar \f9 \sbasedon0\snext27 bt;}{\s28\li240\sb120\sa40\nowidctlpar \f9 \sbasedon0\snext28 Hf;}{
\s29\li240\sb120\sa40\nowidctlpar \f9 \sbasedon0\snext29 Hs;}{\s30\li480\sb120\sa40\nowidctlpar \f9 \sbasedon0\snext30 RT;}{\s31\fi-2160\li2160\sb240\sa80\nowidctlpar\tx2160 \f9 \sbasedon0\snext31 c;}{\s32\li2160\sa20\nowidctlpar \f9 \sbasedon0\snext32
ct;}{\s33\li240\sa20\nowidctlpar \f9 \sbasedon0\snext33 it;}{\s34\li480\nowidctlpar \f9\fs20 \sbasedon0\snext34 nsct;}{\s35\fi-160\li400\sb80\sa40\nowidctlpar \f9 \sbasedon0\snext35 nscb;}{\s36\fi-2640\li2880\sb120\sa40\nowidctlpar\brdrb\brdrs\brdrw15
\brdrbtw\brdrs\brdrw15 \tx2880 \f9 \sbasedon0\snext36 HC2;}{\s37\fi-2640\li2880\sb120\sa20\nowidctlpar\tx2880 \f9 \sbasedon0\snext37 C2;}{\s38\fi-240\li2400\sa20\nowidctlpar \f9\fs20 \sbasedon0\snext38 ctc;}{\s39\li2160\sb160\nowidctlpar \f9
\sbasedon0\snext39 crt;}{\s40\li480\sb20\sa40\nowidctlpar \f9 \sbasedon0\snext40 or;}{\s41\fi-259\li360\sb40\sa40\nowidctlpar\tx360 \f7\fs20 \sbasedon0\snext41 Ln1;}{\s42\li115\sb80\sa80\nowidctlpar \f7\fs20 \sbasedon0\snext0 *Intro;}{
\s43\li115\sb80\sa80\keepn\nowidctlpar \b\f7 \sbasedon3\snext42 *Title;}{\s44\fi-245\li360\sb80\nowidctlpar \f7\fs20 \snext44 *Jl;}{\s45\li360\sb40\sa40\nowidctlpar \f7\fs20 \snext0 Lp1;}{\s46\fi-1800\li1915\sb60\sl-240\slmult1\nowidctlpar\tx1915
\f7\fs20 \sbasedon0\snext46 Tph;}{\s47\li115\sb120\sa80\nowidctlpar \b\f7\fs20 \snext41 Proch;}{\*\cs48 \additive\super \sbasedon10 endnote reference;}}{\info{\title AFXCORE}{\subject MFC Core RTF Help}{\author AFX}{\creatim\yr1992\mo10\dy7\hr11\min4}
{\version1}{\edmins1}{\nofpages0}{\nofwords0}{\nofchars0}{\vern49213}}\widowctrl\ftnbj\aenddoc\hyphcaps0 \fet0\sectd \linex576\endnhere {\*\pnseclvl1\pnucrm\pnstart1\pnindent720\pnhang{\pntxta .}}{\*\pnseclvl2\pnucltr\pnstart1\pnindent720\pnhang
{\pntxta .}}{\*\pnseclvl3\pndec\pnstart1\pnindent720\pnhang{\pntxta .}}{\*\pnseclvl4\pnlcltr\pnstart1\pnindent720\pnhang{\pntxta )}}{\*\pnseclvl5\pndec\pnstart1\pnindent720\pnhang{\pntxtb (}{\pntxta )}}{\*\pnseclvl6\pnlcltr\pnstart1\pnindent720\pnhang
{\pntxtb (}{\pntxta )}}{\*\pnseclvl7\pnlcrm\pnstart1\pnindent720\pnhang{\pntxtb (}{\pntxta )}}{\*\pnseclvl8\pnlcltr\pnstart1\pnindent720\pnhang{\pntxtb (}{\pntxta )}}{\*\pnseclvl9\pnlcrm\pnstart1\pnindent720\pnhang{\pntxtb (}{\pntxta )}}\pard\plain \fs20
{\cs15\fs16\up6 #{\footnote \pard\plain \s16 \fs20 {\cs15\fs16\up6 #} main_index}}{\fs16\up6 }{\b\f2\fs24\up6 <<YourApp>> Help Index}{\b\f2
\par }{\f9
\par }{\b\f2 How To ...
\par }{\f2 \tab <<add your application-specific "how to" topics here>>}{\f9\ulw
\par
\par }{\b\f2 Commands
\par }{\f2 \tab }{\f2\uldb File menu}{\v\f2 menu_file}{\f2
\par \tab }{\f2\uldb Edit menu}{\v\f2 menu_edit}{\f2\uldb
\par }{\f2 \tab }{\f2\uldb Record menu}{\v\f2 menu_record}{\f2
\par \tab }{\f2\uldb View menu}{\v\f2 menu_view}{\f2
\par \tab }{\f2\uldb Window menu}{\v\f2 menu_window}{\f2
\par \tab }{\f2\uldb Help menu}{\v\f2 menu_help}{\f2
\par \page }{\cs15\fs16\up6 #{\footnote \pard\plain \fs20 {\cs15\fs16\up6 #} menu_file}K{\footnote \pard\plain \s16 \fs20 {\cs15\fs16\up6 K} files: managing}}{\f2 }{\cs15\fs16\up6 ${\footnote \pard\plain \s16 \fs20 {\cs15\fs16\up6 $} File menu commands}}{\f2
}{\b\f2 File menu commands}{\f2
\par
\par The File menu offers the following commands:
\par
\par }\trowd \trgaph108\trleft-108 \cellx1302\cellx8622 \pard \intbl {\f2\uldb New}{\v\f2 HID_FILE_NEW}{\f2 \cell Creates a new document.\cell }\pard \intbl {\f2 \row }\trowd \trgaph108\trleft-108 \cellx1302\cellx8622 \pard \intbl {\f2\uldb Open}{\v\f2
HID_FILE_OPEN}{\f2\uldb \cell }{\f2 Opens an existing document.\cell }\pard \intbl {\f2 \row }\pard \intbl {\f2\uldb Close}{\v\f2 HID_FILE_CLOSE}{\f2\uldb \cell }{\f2 Closes an opened document.\cell }\pard \intbl {\f2 \row }\pard \intbl {\f2\uldb Save}{
\v\f2 HID_FILE_SAVE}{\f2\uldb \cell }{\f2 Saves an opened document using the same file name.\cell }\pard \intbl {\f2 \row }\pard \intbl {\f2\uldb Save As}{\v\f2 HID_FILE_SAVE_AS}{\f2\uldb \cell }{\f2 Saves an opened document to a specified file name.
\cell }\pard \intbl {\f2 \row }\pard \intbl {\f2\uldb Print}{\v\f2 HID_FILE_PRINT}{\f2\uldb \cell }{\f2 Prints a document.\cell }\pard \intbl {\f2 \row }\pard \intbl {\f2\uldb Print Preview}{\v\f2 HID_FILE_PRINT_PREVIEW}{\f2\uldb \cell }{\f2
Displays the document on the screen as it would appear printed.\cell }\pard \intbl {\f2 \row }\pard \intbl {\f2\uldb Print Setup}{\v\f2 HID_FILE_PRINT_SETUP}{\f2\uldb \cell }{\f2 Selects a printer and printer connection.\cell }\pard \intbl {\f2 \row
}\pard \intbl {\f2\uldb Send...}{\v\f2 HID_FILE_SEND_MAIL}{\f2\uldb \cell }{\f2 Sends the active document through electronic mail.\cell }\pard \intbl {\f2 \row }\trowd \trgaph108\trleft-108 \cellx1302\cellx8622 \pard \intbl {\f2\uldb Exit}{\v\f2
HID_APP_EXIT}{\f2 \tab
\par }{\f2\uldb \cell }{\f2 Exits <<YourApp>>.\cell }\pard \intbl {\f2 \row }\pard {\f2
\par \page }{\cs15\fs16\up6 #{\footnote \pard\plain \fs20 {\cs15\fs16\up6 #} menu_edit}}{\b\f2 Edit menu commands}{\f2
\par
\par The Edit menu offers the following commands:
\par }\pard \fi-720\li720 {\f2
\par }\trowd \trgaph108\trleft-108 \cellx1497\cellx10212 \pard \intbl {\f2\uldb Undo}{\v\f2 HID_EDIT_UNDO}{\f2 \cell Reverse previous editing operation.\cell }\pard \intbl {\f2 \row }\trowd \trgaph108\trleft-108 \cellx1497\cellx10212 \pard \intbl {\f2\uldb Cut
}{\v\f2 HID_EDIT_CUT}{\f2\uldb \cell }{\f2 Deletes data from the document and moves it to the clipboard.\cell }\pard \intbl {\f2 \row }\pard \intbl {\f2\uldb Copy}{\v\f2 HID_EDIT_COPY}{\f2\uldb \cell }{\f2 Copies data from the document to the clipboard.
\cell }\pard \intbl {\f2 \row }\pard \intbl {\f2\uldb Paste}{\v\f2 HID_EDIT_PASTE}{\f2\uldb \cell }{\f2 Pastes data from the clipboard into the document.\cell }\pard \intbl {\f2 \row }\pard \intbl {\f2\uldb Paste Link}{\v\f2 HID_EDIT_PASTE_LINK}{\f2\uldb
\cell }{\f2 Pastes from the clipboard a link to data in another application.\cell }\pard \intbl {\f2 \row }\pard \intbl {\f2\uldb Insert New Object}{\v\f2\uldb HID_OLE_INSERT_NEW}{\f2\uldb \cell }{\f2
Inserts and embeds an object, such as a chart or an equation in a document.\cell }\pard \intbl {\f2 \row }\trowd \trgaph108\trleft-108 \cellx1497\cellx10212 \pard \intbl {\f2\uldb Links}{\v\f2 HID_OLE_EDIT_LINKS}{\f2\uldb \cell }{\f2
List and edit links to embedded documents.\cell }\pard \intbl {\f2 \row }\pard \fi-720\li720 {\f2
\par }\pard {\f2 \tab \page }{\cs15\fs16\up6 #{\footnote \pard\plain \fs20 {\cs15\fs16\up6 #} menu_view}}{\b\f2 View menu commands}{\f2
\par
\par The View menu offers the following commands:
\par
\par }\trowd \trgaph108\trleft-108 \cellx1272\cellx7452 \pard \intbl {\f2\uldb Toolbar}{\v\f2 HID_VIEW_TOOLBAR}{\f2\uldb \cell }{\f2 Shows or hides the toolbar.\cell }\pard \intbl {\f2 \row }\trowd \trgaph108\trleft-108 \cellx1272\cellx7452 \pard \intbl {
\f2\uldb Status Bar}{\v\f2 HID_VIEW_STATUS_BAR}{\f2\uldb \cell }\pard \fi-720\li720\intbl {\f2 Shows or hides the status bar.
\par }\pard \intbl {\f2 \cell }\pard \intbl {\f2 \row }\pard {\f2 \page }{\cs15\fs16\up6 #{\footnote \pard\plain \fs20 {\cs15\fs16\up6 #} menu_window}}{\b\f2 Window menu commands}{\f2
\par
\par The Window menu offers the following commands, which enable you to arrange multiple views of multiple documents in the application window:
\par
\par }\trowd \trgaph108\trleft-108 \cellx1572\cellx7752 \pard \intbl {\f2\uldb New Window}{\v\f2 HID_WINDOW_NEW}{\f2\uldb \cell }{\f2 Creates a new window that views the same document.\cell }\pard \intbl {\f2 \row }\trowd \trgaph108\trleft-108 \cellx1572
\cellx7752 \pard \intbl {\f2\uldb Cascade}{\v\f2 HID_WINDOW_CASCADE}{\f2\uldb \cell }{\f2 Arranges windows in an overlapped fashion.\cell }\pard \intbl {\f2 \row }\pard \intbl {\f2\uldb Tile}{\v\f2 HID_WINDOW_TILE}{\f2\uldb \cell }{\f2
Arranges windows in non-overlapped tiles.\cell }\pard \intbl {\f2 \row }\pard \intbl {\f2\uldb Arrange Icons}{\v\f2 HID_WINDOW_ARRANGE}{\f2\uldb \cell }\pard \fi-720\li720\intbl {\f2 Arranges icons of closed windows.\cell }\pard \intbl {\f2 \row }\pard
\intbl {\f2\uldb Split}{\v\f2 HID_WINDOW_SPLIT}{\f2\uldb \cell }\pard \fi-720\li720\intbl {\f2 Split the active window into panes.\cell }\pard \intbl {\f2 \row }\trowd \trgaph108\trleft-108 \cellx1572\cellx7752 \pard \intbl {\f2\uldb Window 1, 2, ...}{
\v\f2 HID_WINDOW_ALL}{\f2\uldb \cell }\pard \fi-720\li720\intbl {\f2 Goes to specified window.\cell }\pard \intbl {\f2 \row }\pard \fi-720\li720 {\f2
\par }\pard {\f2
\par \page }{\cs15\fs16\up6 #{\footnote \pard\plain \fs20 {\cs15\fs16\up6 #} menu_help}}{\b\f2 Help menu commands}{\f2
\par
\par The Help menu offers the following commands, which provide you assistance with this application:
\par
\par }\trowd \trgaph108\trleft-108 \cellx1077\cellx7257 \pard \intbl {\f2\uldb Help Topics}{\v\f2 HID_HELP_INDEX}{\f2\uldb \cell }\pard \fi-720\li720\intbl {\f2 Offers you an index to topics on which you can get help.\cell }\pard \intbl {\f2 \row }\trowd
\trgaph108\trleft-108 \cellx1077\cellx7257 \pard \intbl {\f2\uldb About}{\v\f2 HID_APP_ABOUT}{\f2\uldb \cell }\pard \fi-720\li720\intbl {\f2 Displays the version number of this application.\cell }\pard \intbl {\f2 \row }\pard \fi-720\li720 {\f2
\par
\par }\pard {\f2 \page }{\cs15\fs16\up6 #{\footnote \pard\plain \fs20 {\cs15\fs16\up6 #} HID_FILE_NEW}K{\footnote \pard\plain \s16 \fs20 {\cs15\fs16\up6 K} files: managing}}{\f2 }{\cs15\fs16\up6 ${\footnote \pard\plain \s16 \fs20 {\cs15\fs16\up6 $}
File New command}}{\f2 }{\b\f2 New command (File menu)}{\f2
\par
\par Use this command to create a new document in <<YourApp>>. Select the type of new file you want to create in the }{\f2\uldb File New dialog box}{\v AFX_HIDD_NEWTYPEDLG}. {\f2 << R
emove previous sentence if your application supports only one document type. >>
\par
\par You can open an existing document with the }{\f2\uldb Open command}{\v HID_FILE_OPEN}{\f2 .
\par
\par }{\b\f2 Shortcuts
\par }\pard \fi-1080\li1440\tx1440 {\f2 Toolbar:\tab \{bmc filenew.bmp\}
\par Keys:\tab CTRL+N
\par }\pard {\f2
\par \page }{\cs15\fs16\up6 #{\footnote \pard\plain \fs20 {\cs15\fs16\up6 #} AFX_HIDD_NEWTYPEDLG}}{\b\f2 File New dialog box
\par }{\f2
\par << Delete this help topic if your application supports only one document type. >>
\par
\par Specify the type of document you wish to create:
\par << List your application's document types here >>\page }{\cs15\fs16\up6 #{\footnote \pard\plain \fs20 {\cs15\fs16\up6 #} HID_FILE_OPEN}K{\footnote \pard\plain \s16 \fs20 {\cs15\fs16\up6 K} files: managing}}{\f2 }{\cs15\fs16\up6 ${\footnote \pard\plain
\s16 \fs20 {\cs15\fs16\up6 $} File Open command}}{\f2 }{\b\f2 Open command (File menu)}{\f2
\par
\par Use this command to open an existing document in a new window. You can open multiple documents at once. Use the Window menu to switch among the multiple open documents. See }{\f2\uldb Window 1, 2, ... command}{\v\f2 HID_WINDOW_ALL}{\f2 .
\par
\par You can create new documents with the }{\f2\uldb New command}{\v HID_FILE_NEW}{\f2 .
\par
\par }{\b\f2 Shortcuts
\par }\pard \fi-1080\li1440\tx1440 {\f2 Toolbar:\tab \{bmc fileopen.bmp\}
\par Keys:\tab CTRL+O
\par }\pard \li360 {\f2
\par }\pard {\f2 \page }{\cs15\fs16\up6 #{\footnote \pard\plain \fs20 {\cs15\fs16\up6 #} AFX_HIDD_FILEOPEN}}{\b\f2 File Open dialog box
\par }{\f2
\par The following options allow you to specify which file to open:
\par }\pard \sb60 {\b\f2 File Name
\par }\pard \li360 {\f2 Type or select the filename you want to open. This box lists files with the extension you select in the List Files of Type box.
\par }\pard \sb60 {\b\f2 List Files of Type
\par }\pard \li360 {\f2 Select the type of file you want to open:
\par << List your application's file types here. >>
\par }\pard \sb60 {\b\f2 Drives
\par }\pard \li360 {\f2 Select the drive in which <<YourApp>> stores the file that you want to open.
\par }\pard \sb60 {\b\f2 Directories
\par }\pard \li360 {\f2 Select the directory in which <<YourApp>> stores the file that you want to open.
\par }\pard \sb60 {\b\f2 Network...
\par }\pard \li360 {\f2 Choose this button to connect to a network location, assigning it a new drive letter.
\par
\par }\pard {\f2 \page }{\cs15\fs16\up6 #{\footnote \pard\plain \fs20 {\cs15\fs16\up6 #} HID_FILE_CLOSE}K{\footnote \pard\plain \s16 \fs20 {\cs15\fs16\up6 K} files: managing}}{\f2 }{\cs15\fs16\up6 ${\footnote \pard\plain \s16 \fs20 {\cs15\fs16\up6 $}
File Close command}}{\f2 }{\b\f2 Close command (File menu)}{\f2
\par
\par Use this command to close all windows containing the active document. <<YourApp>> suggests that you save changes to your document before you close it. If you close a document without saving, you lose all changes made since the last time you saved it. B
efore closing an untitled document, <<YourApp>> displays the }{\f2\uldb Save As dialog box}{\v AFX_HIDD_FILESAVE}{\f2 and suggests that you name and save the document.
\par
\par You can also close a document by using the Close icon on the document's window, as shown below:
\par \{bml scmenu.bmp\}
\par \page }{\cs15\fs16\up6 #{\footnote \pard\plain \fs20 {\cs15\fs16\up6 #} HID_FILE_SAVE}K{\footnote \pard\plain \s16 \fs20 {\cs15\fs16\up6 K} files: managing}}{\f2 }{\cs15\fs16\up6 ${\footnote \pard\plain \s16 \fs20 {\cs15\fs16\up6 $} File Save command}}{
\f2 }{\b\f2 Save command (File menu)}{\f2
\par
\par Use this command to save the active document to its current name and directory. When you save a document for the first time, <<YourApp>> displays the }{\f2\uldb Save As dialog box}{\v AFX_HIDD_FILESAVE}{\f2
so you can name your document. If you want to change the name and directory of an existing document before you save it, choose the }{\f2\uldb Save As command}{\v HID_FILE_SAVE_AS}{\f2 .
\par
\par }{\b\f2 Shortcuts
\par }\pard \fi-1080\li1440\tx1440 {\f2 Toolbar:\tab \{bmc filesave.bmp\}
\par Keys:\tab CTRL+S
\par }\pard \li360 {\f2
\par }\pard {\f2
\par \page }{\cs15\fs16\up6 #{\footnote \pard\plain \fs20 {\cs15\fs16\up6 #} HID_FILE_SAVE_AS}K{\footnote \pard\plain \s16 \fs20 {\cs15\fs16\up6 K} files: managing}}{\f2 }{\cs15\fs16\up6 ${\footnote \pard\plain \s16 \fs20 {\cs15\fs16\up6 $}
File Save As command}}{\f2 }{\b\f2 Save As command (File menu)}{\f2
\par
\par Use this command to save and name the active document. <<YourApp>> displays the }{\f2\uldb Save As dialog box}{\v AFX_HIDD_FILESAVE}{\f2 so you can name your document.
\par
\par To save a document with its existing name and directory, use the }{\f2\uldb Save command}{\v HID_FILE_SAVE}{\f2 .
\par
\par \page }{\cs15\fs16\up6 #{\footnote \pard\plain \fs20 {\cs15\fs16\up6 #} HID_FILE_SEND_MAIL}}{\b\f2 Send command (File menu)}{\f2
\par
\par Use this command to send the active document through electronic mail. This command presents a mail window with the active document attached to it. You may then fill out the To: field, Subject: field, etc., and add text to the body of the message if you
wish. When you are finished you may click the "Send" button to send the message.
\par \page }{\cs15\fs16\up6 #{\footnote \pard\plain \fs20 {\cs15\fs16\up6 #} AFX_HIDD_FILESAVE}}{\b\f2 File Save As dialog box
\par }{\f2
\par The following options allow you to specify the name and location of the file you're about to save:
\par }\pard \sb60 {\b\f2 File Name
\par }\pard \li360 {\f2 Type a new filename to save a document with a different name. <<YourApp>> adds the extension you specify in the Save File As Type box.
\par }\pard \sb60 {\b\f2 Drives
\par }\pard \li360 {\f2 Select the drive in which you want to store the document.
\par }\pard \sb60 {\b\f2 Directories
\par }\pard \li360 {\f2 Select the directory in which you want to store the document.
\par }\pard \sb60 {\b\f2 Network...
\par }\pard \li360 {\f2 Choose this button to connect to a network location, assigning it a new drive letter.
\par
\par }\pard {\f2 << Add other File Save As dialog box options depending on which ones your application chooses via the OFN_ flags of the OPENFILENAME structure used by the CFileDialog. >>
\par \page }{\cs15\fs16\up6 #{\footnote \pard\plain \s16 \fs20 {\cs15\fs16\up6 #} HID_FILE_MRU_FILE1}}{\f2 }{\cs15\fs16\up6 K{\footnote \pard\plain \s16 \fs20 {\cs15\fs16\up6 K} files: managing}}{\f2 }{\cs15\fs16\up6 ${\footnote \pard\plain \s16 \fs20 {
\cs15\fs16\up6 $} File 1, 2, 3, 4 command}}{\f2 }{\b\f2 1, 2, 3, 4 command (File menu)}{\f2
\par
\par Use the numbers and filenames listed at the bottom of the File menu to open the last four documents you closed. Choose the number that corresponds with the document you want to open.
\par \page }{\cs15\fs16\up6 #{\footnote \pard\plain \fs20 {\cs15\fs16\up6 #} HID_APP_EXIT}K{\footnote \pard\plain \s16 \fs20 {\cs15\fs16\up6 K} exit}}{\f2 }{\cs15\fs16\up6 ${\footnote \pard\plain \s16 \fs20 {\cs15\fs16\up6 $} File Exit command}}{\f2 }{\b\f2
Exit command (File menu)}{\f2
\par
\par Use this command to end your <<YourApp>> session. You can also use the Close command on the application Control menu. <<YourApp>> prompts you to save documents with unsaved changes.
\par }
\par {\b\f2 Shortcuts
\par }\pard \fi-1080\li1440\tx1440 {\f2 Mouse:\tab Double-click the application's Control menu button.
\par \tab \{bmc appexit.bmp\}
\par Keys:\tab ALT+F4
\par }\pard \page {\cs15\fs16\up6 #{\footnote \pard\plain \fs20 {\cs15\fs16\up6 #} HID_EDIT_UNDO}}{\b\f2 Undo/Can't Undo command (Edit menu)}{\f2
\par
\par << Your application's user interface for Undo may differ from the one described below. Modify this help text accordingly. >>
\par
\par Use this command to reverse the last editing action, if possible. The name of the command changes, depending on what the last action was. The Undo command changes to Can't Undo on the menu if you cannot reverse your last action.
\par
\par }{\b\f2 Shortcuts
\par }\pard \fi-1080\li1440\tx1440 {\f2 Toolbar:\tab \{bmc editundo.bmp\}
\par Keys:\tab CTRL+Z or
\par \tab ALT-BACKSPACE\tab
\par }\pard {\f2
\par \page }{\cs15\fs16\up6 #{\footnote \pard\plain \fs20 {\cs15\fs16\up6 #} HID_EDIT_REDO}}{\b\f2 Redo command (Edit menu)}{\f2
\par
\par << Write application-specific help here. >>
\par \page }{\cs15\fs16\up6 #{\footnote \pard\plain \fs20 {\cs15\fs16\up6 #} HID_EDIT_CUT}}{\b\f2 Cut command (Edit menu)}{\f2
\par
\par Use this command to remove the currently selected data from the document and put it on the clipboard. This command is unavailable if there is no data currently selected.
\par
\par Cutting data to the clipboard replaces the contents previously stored there.
\par
\par }{\b\f2 Shortcuts
\par }\pard \fi-1080\li1440\tx1440 {\f2 Toolbar:\tab \{bmc editcut.bmp\}
\par Keys:\tab CTRL+X
\par }\pard {\f2
\par \page }{\cs15\fs16\up6 #{\footnote \pard\plain \fs20 {\cs15\fs16\up6 #} HID_EDIT_COPY}}{\b\f2 Copy command (Edit menu)}{\f2
\par
\par Use this command to copy selected data onto the clipboard. This command is unavailable if there is no data currently selected.
\par
\par Copying data to the clipboard replaces the contents previously stored there.
\par
\par }{\b\f2 Shortcuts
\par }\pard \fi-1080\li1440\tx1440 {\f2 Toolbar:\tab \{bmc editcopy.bmp\}
\par Keys:\tab CTRL+C
\par }\pard {\f2
\par \page }{\cs15\fs16\up6 #{\footnote \pard\plain \fs20 {\cs15\fs16\up6 #} HID_EDIT_PASTE}}{\b\f2 Paste command (Edit menu)}{\f2
\par
\par Use this command to insert a copy of the clipboard contents at the insertion point. This command is unavailable if the clipboard is empty.
\par
\par }{\b\f2 Shortcuts
\par }\pard \fi-1080\li1440\tx1440 {\f2 Toolbar:\tab \{bmc editpast.bmp\}
\par Keys:\tab CTRL+V
\par }\pard {\f2
\par \page }{\cs15\fs16\up6 #{\footnote \pard\plain \fs20 {\cs15\fs16\up6 #} HID_VIEW_TOOLBAR}K{\footnote \pard\plain \s16 \fs20 {\cs15\fs16\up6 K} toolbar}}{\f2 }{\cs15\fs16\up6 ${\footnote \pard\plain \s16 \fs20 {\cs15\fs16\up6 $} View Toolbar command}}{
\f2 }{\b\f2 Toolbar command (View menu)}{\f2
\par
\par Use this command to display and hide the Toolbar, which includes buttons for some of the most common commands in <<YourApp>>, such as File Open. A check mark appears next to the menu item when the Toolbar is displayed.
\par
\par See }{\f2\uldb Toolbar}{\v\f2 AFX_HIDW_TOOLBAR}{\f2 for help on using the toolbar.
\par \page }{\cs15\fs16\up6 #{\footnote \pard\plain \fs20 {\cs15\fs16\up6 #} AFX_HIDW_TOOLBAR}K{\footnote \pard\plain \s16 \fs20 {\cs15\fs16\up6 K} toolbar}}{\f2 }{\cs15\fs16\up6 ${\footnote \pard\plain \s16 \fs20 {\cs15\fs16\up6 $} toolbar}}{\f2 }{\b\f2
Toolbar}{\f2
\par \{bml hlptbar.bmp\}
\par
\par The toolbar is displayed across the top of the application window, below the menu bar. The toolbar provides quick mouse access to many tools used in <<YourApp>>,
\par
\par To hide or display the Toolbar, choose Toolbar from the View menu (ALT, V, T).
\par
\par << Add or remove toolbar buttons from the list below according to which ones your application offers. >>
\par
\par }\pard \brdrb\brdrs\brdrw15\brsp20 \tx1080 {\b\f2 Click\tab To}{\f2
\par }\pard \fi-1080\li1080\tx1080 {\f2 \{bmc filenew.bmp\}\tab Open a new document.
\par
\par \{bmc fileopen.bmp\}\tab Open an existing document. <<YourApp>> displays the Open dialog box, in which you can locate and open the desired file.
\par
\par \{bmc filesave.bmp\}\tab Save the active document or template with its current name. If you have not named the document, <<YourApp>> displays the Save As dialog box.
\par
\par \{bmc fileprnt.bmp\}\tab Print the active document.
\par
\par \{bmc editcut.bmp\}\tab Remove selected data from the document and stores it on the clipboard.
\par
\par \{bmc editcopy.bmp\}\tab Copy the selection to the clipboard.
\par
\par \{bmc editpast.bmp\}\tab Insert the contents of the clipboard at the insertion point.
\par
\par \{bmc editundo.bmp\}\tab Reverse the last editing. Note: You cannot undo some actions.
\par
\par \{bmc recfirst.bmp\}\tab Go to the first record in the current selection.
\par
\par \{bmc recprev.bmp\}\tab Go to the previous record in the current selection.
\par
\par \{bmc recnext.bmp\}\tab Go to the next record in the current selection.
\par
\par \{bmc reclast.bmp\}\tab Go to the last record in the current selection.
\par
\par }\pard {\f2 \page }{\cs15\fs16\up6 #{\footnote \pard\plain \fs20 {\cs15\fs16\up6 #} HID_VIEW_STATUS_BAR}K{\footnote \pard\plain \s16 \fs20 {\cs15\fs16\up6 K} status bar}}{\f2 }{\cs15\fs16\up6 ${\footnote \pard\plain \fs20 {\cs15\fs16\up6 $}
View Status Bar Command}}{\b\f2 Status Bar command (View menu)
\par }{\f2
\par Use this command to display and hide the Status Bar, which describes the action to be executed by the selected menu item or depressed toolbar button, and keyboard latch state. A check mark appears next to the menu item when the Status Bar is displayed.
\par
\par See }{\f2\uldb Status Bar}{\v\f2 AFX_HIDW_STATUS_BAR}{\f2 for help on using the status bar.
\par \page }{\cs15\fs16\up6 #{\footnote \pard\plain \fs20 {\cs15\fs16\up6 #} AFX_HIDW_STATUS_BAR}K{\footnote \pard\plain \s16 \fs20 {\cs15\fs16\up6 K} status bar}}{\f2 }{\cs15\fs16\up6 ${\footnote \pard\plain \fs20 {\cs15\fs16\up6 $} status bar}}{\b\f2
Status Bar}{\f2
\par \{bml hlpsbar.bmp\}
\par
\par The status bar is displayed at the bottom of the <<YourApp>> window. To display or hide the status bar, use the Status Bar command in the View menu.
\par
\par The left area of the status bar describes actions of menu items as you use the arrow keys to navigate through menus. This area similarly shows messages that describe the actions of toolbar buttons as you depress them, before releasing them. If after vie
wing the description of the toolbar button command you wish not to execute the command, then release the mouse button while the pointer is off the toolbar button.
\par
\par The right areas of the status bar indicate which of the following keys are latched down:
\par
\par }\pard \tx1440 {\b\f2 Indicator\tab Description}{\f2
\par }\pard \fi-1440\li1440\sa120\tx1440 {\f2 CAP\tab The Caps Lock key is latched down.
\par NUM\tab The Num Lock key is latched down.
\par SCRL\tab The Scroll Lock key is latched down.
\par }\pard {\f2 \page }{\cs15\fs16\up6 #{\footnote \pard\plain \fs20 {\cs15\fs16\up6 #} HID_WINDOW_NEW}}{\b\f2 New command (Window menu)}{\f2
\par
\par Use this command to open a new window with the same contents as the active window. You can open multiple document windows to display different parts or views of a document at the same time. If you change the contents in one window, all other windows con
taining the same document reflect those changes. When you open a new window, it becomes the active window and is displayed on top of all other open windows.
\par
\par \page }{\cs15\fs16\up6 #{\footnote \pard\plain \fs20 {\cs15\fs16\up6 #} HID_WINDOW_CASCADE}}{\b\f2 Cascade command (Window menu)}{\f2
\par
\par Use this command to arrange multiple opened windows in an overlapped fashion.
\par
\par \page }{\cs15\fs16\up6 #{\footnote \pard\plain \fs20 {\cs15\fs16\up6 #} HID_WINDOW_TILE}}{\b\f2 Tile command (Window menu)}{\f2
\par
\par Use this command to arrange multiple opened windows in a non-overlapped fashion.
\par
\par
\par \page }{\cs15\fs16\up6 #{\footnote \pard\plain \fs20 {\cs15\fs16\up6 #} HID_WINDOW_TILE_HORZ}}{\b\f2 Tile Horizontal command (Window menu)}{\f2
\par
\par Use this command to vertically arrange multiple opened windows in a non-overlapped fashion.
\par \page }{\cs15\fs16\up6 #{\footnote \pard\plain \fs20 {\cs15\fs16\up6 #} HID_WINDOW_TILE_VERT}}{\b\f2 Tile Vertical command (Window menu)}{\f2
\par
\par Use this command to arrange multiple opened windows side by side.
\par \page }{\cs15\fs16\up6 #{\footnote \pard\plain \fs20 {\cs15\fs16\up6 #} HID_WINDOW_ARRANGE}}{\b\f2 Window Arrange Icons Command}{\f2
\par
\par Use this command to arrange the icons for minimized windows at the bottom of the main window. If there is an open document window at the bottom of the main window, then some or all of the icons may not be visible because they will be underneath this docu
ment window.\page }{\cs15\fs16\up6 #{\footnote \pard\plain \fs20 {\cs15\fs16\up6 #} HID_WINDOW_SPLIT}}{\b\f2 Split Command (Window menu)
\par
\par }{\f2 Use this command
to split the active window into panes. You may then use the mouse or the keyboard arrows to move the splitter bars. When you are finished, press the mouse button or enter to leave the splitter bars in their new location. Pressing escape keeps the split
ter bars in their original location. << In a single document interface application, this command will appear on the View menu. >>\page }{\cs15\fs16\up6 #{\footnote \pard\plain \fs20 {\cs15\fs16\up6 #} HID_WINDOW_ALL}}{\b\f2
1, 2, ... command (Window menu)}{\f2
\par
\par <<YourApp>> displays a list of currently open document windows at the bottom of the Window menu. A check mark appears in front of the document name of the active window. Choose a document from this list to make its window active.
\par \page }{\cs15\fs16\up6 #{\footnote \pard\plain \fs20 {\cs15\fs16\up6 #} HID_HELP_INDEX}}{\b\f2 Index command (Help menu)
\par }{\f2
\par Use this command to display the opening screen of Help. From the opening screen, you can jump to step-by-step instructions for using <<YourApp>> and various types of reference information.
\par
\par Once you open Help, you can click the Contents button whenever you want to return to the opening screen.
\par
\par \page }{\cs15\fs16\up6 #{\footnote \pard\plain \fs20 {\cs15\fs16\up6 #} HID_HELP_USING}}{\b\f2 Using Help command (Help menu)
\par }{\f2
\par Use this command for instructions about using Help.
\par \page }{\cs15\fs16\up6 #{\footnote \pard\plain \fs20 {\cs15\fs16\up6 #} HID_APP_ABOUT}}{\b\f2 About command (Help menu)
\par }{\f2
\par Use this command to display the copyright notice and version number of your copy of <<YourApp>>.
\par \page }{\cs15\fs16\up6 #{\footnote \pard\plain \fs20 {\cs15\fs16\up6 #} HID_CONTEXT_HELP}${\footnote \pard\plain \fs20 {\cs15\fs16\up6 $} Help Using Help Command}}{\b\f2 Context Help command
\par }{\f2 \{bml curhelp.bmp\}
\par
\par Use the Context Help command to obtain help on some portion of <<YourApp>>. When you choose the Toolbar's Context Help button, the mouse pointer will change to an arrow and question mark. Then click somewhere in the <<YourApp>> window, such as another T
oolbar button. The Help topic will be shown for the item you clicked.
\par
\par }{\b\f2 Shortcut
\par }\pard \fi-1080\li1440\tx1440 {\f2 Keys:\tab SHIFT+F1
\par }\pard {\f2 \page }{\cs15\fs16\up6 #{\footnote \pard\plain \fs20 {\cs15\fs16\up6 #} HID_HT_CAPTION}}{\b\f2 Title Bar}
\par
\par {\f2 << Show your application's title bar here. >>
\par
\par }\pard\plain \s42\fi-360\li360\tx360 \f7\fs20 {\f2 The title bar is located along the top of a window. It contains the name of the application and document.
\par }\pard\plain \fs20 {\f2
\par }\pard\plain \s42\fi-360\li360\tx360 \f7\fs20 {\f2 To move the window, drag the title bar. Note: You can also move dialog boxes by dragging their title bars.
\par }\pard\plain \fs20 {\f2
\par }\pard \fi-360\li360\tx360 {\f2 A title bar may contain the following elements:
\par }\pard\plain \s41\fi-360\li360\sb40\sa40\tx360 \f7\fs20 {\f2 \{bmc bullet.bmp\}\tab Application Control-menu button
\par \{bmc bullet.bmp\}\tab Document Control-menu button
\par \{bmc bullet.bmp\}\tab Maximize button
\par \{bmc bullet.bmp\}\tab Minimize button
\par \{bmc bullet.bmp\}\tab Name of the application
\par \{bmc bullet.bmp\}\tab Name of the document
\par \{bmc bullet.bmp\}\tab Restore button
\par }\pard\plain \fs20 {\f2 \page }{\cs15\fs16\up6 #{\footnote \pard\plain \s16 \fs20 {\cs15\fs16\up6 #} scrollbars}}{\f2 }{\b\f2 Scroll bars}{\f2
\par
\par Displayed at the right and bottom edges of the document window. The scroll boxes inside the scroll bars indicate your vertical and horizontal location in the document. You can use the mouse to scroll to other parts of the document.
\par
\par << Describe the actions of the various parts of the scrollbar, according to how they behave in your application. >>
\par \page }{\cs15\fs16\up6 #{\footnote \pard\plain \fs20 {\cs15\fs16\up6 #} HID_SC_SIZE}}{\b\f2 Size command (System menu)}
\par
\par {\f2 Use this command to display a four-headed arrow so you can size the active window with the arrow keys.
\par \{bml curarw4.bmp\}
\par
\par After the pointer changes to the four-headed arrow:
\par }\pard \fi-360\li360\sb60 {\f2 1.\tab Press one of the DIRECTION keys (left, right, up, or down arrow key) to move the pointer to the border you want to move.
\par 2.\tab Press a DIRECTION key to move the border.
\par 3.\tab Press ENTER when the window is the size you want.
\par }\pard {\f2
\par Note: This command is unavailable if you maximize the window.
\par }
\par {\b\f2 Shortcut}{\b
\par }\pard \fi-1080\li1440\tx1440 {\f2 Mouse:\tab Drag the size bars at the corners or edges of the window.
\par }\pard \li360 {\f2
\par }\pard {\f2 \page }{\cs15\fs16\up6 #{\footnote \pard\plain \fs20 {\cs15\fs16\up6 #} HID_SC_MOVE}}{\b\f2 Move command (Control menu)
\par }{\f2
\par Use this command to display a four-headed arrow so you can move the active window or dialog box with the arrow keys.
\par \{bmc curarw4.bmp\}
\par
\par Note: This command is unavailable if you maximize the window.
\par
\par }{\b\f2 Shortcut
\par }\pard \fi-1080\li1440\tx1440 {\f2 Keys:\tab CTRL+F7
\par
\par }\pard \tx1440 {\f2 \page }{\cs15\fs16\up6 #{\footnote \pard\plain \fs20 {\cs15\fs16\up6 #} HID_SC_MINIMIZE}${\footnote \pard\plain \fs20 {\cs15\fs16\up6 $} System Minimize Command}}{\b\f2 Minimize command (application Control menu)
\par }\pard {\f2
\par Use this command to reduce the <<YourApp>> window to an icon.
\par }\pard \fi-360\li360 {\b
\par }{\b\f2 Shortcut}{\f2
\par }\pard \fi-1080\li1440\tx1440 {\f2 Mouse:\tab Click the minimize icon \{bmc scmin.bmp\} on the title bar.
\par Keys:\tab ALT+F9
\par }\pard \fi-360\li1080
\par \pard {\f2 \page }{\cs15\fs16\up6 #{\footnote \pard\plain \fs20 {\cs15\fs16\up6 #} HID_SC_MAXIMIZE}}{\b\f2 Maximize command (System menu)
\par }{\f2
\par Use this command to enlarge the active window to fill the available space.
\par }\pard \fi-360\li360 {\b\f2
\par Shortcut}{\f2
\par }\pard \fi-1080\li1440\tx1440 {\f2 Mouse:\tab Click the maximize icon \{bmc scmax.bmp\} on the title bar; or double-click the title bar.
\par Keys:\tab CTRL+F10 enlarges a document window.
\par }\pard \fi-360\li1080
\par \pard {\f2 \page }{\cs15\fs16\up6 #{\footnote \pard\plain \fs20 {\cs15\fs16\up6 #} HID_SC_NEXTWINDOW}}{\b\f2 Next Window command (document Control menu)
\par }{\f2
\par Use this command to switch to the next open document window. <<YourApp>> determines which window is next according to the order in which you opened the windows.
\par
\par }{\b\f2 Shortcut
\par }\pard \fi-1080\li1440\tx1440 {\f2 Keys:\tab CTRL+F6
\par }\pard {\f2
\par \page }{\cs15\fs16\up6 #{\footnote \pard\plain \fs20 {\cs15\fs16\up6 #} HID_SC_PREVWINDOW}}{\b\f2 Previous Window command (document Control menu)
\par }{\f2
\par Use this command to switch to the previous open document window. <<YourApp>> determines which window is previous according to the order in which you opened the windows.
\par
\par }{\b\f2 Shortcut
\par }\pard \fi-1080\li1440\tx1440 {\f2 Keys:\tab SHIFT+CTRL+F6
\par }\pard {\f2
\par \page }{\cs15\fs16\up6 #{\footnote \pard\plain \fs20 {\cs15\fs16\up6 #} HID_SC_CLOSE}}{\b\f2 Close command (Control menus)
\par }{\f2
\par Use this command to close the active window or dialog box.
\par
\par Double-clicking a Control-menu box is the same as choosing the Close command.
\par \{bml appexit.bmp\}
\par
\par Note: If you have multiple windows open for a single document, the Close command on the document Control menu closes only one window at a time. You can close all windows at once with the Close command on the File menu.
\par
\par }{\b\f2 Shortcuts
\par }\pard \fi-1080\li1440\tx1440 {\f2 Keys: \tab CTRL+F4 closes a document window
\par \tab ALT+F4 closes the <<YourType>> window or dialog box
\par }\pard {\f2 \tab \tab \tab \page }{\cs15\fs16\up6 #{\footnote \pard\plain \fs20 {\cs15\fs16\up6 #} HID_SC_RESTORE}}{\b\f2 Restore command (Control menu)
\par }{\f2
\par Use this command to return the active window to its size and position before you chose the Maximize or Minimize command.
\par \page }{\cs15\fs16\up6 #{\footnote \pard\plain \fs20 {\cs15\fs16\up6 #} HID_SC_TASKLIST}}{\b\f2 Switch to command (application Control menu)
\par }{\f2
\par Use this command to display a list of all open applications. Use this "Task List" to switch to or close an application on the list.
\par
\par }{\b\f2 Shortcut
\par }\pard \fi-1080\li1440\tx1440 {\f2 Keys:\tab CTRL+ESC
\par }\pard {\f2
\par }{\b\f2 Dialog Box Options
\par }{\f2 When you choose the Switch To command, you will be presented with a dialog box with the following options:
\par }\pard \sb60 {\b\f2 Task List
\par }\pard \li360 {\f2 Select the application you want to switch to or close.
\par }\pard \sb60 {\b\f2 Switch To
\par }\pard \li360 {\f2 Makes the selected application active.
\par }\pard \sb60 {\b\f2 End Task
\par }\pard \li360 {\f2 Closes the selected application.
\par }\pard \sb60 {\b\f2 Cancel
\par }\pard \li360 {\f2 Closes the Task List box.
\par }\pard \sb60 {\b\f2 Cascade
\par }\pard \li360 {\f2 Arranges open applications so they overlap and you can see each title bar. This option does not affect applications reduced to icons.
\par }\pard \sb60 {\b\f2 Tile
\par }\pard \li360 {\f2 Arranges open applications into windows that do not overlap. This option does not affect applications reduced to icons.
\par }\pard \sb60 {\b\f2 Arrange Icons
\par }\pard \li360 {\f2 Arranges the icons of all minimized applications across the bottom of the screen.
\par }\pard {\f2 \page }{\cs15\fs16\up6 #{\footnote \pard\plain \fs20 {\cs15\fs16\up6 #} HID_VIEW_RULER}${\footnote \pard\plain \fs20 {\cs15\fs16\up6 $} View Ruler Command}}{\b\f2 Ruler command (View menu)
\par
\par }{\f2 << Write application-specific help here. >>
\par \page }{\cs15\fs16\up6 #{\footnote \pard\plain \fs20 {\cs15\fs16\up6 #} AFX_HIDD_FONT}${\footnote \pard\plain \fs20 {\cs15\fs16\up6 $} Choose Font Dialog}}{\b\f2 Choose Font dialog box
\par
\par }{\f2 << Write application-specific help here. >>
\par \page }{\cs15\fs16\up6 #{\footnote \pard\plain \fs20 {\cs15\fs16\up6 #} AFX_HIDD_COLOR}${\footnote \pard\plain \fs20 {\cs15\fs16\up6 $} Choose Color Dialog}}{\b\f2 Choose Color dialog box
\par
\par }{\f2 << Write application-specific help here. >>
\par \page }{\cs15\fs16\up6 #{\footnote \pard\plain \fs20 {\cs15\fs16\up6 #} HID_EDIT_FIND}${\footnote \pard\plain \fs20 {\cs15\fs16\up6 $} Edit Find Command}}{\b\f2 Find command (Edit menu)
\par
\par }{\f2 << Write application-specific help here. >>
\par \page }{\cs15\fs16\up6 #{\footnote \pard\plain \fs20 {\cs15\fs16\up6 #} AFX_HIDD_FIND}${\footnote \pard\plain \fs20 {\cs15\fs16\up6 $} Find Dialog}}{\b\f2 Find dialog box
\par
\par }{\f2 << Write application-specific help here. >>
\par \page }{\cs15\fs16\up6 #{\footnote \pard\plain \fs20 {\cs15\fs16\up6 #} HID_EDIT_REPLACE}${\footnote \pard\plain \fs20 {\cs15\fs16\up6 $} Edit Replace Command}}{\b\f2 Replace command (Edit menu)
\par
\par }{\f2 << Write application-specific help here. >>
\par \page }{\cs15\fs16\up6 #{\footnote \pard\plain \fs20 {\cs15\fs16\up6 #} AFX_HIDD_REPLACE}${\footnote \pard\plain \fs20 {\cs15\fs16\up6 $} Replace Dialog}}{\b\f2 Replace dialog box
\par
\par }{\f2 << Write application-specific help here. >>
\par \page }{\cs15\fs16\up6 #{\footnote \pard\plain \fs20 {\cs15\fs16\up6 #} HID_EDIT_REPEAT}${\footnote \pard\plain \fs20 {\cs15\fs16\up6 $} Edit Repeat Command}}{\b\f2 Repeat command (Edit menu)
\par
\par }{\f2 Use this command to repeat the last editing command carried out. The Repeat menu item changes to Can't Repeat if you cannot repeat your last action.
\par
\par }{\b\f2 Shortcut
\par }\pard \fi-1080\li1440\tx1440 {\f2 Key:\tab F4
\par }\pard {\f2
\par \page }{\cs15\fs16\up6 #{\footnote \pard\plain \fs20 {\cs15\fs16\up6 #} HID_EDIT_CLEAR}${\footnote \pard\plain \fs20 {\cs15\fs16\up6 $} Edit Clear Command}}{\b\f2 Clear command (Edit menu)
\par
\par }{\f2 << Write application-specific help here. >>
\par \page }{\cs15\fs16\up6 #{\footnote \pard\plain \fs20 {\cs15\fs16\up6 #} HID_EDIT_CLEAR_ALL}${\footnote \pard\plain \fs20 {\cs15\fs16\up6 $} Edit Clear All}}{\b\f2 Clear All command (Edit menu)
\par
\par }{\f2 << Write application-specific help here. >>
\par \page }{\cs15\fs16\up6 #{\footnote \pard\plain \fs20 {\cs15\fs16\up6 #} HID_NEXT_PANE}${\footnote \pard\plain \fs20 {\cs15\fs16\up6 $} Next Pane Command}}{\b\f2 Next Pane
\par
\par }{\f2 << Write application-specific help here. >>
\par \page }{\cs15\fs16\up6 #{\footnote \pard\plain \fs20 {\cs15\fs16\up6 #} HID_PREV_PANE}${\footnote \pard\plain \fs20 {\cs15\fs16\up6 $} Prev Pane Command}}{\b\f2 Prev Pane
\par
\par }{\f2 << Write application-specific help here. >>
\par \page }{\cs15\fs16\up6 #{\footnote \pard\plain \fs20 {\cs15\fs16\up6 #} HIDR_DOC1TYPE}}{\b\f2 Modifying the Document
\par }{\f2
\par << Write application-specific help here that provides an overview of how the user should modify a document using your application.>>
\par
\par \page
\par \page }{\cs15\fs16\up6 #{\footnote \pard\plain \fs20 {\cs15\fs16\up6 #} HID_HT_NOWHERE}}{\b\f2 No Help Available}
\par
\par {\f2 No help is available for this area of the window.
\par \page }{\cs15\fs16\up6 #{\footnote \pard\plain \s16 \fs20 {\cs15\fs16\up6 #} AFX_HIDP_default
\par }}{\f2 }{\b\f2 No Help Available
\par }
\par {\f2 No help is available for this message box.
\par }
\par {\f2 << If you wish to author help specific to each message box prompt, then remove the AFX_HIDP_xxx values from the [ALIAS] section of your .HPJ file, and author a topic for each AF
X_HIDP_xxx value. For example, AFX_HIDP_INVALID_FILENAME is the help topic for the Invalid Filename message box. >>
\par
\par }
\par }
@@ -0,0 +1,98 @@
{\rtf1\ansi \deff0\deflang1024{\fonttbl{\f0\froman Times New Roman;}{\f1\froman Symbol;}{\f2\fswiss Arial;}{\f3\froman Tms Rmn;}{\f4\fswiss Helv;}{\f5\fswiss Helvetica;}{\f6\fswiss MS Sans Serif;}}
{\colortbl;\red0\green0\blue0;\red0\green0\blue255;\red0\green255\blue255;\red0\green255\blue0;\red255\green0\blue255;\red255\green0\blue0;\red255\green255\blue0;\red255\green255\blue255;\red0\green0\blue127;\red0\green127\blue127;\red0\green127\blue0;
\red127\green0\blue127;\red127\green0\blue0;\red127\green127\blue0;\red127\green127\blue127;\red192\green192\blue192;}{\stylesheet{\s244 \f3\fs16\up6\lang1033 \sbasedon0\snext0 footnote reference;}{\s245 \f3\fs20\lang1033
\sbasedon0\snext245 footnote text;}{\s246\li720 \i\f3\fs20\lang1033 \sbasedon0\snext255 heading 9;}{\s247\li720 \i\f3\fs20\lang1033 \sbasedon0\snext255 heading 8;}{\s248\li720 \i\f3\fs20\lang1033 \sbasedon0\snext255 heading 7;}{\s249\li720
\f3\fs20\ul\lang1033 \sbasedon0\snext255 heading 6;}{\s250\li720 \b\f3\fs20\lang1033 \sbasedon0\snext255 heading 5;}{\s251\li360 \f3\ul\lang1033 \sbasedon0\snext255 heading 4;}{\s252\li360 \b\f3\lang1033 \sbasedon0\snext255 heading 3;}{\s253\sb120
\b\f4\lang1033 \sbasedon0\snext0 heading 2;}{\s254\sb240 \b\f4\ul\lang1033 \sbasedon0\snext0 heading 1;}{\s255\li720 \f3\fs20\lang1033 \sbasedon0\snext255 Normal Indent;}{\f3\fs20\lang1033 \snext0 Normal;}{\s2\fi-240\li480\sb80\tx480 \f5\lang1033
\sbasedon0\snext2 nscba;}{\s3\fi-240\li240\sa20 \f5\lang1033 \sbasedon0\snext3 j;}{\s4\li480\sa20 \f5\lang1033 \sbasedon0\snext4 ij;}{\s5\sb80\sa20 \f5\lang1033 \sbasedon0\snext5 btb;}{\s6\fi-240\li2400\sb20\sa20 \f5\fs20\lang1033 \sbasedon0\snext6 ctcb;}
{\s7\fi-240\li480\sa40\tx480 \f5\lang1033 \sbasedon0\snext7 ns;}{\s8\sa120 \f5\fs28\lang1033 \sbasedon0\snext8 TT;}{\s9\fi-240\li2400\sa20 \f5\lang1033 \sbasedon0\snext9 crtj;}{\s10\fi-240\li480\tx480 \f5\lang1033 \sbasedon0\snext10 nsca;}{\s11\sa20
\f5\lang1033 \sbasedon0\snext11 bt;}{\s12\li240\sb120\sa40 \f5\lang1033 \sbasedon0\snext12 Hf;}{\s13\li240\sb120\sa40 \f5\lang1033 \sbasedon0\snext13 Hs;}{\s14\li480\sb120\sa40 \f5\lang1033 \sbasedon0\snext14 RT;}{\s15\fi-2160\li2160\sb240\sa80\tx2160
\f5\lang1033 \sbasedon0\snext15 c;}{\s16\li2160\sa20 \f5\lang1033 \sbasedon0\snext16 ct;}{\s17\li240\sa20 \f5\lang1033 \sbasedon0\snext17 it;}{\s18\li480 \f5\fs20\lang1033 \sbasedon0\snext18 nsct;}{\s19\fi-160\li400\sb80\sa40 \f5\lang1033
\sbasedon0\snext19 nscb;}{\s20\fi-2640\li2880\sb120\sa40\brdrb\brdrs\brdrw15 \brdrbtw\brdrs\brdrw15 \tx2880 \f5\lang1033 \sbasedon0\snext20 HC2;}{\s21\fi-2640\li2880\sb120\sa20\tx2880 \f5\lang1033 \sbasedon0\snext21 C2;}{\s22\fi-240\li2400\sa20
\f5\fs20\lang1033 \sbasedon0\snext22 ctc;}{\s23\li2160\sb160 \f5\lang1033 \sbasedon0\snext23 crt;}{\s24\li480\sb20\sa40 \f5\lang1033 \sbasedon0\snext24 or;}{\s25\fi-259\li360\sb40\sa40\tx360 \f6\fs20\lang1033 \sbasedon0\snext25 Ln1;}{\s26\li115\sb80\sa80
\f6\fs20\lang1033 \sbasedon0\snext0 *Intro;}{\s27\li115\sb80\sa80\keepn \b\f6\lang1033 \sbasedon252\snext26 *Title;}{\s28\fi-245\li360\sb80 \f6\fs20\lang1033 \snext28 *Jl;}{\s29\li360\sb40\sa40 \f6\fs20\lang1033 \snext0 Lp1;}{
\s30\fi-1800\li1915\sb60\sl-240\tx1915 \f6\fs20\lang1033 \sbasedon0\snext30 Tph;}{\s31\li115\sb120\sa80 \b\f6\fs20\lang1033 \snext25 Proch;}}{\info{\title AFXPRINT}{\subject MFC Print RTF Help}{\author AFX}{\creatim\yr1992\mo10\dy7\hr12\min33}{\version1}
{\edmins46}{\nofpages1}{\nofwords65536}{\nofchars65536}{\vern16433}}\paperw12240\paperh15840\margl1800\margr1800\margt1440\margb1440\gutter0 \widowctrl\ftnbj \sectd \linex0\endnhere \pard\plain \sl240 \f3\fs20\lang1033 {\f4 \page }{\f4 #{\footnote
\pard\plain \sl240 \f3\fs20\lang1033 # HID_FILE_PRINT}}{\fs16\up6 K{\footnote \pard\plain \s245 \f3\fs20\lang1033 {\fs16\up6 K} printing and print preview}}{\f4 }{\fs16\up6 ${\footnote \pard\plain \s245 \f3\fs20\lang1033 {\fs16\up6 $} File Print command}
}{\f4 }{\b\f4 Print command (File menu)}{\b\f4
\par }{\f4
\par }{\f4 Use this command to print a document. This command presents a }{\f4\uldb Print dialog box}{\v AFX_HIDD_PRINT}{\f4
, where you may specify the range of pages to be printed, the number of copies, the destination printer, and other printer setup options.}{\b\f4
\par }{\b\f4
\par }{\b\f4 Shortcuts}{\b\f4
\par }\pard \fi-1080\li1440\sl240\tx1440 {\f4 Toolbar:}{\f4 \tab }{\f4 \{}{\f4 bmc }{\f4 fileprnt.bmp}{\f4 \}}{\f4
\par }{\f4 Keys:}{\f4 \tab }{\f4 CTRL+P}{\f4
\par }\pard \sl240 {\f4
\par }{\f4 \page }{\f4 #{\footnote \pard\plain \sl240 \f3\fs20\lang1033 # AFX_HIDD_PRINT}}{\b\f4 Print }{\b\f4 dialog box}{\b\f4
\par }{\f4
\par }{\f4 The following options allow you to specify how the document should be printed:}{\f4
\par }\pard \sb60\sl240 {\b\f4 Printer}{\b\f4
\par }\pard \li360\sl240 {\f4 This is the active printer and printer connection. Choose the Setup option to change the printer and printer connection.}{\f4
\par }\pard \sb60\sl240 {\b\f4 Setup}{\b\f4
\par }\pard \li360\sl240 {\f4 Displays a }{\f4\uldb Print Setup dialog box}{\v AFX_HIDD_PRINTSETUP}{\f4 , so you can select a printer and printer connection.}{\f4
\par }\pard \sb60\sl240 {\b\f4 Print Range}{\b\f4
\par }\pard \li360\sl240 {\f4 Specify the pages you want to print:}{\f4
\par }\trowd \trgaph108\trleft402 \cellx1647\cellx8622\pard \sl240\intbl {\b\f4 All}{\b\f4 \cell }{\f4 Prints the entire document.}{\f4 \cell }\pard \intbl {\f4 \row }\trowd \trgaph108\trleft402 \cellx1647\cellx8622\pard \sl240\intbl {\b\f4 Selection}{\b\f4
\cell }{\f4 Prints the currently selected text.}{\f4 \cell }\pard \intbl {\f4 \row }\trowd \trgaph108\trleft402 \cellx1647\cellx8622\pard \sl240\intbl {\b\f4 Pages}{\b\f4 \cell }{\f4 Prints the range of pages you specify in }{\f4 the From and To boxes.}{
\f4 \cell }\pard \intbl {\f4 \row }\pard \sb60\sl240 {\b\f4 Copies}{\b\f4
\par }\pard \li360\sl240 {\f4 Specify the number of copies you want to print for the above page range.}{\f4
\par }\pard \sb60\sl240 {\b\f4 Collate Copies}{\b\f4
\par }\pard \li360\sl240 {\f4 Prints copies in page number order, instead of separated multiple copies of each page.}{\f4
\par }\pard \sb60\sl240 {\b\f4 Print Quality}{\b\f4
\par }\pard \li360\sl240 {\f4 Select the quality of the printing. Generally, lower quality printing takes less time to produce.}{\f4
\par }\pard \sl240 {\f4 \page }{\f4 #{\footnote \pard\plain \sl240 \f3\fs20\lang1033 # AFX_HIDD_PRINTDLG}}{\b\f4 P}{\b\f4 rint Progress Dialog}{\b\f4
\par }{\f4
\par }{\f4 The Printing dialog box is shown during the time that <<YourApp>> is sending output to the printer. The page number indicates the progre}{\f4 ss of the printing.}{\f4
\par }{\f4
\par }{\f4 To abort printing, choose Cancel.}{\f4
\par }{\f4
\par }{\f4 \page }{\f4 #{\footnote \pard\plain \sl240 \f3\fs20\lang1033 # HID_FILE_PRINT_PREVIEW}}{\fs16\up6 K{\footnote \pard\plain \s245 \f3\fs20\lang1033 {\fs16\up6 K} printing and print preview}}{\f4 }{\fs16\up6 ${\footnote \pard\plain \s245
\f3\fs20\lang1033 {\fs16\up6 $} File Print Preview command}}{\f4 }{\b\f4 Print Preview command (File menu)}{\f4
\par }{\f4
\par }{\f4 Use this command to display the active document as it would appear when printed. When you choose this command, the main window will be replaced with a print preview window in which one or two pages will be displayed in their printed format. The }{
\f4\uldb print preview toolbar}{\v\f4 AFX_HIDW_PREVIEW_BAR}{\f4 offers you options to view either one or two pages at a time; move back and forth through the document; zoom in and out of pages; and initiate a print job.}{\f4
\par }{\f4 \page }{\f4 #{\footnote \pard\plain \sl240 \f3\fs20\lang1033 # AFX_HIDW_PREVIEW_BAR}}{\fs16\up6 K{\footnote \pard\plain \s245 \f3\fs20\lang1033 {\fs16\up6 K} printing and print preview}}{\f4 }{\fs16\up6 ${\footnote \pard\plain \s245
\f3\fs20\lang1033 {\fs16\up6 $} print preview toolbar}}{\f4 }{\b\f4 Print Preview toolbar}{\b\f4
\par }{\f4
\par }{\f4 The print preview toolbar offers you the following options:}{\f4
\par }\pard \sb60\sl240 {\b\f4 Print}{\b\f4
\par }\pard \li360\sl240 {\f4 Bring up the print dialog box, to start a print job.}{\f4
\par }\pard \sb60\sl240 {\b\f4 Next Page}{\b\f4
\par }\pard \li360\sl240 {\f4 Preview the next printed page.}{\f4
\par }\pard \sb60\sl240 {\b\f4 Prev Page}{\b\f4
\par }\pard \li360\sl240 {\f4 Preview the previous printed page.}{\f4
\par }\pard \sb60\sl240 {\b\f4 One Page / Two Page}{\b\f4
\par }\pard \li360\sl240 {\f4 Preview one or two printed pages at a time.}{\f4
\par }\pard \sb60\sl240 {\b\f4 Zoom In}{\b\f4
\par }\pard \li360\sl240 {\f4 Take a closer look at the printed page.}{\f4
\par }\pard \sb60\sl240 {\b\f4 Zoom Out}{\b\f4
\par }\pard \li360\sl240 {\f4 Take a larger look at the printed page.}{\f4
\par }\pard \sb60\sl240 {\b\f4 Close}{\b\f4
\par }\pard \li360\sl240 {\f4 Return from print preview to the editing window.}{\f4
\par }\pard \sl240 {\f4
\par }{\f4 \page }{\f4 #{\footnote \pard\plain \sl240 \f3\fs20\lang1033 # HID_FILE_PRINT_SETUP}}{\fs16\up6 K{\footnote \pard\plain \s245 \f3\fs20\lang1033 {\fs16\up6 K} printing and print preview}}{\f4 }{\fs16\up6 ${\footnote \pard\plain \s245
\f3\fs20\lang1033 {\fs16\up6 $} File Print Setup command}}{\f4 }{\b\f4 Print Setup command (File menu)}{\b\f4
\par }{\f4
\par }{\f4 Use this command to select a printer and a printer connection. This command presents a }{\f4\uldb Print Setup dialog box}{\v AFX_HIDD_PRINTSETUP}{\f4 , where you specify the printer and its connection.}{\b\f4
\par }{\f4 \page }{\f4 #{\footnote \pard\plain \sl240 \f3\fs20\lang1033 # AFX_HIDD_PRINTSETUP}}{\b\f4 Print}{\b\f4 Setup dialog box}{\b\f4
\par }{\f4
\par }{\f4 The following options allow you to select the destination printer and its connection.}{\f4
\par }\pard \sb60\sl240 {\b\f4 Printer}{\b\f4
\par }\pard \li360\sl240 {\f4
Select the printer you want to use. Choose the Default Printer; or choose the Specific Printer option and select one of the current installed printers shown in the box. You install printers and configure ports using the Windows Control Panel. }{\f4
\par }\pard \sb60\sl240 {\b\f4 Orientation}{\b\f4
\par }\pard \li360\sl240 {\f4 Choose Portrait or Landscape.}{\f4
\par }\pard \sb60\sl240 {\b\f4 Paper Size}{\b\f4
\par }\pard \li360\sl240 {\f4 Select the size of paper that the document is to be printed on.}{\f4
\par }\pard \sb60\sl240 {\b\f4 Paper Source}{\b\f4
\par }\pard \li360\sl240 {\f4 Some printers offer multiple trays for different paper sources. Specify the tray here.}{\f4
\par }\pard \sb60\sl240 {\b\f4 Options}{\b\f4
\par }\pard \li360\sl240 {\f4 Displays a dialog box where you can make additional choices about printing, specific to the type of printer you have selected.}{\f4
\par }\pard \sb60\sl240 {\b\f4 Network...}{\b\f4
\par }\pard \li360\sl240 {\f4 Choose this button to connect to a network location, assigning it a new drive letter.}{\f4
\par }\pard \sl240 {\f4 \page }{\f4 #{\footnote \pard\plain \sl240 \f3\fs20\lang1033 # HID_FILE_PAGE_SETUP}}{\f4 ${\footnote \pard\plain \sl240 \f3\fs20\lang1033 $ File Page Setup Command}}{\b\f4 Page Setup command (File menu)}{\b\f4
\par }{\b\f4
\par }{\f4 << Write application-specific help here. >>}{\f4
\par }\pard
\par }
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,9 @@
:Base GosView.hlp
1 Menus
2 File menu=menu_file
2 Edit menu=menu_edit
2 View menu=menu_view
2 Window menu=menu_window
2 Help menu=menu_help
1 <<add your application-specific topics here>>
2 <<add your topic jumps here>>=main_index
@@ -0,0 +1,61 @@
[OPTIONS]
LCID=0x409 0x0 0x0 ;English (U.S.)
CONTENTS=main_index
TITLE=GOSVIEW Application Help
COMPRESS=true
WARNING=2
BMROOT= ..,.
ROOT= ..,.
HLP=GosView.HLP
ERRORLOG=GosView.LOG
[FILES]
afxcore.rtf
afxprint.rtf
[ALIAS]
HIDR_MAINFRAME = main_index
HIDR_GOSTYPE = HIDR_DOC1TYPE
HIDD_ABOUTBOX = HID_APP_ABOUT
HID_HT_SIZE = HID_SC_SIZE
HID_HT_HSCROLL = scrollbars
HID_HT_VSCROLL = scrollbars
HID_HT_MINBUTTON = HID_SC_MINIMIZE
HID_HT_MAXBUTTON = HID_SC_MAXIMIZE
AFX_HIDP_INVALID_FILENAME = AFX_HIDP_default
AFX_HIDP_FAILED_TO_OPEN_DOC = AFX_HIDP_default
AFX_HIDP_FAILED_TO_SAVE_DOC = AFX_HIDP_default
AFX_HIDP_ASK_TO_SAVE = AFX_HIDP_default
AFX_HIDP_FAILED_TO_CREATE_DOC = AFX_HIDP_default
AFX_HIDP_FILE_TOO_LARGE = AFX_HIDP_default
AFX_HIDP_FAILED_TO_START_PRINT = AFX_HIDP_default
AFX_HIDP_FAILED_TO_LAUNCH_HELP = AFX_HIDP_default
AFX_HIDP_INTERNAL_FAILURE = AFX_HIDP_default
AFX_HIDP_COMMAND_FAILURE = AFX_HIDP_default
AFX_HIDP_PARSE_INT = AFX_HIDP_default
AFX_HIDP_PARSE_REAL = AFX_HIDP_default
AFX_HIDP_PARSE_INT_RANGE = AFX_HIDP_default
AFX_HIDP_PARSE_REAL_RANGE = AFX_HIDP_default
AFX_HIDP_PARSE_STRING_SIZE = AFX_HIDP_default
AFX_HIDP_FAILED_INVALID_FORMAT = AFX_HIDP_default
AFX_HIDP_FAILED_INVALID_PATH = AFX_HIDP_default
AFX_HIDP_FAILED_DISK_FULL = AFX_HIDP_default
AFX_HIDP_FAILED_ACCESS_READ = AFX_HIDP_default
AFX_HIDP_FAILED_ACCESS_WRITE = AFX_HIDP_default
AFX_HIDP_FAILED_IO_ERROR_READ = AFX_HIDP_default
AFX_HIDP_FAILED_IO_ERROR_WRITE = AFX_HIDP_default
AFX_HIDP_STATIC_OBJECT = AFX_HIDP_default
AFX_HIDP_FAILED_TO_CONNECT = AFX_HIDP_default
AFX_HIDP_SERVER_BUSY = AFX_HIDP_default
AFX_HIDP_BAD_VERB = AFX_HIDP_default
AFX_HIDP_FAILED_MEMORY_ALLOC = AFX_HIDP_default
AFX_HIDP_FAILED_TO_NOTIFY = AFX_HIDP_default
AFX_HIDP_FAILED_TO_LAUNCH = AFX_HIDP_default
AFX_HIDP_ASK_TO_UPDATE = AFX_HIDP_default
AFX_HIDP_FAILED_TO_UPDATE = AFX_HIDP_default
AFX_HIDP_FAILED_TO_REGISTER = AFX_HIDP_default
AFX_HIDP_FAILED_TO_AUTO_REGISTER = AFX_HIDP_default
[MAP]
#include <GosView.hm>
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.

Some files were not shown because too many files have changed in this diff Show More